/* Kitabi's colours, each named for what it's for. These are the Standard look; the other looks (Navy and gold, Dark,
   picked in the account menu: theme.js) give the same names other colours, just below. A printed page always has the
   Standard ones, and so does a book's own page (it stays as printed, rule 1), and the highlight colours keep theirs. */
:root, :root[data-theme="dark"] .book-page, :root[data-theme="dark"][data-board-surface="white"] .bd-main {
  --bg: #f4f6fb;
  --doodle: #e1e5ee; /* (the doodles behind the pages: a little darker than the ground, or lighter in Dark) */
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --reader: #e5e9ef; /* (round a book's page) */
  --stage: #e3ecf7; /* (a moving scene's ground) */
  --tip: #0f172a; /* (dark notes: tips, tooltips, toasts, white words on it) */
  --shade: 15 23 42; /* (shadows) */
  --glass: 255 255 255; /* (see-through bars) */
  --tone: 15 23 42; /* (faint washes) */
  --brand: #4f46e5;
  --brand-hi: #818cf8;
  --brand-mid: #a5b4fc;
  --brand-line: #c7d2fe;
  --brand-soft-2: #e0e7ff;
  --brand-soft: #eef2ff;
  --brand-ink: #3730a3;
  --brand-deep: #1e1b4b;
  --brand-rgb: 79 70 229;
  --brand-wash: 238 242 255;
  --deep-2: #45476e;
  --deep-3: #5b5e8a;
  --band: #4f46e5; /* (a practice exam's top: its colour, its small label and the line under its title) */
  --band-label: #c7d2fe;
  --band-sub: #e0e7ff;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --ok-faint: #f0fdf4;
  --ok-line: #bbf7d0;
  --ok-ink: #166534;
  --bad: #dc2626;
  --bad-soft: #fee2e2;
  --bad-faint: #fff1f2;
  --bad-line: #fecaca;
  --bad-ink: #b91c1c;
  --amber: #d97706;
  --amber-2: #f59e0b;
  --amber-soft: #fffbeb;
  --amber-soft-2: #fef3c7;
  --amber-line: #fde68a;
  --amber-ink: #92400e;
  --info: #2563eb;
  --info-2: #60a5fa;
  --info-soft: #eff6ff;
  --info-soft-2: #dbeafe;
  --info-line: #bfdbfe;
  --info-ink: #1d4ed8;
  --cyan: #0891b2;
  --cyan-soft: #ecfeff;
  --cyan-line: #a5f3fc;
  --cyan-ink: #155e75;
  --violet: #9333ea;
  --violet-soft: #faf5ff;
  --violet-line: #e9d5ff;
  --violet-mid: #c084fc;
  --violet-ink: #6b21a8;
  --orange: #ea580c;
  --orange-soft: #fff7ed;
  --orange-line: #fed7aa;
  --orange-ink: #9a3412;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(var(--shade) / 0.04), 0 4px 16px rgb(var(--shade) / 0.06);
  --shadow-lg: 0 10px 40px rgb(var(--shade) / 0.14);
  --topbar: 60px;
  --tutor-w: 400px;
  --font: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media screen {
  /* Navy and gold: navy, teal and white on a warm light ground, gold for a small label */
  :root[data-theme="navy"] {
    --bg: #f1efe9;
    --doodle: #e0d9cc; /* (the doodles behind the pages: a little darker than the ground, or lighter in Dark) */
    --surface-2: #f9f7f3;
    --surface-3: #efece5;
    --ink: #1c2733;
    --ink-2: #3a4652;
    --muted: #6b7480;
    --faint: #a3a9b1;
    --line: #e4dfd5;
    --line-2: #d3ccbf;
    --reader: #e6e1d7;
    --stage: #e4ece9;
    --tip: #1f3b4d;
    --shade: 31 45 56;
    --tone: 31 59 77;
    --brand: #0f766e;
    --brand-hi: #4fa89f;
    --brand-mid: #8ccbc3;
    --brand-line: #bfe2dc;
    --brand-soft-2: #d3ece8;
    --brand-soft: #e6f4f1;
    --brand-ink: #115e59;
    --brand-deep: #1f3b4d;
    --brand-rgb: 15 118 110;
    --brand-wash: 230 244 241;
    --deep-2: #3d5566;
    --deep-3: #5f7383;
    --band: #1f3b4d;
    --band-label: #e3b34c;
    --band-sub: #cbd5e1;
  }
  /* Blue (5 November 2026): Kayaan's colours, a clear blue on white and light grey */
  :root[data-theme="blue"] {
    --bg: #f6f8fb;
    --doodle: #e3e8f1; /* (the doodles behind the pages: a little darker than the ground, or lighter in Dark) */
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --faint: #94a3b8;
    --line: #e5e7eb;
    --line-2: #d1d5db;
    --reader: #e8edf3;
    --stage: #e6effb;
    --tip: #0f172a;
    --shade: 15 23 42;
    --tone: 15 23 42;
    --brand: #2563eb;
    --brand-hi: #60a5fa;
    --brand-mid: #93c5fd;
    --brand-line: #bfdbfe;
    --brand-soft-2: #dbeafe;
    --brand-soft: #eff6ff;
    --brand-ink: #1d4ed8;
    --brand-deep: #1e3a8a;
    --brand-rgb: 37 99 235;
    --brand-wash: 239 246 255;
    --deep-2: #3b4f7a;
    --deep-3: #55698f;
    --band: #2563eb;
    --band-label: #bfdbfe;
    --band-sub: #dbeafe;
  }
  /* Rose: a deep rose for buttons and the chosen tab, soft blush grounds, dark plum words */
  :root[data-theme="rose"] {
    --bg: #fff7fa;
    --doodle: #f5e0e8; /* (the doodles behind the pages: a little darker than the ground, or lighter in Dark) */
    --surface-2: #fff9fb;
    --surface-3: #fdf0f5;
    --ink: #3b1424;
    --ink-2: #5c2a3f;
    --muted: #8a5a6e;
    --faint: #b892a3;
    --line: #f5dbe6;
    --line-2: #ecc3d4;
    --reader: #f7e6ee;
    --stage: #fbe7f0;
    --tip: #3b1424;
    --shade: 59 20 36;
    --tone: 59 20 36;
    --brand: #be185d;
    --brand-hi: #ec4899;
    --brand-mid: #f9a8d4;
    --brand-line: #fbcfe8;
    --brand-soft-2: #fbd5e8;
    --brand-soft: #fce7f3;
    --brand-ink: #9d174d;
    --brand-deep: #500724;
    --brand-rgb: 190 24 93;
    --brand-wash: 252 231 243;
    --deep-2: #6b2d47;
    --deep-3: #8a4a65;
    --band: #be185d;
    --band-label: #fbcfe8;
    --band-sub: #fce7f3;
  }
  /* Lavender: pink with purple in it, on the palest lilac */
  :root[data-theme="lavender"] {
    --bg: #fcf7ff;
    --doodle: #eedff5; /* (the doodles behind the pages: a little darker than the ground, or lighter in Dark) */
    --surface-2: #fdf9ff;
    --surface-3: #f6ecfb;
    --ink: #2e1036;
    --ink-2: #4c2a57;
    --muted: #7c5a87;
    --faint: #ac91b5;
    --line: #efdcf5;
    --line-2: #e2c4ec;
    --reader: #f1e5f6;
    --stage: #f5e8fb;
    --tip: #2e1036;
    --shade: 46 16 54;
    --tone: 46 16 54;
    --brand: #a21caf;
    --brand-hi: #d946ef;
    --brand-mid: #f0abfc;
    --brand-line: #f5d0fe;
    --brand-soft-2: #f5d6fd;
    --brand-soft: #fae8ff;
    --brand-ink: #86198f;
    --brand-deep: #4a044e;
    --brand-rgb: 162 28 175;
    --brand-wash: 250 232 255;
    --deep-2: #5b2c66;
    --deep-3: #7a4a86;
    --band: #a21caf;
    --band-label: #f5d0fe;
    --band-sub: #fae8ff;
  }
  /* Blush: the softest pink grounds, with a dusty rose deep enough for its words and buttons to read */
  :root[data-theme="blush"] {
    --bg: #fff8f8;
    --doodle: #f6e1e4; /* (the doodles behind the pages: a little darker than the ground, or lighter in Dark) */
    --surface-2: #fffafa;
    --surface-3: #fff0f2;
    --ink: #4a1d2e;
    --ink-2: #6b3446;
    --muted: #966270;
    --faint: #c39aa5;
    --line: #fbe0e6;
    --line-2: #f5c9d3;
    --reader: #fbeaee;
    --stage: #ffedf1;
    --tip: #4a1d2e;
    --shade: 74 29 46;
    --tone: 74 29 46;
    --brand: #c04a76;
    --brand-hi: #f49ab3;
    --brand-mid: #f9c6d4;
    --brand-line: #fbd3de;
    --brand-soft-2: #ffd6e0;
    --brand-soft: #ffe4ea;
    --brand-ink: #9b3058;
    --brand-deep: #4a1d2e;
    --brand-rgb: 192 74 118;
    --brand-wash: 255 228 234;
    --deep-2: #7a3a50;
    --deep-3: #9a5a70;
    --band: #c04a76;
    --band-label: #ffe4ea;
    --band-sub: #fff0f3;
  }
  /* Dark: light words on dark grounds, for reading at night */
  :root[data-theme="dark"], :root[data-board-surface="black"] .bd-main {
    color-scheme: dark;
    --bg: #0f172a;
    --doodle: #1c2639; /* (the doodles behind the pages: a little darker than the ground, or lighter in Dark) */
    --surface: #1e293b;
    --surface-2: #19243a;
    --surface-3: #283548;
    --ink: #e2e8f0;
    --ink-2: #cbd5e1;
    --muted: #94a3b8;
    --faint: #64748b;
    --line: #334155;
    --line-2: #475569;
    --reader: #0b1220;
    --stage: #172236;
    --tip: #334155;
    --shade: 0 0 0;
    --glass: 30 41 59;
    --tone: 226 232 240;
    --brand: #6366f1;
    --brand-hi: #818cf8;
    --brand-mid: #6366f1;
    --brand-line: #3b3f86;
    --brand-soft-2: #2e2c74;
    --brand-soft: #25245a;
    --brand-ink: #c7d2fe;
    --brand-deep: #e0e7ff;
    --brand-rgb: 129 140 248;
    --brand-wash: 37 36 90;
    --deep-2: #cbd5e1;
    --deep-3: #a5adc4;
    --band: #1e1b4b;
    --band-label: #a5b4fc;
    --band-sub: #c7d2fe;
    --ok: #22c55e;
    --ok-soft: rgb(34 197 94 / .16);
    --ok-faint: rgb(34 197 94 / .08);
    --ok-line: rgb(34 197 94 / .42);
    --ok-ink: #86efac;
    --bad: #ef4444;
    --bad-soft: rgb(239 68 68 / .16);
    --bad-faint: rgb(239 68 68 / .08);
    --bad-line: rgb(239 68 68 / .45);
    --bad-ink: #fca5a5;
    --amber: #f59e0b;
    --amber-2: #fbbf24;
    --amber-soft: rgb(245 158 11 / .12);
    --amber-soft-2: rgb(245 158 11 / .2);
    --amber-line: rgb(245 158 11 / .42);
    --amber-ink: #fcd34d;
    --info: #3b82f6;
    --info-2: #60a5fa;
    --info-soft: rgb(59 130 246 / .13);
    --info-soft-2: rgb(59 130 246 / .22);
    --info-line: rgb(59 130 246 / .45);
    --info-ink: #93c5fd;
    --cyan: #06b6d4;
    --cyan-soft: rgb(6 182 212 / .12);
    --cyan-line: rgb(6 182 212 / .4);
    --cyan-ink: #67e8f9;
    --violet: #a855f7;
    --violet-soft: rgb(168 85 247 / .12);
    --violet-line: rgb(168 85 247 / .4);
    --violet-mid: #c084fc;
    --violet-ink: #d8b4fe;
    --orange: #f97316;
    --orange-soft: rgb(249 115 22 / .12);
    --orange-line: rgb(249 115 22 / .4);
    --orange-ink: #fdba74;
    --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 4px 16px rgb(0 0 0 / .3);
    --shadow-lg: 0 10px 40px rgb(0 0 0 / .55);
  }
}
:lang(ar) {
  --font: "IBM Plex Sans Arabic", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* The doodles (the owner's wish, 8 November 2026: like WhatsApp's chat background, with things about studying): small
   line drawings (public/img/doodles.svg, made by tools/make_doodles.mjs) behind the pages, in each look's own soft colour
   (--doodle), never inside a book or a lesson (its page stays calm, rule 1), nor on the welcome page and the first
   steps. Settings → Look and language turns them off (data-doodles="off", theme.js). */
:root:not([data-doodles="off"]) body:not(.lesson-page, .welcome-page, .start-page)::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--doodle);
  -webkit-mask: url("/img/doodles.svg") 0 0 / 720px 720px repeat;
  mask: url("/img/doodles.svg") 0 0 / 720px 720px repeat;
}
@media print { body::before { display: none !important; } }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
[dir="rtl"] .flip-rtl { display: inline-block; transform: scaleX(-1); }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 999px; padding: 9px 16px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn-danger { background: var(--bad); color: #fff; } /* (what can't be undone: Delete, Cancel the exam) */
.btn-danger:hover { filter: brightness(.94); }
.btn-soft:hover { background: var(--brand-soft-2); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 26px; font-size: 16px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.on { background: var(--brand-soft); color: var(--brand); }

/* ---- Top bar ------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar);
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: rgb(var(--glass) / 0.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 14px; padding: 6px 8px; border-radius: 8px; }
.back.child-back { margin: 0 0 4px; margin-inline-start: -8px; } /* (a parent's look at their child's notebook or Practice: ui.js childBack) */
.back:hover { background: var(--surface-2); color: var(--ink); }
.titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.titles h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapter { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
:lang(ar) .chapter { text-transform: none; letter-spacing: 0; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--ink); margin-inline-end: auto; }
.logo-mark { color: var(--brand); display: inline-flex; }

/* ---- Home ------------------------------------------------------------- */
.home { max-width: 1120px; margin: 0 auto; padding: 0 16px 80px; }
.eyebrow { display: inline-block; color: var(--brand); background: var(--brand-soft); font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; }
.library-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 18px; }
.library-head h2 { font-size: 26px; margin: 0; margin-inline-end: auto; }
/* My books, from the menu (home.js booksOnly): the Library alone, from the top, its name as big as a page's
   (My children's) */
.home.books-only > section:not(#library) { display: none !important; }
.home.books-only .library-head { margin-top: 26px; }
.home.books-only .library-head h2 { font-size: 30px; }
.lib-add { flex: none; }
/* the room their books take, in pages, by the Library's name (on a phone, on its own line under it) */
.library-head { flex-wrap: wrap; }
.lib-room { display: grid; gap: 5px; min-width: 150px; color: var(--muted); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.lib-room:hover { color: var(--ink); }
.lib-room .pbar { height: 6px; }
.lib-room.low .pbar i { background: var(--amber); }
.lib-room.full { color: var(--bad); }
.lib-room.full .pbar i { background: var(--bad); }
@media (max-width: 600px) { .lib-room { order: 9; flex: 1 1 100%; } }
.lib-add.pulse { animation: lib-ring 1.2s ease-out 2; }
@keyframes lib-ring { from { box-shadow: 0 0 0 0 rgb(var(--brand-rgb) / .45); } to { box-shadow: 0 0 0 14px rgb(var(--brand-rgb) / 0); } }
/* in a list or side by side (home.js paintView) */
.view-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.view-switch button { display: grid; place-items: center; width: 38px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.view-switch button:hover { color: var(--ink); }
.view-switch button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); }
.book { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; border-top: 5px solid var(--book); }
.book-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.book-head h3 { font-size: 21px; }
.book-head p { color: var(--muted); }
.book-head > .pill { margin-inline-start: auto; } /* beside the book's buttons, not in the middle */
.pill { flex: none; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; }
/* light colours that tell boxes apart at a glance (the Study panel's kinds of practice, the chapters in Contents): a
   tint, its border and its icon's colour; neighbours never alike (indigo, amber, green, rose, sky, orange) */
.tint-0 { --tint: var(--brand-soft); --tint-line: var(--brand-line); --tint-ink: var(--brand); }
.tint-1 { --tint: var(--amber-soft); --tint-line: var(--amber-line); --tint-ink: var(--amber); }
.tint-2 { --tint: var(--ok-faint); --tint-line: var(--ok-line); --tint-ink: var(--ok); }
.tint-3 { --tint: var(--bad-faint); --tint-line: var(--bad-line); --tint-ink: var(--bad); }
.tint-4 { --tint: var(--info-soft); --tint-line: var(--info-line); --tint-ink: var(--info); }
.tint-5 { --tint: var(--orange-soft); --tint-line: var(--orange-line); --tint-ink: var(--orange); }
.chapter-title { font-size: 14px; color: var(--muted); margin: 20px 0 10px; }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.lesson-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); transition: transform .15s, box-shadow .15s, border-color .15s; }
.lesson-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand-line); }
.art { background: linear-gradient(180deg, var(--brand-soft), var(--surface-2)); padding: 14px 18px 6px; }
.art svg { display: block; width: 100%; height: 110px; }
.lc-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.lc-body p { color: var(--muted); font-size: 14px; flex: 1; }
.lc-cta { color: var(--brand); font-weight: 700; font-size: 14px; margin-top: 8px; }
.add-book { display: flex; gap: 18px; align-items: center; border: 2px dashed var(--brand-line); border-radius: 20px; padding: 18px; background: rgb(var(--brand-wash) / .5); }
.add-book .art { flex: none; width: 160px; border-radius: 12px; background: transparent; padding: 0; }
.add-book .art svg { height: 88px; }
.add-book p { color: var(--muted); }

/* ---- Lesson layout ---------------------------------------------------- */
.lesson-page { overflow: hidden; }
.app { display: grid; grid-template-columns: minmax(0, 1fr) var(--tutor-w); height: calc(100dvh - var(--topbar)); }
.main { overflow-y: auto; padding: 16px; scroll-behavior: smooth; }
.stage-wrap { position: relative; height: min(62vh, 660px); min-height: 360px; border-radius: 20px; overflow: hidden; background: var(--stage); box-shadow: var(--shadow); isolation: isolate; }
.stage { position: absolute; inset: 0; }
.stage canvas { display: block; cursor: grab; touch-action: none; }
.stage canvas:active { cursor: grabbing; }
.stage-hint {
  position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2;
  background: rgb(var(--glass) / .85); backdrop-filter: blur(6px); border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; pointer-events: none;
}
.hud {
  position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; width: 250px;
  background: rgb(var(--glass) / .9); backdrop-filter: blur(8px); border-radius: 14px;
  padding: 10px 12px; box-shadow: var(--shadow); display: grid; gap: 7px 8px;
  grid-template-columns: max-content 1fr auto; align-items: center; font-size: 12px;
}
.bar { display: contents; }
.bar-label { color: var(--ink-2); font-weight: 600; }
.bar-track { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 99px; transition: width .12s linear; }
.bar-val { text-align: end; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 11.5px; }
.playbar {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 4px; padding: 6px;
  background: rgb(var(--glass) / .94); backdrop-filter: blur(8px); border-radius: 999px; box-shadow: var(--shadow-lg);
  max-width: calc(100% - 24px); overflow-x: auto;
}
.playbar .icon-btn { border-radius: 999px; }
.playbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; flex: none; }
.scene-actions { display: flex; gap: 6px; }
.scene-actions .btn { padding: 8px 16px; }
.toast {
  position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 4;
  background: var(--tip); color: #fff; font-weight: 600; padding: 9px 16px; border-radius: 999px; box-shadow: var(--shadow-lg);
  white-space: nowrap; pointer-events: none;
}
.toast.show { animation: pop .3s ease-out; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -8px) scale(.96); } }
.info-card {
  position: absolute; z-index: 5; width: min(320px, calc(100% - 24px));
  background: var(--surface); border-radius: 14px; padding: 14px 16px 14px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); animation: pop2 .18s ease-out;
}
@keyframes pop2 { from { opacity: 0; transform: scale(.96); } }
.info-card h3 { font-size: 16px; margin-bottom: 6px; padding-inline-end: 28px; }
.info-card p { color: var(--ink-2); font-size: 14px; margin-bottom: 10px; }
.info-close { position: absolute; top: 8px; inset-inline-end: 8px; width: 28px; height: 28px; }

/* 3D labels */
.scene-label {
  font: 600 12px/1.2 var(--font); color: var(--ink); background: rgb(var(--glass) / .9);
  padding: 3px 7px; border-radius: 7px; white-space: nowrap; margin-top: -4px;
  font-variant-numeric: tabular-nums; box-shadow: 0 1px 3px rgb(var(--shade) / .12);
}
.scene-label:empty { display: none; }
.scene-label.muted { color: var(--muted); background: rgb(var(--glass) / .7); font-weight: 500; box-shadow: none; }
.scene-label.strong { background: var(--tip); color: #fff; }
.scene-label.brand { color: var(--brand); }
.scene-label.amber { color: var(--amber-ink); }
.scene-label.blue { color: var(--info-ink); }
.scene-label.red { color: var(--bad-ink); }
.scene-label.chip { background: var(--surface); border: 1px solid var(--line); }

/* Cards below the stage */
.below { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.side-col { display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card > h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
:lang(ar) .card > h2 { text-transform: none; letter-spacing: 0; font-size: 14px; }

.controls { display: grid; gap: 14px; }
.ctl { border-radius: 10px; transition: background .3s; }
.ctl.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 30% { background: var(--brand-soft); box-shadow: 0 0 0 6px var(--brand-soft); } }
.ctl-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.ctl-head output { color: var(--brand); font-variant-numeric: tabular-nums; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; margin: 6px 0;
  background: linear-gradient(to right, var(--brand) var(--p, 50%), var(--line) var(--p, 50%));
  cursor: pointer;
}
[dir="rtl"] input[type="range"] { background: linear-gradient(to left, var(--brand) var(--p, 50%), var(--line) var(--p, 50%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 1px 4px rgb(var(--shade) / .25); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--surface-2); border: 1px solid var(--line); padding: 3px; border-radius: 10px; }
.seg button { border: 0; background: transparent; border-radius: 7px; padding: 6px 4px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgb(var(--shade) / .12); }
.switch { position: relative; display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.knob { flex: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .15s; }
.knob::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.switch input:checked + .knob { background: var(--brand); }
.switch input:checked + .knob::after { inset-inline-start: 19px; }
.switch input:focus-visible + .knob { outline: 2.5px solid var(--brand); outline-offset: 2px; }

.readouts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.readout { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; min-width: 0; }
.r-label { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-value { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.plot-card { margin-top: 14px; }
.plot-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.table-card { margin-top: 14px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.data-table th { background: var(--surface-2); color: var(--ink-2); font-weight: 600; text-align: center; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { text-align: center; padding: 4px 8px; border-top: 1px solid var(--line); color: var(--ink); }
.data-table tbody tr:nth-child(even) td { background: var(--surface-2); }
.data-table td:first-child, .data-table th:first-child { color: var(--muted); }
.plot { width: 100%; height: 130px; display: block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }

/* Tabs */
.content-card { padding: 0; overflow: hidden; }
.tabs { display: flex; gap: 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tabs button { border: 0; background: transparent; padding: 10px 16px; font-weight: 600; color: var(--muted); border-radius: 10px 10px 0 0; cursor: pointer; border-bottom: 2.5px solid transparent; }
.tabs button.on { color: var(--brand); background: var(--surface); border-bottom-color: var(--brand); }
.tab-panel { padding: 18px 20px 22px; display: grid; gap: 16px; }
.lead { font-size: 16.5px; color: var(--ink-2); }
.learn-sec h3 { font-size: 17px; margin-bottom: 6px; }
.learn-sec p { color: var(--ink-2); margin-bottom: 8px; }
.learn-sec ul { margin: 4px 0 8px; padding-inline-start: 20px; color: var(--ink-2); }
.formulas { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.formula { background: var(--brand-soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.formula code { font: 700 17px/1.4 "Inter", system-ui, sans-serif; color: var(--brand-ink); }
.formula span { font-size: 13px; color: var(--ink-2); }
.explore { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.explore li { display: grid; grid-template-columns: 32px 1fr; gap: 4px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.explore .num { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; grid-row: span 2; }
.explore-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.quiz-score { font-size: 15px; color: var(--ink-2); }
/* a quiz's or practice exam's questions: each in a white box of its own on the window's tinted ground; once marked, a
   stripe of colour down its start (green: right, amber: partly, red: missed) */
.quiz-modal .modal-body:has(> .quiz-list) { background: var(--bg); }
.quiz-q { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; background: var(--surface); box-shadow: var(--shadow); }
.quiz-q.got { border-inline-start: 5px solid var(--ok); }
.quiz-q.missed { border-inline-start: 5px solid var(--bad); }
.quiz-q .q { font-weight: 700; margin-bottom: 12px; }
.opts { display: grid; gap: 8px; }
/* each answer a box of its own, with a circle at its start to mark: filled when picked (a practice exam's, not marked
   till it's handed in); once marked, ✓ on the right one and ✕ on a wrong pick */
.opt { display: flex; align-items: center; gap: 12px; text-align: start; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); padding: 11px 14px; border-radius: 12px; line-height: 1.4; cursor: pointer; }
.opt::before { content: ""; flex: none; display: grid; place-items: center; box-sizing: border-box; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); color: #fff; font-size: 12px; font-weight: 800; line-height: 1; transition: border-width .12s; }
.opt:hover { border-color: var(--brand-hi); }
.opt.picked { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.opt.picked::before { border: 6px solid var(--brand); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); color: var(--ok-ink); }
.opt.right::before { content: "✓"; border-color: var(--ok); background: var(--ok); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad-ink); }
.opt.wrong::before { content: "✕"; border-color: var(--bad); background: var(--bad); }
.quiz-q.done .opt:not(.right, .wrong):hover { border-color: var(--line); }
/* fill in the blank: a box in its sentence, where the missing words go (once marked: green, amber, red) */
/* What's in this quiz (or exam), at its top: how many, and each kind's questions by their numbers (practice.js
   #formatBox); in a practice exam's paper head, under its time */
.q-format { display: grid; gap: 4px; margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.q-format p { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.q-format p span { color: var(--muted); font-size: 13.5px; }
.q-format ul { margin: 0; padding-inline-start: 20px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.ex-paper-in .q-format { margin: 0; background: var(--surface-2); }
/* ↻ Replace this question, at a question's foot (practice.js #replaceRow): quiet until it's wanted; gone once the
   question is answered; New question on the one that took a question's place */
.q-replace { display: flex; flex-wrap: wrap; justify-content: flex-end; margin-top: 8px; }
.quiz-q.done .q-replace { display: none; }
.q-replace-open { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.q-replace-open:hover { background: var(--surface-2); color: var(--brand-ink); }
.q-replace-open svg, .q-new svg { width: 15px; height: 15px; flex: none; }
.q-replace-ask { flex: 1 1 100%; display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.q-replace-ask p { margin: 0; display: grid; gap: 2px; }
.q-replace-ask small { color: var(--muted); font-size: 12.5px; }
.q-replace-why { display: flex; flex-wrap: wrap; gap: 6px; }
.q-replace-why button { padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.q-replace-why button:hover, .q-replace-why button:focus-visible { border-color: var(--brand); color: var(--brand-ink); }
.q-replace-cancel { justify-self: start; padding: 2px 4px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.q-replace-cancel:hover { color: var(--ink); }
.q-replace-wait { margin: 0; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.q-replace-err { flex: 1 1 100%; margin: 6px 0 0; color: var(--bad); font-size: 13px; text-align: end; }
.quiz-q.q-busy > :not(.q-replace) { opacity: .45; pointer-events: none; }
.q-new { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: 12.5px; font-weight: 700; }
.qb-box { width: 11em; max-width: 100%; margin: 0 4px; padding: 3px 8px; border: 0; border-bottom: 2px solid var(--brand); border-radius: 6px 6px 0 0; background: var(--brand-soft); color: var(--ink); font: inherit; font-weight: 600; text-align: center; }
.qb-box:focus { outline: 2px solid var(--brand-line); outline-offset: 1px; }
.qb-box.right { border-color: var(--ok); background: var(--ok-soft); color: var(--ok-ink); }
.qb-box.near { border-color: var(--amber); background: var(--amber-soft); color: var(--amber-ink); }
.qb-box.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad-ink); }
/* matching: the words, numbered, each with a list of the other side's letters; the other side, lettered */
.qm { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 18px; }
.qm ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; }
.qm-a li { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; border: 1.5px solid var(--line); border-radius: 12px; }
.qm-a li.right { border-color: var(--ok); background: var(--ok-soft); }
.qm-a li.wrong { border-color: var(--bad); background: var(--bad-soft); }
.qm-n { font-weight: 700; color: var(--muted); }
.qm-word { flex: 1; min-width: 0; font-weight: 600; }
.qm-pick { flex: none; min-width: 56px; padding: 5px 6px; border: 1.5px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; }
.qm-pick:focus { outline: none; border-color: var(--brand); }
.qm-fix { flex: none; font-weight: 700; color: var(--ok-ink); }
.qm-b li { padding: 7px 10px; border: 1px dashed var(--line-2); border-radius: 12px; }
@media (max-width: 560px) { .qm { grid-template-columns: minmax(0, 1fr); } }
/* a question's picture: part of its page (--x, --y: where it starts; --w, --h: how much of the page; --ar: its shape) */
.q-fig { margin: 0 0 12px; }
.q-fig-in { position: relative; overflow: hidden; width: min(100%, 460px); aspect-ratio: var(--ar); border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.q-fig-in img { position: absolute; max-width: none; width: calc(100% / var(--w)); left: calc(-100% * var(--x) / var(--w)); top: calc(-100% * var(--y) / var(--h)); }
/* a quiz's or practice exam's setup: how hard, what it's about, its pictures; Make it later */
.qs-pics { border-style: dashed; }
.qs-focus { width: 100%; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; }
.qs-focus:focus { outline: none; border-color: var(--brand); }
.qs-optional { color: var(--muted); font-weight: 500; font-size: 13px; }
/* ⓘ by the box for what the questions should be about: how it's used, with examples, under it when tapped */
.qs-info { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-inline: 3px 1px; padding: 0; vertical-align: 2px; border: 1.5px solid var(--muted); border-radius: 50%; background: none; color: var(--muted); font: 800 12px/1 var(--font); cursor: pointer; }
.qs-info:hover, .qs-info[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.qs-how { margin: 0 0 10px; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.qs-how[hidden] { display: none; }
.qs-how p { margin: 0; }
.qs-how .qs-how-eg { margin-top: 8px; font-weight: 700; }
.qs-how ul { margin: 2px 0 0; padding-inline-start: 20px; }
.pd-sees-pass { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.pd-sees-pass span { display: grid; gap: 2px; }
.pd-sees-pass small { color: var(--muted); font-size: 12.5px; }
.ex-rest { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--amber-soft); color: var(--amber-ink); font-size: 14px; }
.ex-rest p { flex: 1 1 240px; margin: 0; }
.ex-later-text, .ex-wait-close { margin: -10px 0 0; color: var(--muted); font-size: 12.5px; }
.ex-wait-close { margin: 0; text-align: center; }
/* a practice exam made on its own: Ready (in the menu, in Practice, on the Practice page), being written, and its note */
.sn-ready, .pr-ready { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--ok); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 18px; }
.sn-ready { margin-inline-start: auto; }
.sn-badge + .sn-ready { margin-inline-start: 4px; }
.pr-ready { justify-self: start; margin-bottom: 2px; }
.pr-ready-row { border-color: var(--ok-line); background: var(--ok-faint); }
.pr-writing { color: var(--muted); }
#sb-study, #sb-translate { position: relative; }
/* (a practice exam, or a translation made on the server, ready: a green dot on its button, alike: rule 28) */
:is(#sb-study.exam-ready, #sb-translate.tr-ready)::after { content: ""; position: absolute; top: 3px; left: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--surface); }
.sh-ready .pr-ready { display: inline-block; margin: 0 0 3px; }
.exam-note { position: fixed; z-index: 90; left: 50%; top: calc(var(--topbar) + 12px); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: min(460px, calc(100vw - 24px)); padding: 12px 12px 12px 14px; border: 1px solid var(--ok-line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); }
.exam-note.failed { border-color: var(--bad-line); }
.exam-note > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.exam-note strong { font-size: 14.5px; }
.exam-note small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-note-mark { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ok); color: #fff; font-weight: 800; }
.exam-note.failed .exam-note-mark { background: var(--bad); }
.exam-note-x { flex: none; width: 30px; height: 30px; font-size: 18px; color: var(--muted); }
/* A practice exam (practice.js: exam, #runExam): which lessons it's on and how long; the clock and Hand in at the top
   while it's taken; after, what to go over again */
.ex-parts { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ex-module { margin: 8px 6px 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ex-parts > .ex-module:not(:first-child) { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); } /* (each module's lessons apart from the ones before: easier on the eye) */
:lang(ar) .ex-module { letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.ex-part { display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px !important; padding: 5px 4px 5px 8px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; }
/* (👁 beside a lesson's pages: its first page, small, under it; practice.js exam) */
.ex-peek { width: 30px; height: 30px; color: var(--muted); }
.ex-peek svg { width: 18px; height: 18px; }
.ex-peek:hover, .ex-peek.on { color: var(--brand); background: var(--brand-soft); }
.ex-parts:has(.ex-peek-card) { max-height: 480px; } /* (room for the page while it's shown) */
.ex-peek-card { display: grid; gap: 8px; margin: 2px 8px 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.ex-peek-card img { display: block; justify-self: center; max-width: 100%; height: 280px; object-fit: contain; border-radius: 4px; background: #fff; box-shadow: 0 2px 10px rgb(15 23 42 / .15); }
.ex-peek-acts { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ex-part:hover { background: var(--surface-2); }
.ex-part small { color: var(--muted); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.ex-part input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
.ex-cost { margin: 0; color: var(--ink-2); font-size: 13.5px; }
/* (how many pages are picked, and Select all / Deselect all, over the lessons) */
.ex-parts-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 6px; font-size: 13px; color: var(--muted); }
.ex-picked.over { color: var(--bad); font-weight: 600; }
.ex-all { border: 0; background: none; padding: 4px 8px; border-radius: 8px; font: inherit; font-weight: 700; color: var(--brand-ink); cursor: pointer; white-space: nowrap; }
.ex-all:hover { background: var(--brand-soft); }
/* its paper's head, like a school's: a band of colour with the book (small, in capitals), Practice exam and what it's
   on; under it the name and date, the time and questions, and printing it */
.ex-paper { display: grid; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.ex-band { display: grid; gap: 3px; padding: 16px 18px; border-radius: 15px 15px 0 0; background: var(--band); } /* (its own round corners: clipping them in the paper would let the window's grid squash the paper to a line) */
.ex-band-book { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--band-label); }
:lang(ar) .ex-band-book { letter-spacing: 0; text-transform: none; font-size: 13px; }
.ex-band-title { font-size: 22px; font-weight: 800; line-height: 1.25; color: #fff; }
.ex-band-on { margin: 0; font-size: 13.5px; color: var(--band-sub); }
.ex-paper-in { display: grid; gap: 10px; padding: 14px 16px 16px; }
.ex-paper-facts { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.ex-paper-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
.ex-paper-row label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.ex-paper-row input { flex: 1; min-width: 0; font: inherit; font-weight: 500; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.ex-paper-row input:focus { outline: none; border-color: var(--brand); }
.ex-paper-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ex-paper-acts .btn { display: inline-flex; align-items: center; gap: 6px; }
.ex-paper-acts .btn svg { width: 16px; height: 16px; }
.ex-key { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.ex-key input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
@media (max-width: 520px) { .ex-paper-row { grid-template-columns: minmax(0, 1fr); } }
/* the date: typed, or picked on a calendar from the button at its end (8 November 2026); the browser's own date picker
   sits hidden under the button, so its calendar opens beside it */
.ex-date-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.ex-date-box { position: relative; flex: 1; min-width: 0; display: flex; }
.ex-paper-row .ex-date { padding-inline-end: 38px; }
.ex-cal { position: absolute; top: 50%; inset-inline-end: 4px; transform: translateY(-50%); display: grid; place-items: center; width: 30px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--brand-ink); cursor: pointer; }
.ex-cal:hover, .ex-cal:focus-visible { background: var(--brand-soft); outline: none; }
.ex-paper-row .ex-cal-pick { position: absolute; inset-inline-end: 0; bottom: 0; flex: none; width: 1px; height: 1px; min-width: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.ex-bar { position: sticky; top: -16px; z-index: 2; display: flex; align-items: center; gap: 12px; margin: -16px -18px 4px; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.ex-clock { font: 700 16px/1 var(--font); font-variant-numeric: tabular-nums; color: var(--brand-ink); white-space: nowrap; }
.ex-clock.low { color: var(--bad); }
/* waiting for Start (8 November 2026): the time it will have, not running, and Start under the paper */
.ex-clock.waits { color: var(--muted); }
.ex-start { display: grid; justify-items: center; gap: 12px; padding: 22px 18px; border: 1.5px dashed var(--brand-line); border-radius: 16px; background: var(--brand-soft); text-align: center; }
.ex-start p { margin: 0; max-width: 62ch; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.ex-count { flex: 1; color: var(--muted); font-size: 13.5px; }
/* after it, by lesson: what you know well (a green stripe), and what to go over again (amber), each lesson with how
   many it got right there, the missed questions' numbers (a way back to each) and its pages */
.ex-review { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-inline-start: 5px solid var(--amber); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.ex-known, .ex-again:has(.ex-review-none) { border-inline-start-color: var(--ok); }
.ex-review h4 { margin: 0; font-size: 16px; }
.ex-review ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ex-review li { display: grid; gap: 6px; }
.ex-known li, .ex-review-name { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.ex-review li small { color: var(--bad-ink); font-weight: 700; font-size: 13px; white-space: nowrap; }
.ex-known li small { color: var(--ok-ink); }
.ex-review-text { margin: 0; color: var(--ink-2); font-size: 14px; }
.ex-qnums { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.ex-qnum { min-width: 34px; height: 30px; padding: 0 8px; border: 1.5px solid var(--bad-line); border-radius: 9px; background: var(--bad-soft); color: var(--bad-ink); font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.ex-qnum:hover { border-color: var(--bad); }
.ex-pages { display: flex; flex-wrap: wrap; gap: 4px; }
.ex-review-none { margin: 0; color: var(--ok-ink); font-weight: 600; }
.feedback { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.feedback.ok { background: var(--ok-soft); color: var(--ok-ink); }
.feedback.no { background: var(--bad-soft); color: var(--bad-ink); }

/* ---- Tutor -------------------------------------------------------------- */
.tutor { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-inline-start: 1px solid var(--line); }
.tutor-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #6366f1, #06b6d4); color: #fff; display: grid; place-items: center; flex: none; }
.tutor-names { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tutor-sub { font-size: 12.5px; color: var(--muted); }
.tutor-names.has-model .tutor-sub { display: none; } /* (the AI it uses says more) */
.tutor-model { display: inline-flex; align-items: center; gap: 2px; align-self: flex-start; max-width: 100%; margin-top: 2px; padding: 1px 6px 1px 9px; border: 1px solid var(--brand-line); border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font: inherit; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; cursor: pointer; }
.tutor-model:hover { background: var(--brand-soft-2); }
.tutor-model span { overflow: hidden; text-overflow: ellipsis; }
.tutor-model svg { flex: none; }
.tutor-close { display: none; }
.chat { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; display: flex; flex-direction: column; gap: 4px; }
.msg-body { padding: 10px 13px; border-radius: 14px; font-size: 14.5px; }
.msg-body p + p, .msg-body p + ul, .msg-body ul + p { margin-top: 8px; }
.msg-body ul { margin: 0; padding-inline-start: 18px; }
.msg-body code { background: rgb(var(--tone) / .06); padding: 1px 5px; border-radius: 5px; font-size: .95em; }
.msg.user { align-self: flex-end; }
.msg.user .msg-body { background: var(--brand); color: #fff; white-space: pre-wrap; }
.msg.assistant .msg-body { background: var(--surface-2); border: 1px solid var(--line); } /* (all four corners alike: the sharper "tail" corner looked like a mistake, the owner, 4 November 2026) */
.msg.notice .msg-body { background: var(--amber-soft); border: 1px solid var(--amber-line); color: var(--amber-ink); font-size: 13.5px; }
.msg .err { color: var(--bad); font-weight: 500; }
.msg.thinking .msg-body { min-width: 64px; min-height: 40px; }
.msg.thinking .msg-body::after { content: ""; display: block; width: 36px; height: 10px; background: radial-gradient(circle, var(--muted) 3px, transparent 3.5px) 0 50% / 12px 10px repeat-x; animation: dots 1s infinite steps(4); opacity: .6; }
@keyframes dots { from { width: 0; } to { width: 48px; } }
.listen { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.listen:hover { color: var(--brand); background: var(--brand-soft); }
.msg.thinking .listen, .msg.error .listen { display: none; }
.msg.reading .msg-body { border-color: var(--brand); box-shadow: 0 0 0 1.5px var(--brand), 0 0 0 6px color-mix(in srgb, var(--brand) 16%, transparent); } /* (the answer being read aloud: plain to see) */
.msg.stopped .msg-body { display: grid; justify-items: start; gap: 8px; color: var(--muted); font-size: 13.5px; }
.msg.stopped .msg-body p { margin: 0; }
.voice-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 12px 10px; padding: 5px; border-radius: 999px; background: var(--brand-soft); border: 1px solid var(--brand-line); }
.voice-bar:has(.vb-seekrow:not([hidden])) { border-radius: 22px; }
/* how far the reading has got, over its buttons, between the time heard and the time it all takes: dragged (or tapped)
   to skip ahead or go back. Its blue part is a bar of its own under the slider (tutor.js paintSeek), so it always
   reaches the dot */
.vb-seekrow { order: -1; flex: 1 1 calc(100% - 20px); display: flex; align-items: center; gap: 8px; margin: 4px 10px 0; }
.vb-seekrow[hidden] { display: none; }
.vb-time { flex: none; min-width: 32px; color: var(--brand-ink); font: 600 11.5px/1 var(--font); font-variant-numeric: tabular-nums; text-align: center; }
.vb-track { position: relative; flex: 1; min-width: 0; height: 16px; }
.vb-track::before, .vb-fill { content: ""; position: absolute; inset-inline-start: 0; top: 5px; height: 6px; border-radius: 999px; }
.vb-track::before { inset-inline-end: 0; background: var(--brand-line); }
.vb-fill { background: var(--brand); }
/* (over the lesson sliders' own look, input[type="range"], whose blue part follows --p, never set here) */
.vb-track input[type="range"].vb-seek { position: relative; display: block; width: 100%; height: 16px; margin: 0; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
.vb-track .vb-seek::-webkit-slider-runnable-track { height: 16px; background: transparent; }
.vb-track .vb-seek::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 16px; height: 16px; border: 3px solid var(--brand); border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(var(--shade) / .25); }
.vb-track .vb-seek::-moz-range-track { height: 16px; background: transparent; }
.vb-track .vb-seek::-moz-range-thumb { box-sizing: border-box; width: 16px; height: 16px; border: 3px solid var(--brand); border-radius: 50%; background: #fff; }
.voice-bar button { flex: none; border: 0; padding: 0; display: grid; place-items: center; cursor: pointer; }
.vb-play { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; }
.vb-play:hover { background: var(--brand-ink); }
.vb-stop { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--brand-line); }
.vb-stop:hover { color: var(--bad); }
.vb-state { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--brand-ink); }
.vb-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vb-wave { flex: none; display: inline-flex; align-items: center; gap: 2px; height: 14px; }
.vb-wave i { width: 3px; height: 4px; border-radius: 2px; background: var(--brand); animation: vb-wave .9s ease-in-out infinite; }
.vb-wave i:nth-child(2) { animation-delay: -.6s; }
.vb-wave i:nth-child(3) { animation-delay: -.3s; }
.voice-bar.paused .vb-wave i, .voice-bar.loading .vb-wave i { animation: none; }
@keyframes vb-wave { 50% { height: 14px; } }
.vb-speed { flex: none; display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--brand-line); }
.vb-speed-label { font-size: 12px; color: var(--muted); padding-inline: 8px 2px; }
.vb-speed button { width: 28px; height: 28px; border-radius: 50%; background: transparent; color: var(--brand-ink); }
.vb-speed button:hover:not(:disabled) { background: var(--brand-soft); }
.vb-speed button:disabled { opacity: .35; cursor: default; }
.vb-rate { min-width: 40px; text-align: center; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .vb-speed-label { display: none; } }
/* the voice menu stays inside the bar (.vb-voice gives up width): in a narrow bar the "Speed" word and the state go */
.voice-bar { container-type: inline-size; }
@container (max-width: 470px) { .vb-speed-label { display: none; } }
@container (max-width: 360px) { .vb-state { display: none; } }
/* quick prompts: laid out when a book's chat is new */
.quick { margin: 2px 0 6px; }
.quick-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin: 0 0 8px; padding: 2px; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); text-align: start; cursor: pointer; }
.quick-fold { display: inline-flex; align-items: center; gap: 3px; color: var(--brand); font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.quick-title:hover .quick-fold { text-decoration: underline; }
.quick:not(.folded) .quick-fold svg { transform: rotate(180deg); }
.quick.folded .quick-title { margin-bottom: 0; }
.quick.folded .quick-grid { display: none; }
:lang(ar) .quick-title { letter-spacing: 0; text-transform: none; font-size: 13px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.quick-grid button { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.35; text-align: start; cursor: pointer; }
.quick-grid button:hover { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand-ink); }
.quick-grid svg { flex: none; margin-top: 1px; color: var(--brand); }
/* the words picked on the page that the next question is about */
.quote-box { display: flex; align-items: flex-start; gap: 8px; margin: 0 12px 8px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--brand-soft); border-inline-start: 3px solid var(--brand); }
.quote-box[hidden] { display: none; }
.quote-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.quote-label { font-size: 11.5px; font-weight: 700; color: var(--brand-ink); }
.quote-box q { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; color: var(--ink-2); }
.quote-x { flex: none; width: 26px; height: 26px; font-size: 12px; }
.quote-how { margin: 6px 0 4px; font-size: 12.5px; color: var(--ink-2); }
.quote-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.quote-chips button { border: 1px solid var(--brand-line); border-radius: 999px; padding: 5px 10px; background: var(--surface); color: var(--brand-ink); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.quote-chips button:hover { background: var(--brand-soft-2); }
/* a picture with the question (dropped on the tutor, pasted or chosen): over the box you type in, with what it costs */
.pic-box { display: flex; align-items: center; gap: 10px; margin: 0 12px 8px; padding: 8px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.pic-box[hidden] { display: none; }
.pic-box img { flex: none; width: 52px; height: 52px; object-fit: cover; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.pic-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pic-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.pic-text small { font-size: 12px; color: var(--muted); }
.pic-x { flex: none; width: 26px; height: 26px; }
/* its button, inside the end of the box you type in */
.composer .attach { flex: none; width: 34px; height: 34px; margin-inline: -46px 4px; margin-bottom: 5px; border-radius: 50%; color: var(--muted); position: relative; z-index: 1; }
.composer .attach:hover { color: var(--brand); background: var(--brand-soft); }
/* the picture in the chat, over the question */
.msg-pic { display: block; max-width: 100%; max-height: 220px; margin-bottom: 6px; border-radius: 10px; }
/* a picture dragged over the tutor */
.tutor.drop-on::after { content: attr(data-drop); position: absolute; inset: 8px; z-index: 20; display: grid; place-items: center; border: 2px dashed var(--brand); border-radius: 16px; background: rgb(var(--brand-wash) / .92); color: var(--brand-ink); font-weight: 700; font-size: 15px; pointer-events: none; }
/* a few choices opened over a button (ui.js choicesOver): Explain's Arabic and English */
.choice-over { position: fixed; z-index: 80; display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); animation: pop2 .12s ease-out; }
.choice-over button { border: 0; border-radius: 9px; padding: 8px 14px; background: var(--brand-soft); color: var(--brand-ink); font: 700 13px/1 var(--font); cursor: pointer; }
.choice-over button:lang(ar) { font-size: 15px; }
.choice-over button:hover, .choice-over button:focus-visible { background: var(--brand-soft-2); }
.co-always { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; } /* (Always: inHelpLang in ui.js) */
.co-always input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }
.choice-over.list { flex-direction: column; min-width: 190px; padding: 6px; } /* (a ⋯ button's menu: ui.js choicesOver, list) */
.choice-over.list button { background: none; color: var(--ink); text-align: start; font-weight: 600; padding: 10px 12px; }
.choice-over.list button:hover, .choice-over.list button:focus-visible { background: var(--surface-2); }
.choice-over.list button.danger { color: var(--bad); }
/* quick tooltips (public/js/tooltip.js) */
.tip-bubble { position: fixed; top: 0; left: 0; z-index: 3000; max-width: 260px; padding: 6px 10px; border-radius: 8px; background: var(--tip); color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.35; box-shadow: 0 6px 20px rgb(var(--shade) / .25); pointer-events: none; opacity: 0; transition: opacity .1s; }
.tip-bubble.on { opacity: 1; }
/* a sideways swipe on the book turns its page, not the browser's (back / forward) */
html:has(body.book-reader) { overscroll-behavior-x: none; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 14px; border-top: 1px solid var(--line); }
.composer textarea {
  flex: 1; min-width: 0; /* (min-width: 0: else Firefox keeps a text box at least its built-in width, which pushed the picture and Send buttons off the tutor: number 112) */
  resize: none; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px;
  font: inherit; font-size: 15px; line-height: 1.4; max-height: 140px; background: var(--surface-2); color: var(--ink);
}
.composer textarea { padding-inline-end: 40px; } /* (room for the picture button inside its end) */
.composer textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mic, .send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; }
.mic { background: var(--brand-soft); color: var(--brand); position: relative; }
.mic:hover { background: var(--brand-soft-2); }
.mic.unsupported { opacity: .5; }
.mic.listening { background: var(--bad); color: #fff; }
.mic.listening::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 3px solid var(--bad); animation: ring 1.2s ease-out infinite; }
@keyframes ring { from { opacity: .7; transform: scale(.9); } to { opacity: 0; transform: scale(1.35); } }
.send { background: var(--brand); color: #fff; }
.send:hover { background: var(--brand-ink); }
.send.busy { background: var(--tip); }
[dir="rtl"] .send svg { transform: scaleX(-1); }
.tutor-fab { display: none; }

/* ---- Book reader ---------------------------------------------------------- */
.book-reader .reader { padding: 0; background: var(--reader); position: relative; }
.pager { display: flex; align-items: center; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; flex: none; }
.pager select { font: inherit; font-weight: 600; font-size: 14px; border: 0; background: transparent; color: var(--ink); padding: 6px 4px; border-radius: 8px; cursor: pointer; max-width: 190px; position: relative; }
.pager select:focus-visible { z-index: 1; } /* (its ring over the buttons beside it: one under the mouse would cover its edge) */
/* the page list, and its short words ("19 / 193"), shown instead on a narrow screen with the list unseen over them,
   opening as before when tapped (book.js buildSelect; the whole of "Page 19 of 193 ✓" didn't fit there) */
.pg-box { position: relative; display: flex; align-items: center; }
/* The page box gives way before a book's bar leaves the screen (13 November 2026, MISTAKES.md numbers 326 and 327): its
   row was kept whole, so a real book's page name, "119 / 217", pushed the account picture off a phone 360 or 390 wide,
   and a parent's bar off a tablet held upright. Now its list, or on a phone its short name, is cut first. */
.book-reader .pager { flex: 0 1 auto; min-width: 0; }
.book-reader .pg-box, .book-reader .pager select { min-width: 0; }
.pg-short { display: none; }
.pager .icon-btn { width: 34px; height: 34px; }
.pager .icon-btn:disabled { opacity: .3; cursor: default; }
.zoom { display: flex; gap: 2px; flex: none; }
.topbar .zoom.over { position: absolute; top: 50%; transform: translateY(-50%); } /* over the middle of the page (book.js: placeZoom) */
.reader-tip {
  position: sticky; top: 10px; z-index: 6; margin: 12px auto 0; width: fit-content; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 6px; background: var(--tip); color: #fff; border-radius: 999px;
  padding: 6px 6px 6px 16px; font-size: 13px; box-shadow: var(--shadow-lg);
}
.reader-tip .icon-btn { color: #fff; width: 28px; height: 28px; }
.reader-tip .icon-btn:hover { background: rgb(255 255 255 / .12); }
/* (align-items: the page as tall as its picture: Safari kept a stretched page at its first height, 900px wide, so
   on a narrower page the hidden words sat lower than the printed ones and couldn't be selected) */
.page-wrap { display: flex; align-items: flex-start; justify-content: center; padding: 18px 16px 48px; min-width: fit-content; }
.book-page {
  position: relative; flex: none; width: 900px; background: #fff; border-radius: 3px;
  box-shadow: 0 2px 6px rgb(var(--shade) / .12), 0 18px 50px rgb(var(--shade) / .18);
}
.book-page img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; transition: opacity .18s; }
.book-page img.turning { opacity: .3; }
.fig-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.fig-anim { transition: opacity .35s; }
.fig-ui { position: absolute; inset: 0; pointer-events: none; }
.fig-ui > * { pointer-events: auto; }
.fig-chips { position: absolute; transform: translate(-100%, 4px); display: flex; gap: 6px; z-index: 2; }
.fig-chip {
  border: 0; border-radius: 999px; padding: 7px 13px; font: 600 13px/1 var(--font); white-space: nowrap; cursor: pointer;
  background: var(--surface); color: var(--ink-2); box-shadow: 0 2px 10px rgb(var(--shade) / .28);
}
.fig-chip:hover { background: var(--brand-soft); color: var(--brand-ink); }
.fig-chip.primary { background: var(--brand); color: #fff; animation: nudge 1.5s ease-in-out 2; }
.fig-chip.primary:hover { background: var(--brand-ink); }
.fig-chip.primary.on { background: var(--tip); animation: none; }
@keyframes nudge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
/* a quiz or flashcards: a click around it (or Esc) doesn't close it; its × pulses to show the way out (ui.js: stay) */
.modal-head .icon-btn.nudging { animation: close-nudge .8s ease-out; }
@keyframes close-nudge {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgb(var(--brand-rgb) / .45); }
  30% { transform: scale(1.18); background: var(--brand-soft); color: var(--brand-ink); }
  60% { transform: scale(.96); }
  100% { transform: scale(1); box-shadow: 0 0 0 12px rgb(var(--brand-rgb) / 0); }
}
.term-hot { position: absolute; border: 0; padding: 0; margin: 0; background: transparent; border-radius: 4px; cursor: help; }
.term-hot:hover, .term-hot:focus-visible { background: rgb(250 204 21 / .3); outline: 2px dashed rgb(202 138 4 / .9); outline-offset: 1px; }
.term-pop { position: absolute; transform: translate(-50%, 6px); z-index: 5; background: var(--surface); border-radius: 12px; padding: 6px; box-shadow: var(--shadow-lg); }
.term-pop .btn { white-space: nowrap; }
.video-hot { position: absolute; border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer; border-radius: 3px; }
.video-hot:hover, .video-hot:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; background: rgb(255 255 255 / .14); }
.fig-3d { position: absolute; z-index: 4; border-radius: 10px; overflow: hidden; background: #0f172a; box-shadow: 0 10px 40px rgb(15 23 42 / .4); }
.fig-3d-stage { position: absolute; inset: 0; }
.fig-3d-close { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2; }
/* (its hint fades away after a while, out of the picture's way) */
@keyframes fig-hint-out { to { opacity: 0; visibility: hidden; } }
.fig-3d-hint {
  position: absolute; bottom: 10px; inset-inline-start: 10px; z-index: 2; pointer-events: none; max-width: calc(100% - 20px); animation: fig-hint-out .6s ease 8s forwards;
  background: rgb(var(--glass) / .85); border-radius: 999px; padding: 5px 11px; font-size: 12px; color: var(--ink-2);
}
/* its buttons, top left (the way back is top right): see all, zoom out and in, and move it */
.fig-3d-nav { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; flex-wrap: wrap; gap: 3px; max-width: calc(100% - 190px); padding: 3px; border-radius: 12px; background: rgb(var(--glass) / .9); box-shadow: 0 2px 10px rgb(var(--shade) / .25); }
.fig-3d-nav button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font: 700 18px/1 var(--font); cursor: pointer; }
.fig-3d-nav button:hover { background: var(--brand-soft); color: var(--brand); }
/* on a phone (or for a picture too small for its 3D), the 3D view fills the screen, clear of the phone's notch */
.fig-3d.full { position: fixed; inset: 0; z-index: 75; border-radius: 0; box-shadow: none; }
.fig-3d.full .fig-3d-close { top: max(10px, env(safe-area-inset-top)); }
@container (max-width: 460px) { .fig-3d .scene-label { font-size: 11px; padding: 2px 6px; } } /* (smaller labels on a phone) */
/* (a narrow 3D view, on a phone: its buttons go along its bottom, in one row, and the hint makes way) */
.fig-3d { container-type: inline-size; }
@container (max-width: 460px) {
  .fig-3d-nav { top: auto; bottom: 8px; left: 8px; max-width: calc(100% - 16px); flex-wrap: nowrap; }
  .fig-3d.full .fig-3d-nav { bottom: max(10px, env(safe-area-inset-bottom)); left: 50%; translate: -50% 0; }
  .fig-3d-nav button { width: 28px; height: 28px; }
  .fig-3d-hint { display: none; }
}
.fig-3d-tag {
  position: absolute; z-index: 2; transform: translate(-50%, -140%); pointer-events: none;
  background: var(--tip); color: #fff; padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.reader-toast { position: fixed; top: calc(var(--topbar) + 14px); z-index: 50; width: max-content; max-width: calc(100vw - 32px); white-space: normal; text-align: center; line-height: 1.45; border-radius: 20px; } /* (a long one wraps on a phone, never wider than the screen: number 124) */
.modal { position: fixed; inset: 0; z-index: 60; background: rgb(15 23 42 / .6); display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(720px, 100%); background: var(--surface); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 18px; font-size: 17px; }
/* (a picture before the title, like the tutor's: the AI's sparkle in its colours, in Which AI answers you) */
.modal-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, #6366f1, #06b6d4); color: #fff; } /* (as the tutor's own, .avatar) */
.modal-icon svg { width: 18px; height: 18px; }
.modal-icon + strong { flex: 1; min-width: 0; margin-inline-end: auto; }
.video-frame svg { display: block; width: 100%; height: auto; }
.modal-note { padding: 12px 18px 16px; color: var(--ink-2); font-size: 14px; }

/* Home: the book card */
.reader-card { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 14px; }
.reader-cover { display: block; border-radius: 6px; overflow: hidden; box-shadow: 0 10px 28px rgb(var(--shade) / .25); transition: transform .15s; }
.reader-cover:hover { transform: translateY(-3px); }
.reader-cover img { display: block; width: 100%; height: auto; }
.reader-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.toc a { display: flex; justify-content: space-between; gap: 14px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-size: 14.5px; }
.toc a:hover { background: var(--surface-2); color: var(--brand); }
.toc-page { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.pill.warn { background: var(--amber-soft-2); color: var(--amber-ink); }
.toc a { justify-content: flex-start; align-items: flex-start; }
.toc-title { flex: 1; min-width: 0; }
.toc-state { flex: none; width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; }
.toc-state.some { border-color: var(--ok); background: linear-gradient(90deg, var(--ok) 50%, transparent 50%); }
[dir="rtl"] .toc-state.some { background: linear-gradient(270deg, var(--ok) 50%, transparent 50%); }
.toc-state.done { border-color: var(--ok); background: var(--ok); }
.toc-state.done::after { content: "✓"; color: #fff; font-size: 10px; font-weight: 800; line-height: 1; }
.progress-total { margin-top: 14px; font-weight: 600; color: var(--ink-2); font-size: 14px; }
.pbar { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
/* home: the contents by module and lesson */
.contents { display: grid; gap: 6px; }
/* a module (or a part of a book added in several files) folds open to its lessons (or chapters) */
.mod { margin-top: 6px; }
.mod-parts { display: grid; gap: 6px; padding: 6px 0 2px; }
.mod-title { list-style: none; display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 10px; cursor: pointer; background: var(--brand-soft); font-size: 14px; font-weight: 700; color: var(--brand-ink); }
.mod-title::-webkit-details-marker { display: none; }
.mod-title::before { content: ""; flex: none; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s; }
[dir="rtl"] .mod-title::before { transform: rotate(135deg); }
.mod[open] > .mod-title::before { transform: rotate(45deg); }
.mod-title:hover { color: var(--brand); }
.mod-title .count { margin-inline-start: auto; color: var(--muted); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.part { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.part > summary { list-style: none; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto 96px; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; border-radius: 12px; }
.part > summary::-webkit-details-marker { display: none; }
.part > summary:hover { background: var(--surface-2); }
.part > summary .toc-state { margin-top: 0; }
.part-title { font-weight: 600; font-size: 14.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.part[open] > summary .part-title { color: var(--ink); }
.part-count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.part .pbar { height: 6px; }
.part .toc { padding: 0 6px 8px; }
/* "All chapters": the contents folded away, opened when asked for */
.all-parts { margin-top: 14px; }
.all-parts > summary { display: inline-flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; padding: 7px 14px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.all-parts > summary::-webkit-details-marker { display: none; }
.all-parts > summary::before { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s; }
[dir="rtl"] .all-parts > summary::before { transform: rotate(135deg); }
.all-parts[open] > summary::before { transform: rotate(45deg); }
.all-parts > summary:hover { color: var(--brand); }
.all-parts .count { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
/* a book's "✓ Mark as finished", or when it was finished with "Read it again" */
.finish-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
.finish-btn { font: inherit; font-weight: 600; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.finish-btn:hover, .finish-btn:focus-visible { color: var(--brand); text-decoration: underline; }
.finished-books .finish-btn { color: var(--brand); }
/* the books they finished, folded at the bottom of the Library */
.finished-books { margin: 6px 0 20px; }
.finished-books > summary { display: inline-flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; padding: 9px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: 15px; }
.finished-books > summary::-webkit-details-marker { display: none; }
.finished-books > summary::before { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s; }
[dir="rtl"] .finished-books > summary::before { transform: rotate(135deg); }
.finished-books[open] > summary::before { transform: rotate(45deg); }
.finished-books > summary:hover { color: var(--brand); }
.finished-books .count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.finished-list { margin-top: 16px; }
.all-parts > .contents { margin-top: 10px; }
@media (max-width: 760px) {
  .part > summary { grid-template-columns: 16px minmax(0, 1fr) auto; }
  .part > summary .pbar { grid-column: 2 / -1; }
}

/* ---- Study tools on the book page -------------------------------------------------- */
.book-page { container-type: inline-size; isolation: isolate; }
.marks-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: multiply; }
.hl-yellow { fill: #fef08a; }
.hl-green { fill: #bbf7d0; }
.hl-pink { fill: #fbcfe8; }
.hl-blue { fill: #bfdbfe; }
.mk-flash { fill: #fdba74; animation: mk-flash 3.2s ease-out forwards; }
@keyframes mk-flash { 0%, 12%, 30% { opacity: 1; } 20% { opacity: .35; } 100% { opacity: 0; } }
.marks-off .hl, .marks-off .mk-mark, .marks-off .mk-box { display: none; }
.word-layer { position: absolute; inset: 0; overflow: hidden; line-height: 1; font-family: Helvetica, Arial, sans-serif; -webkit-text-size-adjust: none; text-size-adjust: none; }
.word-layer > span { position: absolute; white-space: pre; color: transparent; transform-origin: 0 0; cursor: text; }
.word-layer > span::selection { background: rgb(var(--brand-rgb) / .3); color: transparent; }
.marks-ui { position: absolute; inset: 0; pointer-events: none; }
/* Drawing on the page (ink.js, 8 November 2026): the reader's own lines over the page and everything on it (never part of
   the page: rule 1), letting clicks through until Draw is on; a highlighter's lines see-through, like a real one's */
.ink-layer { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 6; pointer-events: none; overflow: visible; }
.ink-layer path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ink-layer .ink-hl { opacity: .38; mix-blend-mode: multiply; }
.ink-layer.ink-hidden { display: none; }
.book-page.inking .ink-layer { pointer-events: auto; cursor: crosshair; }
.book-page.inking .word-layer { pointer-events: none; } /* (no selecting words while drawing) */
/* the drawing bar, at the top of the page while Draw is on: Done, Undo, the pen, the highlighter and the eraser, three
   sizes and six colours (wrapping onto two lines on a phone) */
.ink-bar { position: sticky; top: 10px; z-index: 9; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; width: fit-content; max-width: calc(100% - 20px); margin: 10px auto -50px; padding: 6px 8px; background: rgb(var(--glass) / .96); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.ink-bar[hidden] { display: none; }
.ink-rest { display: contents; } /* (the bar's buttons, after its handle, in the bar's own rows) */
/* dragged by its handle (the writing bar's, rule 28): wherever it was left on the screen, over everything (ink.js #place) */
.ink-bar.moved { position: fixed; margin: 0; z-index: 40; }
.ink-bar .ink-grip { height: 36px; margin-inline-start: 0; }
.ink-group { display: inline-flex; align-items: center; gap: 2px; }
.ink-tool, .ink-undo, .ink-size, .ink-turn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 11px; background: none; color: var(--ink-2); cursor: pointer; }
.ink-size { width: 30px; } /* (a little narrower: the bar stays on one line beside the tutor) */
.ink-tool:hover, .ink-undo:hover:not(:disabled), .ink-size:hover, .ink-turn:hover { background: var(--surface-2); color: var(--ink); }
.ink-tool[aria-pressed="true"], .ink-size[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-ink); }
.ink-undo:disabled { opacity: .35; cursor: default; }
.ink-size i { display: block; width: var(--d); height: var(--d); border-radius: 50%; background: currentColor; }
.ink-color { width: 26px; height: 26px; margin: 0 1px; padding: 0; border: 3px solid var(--surface); border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.ink-color[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--brand); }
/* More colours (8 November 2026): a rainbow button after the six; its panel, under the bar (over it when the bar is low):
   18 more colours, and Any colour… (the device's own picker, its input hidden in its label) */
.ink-more { width: 26px; height: 26px; margin: 0 1px; padding: 0; border: 3px solid var(--surface); border-radius: 50%; background: conic-gradient(#ef4444, #f59e0b, #eab308, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.ink-more[aria-expanded="true"] { box-shadow: 0 0 0 2.5px var(--brand); }
.ink-panel { position: absolute; top: calc(100% + 8px); inset-inline-end: 8px; z-index: 2; display: grid; gap: 10px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); }
.ink-panel.up { top: auto; bottom: calc(100% + 8px); }
.ink-panel-grid { display: grid; grid-template-columns: repeat(6, 26px); gap: 8px; }
.ink-panel .ink-color { margin: 0; }
.ink-any { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.ink-any::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(#ef4444, #eab308, #22c55e, #3b82f6, #8b5cf6, #ef4444); }
.ink-any:hover { background: var(--surface-2); }
.ink-any input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; } /* (a tap anywhere on it opens the picker) */
.ink-sep { width: 1px; height: 26px; margin: 0 2px; background: var(--line); }
.ink-hint { padding: 0 8px; color: var(--muted); font-size: 13.5px; }
.ink-done { margin-inline-end: 2px; }
@media (max-width: 600px) { .ink-sep { display: none; } .ink-bar { gap: 2px; padding: 5px 6px; } .ink-tool, .ink-undo, .ink-size, .ink-turn { width: 34px; height: 34px; } .ink-color { width: 26px; height: 26px; } }
/* upright (8 November 2026, the owner's wish; its button after the handle, ink.js #turn): a column of the same buttons,
   Done a ✓; two or three columns when one is taller than the screen (--cols, #fit); at the page's side until it's
   moved; More colours opens beside it */
.ink-bar.upright:not([hidden]) { display: grid; grid-template-columns: repeat(var(--cols, 1), 34px); justify-content: center; justify-items: center; align-items: center; gap: 4px; width: auto; max-width: none; padding: 6px; }
.ink-bar.upright .ink-grip { width: 34px; height: 22px; margin: 0; }
.ink-bar.upright .ink-grip svg { transform: rotate(90deg); }
.ink-bar.upright .ink-done { grid-column: 1 / -1; display: grid; place-items: center; width: 100%; height: 34px; margin: 0; padding: 0; }
.ink-bar.upright .ink-sep { display: block; grid-column: 1 / -1; width: 100%; height: 1px; margin: 1px 0; }
.ink-bar.upright .ink-group { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(var(--cols, 1), 34px); justify-items: center; align-items: center; gap: 4px; }
.ink-bar.upright :is(.ink-tool, .ink-undo, .ink-size, .ink-turn) { width: 34px; height: 34px; }
.ink-bar.upright :is(.ink-color, .ink-more) { margin: 0; }
.ink-bar.upright .ink-hint { display: none; } /* (the eraser's words don't fit a column: its button says what it is) */
.ink-bar.upright.packed .ink-group { display: contents; } /* (a phone on its side: the buttons in rows, no lines between) */
.ink-bar.upright.packed .ink-sep { display: none; }
.ink-bar.upright.packed .ink-done { grid-column: auto; width: 34px; }
.ink-bar.upright .ink-panel { top: auto; bottom: 0; left: calc(100% + 8px); right: auto; }
.ink-bar.upright .ink-panel.left { left: auto; right: calc(100% + 8px); }
.ink-bar.upright .ink-panel.down { top: 0; bottom: auto; }
/* The new pens' bar (the owner's wish, 9 November 2026, after Boardmix's; theirs only while they try it: ink.js, PENS),
   as slim as the old bar (the owner's wish, the same day: "the new one is too bulky"): the pens stand in a tray as tall
   as the bar's buttons, going down into the bar's foot, each showing its top, and the one in hand rises to the bar's
   top; a second tap on it opens its box. The colours in one row, as the old bar has them. Upright, the pens lie across
   the bar, their tips towards the page. */
.ink-bar.pens .ink-end { display: contents; }
.pen-tray { position: relative; align-self: flex-end; flex: 1 1 133px; width: 196px; min-width: 133px; max-width: 196px; height: 36px; margin: 0; gap: 0; align-items: flex-end; }
/* (on the bar's last row, the pens go down into its foot, as in a tray; on a row above another, they stop at that row's
   foot: ink.js .foot) */
.pen-tray.foot { height: 42px; margin-bottom: -6px; }
.pen-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
/* (each pen cut off at the bar's foot only, so the one raised can reach up to the bar's top) */
.pen-pick { position: relative; flex: 1 1 0; min-width: 0; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; clip-path: inset(-12px -4px 0 -4px); -webkit-tap-highlight-color: transparent; }
/* (each pen's picture as wide as its button allows, up to 22: a little smaller when the page is narrow) */
.pen-w { position: absolute; left: 50%; top: 0; width: clamp(15px, calc(100% - 4px), 22px); aspect-ratio: 28 / 76; transform: translate(-50%, var(--y, 16px)); transition: transform .2s cubic-bezier(.2, .8, .3, 1.15); filter: drop-shadow(0 1px 1px rgb(15 23 42 / .25)); }
.pen-pic { display: block; width: 100%; height: 100%; }
.pen-pic .pc { fill: var(--pc, #1f2937); }
.pen-pic .pcs { fill: none; stroke: var(--pc, #1f2937); }
@media (hover: hover) { .pen-pick:hover .pen-w { --y: 11px; } }
.pen-pick[aria-pressed="true"] .pen-w { --y: -2px; }
.pen-pick:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { .pen-w { transition: none; } }
.ink-bar.pens.upright .pen-tray { flex: none; width: auto; min-width: 0; max-width: none; height: auto; margin: 0; align-self: auto; }
.ink-bar.pens.upright .pen-pick { flex: none; width: 34px; height: 26px; clip-path: inset(-6px -12px -6px 0); }
.ink-bar.pens.upright .pen-w { left: 0; top: 0; width: 22px; transform: translate(var(--x, -19px), -17px) rotate(90deg); }
@media (hover: hover) { .ink-bar.pens.upright .pen-pick:hover .pen-w { --x: -15px; } }
.ink-bar.pens.upright .pen-pick[aria-pressed="true"] .pen-w { --x: -4px; }
.ink-bar.pens.upright[dir="rtl"] .pen-pick { clip-path: inset(-6px 0 -6px -12px); }
.ink-bar.pens.upright[dir="rtl"] .pen-w { transform: translate(var(--x, 31px), -17px) rotate(-90deg); }
@media (hover: hover) { .ink-bar.pens.upright[dir="rtl"] .pen-pick:hover .pen-w { --x: 27px; } }
.ink-bar.pens.upright[dir="rtl"] .pen-pick[aria-pressed="true"] .pen-w { --x: 16px; }
/* (upright with too little room for every colour: only the one in use, then the rainbow, which has the others; ink.js #fit) */
.ink-bar.pens.upright.few .ink-colors .ink-color:not([aria-pressed="true"]) { display: none; }
/* a pen's panel (its second tap), Kitabi's own (the owner's wish: not a copy of Boardmix's box): a sample of the line on a
   strip of white paper, then Size and Strength (sliders, each between a mark for its two ends) and Line end */
.ink-tune { position: absolute; z-index: 3; display: grid; gap: 8px; width: 300px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); color: var(--ink); }
.ink-sample { display: grid; place-items: center; height: 52px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ink-sample-svg { display: block; }
.ink-sample-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ink-sample-svg .ink-hl { opacity: .38; mix-blend-mode: multiply; }
.ink-tune-row { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.ink-tune-label { flex: none; min-width: 64px; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ink-tune-opts { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
/* Size and Strength: Kitabi's own sliders (input[type="range"]: the blue part follows --p), between a mark for each end:
   a small dot and a big one; a faint circle of the pen's colour and a full one, each on a white disc, the page's paper */
.ink-tune-opts input[type="range"] { flex: 1; min-width: 0; margin: 0; }
/* (its knob a little smaller than Kitabi's other sliders': the owner's wish, "make the circle little bit smaller") */
.ink-tune-opts input[type="range"]::-webkit-slider-thumb { box-sizing: border-box; width: 16px; height: 16px; border-width: 2.5px; }
.ink-tune-opts input[type="range"]::-moz-range-thumb { box-sizing: border-box; width: 16px; height: 16px; border-width: 2.5px; }
/* (the number at each row's end: Size 1 to 20, Strength 10 to 100%) */
.ink-tune-num { flex: none; min-width: 40px; color: var(--ink-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: end; }
.ink-tune-opts input[type="range"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 7px; }
.ink-tune-mark { flex: none; display: block; border-radius: 50%; }
.ink-tune-mark.dot { width: 18px; height: 18px; background: radial-gradient(circle closest-side, var(--ink-2) calc(var(--d) - .5px), transparent var(--d)); } /* (as wide as Strength's circles, so the two sliders line up) */
.ink-tune-mark.disc { position: relative; width: 18px; height: 18px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.ink-tune-mark.disc b { position: absolute; inset: 0; border-radius: 50%; background: var(--pc); }
.ink-tune-end { position: relative; display: inline-grid; place-items: center; width: 56px; height: 30px; padding: 0; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; }
@media (hover: hover) { .ink-tune-end:hover { background: var(--surface-2); } }
.ink-tune-end[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-ink); box-shadow: inset 0 0 0 1.5px var(--brand); }
.ink-tune-end:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ink-tune-tip { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
/* (a phone: smaller pens, so they fit on the first row beside Done, Undo and Redo, and the colours on the second, in two
   rows as the old bar is) */
@media (max-width: 600px) {
  .ink-bar.pens:not(.upright) .pen-tray { flex-basis: 126px; min-width: 126px; height: 34px; } /* (at least 18 a pen: room on the first row even 360 wide) */
  .ink-bar.pens:not(.upright) .pen-tray.foot { height: 39px; margin-bottom: -5px; }
  .ink-bar.pens:not(.upright) .pen-w { --y: 14px; }
  .ink-bar.pens:not(.upright) .pen-pick[aria-pressed="true"] .pen-w { --y: -1px; }
}
.marks-ui > * { pointer-events: auto; }
.book-page.placing, .book-page.placing * { cursor: crosshair !important; }
.book-page.placing .word-layer, .book-page.placing .fig-ui > *, .book-page.placing .mk-mark, .book-page.placing .mk-box, .book-page.placing .pt-star { pointer-events: none; }
.mk-spot { position: absolute; width: 1px; height: 1px; pointer-events: none; }
.mk-mark { position: absolute; border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; }
.mk-badge, .mk-pin { width: 28px; height: 28px; border-radius: 8px; background: var(--surface); box-shadow: 0 2px 8px rgb(var(--shade) / .28); transition: transform .12s; }
.mk-badge { transform: translate(-4px, -72%); }
.mk-pin { transform: translate(-50%, -100%); }
.mk-badge:hover { transform: translate(-4px, -72%) scale(1.1); }
.mk-pin:hover { transform: translate(-50%, -100%) scale(1.1); }
.mk-pin { touch-action: none; } /* (dragged to another place on the page: marks.js #dragPin) */
.mk-pin.dragging { cursor: grabbing; transform: translate(-50%, -100%) scale(1.15); box-shadow: 0 8px 20px rgb(var(--shade) / .35); transition: none; z-index: 5; }
.mk-teacher { width: 24px; height: 24px; transform: translate(-60%, -72%); border-radius: 50%; background: var(--surface); box-shadow: 0 1px 6px rgb(var(--shade) / .3); }
.mk-ribbon { width: 26px; height: 46px; transform: translateX(-50%); background: var(--bad); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%); filter: drop-shadow(0 2px 3px rgb(0 0 0 / .25)); }
.mk-menu {
  position: absolute; z-index: 8; max-width: min(400px, calc(100% - 12px)); padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  font: 14px/1.4 var(--font); color: var(--ink); cursor: default; animation: pop2 .14s ease-out;
}
.mk-dots { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 0 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.mk-dot { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; border-radius: 999px; padding: 5px 10px 5px 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.mk-dot i { width: 17px; height: 17px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .14); }
.mk-dot-yellow i { background: #fde047; }
.mk-dot-green i { background: #4ade80; }
.mk-dot-pink i { background: #f472b6; }
.mk-dot-blue i { background: #60a5fa; }
.mk-dot:hover { background: var(--surface-2); }
.mk-dot.on { background: var(--brand-soft); color: var(--brand-ink); }
.mk-acts { display: flex; flex-wrap: wrap; gap: 2px; }
.mk-act { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; min-width: 54px; border: 0; background: transparent; border-radius: 10px; padding: 6px 6px 5px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.mk-act svg { color: var(--brand); }
.mk-act:hover { background: var(--brand-soft); color: var(--brand-ink); }
/* a note's box: as wide as its writing space, which its corner pulls bigger or smaller, down and to the side (never
   wider than the page: --room, marks.js #show) */
.mk-editor { width: max-content; min-width: min(340px, calc(100% - 12px)); padding: 10px; display: grid; gap: 8px; }
.mk-menu.mk-editor { max-width: calc(100% - 12px); }
/* ✕ in the words menu's top corner (the owner's wish, 11 November 2026); its first row leaves it room */
.mk-menu.with-x > :first-child { padding-inline-end: 34px; }
.mk-x { position: absolute; top: 5px; inset-inline-end: 5px; width: 30px; height: 30px; border-radius: 50%; color: var(--muted); }
.mk-x:hover { background: var(--surface-2); color: var(--ink); }
.mk-x svg { width: 16px; height: 16px; }
.mk-editor textarea, .mk-editor input { width: 100%; font: inherit; font-size: 14.5px; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); color: var(--ink); resize: vertical; }
.mk-editor textarea { width: 318px; min-width: 200px; max-width: var(--room, calc(100vw - 48px)); min-height: 64px; resize: both; }
.mk-editor textarea:focus, .mk-editor input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
/* the handle a note's box is moved by (marks.js #grip; .mk-grip is a writing box's bar's) */
.mk-handle { display: flex; justify-content: center; align-items: center; justify-self: stretch; height: 14px; margin: -6px 0 -4px; cursor: grab; touch-action: none; }
.mk-handle i { width: 40px; height: 4px; border-radius: 4px; background: var(--muted); opacity: .4; }
.mk-handle:hover i { opacity: .8; }
.mk-editor.moving { box-shadow: 0 14px 34px rgb(var(--shade) / .32); }
.mk-editor.moving .mk-handle { cursor: grabbing; }
/* a note a parent left on their child's page: a pin in their colour with their first letter */
.mk-pin-from { background: var(--violet); color: #fff; border-radius: 50% 50% 50% 6px; font: 800 13px/1 var(--font); }
.mk-pin-from.is-hidden { opacity: .45; }
.mk-quote { margin: 0; padding: 5px 10px; border-radius: 6px; border-inline-start-width: 4px; border-inline-start-style: solid; font-size: 13px; color: var(--ink-2); max-height: 4.4em; overflow: hidden; }
.mk-q-yellow, .c-yellow blockquote { background: #fefce8; border-color: #facc15; }
.c-parent blockquote { background: var(--violet-soft); border-color: var(--violet-mid); }
.nb-from { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--violet-ink); }
.nb-filter.f-parent::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #c084fc; }
.nb-item.is-hidden { opacity: .6; }
.mk-q-green, .c-green blockquote { background: #f0fdf4; border-color: #4ade80; }
.mk-q-pink, .c-pink blockquote { background: #fdf2f8; border-color: #f472b6; }
.mk-q-blue, .c-blue blockquote { background: #eff6ff; border-color: #60a5fa; }
/* (in Dark: a highlight's colour as a faint wash, its line kept) */
@media screen {
  :root[data-theme="dark"] :is(.mk-q-yellow, .c-yellow blockquote) { background: rgb(250 204 21 / .1); }
  :root[data-theme="dark"] :is(.mk-q-green, .c-green blockquote) { background: rgb(74 222 128 / .1); }
  :root[data-theme="dark"] :is(.mk-q-pink, .c-pink blockquote) { background: rgb(244 114 182 / .1); }
  :root[data-theme="dark"] :is(.mk-q-blue, .c-blue blockquote) { background: rgb(96 165 250 / .1); }
}
.mk-row { display: flex; align-items: center; gap: 6px; }
.mk-grow { flex: 1; }
.mk-mic { color: var(--brand); background: var(--brand-soft); border-radius: 50%; }
.mk-mic.listening { background: var(--bad); color: #fff; }
.mk-title { font-weight: 700; font-size: 14px; }
.mk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-chip { border: 1px solid var(--brand-line); background: var(--brand-soft); color: var(--brand-ink); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; cursor: pointer; }
.mk-chip.on, .mk-chip:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
/* the book's empty answer boxes: typing there looks like writing in the book, in blue pen */
.mk-box { position: absolute; }
.mk-edit {
  position: absolute; inset: 0; border-radius: 6px; outline: none; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; text-align: start;
  padding: .5cqw .9cqw; font: 500 2.7cqw/1.2 "Caveat", "IBM Plex Sans Arabic", cursive; color: var(--info-ink); cursor: text; -webkit-user-select: text; user-select: text;
}
.mk-edit:hover { background: rgb(59 130 246 / .06); box-shadow: inset 0 0 0 1.5px rgb(59 130 246 / .35); }
.mk-edit:focus { background: rgb(255 255 255 / .6); box-shadow: inset 0 0 0 2px rgb(59 130 246 / .65); }
/* ("Write here" fades in by its colour, not opacity: Safari cut the handwriting's last letter in a faded layer; and a
   little room after it for that letter's tail) */
.mk-edit:empty::before { content: attr(data-placeholder); padding-inline-end: .3em; color: rgb(59 130 246 / 0); transition: color .15s; pointer-events: none; }
.mk-box:hover .mk-edit:empty::before, .mk-edit:empty:focus::before { color: rgb(59 130 246 / .7); }
.mk-box:not(.filled, .mk-cell)::after { content: "✎"; position: absolute; top: 3px; right: 6px; font-size: 14px; color: #3b82f6; opacity: .7; pointer-events: none; }
/* how its words can look (the writing bar): sized with the page, like the rest of the answer */
:is(.mk-edit, .ps-answer) b { font-weight: 700; }
:is(.mk-edit, .ps-answer) font[face="hand"] { font-family: "Caveat", "IBM Plex Sans Arabic", cursive; }
:is(.mk-edit, .ps-answer) font[face="plain"] { font-family: "Inter", "IBM Plex Sans Arabic", sans-serif; font-size-adjust: .42; }
:is(.mk-edit, .ps-answer) font[face="book"] { font-family: Georgia, "Times New Roman", "IBM Plex Sans Arabic", serif; font-size-adjust: .42; }
:is(.mk-edit, .ps-answer) font[face="typewriter"] { font-family: "Kitabi Typewriter", "IBM Plex Sans Arabic", monospace; font-size-adjust: .42; }
/* Typewriter: Courier New's letters, with Arabic in the site's Arabic font (Courier's own Arabic letters don't join) */
@font-face { font-family: "Kitabi Typewriter"; src: local("Courier New"), local("CourierNewPSMT"); unicode-range: U+0000-02FF, U+2000-206F, U+20A0-20CF; }
:is(.mk-edit, .ps-answer) font[size="2"] { font-size: .8em; }
:is(.mk-edit, .ps-answer) font[size="3"] { font-size: 1em; }
:is(.mk-edit, .ps-answer) font[size="5"] { font-size: 1.3em; }
:is(.mk-edit, .ps-answer) font[size="6"] { font-size: 1.7em; }
/* Print (the reader's tools): the page as it looks, on one sheet */
@media print {
  #print-sheet .ps-page { position: relative; width: 100%; max-width: calc(95vh * var(--w) / var(--h)); margin: 0 auto; container-type: inline-size; break-inside: avoid; }
  #print-sheet .ps-page img { display: block; width: 100%; height: auto; }
  #print-sheet .ps-answer { position: absolute; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; text-align: start; padding: .5cqw .9cqw; font: 500 2.7cqw/1.2 "Caveat", "IBM Plex Sans Arabic", cursive; color: #1d4ed8; }
}
/* under the answer while it's written in: the writing bar, and "Check my answer" (also when it's pointed at). On
   the way down to the button the answer's reach goes on under it, and the button waits a moment before going, so
   it's still there when the pointer gets to it */
.mk-tools { position: absolute; top: 100%; left: 0; right: 0; z-index: 3; margin-top: 4px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; pointer-events: none; visibility: hidden; opacity: 0; transition: opacity .15s .25s, visibility 0s .4s; }
.mk-tools > * { pointer-events: auto; }
.mk-box.filled:hover:not(:focus-within) .mk-tools { visibility: visible; opacity: 1; transition-delay: 0s; }
.mk-box.filled:hover:not(:focus-within)::before { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 44px; }
/* while it's written in (marks.js #float): the writing bar and "Check my answer" float over the page and its tool bar,
   under the answer or over it, or where they were dragged by their handle */
.mk-float { position: fixed; z-index: 30; display: flex; align-items: center; gap: 8px; }
.mk-float[hidden] { display: none; }
.mk-float-pill { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); }
.mk-float-pill .mk-format { border: 0; background: none; box-shadow: none; }
.mk-grip { display: inline-grid; place-items: center; flex: none; width: 22px; height: 30px; margin-inline-start: 3px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: grab; touch-action: none; }
.mk-grip:hover { background: var(--surface-2); color: var(--ink-2); }
.mk-grip:active { cursor: grabbing; }
.mk-float .mk-check { margin: 0; }
/* What goes here? beside Check my answer, and what it says under them (marks.js: #showHelp) */
.mk-float { flex-wrap: wrap; max-width: calc(100vw - 16px); }
.mk-float .mk-help-btn { background: var(--surface); color: var(--brand-ink); box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--brand-line); }
.mk-float .mk-help-btn:hover { background: var(--brand-soft); }
.mk-help { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; width: min(440px, calc(100vw - 16px)); padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); }
.mk-help.up { top: auto; bottom: calc(100% + 6px); } /* (above the bar: marks.js puts it on the side away from the box) */
.mk-help[hidden] { display: none; }
.mk-help-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink); }
.mk-help-text.bad { color: var(--bad); }
.mk-help-wait { color: var(--muted); }
.mk-help-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.mk-help-act { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 8px; padding: 6px 9px; background: var(--surface-2); color: var(--ink-2); font: 600 12.5px/1 var(--font); cursor: pointer; }
.mk-help-act:hover { background: var(--brand-soft); color: var(--brand-ink); }
.mk-help-act svg { width: 15px; height: 15px; }
@media (max-width: 520px) { .mk-float .mk-help-btn span { display: none; } }
.mk-float.up .mk-f-list { top: auto; bottom: calc(100% + 4px); }
.mk-check { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; border: 0; border-radius: 999px; padding: 6px 11px; background: var(--brand); color: #fff; font: 600 12.5px/1 var(--font); white-space: nowrap; box-shadow: var(--shadow-lg); cursor: pointer; }
.mk-format { position: relative; display: flex; align-items: center; gap: 1px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); font: 600 13px/1 var(--font); color: var(--ink-2); }
.mk-f { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 30px; height: 30px; padding: 0 6px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; cursor: pointer; }
.mk-f:hover, .mk-f[aria-expanded="true"] { background: var(--surface-2); }
.mk-f[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-ink); }
.mk-f b, .mk-f i, .mk-f u { font: 700 15px/1 Georgia, "Times New Roman", serif; }
.mk-f i { font-style: italic; font-weight: 400; }
.mk-f u { font-weight: 400; text-underline-offset: 2px; }
.mk-f-font span { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-f-a { display: grid; justify-items: center; font: 700 14px/1 var(--font); }
.mk-f-a i { display: block; width: 15px; height: 3px; margin-top: 2px; border-radius: 2px; }
.mk-f-line { flex: none; width: 1px; height: 18px; margin: 0 3px; background: var(--line); }
.mk-f-list { position: absolute; top: calc(100% + 4px); z-index: 4; display: grid; min-width: 150px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); animation: pop2 .12s ease-out; }
.mk-f-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font: 600 14px/1.3 var(--font); text-align: start; white-space: nowrap; cursor: pointer; }
.mk-f-item:hover { background: var(--surface-2); }
.mk-f-item svg { flex: none; color: var(--brand); visibility: hidden; }
.mk-f-item.on svg { visibility: visible; }
.mk-f-fonts .mk-f-item, .mk-f-sizes .mk-f-item { font-weight: 500; }
.mk-f-inks { grid-template-columns: repeat(4, 28px); gap: 6px; min-width: 0; padding: 8px; }
.mk-f-inks .mk-f-item { width: 28px; height: 28px; padding: 0; justify-content: center; border-radius: 50%; color: #fff; box-shadow: inset 0 0 0 1px rgb(var(--shade) / .15); }
.mk-f-inks .mk-f-item:hover { transform: scale(1.1); }
.mk-f-inks .mk-f-item span { display: none; }
.mk-f-inks .mk-f-item svg { color: #fff; }

/* the book's important points: blue underline, a star to open each one */
.points-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pt-line { fill: var(--info-2); opacity: .9; }
.pt-line.exam { fill: var(--info); }
.pt-line.saved { opacity: .35; }
.pt-line.caught { fill: var(--ok); }
.pt-line.missed { fill: var(--orange); }
.pt-star {
  position: absolute; z-index: 4; width: 20px; height: 20px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--surface); color: var(--amber-2); font: 700 13px/1 var(--font); box-shadow: 0 1px 6px rgb(var(--shade) / .3); transition: transform .12s;
}
.pt-star:hover { filter: brightness(1.08); box-shadow: 0 0 0 3px var(--info-line), 0 1px 6px rgb(var(--shade) / .3); }
.pt-star.exam { background: var(--amber-soft); box-shadow: 0 0 0 2px var(--info), 0 1px 6px rgb(var(--shade) / .3); }
.pt-star.saved { background: var(--info-soft-2); color: var(--info); }
.pt-star.caught { background: var(--ok); color: #fff; }
.pt-star.missed { background: var(--orange); color: #fff; }
.points-bar {
  position: sticky; top: 10px; z-index: 6; margin: 12px auto 0; width: fit-content; max-width: calc(100% - 24px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 6px 6px 14px;
  background: rgb(var(--glass) / .96); border: 1px solid var(--info-line); border-radius: 16px; box-shadow: var(--shadow-lg); font-size: 13.5px; color: var(--ink-2);
}
.pt-bar-star { color: var(--amber-2); font-size: 16px; }
.pt-bar-text { font-weight: 600; margin-inline-end: 4px; }
.pt-bar-close { width: 30px; height: 30px; }
.pt-pop { width: min(340px, calc(100% - 12px)); padding: 12px; display: grid; gap: 8px; }
.pt-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--amber-ink); text-transform: uppercase; letter-spacing: .03em; }
:lang(ar) .pt-kind { text-transform: none; letter-spacing: 0; }
.pt-exam { background: var(--info-soft-2); color: var(--info-ink); border-radius: 999px; padding: 2px 8px; font-size: 11.5px; text-transform: none; letter-spacing: 0; }
.pt-why { font-size: 14px; color: var(--ink-2); }
.pt-q { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.pt-q span { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 700; color: var(--muted); }
.pt-q p { font-size: 14.5px; font-weight: 600; }
.pt-show { justify-self: start; border: 0; background: transparent; padding: 2px 0; color: var(--brand); font: 600 13px var(--font); cursor: pointer; }
.pt-a { font-size: 14px; color: var(--ok-ink); background: var(--ok-soft); border-radius: 8px; padding: 6px 10px; }
.pt-acts { flex-wrap: wrap; }
.pt-acts .btn svg { width: 15px; height: 15px; }
.study-modal .modal-card.pt-summary { width: min(760px, 100%); }
.pt-sum-head { font-weight: 600; color: var(--ink-2); }
.pt-sum-list { display: grid; gap: 8px; }
.pt-sum-item { display: grid; gap: 4px; padding: 10px 12px 6px; border: 1px solid var(--line); border-inline-start: 4px solid var(--info-2); border-radius: 12px; }
.pt-sum-item.exam { border-inline-start-color: var(--info); }
.pt-sum-text { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.pt-sum-q { font-size: 13.5px; color: var(--muted); }

/* the tool bar at the bottom of the page */
.study-bar {
  position: sticky; bottom: 14px; z-index: 7; display: flex; align-items: center; gap: 2px;
  width: fit-content; max-width: calc(100% - 20px); margin: -36px auto 14px; padding: 5px;
  background: rgb(var(--glass) / .95); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
}
.sb-btn { position: relative; display: inline-flex; flex: none; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; border: 0; background: transparent; border-radius: 12px; padding: 6px 8px 5px; color: var(--ink-2); font: 600 11.5px/1.15 var(--font); white-space: nowrap; cursor: pointer; }
.sb-btn > svg:first-child { flex: none; height: 20px; } /* (every picture's space 20 tall, the smaller ones (Draw 16, Translate and Print 18) drawn their size in its middle: the names under them in one line, MISTAKES 194) */
.sb-btn:hover { background: var(--surface-2); color: var(--ink); }
.sb-btn.on { background: var(--brand-soft); color: var(--brand); }
#sb-bookmark.on { background: var(--bad-soft); color: var(--bad); }
.sb-badge { position: absolute; top: 1px; right: 9px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.sb-timer { display: inline-flex; align-items: center; gap: 5px; margin-inline-start: 4px; border: 0; border-radius: 999px; padding: 9px 12px; background: var(--ok-soft); color: var(--ok-ink); font: 700 13px/1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; }
.sb-timer.break { background: var(--info-soft); color: var(--info-ink); }
/* the tool bar folded away (its first button, book.js barFolded, on the side it folds to): only that button shows, as
   "Tools", beside a focus timer that's running */
.sb-fold { display: inline-grid; place-items: center; flex: none; align-self: stretch; min-width: 34px; padding: 0 5px; margin-inline-end: 2px; border: 0; border-inline-end: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.sb-fold:hover { color: var(--brand); }
.study-bar.folded > :not(.sb-fold, .sb-timer) { display: none; }
.study-bar.folded .sb-fold { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding-block: 6px; padding-inline: 8px 12px; border: 0; border-radius: 12px; color: var(--ink-2); font: 600 12.5px/1 var(--font); }
.study-bar.folded .sb-fold:hover { background: var(--surface-2); color: var(--brand); }
/* folded, it waits in the bottom corner on the menu's side (the side the page's language starts from), out of the
   page's way and away from the tutor */
html:not([dir="rtl"]) .study-bar.folded { margin-left: 12px; margin-right: auto; translate: var(--bl, 0px) 0; }
html[dir="rtl"] .study-bar.folded { margin-right: 12px; margin-left: auto; translate: calc(-1 * var(--br, 0px)) 0; }
.study-bar.folded { padding: 3px; }
/* the tool bar beside the page (a computer's choice, book.js placeBar): a column on its left or right, in view as the
   page scrolls, its parts one under another */
.page-wrap { gap: 14px; }
#study-bar.side {
  position: sticky; top: 14px; bottom: auto; flex-direction: column; align-items: stretch; align-self: flex-start;
  width: auto; max-width: none; max-height: calc(100dvh - var(--topbar) - 40px); margin: 0; translate: none;
  overflow-x: hidden; overflow-y: auto; mask-image: none;
}
#study-bar.side .sb-btn { min-width: 0; }
#study-bar.side .sb-fold { min-height: 30px; margin: 0 0 2px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
#study-bar.side .sb-place, #study-bar.side .sb-lang { align-self: center; margin: 6px 0 0; }
#study-bar.side .sb-timer { justify-content: center; margin: 4px 0 0; }
#study-bar.side .sb-pace { flex-direction: column; gap: 3px; margin: 6px 0 0; padding: 8px 4px 4px; border-inline-start: 0; border-top: 1px solid var(--line); white-space: normal; text-align: center; }
#study-bar.side .pace-long { text-align: center; }
#study-bar.side.folded .sb-fold { margin: 0; border: 0; }
/* where it goes: its button (the bar's shape, with the bar where it is now) beside the fold arrow, the line between the
   tools and them after it instead (under it, beside the page); and the small menu over it */
.sb-place { color: var(--ink-2); }
.sb-fold:has(+ .sb-place:not([hidden])) { border-inline-end: 0; margin-inline-end: 0; }
.sb-fold + .sb-place { position: relative; align-self: center; margin-inline: 0 10px; }
.sb-fold + .sb-place::after { content: ""; position: absolute; top: -9px; bottom: -9px; inset-inline-end: -7px; border-inline-end: 1px solid var(--line); pointer-events: none; }
#study-bar.side .sb-fold:has(+ .sb-place:not([hidden])) { border-bottom: 0; margin: 0; }
#study-bar.side .sb-fold + .sb-place { margin: 2px 0 10px; }
#study-bar.side .sb-fold + .sb-place::after { top: auto; bottom: -6px; inset-inline: -24px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
@media (max-width: 1000px) { .sb-place { display: none !important; } }
.sb-place-menu { position: fixed; z-index: 60; display: grid; gap: 2px; min-width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); }
.sb-place-menu p { margin: 4px 8px 6px; color: var(--muted); font: 700 12px/1.3 var(--font); }
.sb-place-menu button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font: 600 13.5px/1.2 var(--font); text-align: start; cursor: pointer; }
.sb-place-menu button:hover { background: var(--surface-2); color: var(--ink); }
.sb-place-menu button[aria-checked="true"] { color: var(--brand); }
.sb-place-menu button > svg:last-child:not(:first-child) { margin-inline-start: auto; }
/* "ع" / "EN": the bar's names in Arabic or English */
.sb-lang { display: inline-grid; place-items: center; flex: none; align-self: center; min-width: 28px; height: 28px; margin-inline-start: 4px; padding: 0 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--brand-ink); font: 700 11px/1 var(--font); letter-spacing: .02em; cursor: pointer; }
.sb-lang:lang(ar) { font-size: 15px; letter-spacing: 0; }
.sb-lang:hover { border-color: var(--brand); }

/* side sheets (notebook, search, study) and study windows */
.sheet-back { position: fixed; inset: 0; z-index: 55; background: rgb(15 23 42 / .3); opacity: 0; transition: opacity .2s; }
.sheet-back.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 56; top: 0; bottom: 0; inset-inline-start: 0; width: min(430px, 100%);
  display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-lg);
  transform: translateX(-102%); transition: transform .22s ease;
}
[dir="rtl"] .sheet { transform: translateX(102%); }
.sheet.open, [dir="rtl"] .sheet.open { transform: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; font-size: 18px; }
.sheet-actions { display: flex; gap: 6px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 14px 16px 28px; display: flex; flex-direction: column; gap: 10px; }
.nb-tabs { position: sticky; top: -14px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; margin: -14px -16px 0; padding: 10px 12px 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.nb-tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; border-radius: 999px; padding: 7px 12px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.nb-tabs button.on { background: var(--brand-soft); color: var(--brand-ink); }
.nb-count { font-size: 11.5px; background: rgb(var(--tone) / .07); border-radius: 999px; padding: 1px 7px; }
.nb-list { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.nb-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.nb-filter { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.nb-filter.on { border-color: var(--brand-mid); background: var(--brand-soft); color: var(--brand-ink); }
.nb-filter svg { flex: none; width: 15px; height: 15px; }
.nb-filter.f-yellow::before, .nb-filter.f-green::before, .nb-filter.f-pink::before, .nb-filter.f-blue::before { content: ""; width: 10px; height: 10px; border-radius: 50%; }
.nb-filter.f-blue::before { background: #60a5fa; }
.nb-teacher { font-size: 12.5px; font-weight: 700; color: var(--bad-ink); }
.nb-filter.f-yellow::before { background: #fde047; }
.nb-filter.f-green::before { background: #4ade80; }
.nb-filter.f-pink::before { background: #f472b6; }
.nb-page { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 0; border: 0; background: transparent; padding: 4px 2px; font: 700 12.5px/1.3 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; cursor: pointer; text-align: start; }
:lang(ar) .nb-page { text-transform: none; letter-spacing: 0; font-size: 13.5px; }
.nb-page:hover:not(.static) { color: var(--brand); }
.nb-page.static { cursor: default; }
/* each page's things in one box with the page at its top, divided by a line (notebook.js, notebookhub.js) */
.nb-pagebox { display: grid; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.nb-pagebox > .nb-page { margin: 0; padding: 10px 12px 2px; }
.nb-pagebox > .nb-item { border: 0; border-radius: 0; background: none; }
.nb-pagebox > .nb-item + .nb-item { border-top: 1px solid var(--line); }
[dir="rtl"] .i-go { transform: scaleX(-1); }
.nb-item { display: grid; gap: 6px; padding: 10px 12px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.nb-item blockquote { margin: 0; padding: 4px 10px; border-inline-start-width: 4px; border-inline-start-style: solid; border-radius: 4px; font-size: 14px; color: var(--ink); }
.nb-note { font-size: 14px; color: var(--amber-ink); background: var(--amber-soft); border-radius: 8px; padding: 6px 10px; white-space: pre-wrap; }
.nb-pinned .nb-note::before { content: "✎ "; }
.nb-actions { display: flex; flex-wrap: wrap; gap: 2px; justify-content: flex-end; }
.nb-act { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; border-radius: 8px; padding: 4px 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.nb-act svg { width: 15px; height: 15px; }
.nb-act:hover { background: var(--brand-soft); color: var(--brand-ink); }
.nb-empty { color: var(--muted); font-size: 14px; padding: 22px 6px; text-align: center; }
/* My notebook's Find box (notebook.js findBox, in a book and on the My notebook page) */
.nb-find { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--muted); cursor: text; }
.nb-find:focus-within { border-color: var(--brand); background: var(--surface); }
.nb-find svg { flex: none; width: 18px; height: 18px; }
.nb-find input { flex: 1; min-width: 0; border: 0; background: none; padding: 10px 0; font: inherit; font-size: 16px; color: var(--ink); outline: none; }
/* a page drawn on, in My notebook's Drawings (notebook.js drawingItem): a small picture of the page with the drawing on
   it (a tap opens the page) beside the words under its highlighter lines, each run in its own colour */
.nb-draw { grid-template-columns: 78px minmax(0, 1fr); column-gap: 12px; align-items: start; }
.nb-draw > .nb-actions { grid-column: 1 / -1; }
.nb-draw-pic { position: relative; display: block; width: 78px; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; cursor: pointer; box-shadow: 0 2px 6px rgb(var(--shade) / .14); transition: transform .15s ease, border-color .15s ease; }
.nb-draw-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nb-draw-pic .nb-draw-ink { z-index: 1; }
@media (hover: hover) { .nb-draw-pic:hover { border-color: var(--brand); transform: translateY(-2px); } }
.nb-draw-pic:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.nb-draw-what { display: grid; gap: 6px; align-content: start; min-width: 0; }
.nb-item blockquote.nb-ink-run { border-color: var(--run); background: color-mix(in srgb, var(--run) 38%, var(--surface)); overflow-wrap: anywhere; }
/* each highlight with its 🗑 at the end, and the page's drawing's (8 November 2026, the owner's wish) */
.nb-ink-row { display: flex; align-items: center; gap: 4px; }
.nb-ink-row > .nb-ink-run { flex: 1; min-width: 0; }
.nb-ink-del { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.nb-ink-del svg { width: 16px; height: 16px; }
.nb-ink-del:hover { background: var(--bad-faint); color: var(--bad); }
.nb-ink-del:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.nb-ink-del:disabled { opacity: .4; cursor: default; }
.nb-draw-note .nb-ink-del { margin-inline-start: auto; }
.nb-draw-note { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ink-2); font-size: 13.5px; }
.nb-draw-note svg { flex: none; width: 15px; height: 15px; color: var(--muted); }
.nb-draw-when { color: var(--muted); font-size: 12.5px; }
/* what a parent left in the book, on its own (the child's "From Reem", a parent's "My notes for Yousef"): a line on what it is */
.nb-lead { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.nb-bm-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nb-bm-title svg { color: var(--bad); width: 18px; height: 18px; }
.nb-bm-title span { color: var(--muted); font-size: 13.5px; }
.nb-q { font-size: 13px; font-weight: 600; color: var(--muted); }
.nb-a { font-size: 14px; }
.nb-a p + p, .nb-a p + ul, .nb-a ul + p { margin-top: 6px; }
.nb-a ul { margin: 0; padding-inline-start: 18px; }
.nb-term { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 16px; }
.nb-meaning { font-size: 14px; color: var(--ink-2); }
/* the small EN | ع by a word in My words (ui.js miniLangs): the same switch as the others, a little smaller */
.wd-langs.mini { flex: none; padding: 2px; border-radius: 8px; }
.wd-langs.mini button { padding: 3px 9px; font-size: 12px; }
.sr-input { width: 100%; font: inherit; font-size: 16px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); }
.sr-input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.sr-hint, .sr-count { font-size: 12.5px; color: var(--muted); }
.sr-count { font-weight: 600; }
.sr-results { display: flex; flex-direction: column; gap: 5px; }
.sr-hit { border: 0; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; line-height: 1.45; color: var(--ink-2); text-align: left; cursor: pointer; }
.sr-hit:hover { background: var(--brand-soft); }
.sr-hit mark { background: #fde047; color: #0f172a; border-radius: 3px; padding: 0 2px; } /* (dark letters on this yellow in every look: the look's own ink is nearly white in Dark, 1.07 to 1 on it: MISTAKES.md number 325) */
.pr-sec { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--tint-line, var(--line)); border-radius: 14px; background: var(--tint, var(--surface)); }
/* the Practice panel's tabs (practice.js openPanel): one kind of practice at a time, each tab with its own colour */
.pr-tabs { position: sticky; top: -14px; z-index: 2; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; margin: -4px 0 2px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.pr-tab { position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; min-width: 0; padding: 8px 2px 7px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 11.5px; font-weight: 600; line-height: 1.2; text-align: center; color: var(--muted); cursor: pointer; }
.pr-tab svg { width: 20px; height: 20px; color: var(--tint-ink); }
.pr-tab:hover { color: var(--ink-2); background: var(--surface); }
.pr-tab[aria-selected="true"] { background: var(--tint); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--tint-line); }
.pr-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pr-tab-badge.nb-tab-count { background: rgb(var(--tone) / .12); color: var(--ink-2); } /* (how many: just a number, not a call to act) */
.pr-tab-badge { position: absolute; top: 3px; inset-inline-end: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font: 700 11px/18px var(--font); font-style: normal; } /* (cards due today) */
.pr-sec h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.pr-sec h3 svg { flex: none; color: var(--tint-ink, var(--brand)); width: 20px; height: 20px; }
/* each kind of practice in a light colour of its own (.tint-N): quizzes indigo, flashcards amber, explaining back
   green, the focus timer rose; the buttons and rows on it go white */
.pr-sec .btn-soft { background: var(--surface); border-color: var(--tint-line, var(--line)); }
.pr-sec .btn-soft:hover:not(:disabled) { border-color: var(--tint-ink, var(--brand)); }
.pr-sec p { color: var(--ink-2); font-size: 14px; }
.pr-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pr-btns .btn:disabled, .ce-btns .btn:disabled { opacity: .45; cursor: default; }
.pr-big { font-size: 16px; font-weight: 700; color: var(--ink) !important; }
.pr-muted { font-size: 13px !important; color: var(--muted) !important; }
.pr-cards summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--brand-ink); }
.pr-card-list { display: grid; gap: 2px; margin-top: 6px; max-height: 260px; overflow-y: auto; }
.pr-card-row { display: flex; align-items: center; gap: 2px; padding: 2px 2px 2px 8px; border-radius: 8px; font-size: 13.5px; }
.pr-card-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-card-row:hover { background: var(--surface); }
.pr-card-row .icon-btn { width: 30px; height: 30px; }
.study-modal { opacity: 0; transition: opacity .18s; }
.study-modal.open { opacity: 1; }
.study-modal .modal-card { width: min(640px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
.study-modal .modal-head { border-bottom: 1px solid var(--line); }
.modal-body { display: grid; align-content: start; gap: 12px; padding: 16px 18px 20px; overflow-y: auto; }
/* A window floating over the page (a quiz, a practice exam: ui.js floatWindow): the book behind it can be read and
   used; moved by its top bar, resized by its edges and corners, folded to its top bar, or as big as the screen */
.modal.win { background: none; pointer-events: none; }
.modal.win .modal-card { pointer-events: auto; position: relative; border: 1px solid var(--line); box-shadow: 0 24px 70px rgb(var(--shade) / .3), 0 2px 8px rgb(var(--shade) / .12); }
.modal.win .modal-head { gap: 2px; }
.modal.win .modal-head strong { flex: 1; min-width: 0; padding-inline-end: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal.win.min .modal-body, .modal.win.min .win-grip, .modal.win.max .win-grip { display: none; }
.modal.win.min .modal-head { border-bottom: 0; cursor: pointer; }
.modal.win.min .modal-card { border-color: var(--line-2); box-shadow: 0 6px 18px rgb(var(--shade) / .14); } /* (folded down: a thin, soft line round it, the owner's wish; a smaller shadow) */
.win-grip { position: absolute; z-index: 5; touch-action: none; }
.win-grip.n, .win-grip.s { left: 14px; right: 14px; height: 7px; cursor: ns-resize; }
.win-grip.n { top: 0; }
.win-grip.s { bottom: 0; }
.win-grip.e, .win-grip.w { top: 14px; bottom: 14px; width: 7px; cursor: ew-resize; }
.win-grip.e { right: 0; }
.win-grip.w { left: 0; }
.win-grip.ne, .win-grip.nw, .win-grip.se, .win-grip.sw { width: 22px; height: 22px; }
/* its bottom corner at the end of a line (right, or left in Arabic) shows two short slanted lines, as a window that can
   be pulled bigger or smaller does */
.win-grip.se::after, .win-grip.sw::after {
  content: ""; position: absolute; bottom: 7px; width: 11px; height: 11px; display: none; pointer-events: none; opacity: .75; transition: opacity .15s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 11'%3E%3Cpath d='M10 2 2 10M10 6.5 6.5 10' fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
.win-grip.se::after { right: 7px; }
.win-grip.sw::after { left: 7px; transform: scaleX(-1); }
:root:not([dir="rtl"]) .win-grip.se::after, [dir="rtl"] .win-grip.sw::after { display: block; }
.win-grip.se:hover::after, .win-grip.sw:hover::after { opacity: 1; }
.win-grip.ne { top: 0; right: 0; cursor: nesw-resize; }
.win-grip.sw { bottom: 0; left: 0; cursor: nesw-resize; }
.win-grip.nw { top: 0; left: 0; cursor: nwse-resize; }
.win-grip.se { bottom: 0; right: 0; cursor: nwse-resize; }
@media (min-width: 701px) {
  .modal.win { display: block; padding: 0; }
  .modal.win .modal-card { position: fixed; max-height: none; }
  .modal.win:not(.max) .modal-head { cursor: grab; user-select: none; touch-action: none; }
  .modal.win.max .modal-card { inset: 12px; width: auto; height: auto; }
}
@media (max-width: 700px) {
  .win-grip, .modal.win .win-max { display: none; }
  .modal.win.min { display: block; }
  .modal.win.min .modal-card { position: fixed; left: 12px; right: 12px; bottom: 12px; width: auto; }
}
.pr-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 30px 4px; color: var(--ink-2); }
.spinner { display: inline-block; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.quiz-score { font-weight: 700; color: var(--brand-ink); }
.quiz-list { display: grid; gap: 16px; }
/* the end of a quiz: the score and what next */
.quiz-result { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.quiz-result > div { display: grid; gap: 4px; min-width: 0; }
.qr-ring { flex: none; }
.qr-perfect .qr-ring, .qr-high .qr-ring { color: var(--ok); }
.qr-mid .qr-ring { color: var(--amber); }
.qr-low .qr-ring { color: var(--bad); }
.qr-title { margin: 0; font-size: 18px; font-weight: 800; color: var(--ink); }
.qr-text { margin: 0; color: var(--ink-2); }
.qr-best { margin: 0; color: var(--muted); font-size: 13.5px; }
/* Study → Your quizzes */
.pr-quizzes { display: grid; gap: 6px; margin-top: 12px; }
.pr-quizzes h4 { margin: 0 0 2px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
:lang(ar) .pr-quizzes h4 { text-transform: none; letter-spacing: 0; font-size: 14px; }
.pr-quiz-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--tint-line, var(--line)); border-radius: 12px; background: var(--surface); }
.pr-quiz-row > div { flex: 1; min-width: 0; display: grid; }
.pr-quiz-row strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-quiz-row small { color: var(--muted); font-size: 12.5px; }
.quiz-q.done .opt { cursor: default; }
.quiz-q .feedback .btn { margin-inline-start: auto; }
.quiz-end { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.fc-left { text-align: center; font-size: 13px; color: var(--muted); }
.fc-card { display: grid; align-content: center; gap: 14px; min-height: 190px; padding: 22px 20px; border-radius: 16px; border: 1px solid var(--brand-line); background: linear-gradient(180deg, var(--brand-soft), var(--surface)); text-align: center; }
.fc-front { font-size: 20px; font-weight: 700; white-space: pre-wrap; }
.fc-back { font-size: 16px; color: var(--ink-2); white-space: pre-wrap; padding-top: 12px; border-top: 1px dashed var(--brand-mid); }
.fc-back:not([hidden]) { display: grid; justify-items: center; gap: 10px; }
.fc-back-text { margin: 0; }
/* EN | ع in a window's head, beside its ✕ (the Meaning window and Flashcards: langSwitch in practice.js) */
.modal-head .wd-langs { margin-inline-start: auto; }
.modal-head .wd-langs[hidden] { display: none; }
.fc-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fc-rate .btn { min-width: 130px; }
.fc-no { border-color: var(--bad-line); color: var(--bad-ink); }
.fc-done { display: grid; justify-items: center; gap: 8px; padding: 20px 0; text-align: center; }
.fc-star { font-size: 46px; line-height: 1; color: var(--amber-2); }
.ce-field { display: grid; gap: 4px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.ce-field textarea { font: inherit; font-weight: 400; font-size: 15px; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); resize: vertical; }
.ce-field textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.ce-wait { display: flex; align-items: center; gap: 8px; }
.ce-btns { justify-content: flex-end; }
.msg-tools { display: flex; gap: 2px; align-self: flex-start; }
.msg.thinking .msg-tools, .msg.error .msg-tools, .msg.streaming .save-answer { display: none; }
.save-answer.on { color: var(--brand); }
#print-sheet { display: none; }
@media print {
  body.printing { background: #fff; overflow: visible; padding: 0 !important; margin: 0; } /* (the whole page: never the room kept for the menu) */
  body.printing > *:not(#print-sheet) { display: none !important; }
  body.printing #print-sheet { display: block; color: #000; font: 11.5pt/1.5 var(--font); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print-sheet h1 { font-size: 20pt; }
  #print-sheet .ps-sub { color: #555; margin-bottom: 8pt; }
  #print-sheet h2 { font-size: 14pt; margin-top: 16pt; padding-bottom: 3pt; border-bottom: 1px solid #999; }
  #print-sheet h3 { font-size: 11pt; margin: 10pt 0 4pt; color: #444; }
  #print-sheet blockquote { margin: 4pt 0; padding: 2pt 8pt; border-left: 4pt solid #999; }
  #print-sheet blockquote.c-yellow { border-color: #eab308; background: #fef9c3; }
  #print-sheet blockquote.c-green { border-color: #22c55e; background: #dcfce7; }
  #print-sheet blockquote.c-pink { border-color: #ec4899; background: #fce7f3; }
  #print-sheet blockquote.c-blue { border-color: #3b82f6; background: #dbeafe; }
  #print-sheet blockquote.ps-ink { border-color: var(--run); background: color-mix(in srgb, var(--run) 35%, #fff); } /* (words under a highlighter line, in its colour) */
  #print-sheet h4 { font-size: 10.5pt; margin: 8pt 0 3pt; color: #555; }
  #print-sheet .ps-point { margin: 4pt 0 8pt; break-inside: avoid; }
  #print-sheet .ps-point .ps-q { color: #444; font-weight: 400; }
  #print-sheet .ps-note { margin: 2pt 0 6pt; color: #78350f; }
  #print-sheet table { width: 100%; border-collapse: collapse; }
  #print-sheet td { border: 1px solid #ccc; padding: 4pt 6pt; vertical-align: top; }
  #print-sheet .ps-saved { margin: 6pt 0; break-inside: avoid; }
  #print-sheet .ps-q { font-weight: 600; }
  #print-sheet .ps-q span { font-weight: 400; color: #666; }
  /* a practice exam's paper (practice.js: #printExam), on A4 */
}

/* ---- A practice exam's paper, on A4 (practice.js #printExam) ----------------------------------------------
   Laid out page by page by the page's script, measured first in #xp-measure (so these hold for it too, and outweigh the
   print sheet's own headings), each page a frame of its own with Kitabi's mark at the top of the first and the page's
   number at the foot of each. Safari prints everything about 7% bigger than Chrome (a 100 mm box comes out 106.8 mm),
   so a page's frame takes its height from its width, in an A4 page's shape (less its margins), and the blocks are
   measured at Safari's narrower width: it fits on the page in both. */
#xp-measure { position: absolute; top: 0; left: -10000px; width: 162mm; visibility: hidden; }
:is(#print-sheet, #xp-measure) .xp { font: 11.5pt/1.45 var(--font); color: #000; }
:is(#print-sheet, #xp-measure) .xp-block { display: flow-root; }
#print-sheet .xp-page { position: relative; box-sizing: border-box; aspect-ratio: 192 / 277; padding: 7mm 8mm 10mm; border: 1.6pt solid #000; border-radius: 3mm; break-after: page; }
#print-sheet .xp-page:last-child { break-after: auto; }
#print-sheet .xp-foot { position: absolute; inset-inline: 0; bottom: 3.5mm; text-align: center; font-size: 9pt; color: #444; }
:is(#print-sheet, #xp-measure) .xp-brand { display: flex; align-items: center; gap: 6pt; margin-bottom: 8pt; font-size: 14pt; font-weight: 800; color: #1e1b4b; }
:is(#print-sheet, #xp-measure) .xp-logo { flex: none; width: 20pt; height: 20pt; }
:is(#print-sheet, #xp-measure) .xp-head { border: 1.5pt solid #000; border-radius: 6pt; padding: 9pt 12pt 10pt; margin-bottom: 10pt; }
:is(#print-sheet, #xp-measure) .xp-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12pt; padding-bottom: 6pt; margin-bottom: 8pt; border-bottom: 1pt solid #000; }
:is(#print-sheet, #xp-measure) .xp-title h1 { margin: 0; font-size: 18pt; }
:is(#print-sheet, #xp-measure) .xp-title p { margin: 0; font-size: 13pt; font-weight: 700; }
:is(#print-sheet, #xp-measure) .xp-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 7pt 16pt; }
:is(#print-sheet, #xp-measure) .xp-wide { grid-column: 1 / -1; }
:is(#print-sheet, #xp-measure) .xp-format { padding-top: 6pt; border-top: 0.75pt solid #999; font-size: 10.5pt; line-height: 1.5; } /* (what's in it: each kind's questions) */
:is(#print-sheet, #xp-measure) .xp-fill { display: inline-block; min-width: 42mm; padding: 0 4pt; border-bottom: 1pt solid #000; }
:is(#print-sheet, #xp-measure) .xp-empty { height: 1.1em; vertical-align: bottom; }
:is(#print-sheet, #xp-measure) .xp-mark { display: inline-block; width: 14mm; height: 1.1em; vertical-align: bottom; border-bottom: 1pt solid #000; }
:is(#print-sheet, #xp-measure) .xp-part-h { font-size: 13pt; margin: 14pt 0 7pt; padding-bottom: 3pt; border-bottom: 1pt solid #666; }
:is(#print-sheet, #xp-measure) .xp-q { margin: 0 0 10pt; }
:is(#print-sheet, #xp-measure) .xp-text { margin: 0 0 4pt; font-weight: 600; }
:is(#print-sheet, #xp-measure) .xp-opts { list-style: none; display: grid; gap: 3pt; margin: 0; padding: 0; padding-inline-start: 16pt; }
:is(#print-sheet, #xp-measure) .xp-opts li { display: flex; align-items: baseline; gap: 6pt; }
:is(#print-sheet, #xp-measure) .xp-o { display: inline-block; flex: none; width: 9pt; height: 9pt; border: 1pt solid #000; border-radius: 50%; transform: translateY(1pt); }
:is(#print-sheet, #xp-measure) .xp-tf { display: flex; gap: 30pt; margin: 0; padding-inline-start: 16pt; }
:is(#print-sheet, #xp-measure) .xp-tf span { display: inline-flex; align-items: baseline; gap: 6pt; }
:is(#print-sheet, #xp-measure) .xp-lines { padding-inline-start: 16pt; }
:is(#print-sheet, #xp-measure) .xp-lines i { display: block; height: 22pt; border-bottom: 1pt solid #999; }
:is(#print-sheet, #xp-measure) .xp-keytag { margin-inline-start: auto; padding: 1pt 8pt; border: 1pt solid #000; border-radius: 99px; font-size: 10pt; font-weight: 700; color: #000; }
:is(#print-sheet, #xp-measure) .xp-tick { flex: none; display: inline-block; width: 11pt; font-weight: 900; text-align: center; }
:is(#print-sheet, #xp-measure) .xp-yes { font-weight: 700; }
:is(#print-sheet, #xp-measure) .xp-model { display: flex; gap: 6pt; padding-inline-start: 16pt; font-style: italic; }
:is(#print-sheet, #xp-measure) .xp-blank { display: inline-block; min-width: 34mm; margin: 0 2pt; padding: 0 4pt; border-bottom: 1pt solid #000; text-align: center; font-weight: 400; }
:is(#print-sheet, #xp-measure) .xp-blank b { font-weight: 700; }
:is(#print-sheet, #xp-measure) .xp-match { width: calc(100% - 16pt); margin-inline-start: 16pt; border-collapse: collapse; font-weight: 400; }
:is(#print-sheet, #xp-measure) .xp-match td { padding: 3pt 4pt; border: 0; vertical-align: baseline; }
:is(#print-sheet, #xp-measure) .xp-mn { width: 1%; white-space: nowrap; font-weight: 700; }
:is(#print-sheet, #xp-measure) .xp-mpick { width: 1%; white-space: nowrap; padding-inline: 8pt 14pt; }
:is(#print-sheet, #xp-measure) .xp-mpick i { display: inline-block; width: 9mm; }
:is(#print-sheet, #xp-measure) .xp-mr { width: 48%; }
:is(#print-sheet, #xp-measure) .q-fig { margin: 2pt 0 6pt; padding-inline-start: 16pt; }
:is(#print-sheet, #xp-measure) .q-fig-in { width: min(100%, 80mm); border: 0.75pt solid #999; border-radius: 2mm; }
:is(#print-sheet, #xp-measure) .xp-model ul { margin: 3pt 0 0; padding-inline-start: 14pt; font-style: normal; }

/* ---- Responsive ------------------------------------------------------- */
@media (max-width: 1180px) {
  .below { grid-template-columns: 1fr; }
  .side-col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .tutor {
    position: fixed; z-index: 40; inset: auto 0 0 0; height: min(78dvh, 640px);
    border: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgb(var(--shade) / .2);
    transform: translateY(105%); transition: transform .25s ease;
  }
  .tutor.open { transform: none; }
  .tutor-close { display: inline-grid; }
  .tutor-fab {
    display: inline-flex; align-items: center; gap: 8px; position: fixed; z-index: 35; bottom: 18px; inset-inline-end: 16px;
    border: 0; border-radius: 999px; padding: 13px 18px; background: var(--brand); color: #fff; font-weight: 700; box-shadow: var(--shadow-lg); cursor: pointer;
  }
  .main { padding-bottom: 90px; }
}
@media (max-width: 760px) {
  .book-reader .titles, .book-reader #zoom-fit { display: none; }
  .book-reader .topbar { gap: 6px; padding: 0 10px; }
  .book-reader .back, body.book-reader:not(.following) .topbar .sn-open { margin-inline-end: auto; }
  .book-reader .topbar .icon-btn { width: 32px; height: 32px; }
  .pg-short { display: flex; align-items: center; gap: 2px; max-width: 104px; padding: 6px 2px 6px 4px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--ink); white-space: nowrap; }
  .pg-short b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: inherit; }
  .pg-short svg { flex: none; color: var(--ink-2); }
  .book-reader .pg-short { min-width: 0; } /* (cut with … when its box gives way: the rule by .pg-box) */
  /* (16px: a phone's Safari zooms into a smaller one when it's tapped) */
  .pager .pg-box select { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; padding: 0; font-size: 16px; opacity: 0; }
  .pg-box:has(select:focus-visible) .pg-short { outline: 2.5px solid var(--brand); outline-offset: 0; }
  .reader-card { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; }
  .reader-actions .btn-lg { padding: 10px 18px; font-size: 15px; }
  /* a book's title gets the width; "Your book" goes under it */
  .book-head { flex-wrap: wrap; }
  .book-head > div:first-child { flex: 1 1 200px; min-width: 0; }
  .book-head > .pill { order: 3; margin-inline-start: 0; }
  .page-wrap { padding: 10px 6px 90px; }
  .fig-chip { padding: 6px 10px; font-size: 12px; }
  .side-col { grid-template-columns: 1fr; }
  .stage-wrap { height: 58vh; min-height: 340px; border-radius: 16px; }
  .hud { width: 180px; padding: 8px; gap: 5px 6px; grid-template-columns: max-content 1fr; font-size: 11px; }
  .bar-val { display: none; }
  .stage-hint { display: none; }
  .add-book { gap: 14px; padding: 14px; align-items: flex-start; }
  .add-book .art { width: 72px; }
  .add-book .art svg { height: 40px; }
  .back span { display: none; }
  .main { padding: 10px 10px 90px; }
  .tab-panel { padding: 14px; }
  /* phones: the tools on the left, each with its name small under its picture (the owner's "yes, for everyone", 10 November
     2026: icons alone said nothing to someone new, with no mouse to rest on them: MISTAKES 194), the tutor button on the
     right. The pictures one size, so the names stand in one line */
  #study-bar .sb-btn { min-width: 46px; padding: 6px 4px 4px; gap: 2px; }
  #study-bar .sb-label { font-size: 10.5px; }
  .sb-badge { right: 0; }
  .study-bar { bottom: 18px; }
  html:not([dir="rtl"]) .study-bar { margin-left: 10px; margin-right: auto; } /* (on the menu's side, whatever language its names are in) */
  html[dir="rtl"] .study-bar { margin-right: 10px; margin-left: auto; }
  .sheet { top: auto; inset-inline: 0; width: 100%; height: min(86dvh, 720px); border-radius: 20px 20px 0 0; transform: translateY(102%); }
  [dir="rtl"] .sheet { transform: translateY(102%); }
  .mk-act { min-width: 46px; }
}
@media (max-width: 520px) {
  .tutor-fab span { display: none; }
  .tutor-fab { padding: 14px; }
}

/* ---- Today on the home page: where you stopped, the daily goal and streak, cards, plans, a point ---- */
.today { padding: 34px 0 6px; }
.today-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.today-head h2 { margin: 2px 0 0; font-size: clamp(24px, 4vw, 32px); }
.today .eyebrow { margin: 0; }
.streak { display: flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.streak strong { font-size: 22px; color: var(--ink); }
.streak.on { background: var(--orange-soft); border-color: var(--orange-line); color: var(--orange-ink); }
.streak.on strong { color: var(--orange-ink); }
/* the day's cards fill their rows (a short last row stretches across, so no gap is left beside it); the phone's
   reminder is a strip of its own under them, its words on one side and the reminder on the other */
.today-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.today-grid > .t-card { flex: 1 1 260px; }
.today-grid > .t-continue { flex: 2 1 540px; }
/* (the goal, with its words and choices, gets the room; the cards to review, a number and a few words, less) */
.today-grid > .t-goal { flex: 1.35 1 300px; }
.today-grid > .t-cards { flex: .65 1 190px; }
.today-grid > .t-phone { flex: 1 1 100%; container-type: inline-size; }
.t-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); color: inherit; min-width: 0; }
a.t-card:hover { border-color: var(--brand-line); }
.t-continue { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; align-items: center; }
.t-cover img { display: block; width: 100%; border-radius: 5px; box-shadow: 0 6px 18px rgb(var(--shade) / .22); }
.t-info { display: grid; gap: 6px; min-width: 0; }
.t-info strong { font-size: 18px; line-height: 1.3; }
.t-part { margin: 0; color: var(--muted); font-size: 14px; }
/* the time left, then the chapter's whole name on the line under it (two lines at most) */
.t-part > span { display: block; overflow: hidden; }
.t-part .t-left { white-space: nowrap; text-overflow: ellipsis; }
.t-part .t-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.t-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.t-goal { display: flex; align-items: center; gap: 14px; }
.t-goal p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.goal-ring { flex: none; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; transition: transform .15s; }
/* (it lifts a little under the mouse, like a book's cover, so it's seen to be something to press: the owner's wish,
   8 November 2026; not on a touch screen, where it would stay lifted after a tap) */
@media (hover: hover) { .goal-ring:hover { transform: translateY(-3px); } }
.goal-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-btn { font: inherit; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-2); }
.chip-btn.on, .chip-btn:hover { border-color: var(--brand); color: var(--brand); }
/* (a goal of their own, typed: shaped like the choices) */
.goal-own { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px 0 2px; border: 1.5px dashed var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.goal-own input { width: 58px; padding: 4px 6px; border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink); text-align: center; -moz-appearance: textfield; }
.goal-own input::-webkit-inner-spin-button, .goal-own input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.goal-own input:focus { outline: none; }
.goal-own:focus-within, .goal-own.on { border-style: solid; border-color: var(--brand); color: var(--brand); }
.t-cards { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--ink-2); }
.t-big { font-size: 34px; font-weight: 800; color: var(--brand); }
.t-plans h3 { margin: 0 0 8px; font-size: 16px; }
.t-plans ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.t-plans li p { margin: 0; }
.t-from { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.t-point p { margin: 6px 0; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }

/* ---- Books people add ---- */
.book.mine { --book: #0e7490; }
.book-tools { display: flex; gap: 4px; flex: none; }
.pending-book { --book: #94a3b8; }
.prep-step { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.prep-bar { display: block; margin-top: 12px; }
.prep-bar i { background: var(--brand); transition: width .6s; }
/* while a book is got ready: what Kitabi is doing for them, and that they can close Kitabi (6 November 2026) */
.prep-kind { margin: 12px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.prep-kind small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.prep-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; } /* Cancel, while a book is sent or got ready */
/* getting a book ready: its price first (Add it or Cancel) */
.price-modal .sp-what { margin: 0 0 12px; line-height: 1.55; }
.price-modal .sp-cost { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 6px; }
.price-modal .sp-cost strong { font-size: 20px; }
.price-modal .sp-cost span { color: var(--muted); }
.price-modal .ab-actions { gap: 8px; }
/* the price and its buttons on one line (below it on a narrow screen); several books listed, each with its price */
.price-modal .sp-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.price-modal .sp-row .sp-cost { margin: 0; }
.price-modal .sp-row .ab-actions { margin: 0; margin-inline-start: auto; }
.price-modal .ab-error { margin: 10px 0 0; }
.price-modal .sp-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.price-modal .sp-list label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.price-modal .sp-list b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.price-modal .sp-list small { color: var(--muted); white-space: nowrap; font-size: 13px; }
.ad-payers { display: grid; gap: 10px; margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.ad-payers legend { font-weight: 700; padding: 0 6px; }
.ad-payers label { display: grid; gap: 4px; font-size: 14px; }
.ad-payers select { width: 100%; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; color: var(--ink); }
.ad-payers p { margin: 0; }
button.add-book { width: 100%; font: inherit; color: inherit; text-align: start; cursor: pointer; margin-top: 4px; }
button.add-book:hover { border-color: var(--brand); background: var(--brand-soft); }
.add-book strong { font-size: 18px; }
.add-book p { margin: 4px 0 0; }
.add-note { font-size: 13px; }
/* ---- The Library side by side: tiles, each book's cover over its name, where the reader is and its buttons (its
   chapters are in the book's Contents); a book of lessons, and a removed book's notice, across the whole row ---- */
/* (the books they finished, folded at the bottom, are laid out like the rest: .finished-list) */
:is(#books.grid, #books.grid .finished-list) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 18px; }
:is(#books.grid, #books.grid .finished-list) > * { margin: 0; }
:is(#books.grid, #books.grid .finished-list) > :is(.wide, .finished-books) { grid-column: 1 / -1; }
:is(#books.grid, #books.grid .finished-list) > .book:not(.wide) { padding: 16px; }
#books.grid .with-cover {
  display: grid; row-gap: 8px;
  grid-template: "pill tools" auto "cover cover" auto "name name" auto "blurb blurb" auto "where where" 1fr "go go" auto "done done" auto / minmax(0, 1fr) auto;
}
#books.grid .with-cover .finish-line { grid-area: done; margin: 0; }
#books.grid .with-cover :is(.book-head, .reader-card, .reader-info) { display: contents; }
#books.grid .with-cover .book-head > div:first-child { grid-area: name; }
#books.grid .with-cover .book-head > .pill { grid-area: pill; justify-self: start; align-self: center; margin: 0; }
#books.grid .with-cover .book-tools { grid-area: tools; }
#books.grid .with-cover .book-blurb { grid-area: blurb; margin: 0; font-size: 13.5px; -webkit-line-clamp: 2; }
#books.grid .with-cover.has-help { grid-template: "pill tools" auto "cover cover" auto "name name" auto "blurb blurb" auto "help help" auto "where where" 1fr "go go" auto "done done" auto / minmax(0, 1fr) auto; }
#books.grid .with-cover .book-help { grid-area: help; margin: 0; font-size: 12.5px; }
#books.grid .with-cover .reader-cover { grid-area: cover; justify-self: center; width: 124px; margin: 4px 0 8px; }
#books.grid .with-cover .progress-total { grid-area: where; margin: 0; font-size: 13px; }
#books.grid .pg-part { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); }
#books.grid .pg-sep { display: none; }
#books.grid .with-cover .reader-actions { grid-area: go; gap: 8px; }
#books.grid .with-cover .reader-actions .btn { flex: 1 1 auto; padding: 9px 14px; font-size: 14px; }
#books.grid .with-cover .all-parts { display: none; }
#books.grid .book-head h3 { font-size: 17px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* (a name being measured for its cut after a whole word: ui.js fitLines, number 60) */
.fit-measure { display: block !important; -webkit-line-clamp: none !important; overflow: visible !important; }
#books.grid .book-head p { font-size: 13.5px; }
#books.grid .add-book { flex-direction: column; justify-content: center; gap: 10px; text-align: center; }
#books.grid > .add-book:only-child { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; text-align: start; }
#books.grid .add-book .art { width: 120px; }
#books.grid .add-book .art svg { height: 66px; }
@media (max-width: 560px) {
  /* two side by side on a phone */
  :is(#books.grid, #books.grid .finished-list) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  :is(#books.grid, #books.grid .finished-list) > .book:not(.wide) { padding: 12px; border-radius: 16px; }
  #books.grid .with-cover .reader-cover { width: 88px; }
  #books.grid .with-cover .book-head > .pill { display: none; }
  #books.grid .book-tools .icon-btn { width: 30px; height: 30px; }
  #books.grid .book-head h3 { font-size: 15px; }
  #books.grid .with-cover .reader-actions .btn { flex-basis: 100%; padding: 8px 10px; font-size: 13.5px; }
  #books.grid .add-book { padding: 12px; }
  #books.grid .add-book .art { width: 80px; }
  #books.grid .add-book p { font-size: 12.5px; }
}

/* ---- Reader: welcome back, a chapter finished, Arabic hints over hard words ---- */
.reader-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: min(1000px, 100%); margin: 0 auto 10px; padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--cyan-soft); border: 1px solid var(--cyan-line); color: var(--cyan-ink); font-weight: 600; }
.reader-banner .banner-text { flex: 1; min-width: 200px; }
/* a parent in their child's book: whose it is, and the way back; the tools that would change the child's things put away */
.reader-banner.follow-banner { background: var(--violet-soft); border-color: var(--violet-line); color: var(--violet-ink); }
.reader-banner .banner-close { flex: none; width: 32px; height: 32px; color: inherit; }
/* a parent in their child's book: the child's picture and "Yousef's book" all the time, just before the page box (with
   the zoom kept clear of it: book.js placeZoom); only the picture where the bar is narrower, and on a phone (no names
   in the top bar) the child's picture in the way back instead */
.titles-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.titles-top .chapter { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.whose-book { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 4px; padding-inline-end: 12px; border-radius: 999px; background: var(--violet-soft); border: 1px solid var(--violet-line); color: var(--violet-ink); font-size: 13.5px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
:is(.whose-face, .back-face) { display: grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden; background: var(--amber-soft-2); color: var(--amber-ink); font-weight: 800; }
:is(.whose-face, .back-face) img { width: 100%; height: 100%; object-fit: cover; }
.whose-face { width: 28px; height: 28px; font-size: 13px; }
.back-face { display: none; width: 28px; height: 28px; font-size: 13px; }
@media (max-width: 1100px) {
  .whose-book { padding-inline-end: 4px; }
  .whose-book .whose-name { display: none; }
}
@media (max-width: 760px) {
  .whose-book { display: none; }
  body.following .back-face { display: grid; }
  body.following .back .back-text { display: none; }
}
/* (a tablet held upright, 768 wide: a parent's bar, which has the child's badge more than a reader's, was 21px wider
   than the screen. The way back is its arrow alone a little sooner: number 327) */
@media (max-width: 820px) { body.following .back .back-text { display: none; } }
body.following #sb-bookmark, body.following #sb-study, body.following #sb-notebook, body.following #sb-summary, body.following #sb-timer { display: none !important; } /* (Note stays: a note for the child) */
/* rule 49 (13 November 2026, number 298): a parent looks at a child's book; its study tools are for whoever paid for it.
   Kitabi itself refuses them for the parent: here they are only not offered */
body.following #sb-listen, body.following #sb-points, body.following #sb-translate, body.following #tutor, body.following #tutor-fab { display: none !important; }
body.following #tip { display: none !important; } /* (the tip speaks of asking the tutor; the banner says what a parent can do) */
body.following .app { grid-template-columns: minmax(0, 1fr) !important; } /* (the tutor's column goes back to the book) */
/* a parent's highlight for the child: its own purple, with the parent's initial at its start */
.hl-parent { fill: #e9d5ff; }
.hl-parent.hl-hidden { fill: #f5f0ff; }
.mk-from { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: var(--violet); color: #fff; font: 700 10.5px/18px var(--font); text-align: center; translate: -60% -60%; box-shadow: 0 1px 3px rgb(var(--shade) / .3); cursor: pointer; }
[dir="rtl"] .mk-from { translate: 60% -60%; }
.mk-from-menu { max-width: 300px; }
.mk-from-menu .mk-title { color: var(--violet-ink); }
.mk-from-note { margin: 0 0 8px; padding: 6px 10px; border-radius: 8px; background: var(--violet-soft); color: var(--violet-ink); font-size: 14px; white-space: pre-wrap; }
.mk-dot-parent i { background: #c084fc !important; }
.mk-q-parent { border-color: var(--violet-mid); background: var(--violet-soft); }
.mk-seen { pointer-events: none; }
.done-card { position: fixed; z-index: 55; bottom: calc(84px + var(--bar-more, 0px)); left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 14px 10px 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: pop .25s ease-out; }
.done-card[hidden] { display: none; }
.done-mark { font-size: 28px; }
.done-text p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.done-acts { grid-column: 2 / 4; display: flex; gap: 8px; flex-wrap: wrap; }
.done-close { grid-column: 3; grid-row: 1; align-self: start; }
.pt-bar-star.spin { display: inline-block; animation: spin 1.6s linear infinite; }

/* ---- Summaries with a plan, catch-up ---- */
.pt-summary .modal-body, .recap-modal .modal-body { max-height: min(76vh, 760px); overflow: auto; padding: 4px 18px 18px; }
.sum-wait { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 18px 0; margin: 0; }
.sum-error { color: var(--bad); font-weight: 600; }
.sum-offer { display: grid; justify-items: start; gap: 10px; padding: 14px 0; } /* (what a summary will take, before it's written or shown: rules 17, 29) */
.sum-offer p { margin: 0; font-weight: 600; color: var(--ink); }
.sum-top { display: flex; align-items: flex-start; gap: 10px; }
.sum-one { flex: 1; margin: 6px 0 4px; font-size: 17px; font-weight: 700; line-height: 1.5; }
.sum-ideas { margin: 8px 0 4px; padding-inline-start: 22px; display: grid; gap: 8px; line-height: 1.55; color: var(--ink-2); }
.sum-ideas strong { color: var(--ink); }
.sum-h { display: flex; align-items: center; gap: 6px; margin: 18px 0 8px; font-size: 15px; color: var(--brand-ink); }
.sum-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sum-plan li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.sum-plan li > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sum-plan li span { color: var(--muted); font-size: 13.5px; }
.sum-plan .btn { flex: none; }
.sum-think { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--amber-soft); border: 1px solid var(--amber-line); }
.sum-think span { font-size: 12.5px; font-weight: 700; color: var(--amber-ink); text-transform: uppercase; letter-spacing: .04em; }
:lang(ar) .sum-think span { text-transform: none; letter-spacing: 0; }
.sum-think p { margin: 4px 0 0; font-weight: 600; }
.sum-points { border-top: 1px solid var(--line); margin-top: 18px; }
.sum-more { margin: 16px 0 0; text-align: center; }
.recap-welcome { font-size: 17px; font-weight: 700; margin: 8px 0 0; }
.recap-list { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; line-height: 1.55; color: var(--ink-2); }
.recap-next { margin: 14px 0 0; color: var(--ink-2); }
.recap-modal .pr-btns { margin-top: 16px; }

@media (max-width: 720px) {
  .t-continue { grid-template-columns: 70px minmax(0, 1fr); }
  .today-head { align-items: flex-start; flex-direction: column; }
  .done-card { bottom: 12px; }
}
.t-info .eyebrow, .t-point .eyebrow, .t-continue .eyebrow { justify-self: start; font-size: 12px; padding: 3px 10px; }
/* the meaning of a word from the page */
.word-modal { width: min(440px, 100%); }
.word-modal .modal-body { padding: 4px 18px 18px; }
.wd-term { margin: 4px 0 2px; font-size: 22px; font-weight: 800; }
.wd-meaning { margin: 0; color: var(--ink-2); line-height: 1.55; }
.wd-ar { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--cyan-soft); border: 1px solid var(--cyan-line); color: var(--cyan-ink); }
/* a meaning in English or Arabic: the switch at its top (practice.js: #showWord) */
.wd-langs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.wd-langs button { border: 0; border-radius: 8px; padding: 5px 12px; background: none; color: var(--ink-2); font: 600 13px/1.2 var(--font); cursor: pointer; }
.wd-langs button[lang="ar"] { font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; }
.wd-langs button[aria-pressed="true"] { background: var(--surface); color: var(--brand-ink); box-shadow: var(--shadow); }
.wd-term[dir="rtl"], .wd-meaning[dir="rtl"] { font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; text-align: right; }
.wd-ar strong { font-size: 18px; }
.wd-ar p { margin: 2px 0 0; }
.wd-saved { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; color: var(--ok); font-size: 13.5px; font-weight: 600; }
.word-modal .pr-btns { margin-top: 12px; }

/* ---- Listening to the book: the sentence being read lights up ---- */
.listen-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: multiply; }
.la-now { fill: var(--info-line); animation: la-in .25s ease-out; }
@keyframes la-in { from { opacity: 0; } }
.listen-bar { position: sticky; bottom: calc(82px + var(--bar-more, 0px) + var(--sheets-room, 0px)); z-index: 8; display: flex; align-items: center; gap: 4px; width: fit-content; max-width: calc(100% - 20px); margin: 0 auto 46px; /* clear of the tool bar, which reaches up over the page */ padding: 5px 6px; background: rgb(var(--glass) / .97); backdrop-filter: blur(8px); border: 1px solid var(--info-line); border-radius: 999px; box-shadow: var(--shadow-lg); }
.listen-bar[hidden] { display: none; }
.la-play { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--brand); color: #fff; cursor: pointer; }
.la-play:hover { background: var(--brand-ink); }
.la-state { min-width: 0; max-width: 220px; padding: 0 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.la-state.loading { color: var(--muted); }
.la-speed { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px; border-inline: 1px solid var(--line); }
.la-speed .icon-btn { font-size: 18px; font-weight: 700; }
.la-rate { min-width: 40px; text-align: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.la-voice { white-space: nowrap; }
/* time left, at the start of the tool bar */
.sb-pace { display: inline-flex; align-items: center; gap: 6px; flex: none; align-self: stretch; border: 0; border-inline-start: 1px solid var(--line); background: transparent; color: var(--muted); font: 600 12.5px/1.2 var(--font); padding: 4px 10px; margin-inline-start: 4px; white-space: nowrap; cursor: pointer; }
.pace-long { display: grid; text-align: start; line-height: 1.2; }
.pace-long > :first-child { color: var(--ink-2); font-weight: 700; }
.pace-long > :last-child { font-size: 11.5px; font-weight: 500; }
.sb-pace:hover { color: var(--brand); }
.study-bar { overflow-x: auto; scrollbar-width: none; }
.study-bar::-webkit-scrollbar { display: none; }
/* more tools than fit (on a phone): the bar scrolls sideways and fades where more are hiding */
.study-bar.more-end, .sheet-tabs.more-end { mask-image: linear-gradient(to right, #000 82%, transparent); }
.study-bar.more-start, .sheet-tabs.more-start { mask-image: linear-gradient(to left, #000 82%, transparent); }
.study-bar.more-start.more-end, .sheet-tabs.more-start.more-end { mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent); }
.pace-short { display: none; }
/* the tool bar in less room (book.js fitBar): the time left in short and the buttons closer, then icons only; on a
   computer, closer still, then two rows of about the same length (its width set by fitBar), every tool in sight */
.study-bar.tight .pace-long { display: none; }
.study-bar.tight .pace-short { display: inline; }
.study-bar.tight .sb-btn { min-width: 0; padding: 6px 6px 5px; }
.study-bar.icons .sb-label { display: none; }
.study-bar.icons .sb-btn { padding: 8px; }
.study-bar.snug { gap: 1px; }
.study-bar.snug .sb-btn { padding: 8px 6px; }
.study-bar.snug .sb-pace { padding-inline: 6px; }
.study-bar.rows { flex-wrap: wrap; justify-content: center; row-gap: 2px; }
/* a book made from a spreadsheet: its sheets as tabs (book.js wireSheets), over the page above the tool bar as it
   scrolls (how far up: book.js placeSheets), resting under the page at its end (clear of the tool bar, which reaches up
   over the page); a row that scrolls sideways when there are more than fit, its fades as the tool bar's */
.sheet-tabs {
  position: sticky; bottom: 70px; z-index: 7; display: flex; align-items: center; gap: 2px;
  width: fit-content; max-width: calc(100% - 20px - var(--bl, 0px) - var(--br, 0px)); margin: -38px auto 42px; padding: 4px;
  translate: calc((var(--bl, 0px) - var(--br, 0px)) / 2) 0;
  background: rgb(var(--glass) / .95); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  overflow-x: auto; scrollbar-width: none;
}
.sheet-tabs::-webkit-scrollbar { display: none; }
.sheet-tabs-icon { display: inline-grid; place-items: center; flex: none; padding-inline: 5px 4px; color: var(--muted); }
.sheet-tab { flex: none; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; border-radius: 10px; padding: 7px 12px; background: transparent; color: var(--ink-2); font: 600 12.5px/1.2 var(--font); cursor: pointer; }
.sheet-tab:hover { background: var(--surface-2); color: var(--ink); }
.sheet-tab[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
/* (in the sheet view: each sheet's tab in the colour Excel gave it, and the switch between the sheet and its pages first
   in the row) */
.sheet-tab.tinted { box-shadow: inset 0 -3px 0 var(--tab); }
.sheet-tab.tinted[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--tab); }
.sheet-tabs.with-views { overflow: hidden; }
.sv-views { display: inline-flex; flex: none; gap: 2px; margin-inline-end: 4px; padding-inline-end: 5px; border-inline-end: 1px solid var(--line); }
.sv-tabs { display: flex; align-items: center; gap: 2px; flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.sv-tabs::-webkit-scrollbar { display: none; }
.sv-tabs.more-end { mask-image: linear-gradient(to right, #000 82%, transparent); }
.sv-tabs.more-start { mask-image: linear-gradient(to left, #000 82%, transparent); }
.sv-tabs.more-start.more-end { mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent); }
.sv-view { display: inline-flex; align-items: center; gap: 6px; flex: none; border: 0; border-radius: 10px; padding: 7px 10px; background: transparent; color: var(--ink-2); font: 600 12.5px/1.2 var(--font); cursor: pointer; white-space: nowrap; }
.sv-view:hover { background: var(--surface-2); color: var(--ink); }
.sv-view[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); }
.sv-view svg { flex: none; }
@media (max-width: 520px) { .sv-view .sv-view-name { display: none; } .sv-view { padding: 7px 8px; } }

/* the fonts most spreadsheets use, where the device hasn't them: Carlito measures as Calibri and Caladea as Cambria (the
   ones LibreOffice prints the pages with), so words take the room they take in Excel. As they come, unchanged (SIL Open
   Font License: /fonts/*-LICENSE.txt), loaded only when a sheet shows them. */
@font-face { font-family: "Carlito"; src: local("Carlito"), url("/fonts/Carlito-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Carlito"; src: local("Carlito Bold"), local("Carlito-Bold"), url("/fonts/Carlito-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Carlito"; src: local("Carlito Italic"), local("Carlito-Italic"), url("/fonts/Carlito-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Carlito"; src: local("Carlito Bold Italic"), local("Carlito-BoldItalic"), url("/fonts/Carlito-BoldItalic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Caladea"; src: local("Caladea"), url("/fonts/Caladea-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Caladea"; src: local("Caladea Bold"), local("Caladea-Bold"), url("/fonts/Caladea-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Caladea"; src: local("Caladea Italic"), local("Caladea-Italic"), url("/fonts/Caladea-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Caladea"; src: local("Caladea Bold Italic"), local("Caladea-BoldItalic"), url("/fonts/Caladea-BoldItalic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
/* ---- The sheet view (sheetview.js): a spreadsheet as Excel shows it, in place of the page ------------------------------
   The grid stays white in the dark look too, as a book's page does; its bar of formulas follows the site's look. Four
   parts: the corner, the top (column letters and frozen rows) and the left (row numbers and frozen columns) stay in
   place while the rest scrolls under them (sticky, in a grid); only what's in sight is drawn. */
body.sheet-mode #reader { overflow: hidden; scroll-behavior: auto; } /* (kept at its top at once, never sliding: number 250) */
body.sheet-mode .page-wrap, body.sheet-mode #tip, body.sheet-mode #banner, body.sheet-mode #points-bar, body.sheet-mode #ink-bar, body.sheet-mode #listen-bar, body.sheet-mode .pg-box, body.sheet-mode #prev, body.sheet-mode #next { display: none !important; }
#sheet-view { height: 100%; }
#sheet-view[hidden] { display: none; }
.sv { display: flex; flex-direction: column; min-height: 0; background: #fff; color: #000; }
.sv-bar { display: flex; align-items: center; flex: none; height: 36px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 13px/1.2 var(--font); }
.sv-ref { flex: none; display: flex; align-items: center; min-width: 76px; max-width: 130px; height: 100%; padding: 0 12px; border-inline-end: 1px solid var(--line); font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; white-space: nowrap; }
.sv-fx { flex: none; padding: 0 10px 0 12px; color: var(--muted); font: italic 600 14px/1 Georgia, "Times New Roman", serif; letter-spacing: -1px; }
.sv-val { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-inline-end: 8px; font-variant-numeric: tabular-nums; }
.sv-reset { flex: none; display: inline-flex; align-items: center; gap: 6px; margin-inline: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: 600 12.5px/1 var(--font); cursor: pointer; }
.sv-reset:hover { border-color: var(--brand); color: var(--brand); }
.sv-reset[hidden] { display: none; }
.sv-scroll { position: relative; flex: 1; min-height: 0; overflow: auto; outline: none; background: #fff; touch-action: pan-x pan-y; overscroll-behavior: contain; -webkit-user-select: none; user-select: none; }
.sv-grid { display: grid; width: max-content; }
.sv-grid[hidden] { display: none; }
.sv-pane { position: relative; overflow: hidden; background: #fff; }
.sv-corner { position: sticky; top: 0; inset-inline-start: 0; z-index: 4; }
.sv-top { position: sticky; top: 0; z-index: 3; }
.sv-left { position: sticky; inset-inline-start: 0; z-index: 3; }
.sv-body { z-index: 1; }
.sv-pane > * { position: absolute; box-sizing: border-box; margin: 0; }
.sv .g { background: #e2e2e2; }
.sv .m { background: #fff; }
.sv .f { }
.sv .b { pointer-events: none; }
.sv .t { display: flex; overflow: hidden; white-space: pre; line-height: 1.2; color: #000; pointer-events: none; direction: ltr; unicode-bidi: plaintext; } /* (left and right are the cell's own, even in a right-to-left sheet; each line reads its own way) */
.sv .t.w { white-space: pre-wrap; overflow-wrap: anywhere; }
.sv .t > span { min-width: 0; }
.sv .t .rot { display: inline-block; white-space: nowrap; transform-origin: center; }
.sv .al { justify-content: flex-start; text-align: left; }
.sv .ac { justify-content: center; text-align: center; }
.sv .ar { justify-content: flex-end; text-align: right; }
.sv .aj { justify-content: flex-start; text-align: justify; }
.sv .vt { align-items: flex-start; }
.sv .vm { align-items: center; }
.sv .vb { align-items: flex-end; }
.sv .bar { background: linear-gradient(to right, var(--bar), color-mix(in srgb, var(--bar) 18%, #fff)); opacity: .85; }
.sv .nm { background: linear-gradient(225deg, #d93025 50%, transparent 50%); pointer-events: none; }
.sv[dir="rtl"] .nm { background: linear-gradient(135deg, #d93025 50%, transparent 50%); }
.sv .d { pointer-events: none; -webkit-user-drag: none; }
.sv .sel { border: 2px solid var(--brand); pointer-events: none; z-index: 1; }
.sv .sel-all { background: color-mix(in srgb, var(--brand) 9%, transparent); pointer-events: none; }
.sv .h { display: grid; place-items: center; overflow: hidden; background: #f6f7f9; color: #5f6368; font: 500 var(--sv-head, 11.5px)/1 "Inter", system-ui, sans-serif; border-inline-end: 1px solid #d9dce1; border-bottom: 1px solid #d9dce1; cursor: default; }
.sv .h.on { background: color-mix(in srgb, var(--brand) 14%, #f6f7f9); color: var(--brand); font-weight: 700; }
.sv .hk { background: #eef0f3; }
/* a pinch in Safari, shown as a picture (sheetview.js showPicture; number 249): the letters' and numbers' strips and
   their words the size the new zoom will draw them, not the cells' size; what comes after a strip (the kept rows and
   columns) moved to its new edge; the part cut to its new size, or grown, white, when it's bigger */
.sv-pane.pic { overflow: visible; }
.sv-pane.pic::before { content: ""; position: absolute; top: 0; inset-inline-start: 0; width: var(--pic-w); height: var(--pic-h); background: #fff; z-index: -1; }
.sv-pane.pic > .hc { height: var(--pic-ch) !important; font-size: var(--pic-font) !important; translate: var(--pic-dx) 0; }
.sv-pane.pic > .hr { width: var(--pic-rw) !important; font-size: var(--pic-font) !important; translate: 0 var(--pic-dy); }
.sv-pane.pic > .hk { width: var(--pic-rw) !important; height: var(--pic-ch) !important; }
.sv-pane.pic > .rz { visibility: hidden; }
.sv-pane.pic > :not(.h):not(.rz) { translate: var(--pic-dx) var(--pic-dy); }
.sv-note { position: absolute; z-index: 6; max-width: min(280px, 70vw); padding: 8px 10px; background: #fff8d6; border: 1px solid #e9d27a; border-radius: 8px; box-shadow: 0 6px 18px rgb(0 0 0 / .14); color: #2b2b2b; font: 13px/1.45 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; }
.sv-note b { display: block; margin-bottom: 2px; }
.sv-state { position: absolute; inset: 48px 16px auto; text-align: center; color: #64748b; font: 500 14px/1.5 var(--font); }
/* (the study tools on the sheet, sheetmarks.js: the reader's own marks over the cells, as a highlighter pen, never the
   sheet's own colours; a note's corner in Kitabi's colour on the side Excel's red one isn't; ★ the teacher said; the
   round handle at the picked cells' corner, big enough for a finger; cells shown from My notebook lit a moment) */
.sv { position: relative; }
.sv .cm { mix-blend-mode: multiply; pointer-events: none; }
.sv .cm.c-yellow { background: #fef08a; box-shadow: inset 0 0 0 1.5px #facc15; }
.sv .cm.c-green { background: #bbf7d0; box-shadow: inset 0 0 0 1.5px #4ade80; }
.sv .cm.c-pink { background: #fbcfe8; box-shadow: inset 0 0 0 1.5px #f472b6; }
.sv .cm.c-blue { background: #bfdbfe; box-shadow: inset 0 0 0 1.5px #60a5fa; }
.sv .cn { background: linear-gradient(135deg, var(--brand) 50%, transparent 50%); pointer-events: none; z-index: 1; }
.sv[dir="rtl"] .cn { background: linear-gradient(225deg, var(--brand) 50%, transparent 50%); }
.sv .ct { display: grid; place-items: center; color: #dc2626; line-height: 1; pointer-events: none; z-index: 1; text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.sv .sel-h { border-radius: 50%; background: #fff; border: 2px solid var(--brand); pointer-events: auto; touch-action: none; cursor: crosshair; z-index: 2; }
.sv .sel-h::before { content: ""; position: absolute; inset: -12px; border-radius: 50%; } /* (a finger's room) */
.sv .flash { pointer-events: none; animation: sv-flash 1.6s ease-out forwards; }
/* (the cells a picked formula reads, each reference in its own colour, as in the bar above: tap one there to see them) */
.sv .fr { box-shadow: inset 0 0 0 2px var(--fr); background: color-mix(in srgb, var(--fr) 8%, transparent); pointer-events: none; }
.sv-val .frt { color: var(--fr); font-weight: 700; border-radius: 4px; padding: 0 1px; cursor: pointer; }
.sv-val .frt:hover, .sv-val .frt:focus-visible { background: color-mix(in srgb, var(--fr) 14%, transparent); outline: none; }
@keyframes sv-flash { 0%, 30% { background: color-mix(in srgb, var(--brand) 28%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 55%, transparent); } 100% { background: transparent; box-shadow: 0 0 0 0 transparent; } }
/* (the line between two columns' letters, or two rows' numbers: dragged, a column wider or a row taller, for the reader
   only; on a touch screen too, its room a little bigger) */
.sv .rz { z-index: 3; pointer-events: auto; touch-action: none; }
.sv .rz-c { cursor: col-resize; }
.sv .rz-r { cursor: row-resize; }
.sv .rz:hover::after, .sv .rz:active::after { content: ""; position: absolute; background: var(--brand); }
.sv .rz-c:hover::after, .sv .rz-c:active::after { inset: 0 4px; }
.sv .rz-r:hover::after, .sv .rz-r:active::after { inset: 4px 0; }
@media (pointer: coarse) { .sv .rz-c { margin-inline-start: -2px; width: 14px !important; } .sv .rz-r { margin-top: -2px; height: 14px !important; } }
.sm-notes { display: grid; gap: 4px; margin-bottom: 6px; padding: 6px 8px; border-radius: 8px; background: #fff8d6; border: 1px solid #e9d27a; color: #2b2b2b; font-size: 13px; line-height: 1.4; max-height: 9em; overflow: auto; }
.sm-notes p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sm-note-mine b { color: var(--brand); }
.sv-note p { margin: 0; }
.sv-note p + p { margin-top: 6px; padding-top: 6px; border-top: 1px solid #e9d27a; }
.sv-note-mine b { color: var(--brand); }
.sm-menu, .sm-editor { z-index: 9; }
.nb-cells { margin: 0 0 4px; font: 600 12px/1.2 var(--font); color: var(--muted); font-variant-numeric: tabular-nums; }
.sr-cell { display: flex; gap: 10px; align-items: baseline; text-align: start; }
.sr-cell .sr-ref { flex: none; min-width: 42px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.sr-cell .sr-words { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) {
  .sv-reset span { display: none; } /* (its picture only, on a phone) */
  .sv-reset { padding: 6px 9px; }
  .sv-bar { height: 34px; font-size: 12.5px; }
  .sv-ref { min-width: 58px; padding: 0 8px; }
  .sv-fx { padding: 0 6px 0 8px; }
}
/* beside the tutor's own window (book.js besideTutor) the tool bars stay under the page */
.study-bar, .listen-bar { translate: calc((var(--bl, 0px) - var(--br, 0px)) / 2) 0; }
.study-bar { max-width: calc(100% - 20px - var(--bl, 0px) - var(--br, 0px)); }
/* the tutor as a drawer: its button waits in the bottom corner, on the end side, so the tool bar goes to the other
   side and keeps clear of it */
@media (max-width: 1000px) {
  .study-bar:not(.folded) { max-width: calc(100% - 20px - var(--fab-room, 150px)); translate: none; }
  .sheet-tabs { max-width: calc(100% - 20px); translate: none; } /* (on the tool bar's side, over it and the tutor's button) */
  html:not([dir="rtl"]) .sheet-tabs { margin-left: 10px; margin-right: auto; }
  html[dir="rtl"] .sheet-tabs { margin-right: 10px; margin-left: auto; }
  html:not([dir="rtl"]) .study-bar:not(.folded) { margin-left: 10px; margin-right: auto; }
  html[dir="rtl"] .study-bar:not(.folded) { margin-right: 10px; margin-left: auto; }
}
@media (max-width: 520px) {
  .study-bar:not(.folded) { --fab-room: 72px; }
  .pace-long { display: none; }
  .pace-short { display: inline; }
  .listen-bar { bottom: calc(76px + var(--bar-more, 0px) + var(--sheets-room, 0px)); gap: 2px; }
  .la-state { max-width: 112px; font-size: 12px; padding: 0 3px; }
  .la-voice { display: none; }
  .sb-pace { font-size: 11.5px; padding: 8px 6px; }
}
/* Darsi on the phone: install and a daily reminder */
.t-phone h3 { margin: 0 0 8px; font-size: 16px; }
@container (min-width: 620px) {
  .ph-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 32px; align-items: start; }
  .ph-side { padding-inline-start: 24px; border-inline-start: 1px solid var(--line); }
  .ph-text .ph-install:not(:empty) { margin-bottom: 0; }
}
.ph-install:not(:empty) { margin-bottom: 10px; }
.ph-time { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.ph-time[hidden] { display: none; }
.ph-time input[type="time"] { font: inherit; font-weight: 700; padding: 5px 8px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.ph-time input[type="time"]:focus { outline: none; border-color: var(--brand); }
.ph-time input[type="time"]:disabled { opacity: .5; }
/* (the daily reminder and important notes, each ticked on or off: the owner's wish, 7 November 2026) */
:is(.ph-time, .ph-news) input[type="checkbox"] { width: 17px; height: 17px; margin: 0; flex: none; accent-color: var(--brand); cursor: pointer; }
.ph-news { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--ink-2); font-weight: 600; line-height: 1.45; cursor: pointer; }
.ph-news[hidden] { display: none; }
.ph-news input[type="checkbox"] { margin-top: 1px; }
.ph-acts:not(:empty) { margin-top: 8px; }
/* the reminder's buttons and the calendar's link on one line, when there's room */
.ph-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 8px; }
.ph-row .ph-acts { margin-top: 0; }
.ph-note { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.ph-note:empty { display: none; }
.ph-cal { padding: 0; border: 0; background: none; color: var(--brand); font: 600 13.5px/1.4 var(--font); cursor: pointer; text-align: start; }
.ph-cal:hover { text-decoration: underline; }

/* ---- Accounts: the welcome page. Two sides: what Kitabi is (light indigo), and signing up or in (white) ---- */
.welcome-page { background: var(--surface); }
.wl-split { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.wl-side {
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: 32px;
  padding: 40px clamp(28px, 5vw, 76px) 36px; color: var(--brand-deep);
  background: radial-gradient(70% 60% at 0% 0%, rgb(199 210 254 / .75), transparent 70%), radial-gradient(60% 50% at 100% 100%, rgb(221 214 254 / .7), transparent 70%), #eef0ff;
}
@media screen {
  :root[data-theme="navy"] .wl-side { background: radial-gradient(70% 60% at 0% 0%, rgb(191 226 220 / .8), transparent 70%), radial-gradient(60% 50% at 100% 100%, rgb(227 179 76 / .22), transparent 70%), #eef3f1; }
  :root[data-theme="dark"] .wl-side { background: radial-gradient(70% 60% at 0% 0%, rgb(99 102 241 / .28), transparent 70%), radial-gradient(60% 50% at 100% 100%, rgb(139 92 246 / .2), transparent 70%), #141a33; }
}
/* two faint rings for depth */
.wl-side::before, .wl-side::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; border: 1px solid rgb(var(--brand-rgb) / .12); pointer-events: none; }
.wl-side::before { width: 760px; height: 760px; inset-inline-end: -420px; top: 14%; }
.wl-side::after { width: 560px; height: 560px; inset-inline-start: -330px; bottom: -300px; }
.wl-logo { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; color: var(--brand-deep); font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.wl-pitch { margin: auto 0; max-width: 580px; }
.wl-kicker { margin: 0 0 18px; font-size: 12.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); }
:lang(ar) .wl-kicker { letter-spacing: 0; text-transform: none; font-size: 14px; }
.wl-title { margin: 0 0 22px; font-size: clamp(38px, 4.4vw, 60px); font-weight: 800; line-height: 1.05; letter-spacing: -.035em; color: var(--brand-deep); }
.wl-title > * { display: block; }
.wl-title em { margin-top: .04em; font-family: "Instrument Serif", Georgia, serif; font-size: 1.12em; font-style: italic; font-weight: 400; letter-spacing: -.01em; line-height: 1; color: var(--brand); }
:lang(ar) .wl-title { font-size: clamp(34px, 4vw, 52px); line-height: 1.4; letter-spacing: 0; }
:lang(ar) .wl-title em { font-family: "Amiri", serif; font-style: normal; font-weight: 700; font-size: 1.04em; line-height: 1.55; }
.wl-text { margin: 0 0 28px; max-width: 500px; font-size: 17px; line-height: 1.6; color: var(--deep-2); }
.wl-points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.wl-points li { display: flex; gap: 12px; align-items: flex-start; }
.wl-icon { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); color: var(--brand); box-shadow: 0 1px 2px rgb(30 27 75 / .06), 0 4px 12px rgb(var(--brand-rgb) / .1); }
.wl-points strong { font-size: 15px; color: var(--brand-deep); }
.wl-points p { margin: 3px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--deep-3); }
.wl-foot { margin: 0; font-size: 14px; color: var(--deep-3); }

.wl-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 76px 24px 32px; }
/* each side has its own height, so the longer Create account form never moves what's on the left; the left side
   stays in place while the form scrolls */
.wl-split { align-items: start; }
.wl-side { position: sticky; top: 0; min-height: 100vh; min-height: 100dvh; }
.wl-main { min-height: 100vh; min-height: 100dvh; }
.wl-lang { position: absolute; top: 20px; inset-inline-end: 20px; z-index: 1; }
.wl-box { width: min(440px, 100%); }
.wl-main .wl-kicker { margin-bottom: 10px; color: var(--brand); }
.wl-heading { margin: 0 0 8px; font-size: clamp(28px, 2.8vw, 36px); font-weight: 800; line-height: 1.15; letter-spacing: -.025em; color: var(--ink); }
:lang(ar) .wl-heading { line-height: 1.4; letter-spacing: 0; }
.wl-sub { margin: 0 0 24px; line-height: 1.55; color: var(--ink-2); }
.wl-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-3); margin-bottom: 20px; }
.wl-tabs button { font: inherit; font-weight: 700; padding: 10px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; }
.wl-tabs button[aria-selected="true"] { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.wl-form { display: grid; gap: 16px; }
.wl-form[hidden], .wl-form label[hidden] { display: none; }
.wl-form label, .wl-field { display: grid; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.wl-form input:not([type=checkbox]) { width: 100%; font: inherit; font-weight: 500; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.wl-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgb(var(--brand-rgb) / .12); }
.wl-form small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
/* Retype your password: whether the two are the same yet, as they type (6 November 2026) */
.wl-form small.wl-match:empty { display: none; }
.wl-form small.wl-match.ok { color: var(--ok); font-weight: 600; }
/* a date of birth: day, month and year side by side (ui.js: birthPicker), each with its arrow a little in from the edge */
.birth-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1.2fr); gap: 8px; }
.birth-pick select, select.pick-box {
  width: 100%; min-width: 0; font: inherit; font-weight: 500; padding: 12px 30px 12px 12px; border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink); cursor: pointer; -webkit-appearance: none; appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%2364748b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center;
}
[dir="rtl"] :is(.birth-pick select, select.pick-box) { padding: 12px 12px 12px 30px; background-position: left 11px center; }
:is(.birth-pick select, select.pick-box):focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgb(var(--brand-rgb) / .12); }
select.pick-box { width: min(100%, 240px); } /* (one box, like the date's: My profile's Gender) */
/* Show / Hide inside the password box */
.wl-pass { position: relative; display: block; direction: ltr; } /* a password is typed left to right, Show at its end */
.wl-form .wl-pass input { padding-inline-end: 76px; }
.wl-show { position: absolute; top: 50%; inset-inline-end: 6px; transform: translateY(-50%); padding: 6px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.wl-show:hover { color: var(--brand); background: var(--brand-soft); }
.wl-form .wl-keep { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border-radius: 12px; background: var(--ok-soft); color: var(--ok-ink); font-weight: 600; }
.wl-keep input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--ok); flex: none; }
.wl-form .wl-agree { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); cursor: pointer; }
.wl-agree input { margin: 1px 0 0; width: 17px; height: 17px; accent-color: var(--brand); flex: none; cursor: pointer; }
.wl-agree a { color: var(--brand-ink); font-weight: 600; }
.wl-go { width: 100%; margin-top: 4px; border-radius: 14px; }
/* signed in already (welcome.js signedIn): Continue, Sign out and a line for a shared computer, in place of the forms */
.wl-me { display: grid; gap: 10px; }
.wl-me .wl-out { width: 100%; border-radius: 14px; }
.wl-me .wl-small { margin-top: 4px; text-align: center; }
.wl-go::after { content: "→"; }
[dir="rtl"] .wl-go::after { content: "←"; }
.wl-error { margin: 0; color: var(--bad); font-weight: 600; font-size: 14px; }
.wl-small, .wl-closed { margin: 0; color: var(--muted); font-size: 13.5px; }
.wl-closed { padding: 14px; border-radius: 12px; background: var(--surface-3); font-size: 15px; }
.wl-note { margin: 0; max-width: 440px; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 900px) {
  /* on a phone: a short coloured band on top, then the form */
  .wl-split { grid-template-columns: 1fr; min-height: 0; }
  .wl-side { position: relative; min-height: 0; gap: 18px; padding: 20px 20px 28px; }
  .wl-main { min-height: 0; }
  .wl-side::before { width: 420px; height: 420px; inset-inline-end: -220px; top: -130px; }
  .wl-side::after { display: none; }
  .wl-pitch { margin: 0; }
  .wl-kicker { margin-bottom: 10px; }
  .wl-title { margin-bottom: 12px; font-size: clamp(30px, 8.6vw, 40px); }
  :lang(ar) .wl-title { font-size: clamp(28px, 7.6vw, 36px); }
  .wl-text { margin: 0; font-size: 15.5px; }
  .wl-points, .wl-foot { display: none; }
  .wl-main { justify-content: flex-start; padding: 26px 18px 34px; }
  .wl-lang { top: 16px; inset-inline-end: 16px; background: rgb(var(--glass) / .75); border-color: rgb(var(--brand-rgb) / .18); color: var(--brand-ink); }
  .wl-lang:hover { background: var(--surface); border-color: rgb(var(--brand-rgb) / .3); }
}

/* ---- the first steps after signing up ---- */
.start { max-width: 760px; margin: 0 auto; padding: 34px 16px 70px; }
.st-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: var(--shadow-lg); display: grid; gap: 14px; }
.st-card h1 { margin: 0; font-size: clamp(24px, 4vw, 32px); }
.st-back { justify-self: start; }
.st-text { margin: -6px 0 0; color: var(--muted); font-size: 16px; }
.st-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.st-role { display: grid; gap: 4px; justify-items: start; text-align: start; font: inherit; padding: 16px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; color: var(--ink); }
.st-role:hover, .st-role.on { border-color: var(--brand); background: var(--brand-soft); }
.st-role-icon { font-size: 26px; }
.st-role span:last-child { color: var(--muted); font-size: 14px; }
.st-small { margin: 0; color: var(--muted); font-size: 13.5px; }
.st-card label input:not([type=checkbox]) { font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); width: 100%; }
.st-card label input:not([type=checkbox]):focus { outline: none; border-color: var(--brand); }

.st-card label { display: grid; gap: 5px; font-weight: 600; font-size: 14px; color: var(--ink-2); }

.st-grades { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.st-grade { font: inherit; font-weight: 700; padding: 12px 8px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; color: var(--ink-2); }
.st-grade:hover, .st-grade.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.st-grade { line-height: 1.25; } /* (a school's own words can be longer: "Intermediate 3", "الأول الابتدائي") */
/* where a student studies (start.js paintWhere, places.js): country, school or university, the grades' words, grade */
.st-where { display: grid; gap: 18px; }
.st-where .wl-field { gap: 8px; }
/* the first page: the country (everyone's, filled in) and Gender, one under the other, above the four choices */
/* Country and Gender side by side (6 November 2026, the owner's wish); under each other where the card is narrow */
.st-about, .field-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); align-items: end; gap: 14px 16px; max-width: 660px; }
:is(.st-about, .field-pair) select.pick-box { width: 100%; height: 50px; } /* (the same height, so the two boxes are level; My profile's too) */
.st-gender-note { margin: -4px 0 0; max-width: 660px; }
#pf-gender-note { margin-top: -4px; }
.st-grade-label { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.st-system { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.st-system select.pick-box { width: auto; max-width: 100%; padding-block: 8px; font-size: 14px; }
/* the search box for a school or university: the names found under it, the letters typed in ink, the rest faded */
.pl-box { position: relative; max-width: 520px; }
.pl-input { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.pl-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgb(var(--brand-rgb) / .12); }
/* Safari's own contact-card button (it takes Country, or a School, for part of an address): hidden, so only Kitabi's
   arrow shows (6 November 2026, mistake 82). A rule of its own: other browsers skip it. */
.pl-input::-webkit-contacts-auto-fill-button { visibility: hidden; display: none !important; pointer-events: none; position: absolute; right: 0; }
.pl-list { position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 290px; overflow: auto; }
.pl-list[hidden] { display: none; }
.pl-list li { padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.pl-list li b { color: var(--ink); font-weight: 700; }
.pl-list li[aria-selected="true"], .pl-list li:hover { background: var(--brand-soft); }
.pl-hint { margin: 6px 0 0; }
/* The country box (the first steps; 6 November 2026): the School box's look, the size of the Gender box beside it, an
   arrow for all of them; 16px on a phone, so it doesn't zoom in */
.cb-box { max-width: none; }
.pl-input.cb-input { height: 50px; padding-block: 12px; padding-inline: 12px 40px; font-size: 14px; font-weight: 500; }
@media (pointer: coarse) { .pl-input.cb-input { font-size: 16px; } }
.cb-arrow { position: absolute; top: 0; bottom: 0; inset-inline-end: 2px; width: 38px; padding: 0; border: 0; border-radius: 10px; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%2364748b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center; }
.cb-list { max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
.cb-list.cb-all li { color: var(--ink); }
.cb-list .cb-none { cursor: default; color: var(--muted); }
/* Admin → Schools: a box for each school or university, a line for each grade and the books it reads */
.sc-list { display: grid; gap: 12px; }
.sc-group { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: var(--surface); box-shadow: var(--shadow); }
.sc-group header h3 { margin: 0; font-size: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sc-group header p { margin: 2px 0 10px; color: var(--muted); font-size: 13px; }
.sc-group ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.sc-group li { display: grid; gap: 2px; font-size: 13.5px; }
.sc-group li span { color: var(--ink-2); }
.sc-none { background: var(--surface-2); }

.st-note { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); }
.st-note.bad { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.st-note[hidden] { display: none; }
.st-code input { font-size: 22px !important; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; max-width: 260px; }
.st-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- the account button and its menu ---- */
.top-right { display: flex; align-items: center; gap: 8px; }
.account { position: relative; display: flex; align-items: center; gap: 6px; }
/* the bell before the picture (notes.js): a red number for what they haven't seen; its list under it, like the account menu */
.bell-btn { position: relative; flex: none; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink-2); cursor: pointer; }
.bell-btn:hover { background: var(--surface-2); color: var(--brand); }
.bell-n { position: absolute; top: 0; inset-inline-end: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font: 800 11px/18px var(--font); text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.bell-n[hidden] { display: none; }
.notes-panel { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 71; width: 350px; max-width: calc(100vw - 24px); max-height: min(72vh, 540px); overflow: auto; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop2 .15s ease-out; }
.np-title { margin: 6px 10px 8px; font-weight: 800; font-size: 15px; color: var(--ink); }
.np-list { display: grid; gap: 2px; }
.np-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: 12px; }
.np-item.new { background: var(--brand-soft); }
.np-icon { flex: none; display: grid; color: var(--muted); padding-top: 1px; }
.np-item.ok .np-icon { color: var(--ok); }
.np-item.low .np-icon { color: var(--orange-ink); }
.np-item.out .np-icon { color: var(--bad); }
.np-body { min-width: 0; }
.np-text { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.np-meta { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.np-meta a { color: var(--brand); font-weight: 700; }
.np-none { margin: 4px 10px 10px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.np-from { margin: 0 0 2px; font-size: 12px; font-weight: 700; color: var(--brand); } /* (a message from Kitabi: Admin → Messages) */
.np-item.news .np-icon { color: var(--brand); } /* (not .msg: the tutor's chat bubbles) */
.np-text { white-space: pre-line; }
/* Admin → Messages (admin.js paintMessages): the form, and what was sent (a table, like the other lists) */
.ad-msg-form { display: grid; gap: 12px; max-width: 680px; margin: 0 0 28px; }
.ad-msg-form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.ad-msg-form textarea { width: 100%; min-height: 78px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; line-height: 1.5; resize: vertical; }
.ad-msg-form textarea:focus, .ad-msg-form select:focus { outline: none; border-color: var(--brand); }
.ad-msg-hint { margin: -4px 0 0; color: var(--muted); font-size: 13px; }
.ad-msg-h { margin: 0 0 10px; }
.ad-c-msg { min-width: 260px; }
.ad-c-msg p { margin: 0; white-space: pre-line; }
.ad-c-msg p + p { margin-top: 6px; }
.ad-c-msg .ad-bad { display: block; margin-top: 4px; }
.ad-msg-gone td { color: var(--muted); }
.account-menu .am-notes { display: none; }
.account-menu .am-notes .am-value { min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11.5px; text-align: center; }
/* a book's top bar on a phone has no room for the bell: it's the account menu's first line, and a dot on the picture
   says there's something new */
@media (max-width: 480px) {
  .book-reader .bell-btn { display: none; }
  .book-reader .account-menu .am-notes { display: flex; }
  .book-reader .account-btn { position: relative; }
  .book-reader .account.has-notes .account-btn::after { content: ""; position: absolute; top: 0; inset-inline-end: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--surface); }
}
/* the same on every page of the narrowest phones (under 350 wide), where no bar has room for it: Admin's bar was 63px
   wider than a 320-wide screen (13 November 2026, with the bars' other rules by "No top bar is wider") */
@media (max-width: 350px) {
  .bell-btn { display: none; }
  .account-menu .am-notes { display: flex; }
  .account-btn { position: relative; }
  .account.has-notes .account-btn::after { content: ""; position: absolute; top: 0; inset-inline-end: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--surface); }
}
.account-btn { width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font: 800 14px/1 var(--font); cursor: pointer; display: grid; place-items: center; } /* (no padding: Safari's own for a button pushed the initials off the middle of their ring) */
.account-btn:hover { background: var(--brand-ink); }
.account-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 70; width: 284px; max-width: calc(100vw - 24px); display: grid; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop2 .15s ease-out; }
.am-who { display: flex; align-items: center; gap: 12px; padding: 10px 12px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.am-face { position: relative; flex: none; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font: 800 15px/1 var(--font); box-shadow: 0 0 0 3px var(--brand-soft); cursor: pointer; }
/* (the pencil on the menu's picture: a tap on the picture changes it) */
.am-face-edit { position: absolute; inset-inline-end: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink-2); box-shadow: 0 1px 3px rgb(var(--shade) / .3); font-style: normal; }
.am-face-edit svg { width: 12px; height: 12px; }
/* (the picture is a button in the menu: not like the menu's lines, .account-menu button) */
.account-menu .am-face { display: grid; place-items: center; padding: 0; border-radius: 50%; color: #fff; font: 800 15px/1 var(--font); }
.account-menu .am-face:not(.ringed), .account-menu .am-face:not(.ringed):hover { background: var(--brand); }
.account-menu .am-face.ringed, .account-menu .am-face.ringed:hover { background: none; }
.account-menu .am-face-edit svg { color: var(--ink-2); }
.account-menu .am-face:is(:hover, :focus-visible) .am-face-edit { background: var(--brand); }
.account-menu .am-face:is(:hover, :focus-visible) .am-face-edit svg { color: #fff; }
.pf-face { cursor: pointer; }
.am-name { display: grid; gap: 2px; min-width: 0; }
.am-name strong { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* (in the name's own direction, so a long one is cut at its end) */
.am-name span { color: var(--muted); font-size: 13px; }
.account-menu button { display: flex; align-items: center; gap: 12px; font: inherit; font-weight: 600; font-size: 14.5px; text-align: start; padding: 9px 12px; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--ink-2); }
.account-menu button svg { flex: none; color: var(--muted); }
.account-menu button:hover { background: var(--surface-2); color: var(--brand); }
.account-menu button:hover svg { color: var(--brand); }
/* its Colours: Standard, Navy and gold, Dark side by side, each with a small round sample of its colours (theirs in every
   look), the one in use marked */
.am-looks-row:not([hidden]) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 2px 12px 10px; }
:is(.account-menu, .settings) .am-look { display: grid; justify-items: center; gap: 5px; padding: 8px 4px 7px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 12px; line-height: 1.2; text-align: center; color: var(--ink-2); }
:is(.account-menu, .settings) .am-look:hover { background: var(--surface-2); color: var(--ink); }
:is(.account-menu, .settings) .am-look[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.am-look i { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .14); }
.am-look-standard i { background: linear-gradient(135deg, #4f46e5 50%, #f4f6fb 50%); }
.am-look-navy i { background: linear-gradient(135deg, #1f3b4d 50%, #e3b34c 50%); }
.am-look-dark i { background: linear-gradient(135deg, #0f172a 50%, #6366f1 50%); }
.am-look-blue i { background: linear-gradient(135deg, #2563eb 50%, #f8fafc 50%); }
.am-look-rose i { background: linear-gradient(135deg, #be185d 50%, #fce7f3 50%); }
.am-look-lavender i { background: linear-gradient(135deg, #a21caf 50%, #fae8ff 50%); }
.am-look-blush i { background: linear-gradient(135deg, #c04a76 50%, #ffe4ea 50%); }
.am-label { flex: 1; min-width: 0; }
.am-value { flex: none; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.am-card { display: grid; padding: 4px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.am-card button { padding-inline: 7px; } /* (its icons in line with the ones below: the box's edge and padding make up the rest) */
.am-card button:hover { background: var(--surface); }
.am-line { height: 1px; margin: 6px 4px; background: var(--line); }
[dir="rtl"] .am-out svg { transform: scaleX(-1); }
.family-modal { width: min(460px, 100%); }
.family-modal .modal-body { padding: 4px 18px 18px; }
.lp-code { margin: 14px 0 4px; font-size: 38px; font-weight: 800; letter-spacing: .14em; text-align: center; color: var(--brand); }
.lp-list { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; color: var(--ink-2); }
.lp-not { color: var(--ok); font-weight: 600; }
.lp-parent { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* ---- a page's heading with a few words beside it (a parent's children) ---- */
.sch-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sch-head h2 { margin: 0; font-size: 26px; }
.sch-head p { margin: 0; color: var(--muted); font-weight: 600; }

/* ---- home: a parent's children ---- */
.family { padding: 30px 0 0; }
.kids { display: grid; gap: 14px; }
/* two or more children: a tile for each at the top (family.js kidTabs), the chosen one marked; on a phone they scroll
   sideways */
.kid-pick { display: flex; gap: 10px; overflow-x: auto; margin: -6px -16px 0; padding: 10px 16px 22px; scrollbar-width: thin; } /* (room round the tiles for their shadow, ring and red number, which the scrolling row would cut) */
.kid-tab { position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 10px; min-width: 190px; padding: 10px 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; text-align: start; cursor: pointer; box-shadow: var(--shadow); }
.kid-tab:hover { border-color: var(--brand-line); }
.kid-tab[aria-selected="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-line); }
.kid-tab-face { position: relative; flex: none; }
.kid-tab .kid-avatar { width: 40px; height: 40px; font-size: 16px; }
.kid-tab-live { position: absolute; inset-inline-end: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); background: var(--brand); }
.kid-tab-live.on { background: var(--ok); }
.kid-tab-text { display: grid; gap: 3px; min-width: 0; }
.kid-tab-text strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kid-tab-line { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.kid-tab-ring svg { display: block; width: 18px; height: 18px; }
.kid-tab-ring text { display: none; } /* (the minutes are beside it) */
.kid-tab-streak { margin-inline-start: 2px; color: var(--ink-2); }
.kid-tab-due { position: absolute; top: -7px; inset-inline-end: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font: 700 11.5px/20px var(--font); text-align: center; font-style: normal; box-shadow: 0 1px 3px rgb(var(--shade) / .3); }
.kid-card { display: grid; gap: 14px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.kid-head { display: flex; align-items: center; gap: 12px; }
.kid-avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--amber-soft-2); color: var(--amber-ink); font-weight: 800; font-size: 18px; }
.kid-name { flex: 0 1 auto; min-width: 0; display: grid; margin-inline-end: 12px; } /* (on Kitabi now, the notebook and practice right after the name, where the eye is: the owner's wish, 5 November 2026) */
.kid-name strong { font-size: 18px; }
.kid-name span { color: var(--muted); font-size: 13.5px; }
.kid-live { flex: none; font-size: 13px; font-weight: 700; color: var(--muted); }
.kid-live.on { color: var(--ok); }
.kid-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kid-stat { display: grid; justify-items: center; align-content: center; gap: 6px; padding: 10px; border-radius: 14px; background: var(--surface-2); text-align: center; font-size: 13px; color: var(--ink-2); }
.kid-stat svg { width: 64px; height: 64px; }
.kid-big { font-size: 22px; font-weight: 800; color: var(--orange-ink); }
.kid-bars { display: flex; align-items: flex-end; gap: 4px; height: 64px; }
.kid-bars i { width: 10px; border-radius: 4px 4px 2px 2px; background: var(--brand); opacity: .85; }
/* its parts under small headings: time on Kitabi, and the books they started */
.kid-books { display: grid; gap: 14px; }
.kid-sec { display: grid; gap: 8px; }
.kid-sub { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
:lang(ar) .kid-sub { letter-spacing: 0; text-transform: none; font-size: 13px; }
.kid-none { margin: 0; color: var(--muted); font-size: 13.5px; }
.kid-live.onapp { color: var(--brand); }
.kid-nb { flex: none; }
/* a quiz the child took, for their parent: the score, and the questions to look at again */
.nbh-quiz-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 0; }
.nbh-quiz-head span { color: var(--muted); font-size: 13px; }
.nbh-quiz details summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--brand-ink); }
/* (numbered here, at the start of each question's line: Safari put the list's own numbers by its first line's words,
   so an English question in Arabic had its number far to the left) */
/* (a child's quiz, for their parent, as the child's own marked paper: quizreview.js paperOf) */
.pq-paper { gap: 12px; }
details > .pq-paper { margin-top: 10px; }
.pq-paper .quiz-q { box-shadow: none; }
.quiz-q.unanswered { border-inline-start: 5px solid var(--line-2); }
.feedback.none { background: var(--surface-2); color: var(--muted); }
.pq-paper .opt { cursor: default; }
.pq-paper .opt:not(.right, .wrong):hover { border-color: var(--line); }
.qb-box.qb-static { display: inline-block; width: auto; min-width: 5em; }
.qm-pick.qm-static { display: inline-grid; place-items: center; min-width: 40px; }
.qw-answer.qw-static { min-height: 0; white-space: pre-wrap; background: var(--surface-2); }
.nbh-allright { margin: 0; color: var(--ok); font-weight: 600; font-size: 13.5px; }
/* when they were on Kitabi, today and yesterday: a line through the day's hours, a block for each time on */
.kid-times { display: grid; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); color: var(--ink-2); }
.kid-day { display: grid; grid-template-columns: 76px 56px minmax(0, 1fr); align-items: center; gap: 3px 10px; }
.kid-day-name { font-size: 14px; color: var(--ink); }
.kid-day-mins { font-size: 13.5px; font-weight: 700; color: var(--brand-ink); }
.kid-line { position: relative; height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.kid-line i { position: absolute; top: 0; bottom: 0; min-width: 4px; border-radius: 999px; background: var(--brand); }
.kid-day-when { grid-column: 3; font-size: 12.5px; color: var(--muted); }
.kid-ticks-row { margin-top: -6px; }
.kid-ticks { position: relative; height: 14px; }
.kid-ticks span { position: absolute; top: 0; translate: -50% 0; font-size: 11px; color: var(--muted); white-space: nowrap; }
.kid-ticks span:first-child { translate: 0 0; }
.kid-ticks span:last-child { translate: -100% 0; }
[dir="rtl"] .kid-ticks span { translate: 50% 0; }
[dir="rtl"] .kid-ticks span:first-child { translate: 0 0; }
[dir="rtl"] .kid-ticks span:last-child { translate: 100% 0; }
.kid-cards { margin: 0; font-weight: 600; color: var(--brand-ink); font-size: 13.5px; }
/* the books they started: a card with its cover, where they are, how much is read */
.kid-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 10px; }
.kid-book { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.kid-cover { display: block; width: 62px; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: 4px; box-shadow: 0 4px 12px rgb(var(--shade) / .2); background: var(--surface-2); }
.kid-info { display: grid; gap: 3px; min-width: 0; justify-items: start; }
.kid-info strong { font-size: 15px; line-height: 1.3; max-width: 100%; }
.kid-meta { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--muted); }
.kid-progress { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 2px; }
.kid-progress .pbar { flex: 1; }
.kid-pct { font-weight: 700; font-size: 12.5px; color: var(--ink-2); }
.kid-mins { font-size: 12.5px; color: var(--brand-ink); }
.kid-mins:empty { display: none; }
.kid-open { margin-top: 4px; }
/* the last line: Remove, at its end */
.kid-foot { display: flex; align-items: center; gap: 12px; margin-top: -4px; }
.kid-foot .kid-remove { margin-inline-start: auto; flex: none; }
.kid-remove { border: 0; background: none; padding: 4px 8px; border-radius: 8px; color: var(--muted); font: 600 13px/1.2 var(--font); cursor: pointer; }
.kid-remove:hover { color: var(--bad); background: var(--bad-soft); }
/* My children: "+ Link a child" by its name; the code typed in its window (account.js linkChild) */
.fam-head { justify-content: space-between; align-items: center; }
.children { padding-top: 26px; }
.children .fam-head h1 { margin: 0; font-size: 30px; }
/* Home's line for each child (family.js drawChildLines): who and when, today against their goal, the streak, › */
.kid-rows { display: grid; gap: 10px; }
.kid-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto 16px; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.kid-row:hover { border-color: var(--brand-line); }
.kid-row .kid-name strong { font-size: 16px; }
.kid-row .kid-live { font-size: 13px; }
.kid-row-goal { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.kid-row-goal svg { width: 38px; height: 38px; flex: none; }
.kid-row-streak { font-weight: 800; color: var(--orange-ink); white-space: nowrap; }
.kid-row-go { font-size: 22px; line-height: 1; color: var(--muted); }
/* (Home's My children: the arrow folds the box away, the switch shows lines or boxes side by side: family.js) */
.fam-head h2:has(.fam-fold) { margin: 0; }
.fam-fold { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.fam-fold svg { flex: none; color: var(--muted); transition: transform .15s; }
.fam-fold:hover svg { color: var(--brand); }
.fam-fold[aria-expanded="false"] svg { transform: rotate(-90deg); }
[dir="rtl"] .fam-fold[aria-expanded="false"] svg { transform: rotate(90deg); }
.kid-row.kid-row-plain { grid-template-columns: 44px minmax(0, 1fr) 16px; }
.kid-row .kid-name { margin-inline-end: 0; }
.kid-rows.grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.kid-rows.grid .kid-row { grid-template-columns: 1fr auto auto 1fr; align-items: center; gap: 8px 12px; padding: 16px 12px; text-align: center; }
.kid-rows.grid .kid-avatar, .kid-rows.grid .kid-name { grid-column: 1 / -1; justify-self: center; } /* (the picture and name across; today's minutes and the streak side by side, in the middle, under them) */
.kid-rows.grid .kid-row-goal { grid-column: 2; }
.kid-rows.grid .kid-row-streak { grid-column: 3; }
.kid-rows.grid .kid-avatar { width: 64px; height: 64px; font-size: 24px; }
.kid-rows.grid .kid-name { justify-items: center; }
.kid-rows.grid .kid-row-goal { gap: 6px; }
.kid-rows.grid .kid-row-goal svg { width: 30px; height: 30px; }
.kid-rows.grid .kid-row-go { display: none; }
[dir="rtl"] .kid-row-go { transform: scaleX(-1); }
.lc-form { display: grid; gap: 12px; }
.lc-form p { margin: 0; color: var(--ink-2); }
.lc-code { font: inherit; font-size: 20px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; }
.lc-code:focus { outline: none; border-color: var(--brand); }
.lc-form .ph-note:not(.bad) { color: var(--ok); font-weight: 600; }
.lc-form .ph-note.bad { color: var(--bad); }
.kid-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 14px; padding: 16px; border-radius: 16px; border: 1px dashed var(--brand-line); background: rgb(var(--brand-wash) / .5); }
.kid-link label { display: grid; gap: 5px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.kid-link input { font: inherit; font-size: 18px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 12px; }
.kid-link .ph-note { grid-column: 1 / -1; margin: 0; }

@media (max-width: 560px) {
  .st-roles { grid-template-columns: 1fr; }
  .kid-stats { grid-template-columns: 1fr 1fr; }
  .kid-week { grid-column: 1 / -1; }
  .kid-day { grid-template-columns: minmax(0, 1fr) auto; }
  .kid-row { grid-template-columns: 40px minmax(0, 1fr) auto 14px; gap: 10px; }
  .kid-row.kid-row-plain { grid-template-columns: 40px minmax(0, 1fr) 14px; }
  .kid-rows.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kid-rows.grid .kid-row-streak { display: inline; } /* (a box has room for it beside the ring) */
  .kid-row-goal span { display: none; }
  .kid-row-streak { display: none; }
  .kid-line, .kid-day-when, .kid-ticks { grid-column: 1 / -1; }
  .kid-ticks-row > span { display: none; }
  .kid-head { flex-wrap: wrap; }
  .kid-head .kid-live { flex-basis: 100%; margin-top: -8px; padding-inline-start: 56px; } /* under the name (a card's only: Home's lines have it under the name already, MISTAKES.md number 69) */
  .st-card { padding: 18px; }
}

/* ---- The admin area ---- */
.admin-tag { margin-inline-start: 4px; padding: 3px 9px; border-radius: 999px; background: var(--amber-soft-2); color: var(--amber-ink); font-size: 12px; font-weight: 800; }
/* (a phone: the logo with the Admin tag and without its word, so the top bar fits the screen: number 118) */
@media (max-width: 440px) { .logo:has(.admin-tag) > span:not(.logo-mark):not(.admin-tag) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } } /* (still read out by a screen reader) */
.admin { max-width: 1180px; margin: 0 auto; padding: 22px 16px 90px; }
.ad-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.ad-tabs button { flex: none; font: inherit; font-weight: 700; font-size: 14.5px; padding: 10px 14px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ad-tabs button[aria-selected="true"] { background: var(--brand-soft); color: var(--brand); }
.ad-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ad-head h2 { margin: 0 0 4px; font-size: 24px; }
.ad-head p { margin: 0; color: var(--muted); max-width: 720px; }

.ad-empty { margin: 0; padding: 18px; border-radius: 14px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.ad-bad { color: var(--bad); font-weight: 600; font-size: 14px; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
/* Delete my account (account.js deleteAccount): its button red; on the welcome page, when it goes, and Bring it back */
.da-modal .da-go { background: var(--bad); color: #fff; }
.da-modal .da-go:hover { filter: brightness(1.05); }
.da-modal .ab-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.da-notes a { color: var(--brand); font-weight: 600; }
.wl-deleted { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--bad-soft); color: var(--ink); font-size: 14.5px; line-height: 1.5; }
.wl-back { display: grid; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); }
.wl-back p { margin: 0; color: var(--ink); line-height: 1.5; }
/* blocked by Kitabi's team (welcome.js showBlocked): why, and Contact us; in Admin, its red badge; the Bin's promise */
.wl-blocked { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--bad-soft); }
.wl-blocked strong { color: var(--bad); font-size: 15.5px; }
.wl-blocked p { margin: 0; color: var(--ink); line-height: 1.5; }
.ad-badge.ad-badge-blocked { background: var(--bad-soft); color: var(--bad); }
.ad-badge.ad-badge-warned { background: var(--orange-soft); color: var(--orange-ink); } /* (warned: how many, the last on hover) */
.ad-warned-before { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--orange-soft); color: var(--orange-ink); font-size: 13.5px; font-weight: 600; }

.ad-note { position: fixed; z-index: 61; bottom: 84px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: var(--ok-soft); color: var(--ok-ink); font-weight: 600; box-shadow: var(--shadow); }
.ad-note.bad { background: var(--bad-soft); color: var(--bad); }
.ad-note { display: flex; align-items: center; gap: 14px; width: max-content; } /* (as wide as its words, up to the screen less 32px: on a phone it's not squeezed to half the screen) */
.ad-note > span { min-width: 0; }
/* (its ✕, to close it at once: the owner's wish, 7 November 2026) */
.ad-note-x { flex: none; margin-inline-start: -4px; padding: 2px 6px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; font-size: 15px; line-height: 1; opacity: .7; cursor: pointer; }
.ad-note-x:hover { opacity: 1; background: rgb(var(--glass) / .5); }
.ad-note-act { flex: none; padding: 4px 10px; border: 0; border-radius: 8px; background: rgb(var(--glass) / .7); color: inherit; font: inherit; font-weight: 800; cursor: pointer; }
.ad-note-act:hover { background: var(--surface); }
.ad-note[hidden] { display: none; }
.ad-search { font: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); min-width: 270px; }
.ad-search:focus { outline: none; border-color: var(--brand); }
/* books */
.ad-books { display: grid; gap: 10px; }
.ad-book { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.ad-book img, .ad-cover-blank { width: 64px; border-radius: 5px; box-shadow: 0 4px 12px rgb(var(--shade) / .18); }
.ad-cover-blank { aspect-ratio: 3 / 4; background: var(--surface-2); box-shadow: none; border: 2px dashed var(--line-2); }
.ad-book-info { display: grid; gap: 4px; min-width: 0; justify-items: start; }
.ad-book-info strong { font-size: 16px; }
.ad-meta { color: var(--muted); font-size: 13.5px; }
/* who reads a book (Admin → Books): its line, and the list it opens */
.ad-readers { font-size: 13px; }
.ad-readers-note { margin: 0 0 10px; color: var(--muted); font-size: 13.5px; }
.ad-readers-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.ad-readers-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ad-readers-list li > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ad-ai { color: var(--brand-ink); font-size: 13px; font-weight: 600; }
.ad-ai-all { margin: 4px 0 0; color: var(--brand-ink); font-weight: 600; font-size: 14px; }
.ad-ai-note { margin: 12px 2px 0; color: var(--muted); font-size: 12.5px; }
.ad-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ad-badge { padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.ad-prep { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.ad-book-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.ad-link { justify-self: start; padding: 0; border: 0; background: none; color: var(--brand); font: 600 13.5px/1.4 var(--font); cursor: pointer; }

/* accounts */
.ad-accounts { display: grid; gap: 8px; }
/* Admin → Accounts as a table (admin.js paintAccounts): one row of headings, a line for each account; a heading sorts
   the list by it. Where the list is narrow (a phone, or a small screen beside the menu), each line is a card again,
   with each cell's heading before it. */
.ad-table-card { container-type: inline-size; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); overflow-x: auto; overflow-y: hidden; } /* (a table wider than its card can be pushed sideways: what was wider was cut off, each row's ⋯ with it, MISTAKES.md number 418) */
.ad-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ad-table th { padding: 10px 12px; text-align: start; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line); }
.ad-table td { padding: 10px 12px; text-align: start; vertical-align: middle; border-bottom: 1px solid var(--line); }
.ad-table tbody tr:last-child > td { border-bottom: 0; }
.ad-table tbody tr:hover { background: var(--surface-2); }
.ad-table small { display: block; color: var(--muted); font-size: 12px; }
.ad-table small:empty { display: none; }
.ad-sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.ad-sort:hover, .ad-sort.on { color: var(--ink); }
.ad-sort span { font-size: 9px; }
.ad-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ad-c-who { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.ad-c-who .kid-avatar { width: 32px; height: 32px; font-size: 14px; }
.ad-c-who strong { font-weight: 700; }
.ad-c-who .ad-badge { font-size: 11px; padding: 1px 7px; }
.ad-table bdi { color: var(--ink-2); }
.ad-table .ad-links { margin-top: 4px; font-size: 12.5px; }
.ad-table .ad-links[hidden] { display: none; }
.ad-table .ad-link { font-size: 12.5px; }
.ad-c-date, .ad-c-ai > *, .ad-c-credit > * { white-space: nowrap; }
.ad-c-ai, .ad-c-credit { font-variant-numeric: tabular-nums; } /* (not on the grade: in Arabic the font's own digits) */
.ad-c-ai.none > span { color: var(--muted); }
.ad-c-credit > span { font-weight: 700; }
.ad-c-credit.out > span { color: var(--bad); }
.ad-c-credit.low > span { color: var(--orange-ink); }
.ad-c-credit small { color: var(--orange-ink); font-weight: 600; } /* (what they asked for at checkout) */
.ad-c-why { min-width: 220px; }
/* a book's line (Admin → Books): a small cover, its name and author, and how it is */
.ad-c-book { display: flex; align-items: center; gap: 10px; min-width: 230px; }
.ad-c-book img, .ad-c-book .ad-cover-blank { flex: none; width: 34px; height: 46px; aspect-ratio: auto; border-radius: 4px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); box-shadow: none; }
.ad-c-book-text { display: grid; gap: 2px; min-width: 0; justify-items: start; }
.ad-c-book-text strong { font-weight: 700; }
.ad-c-book-text .ad-badges { margin-top: 2px; }
.ad-c-book-text .ad-badge { font-size: 11px; padding: 1px 7px; }
.ad-c-book-text :is(.ad-bad, .ad-prep) { font-size: 12.5px; }
.ad-c-book-text .pbar { width: 100%; max-width: 320px; margin-top: 4px; }
.ad-c-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ad-table .ad-none { color: var(--muted); }
.ad-table .ad-readers { font-size: 12.5px; }
.ad-c-acts { width: 1%; }
.ad-row-acts { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.ad-more-btn { min-width: 36px; font-size: 18px; line-height: 1; }
@container (max-width: 820px) {
  .ad-table thead { display: none; }
  .ad-table, .ad-table tbody, .ad-table tr, .ad-table td { display: block; }
  .ad-table tbody tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .ad-table tbody tr:last-child { border-bottom: 0; }
  .ad-table td { padding: 2px 0; border: 0; }
  .ad-table td[data-k]::before { content: attr(data-k) ": "; color: var(--muted); font-size: 12.5px; }
  .ad-table td[data-k] > small { display: inline; }
  .ad-table td[data-k] > small:not(:empty)::before { content: " · "; }
  .ad-c-who { margin-bottom: 6px; }
  .ad-c-acts { width: auto; }
  .ad-row-acts { justify-content: flex-start; flex-wrap: wrap; margin-top: 8px; }
}
.ad-k { color: var(--muted); font-weight: 500; font-size: 13px; } /* (Name:, Username:, Follows:) */
.ad-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13.5px; }
.ad-link { border: 1px solid var(--line); background: var(--surface-2); color: var(--brand-ink); border-radius: 999px; padding: 1px 10px; margin-inline-end: 2px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; direction: ltr; }
.ad-link:hover { border-color: var(--brand); background: var(--brand-soft); }

@media (max-width: 600px) {
  .ad-book { grid-template-columns: 52px minmax(0, 1fr); }
  .ad-book img, .ad-cover-blank { width: 52px; }
  .ad-book-acts { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---- Chats with the tutor: the past chats, Export ---- */
@media (min-width: 1001px) { .tutor { position: relative; } } /* (on a phone the tutor is a fixed panel, which holds these already) */
.chat-list { position: absolute; z-index: 6; inset: 61px 0 0 0; display: flex; flex-direction: column; background: var(--surface); border-top: 1px solid var(--line); animation: pop2 .15s ease-out; }
.cl-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.cl-head strong { flex: 1; font-size: 16px; }
.cl-items { flex: 1; overflow: auto; padding: 8px; display: grid; align-content: start; gap: 4px; }
.cl-item { display: flex; align-items: center; gap: 2px; border-radius: 12px; border: 1px solid transparent; }
.cl-item:hover { background: var(--surface-2); }
.cl-item.on { border-color: var(--brand-line); background: var(--brand-soft); }
.cl-open { flex: 1; min-width: 0; display: grid; gap: 2px; text-align: start; font: inherit; padding: 10px 12px; border: 0; background: none; cursor: pointer; color: var(--ink); }
.cl-open strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-open span { color: var(--muted); font-size: 12.5px; }
.cl-empty { margin: 20px 12px; color: var(--muted); text-align: center; }
.export-menu { position: absolute; z-index: 7; inset-inline-end: 12px; display: grid; min-width: 190px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); animation: pop2 .15s ease-out; }
.export-menu button { font: inherit; font-weight: 600; font-size: 14.5px; text-align: start; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); cursor: pointer; }
.export-menu button:hover { background: var(--surface-2); color: var(--brand); }
.tutor-flash { position: absolute; z-index: 8; top: 70px; left: 50%; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; background: var(--tip); color: #fff; font-weight: 600; font-size: 13.5px; animation: pop2 .15s ease-out; }
@media print {
  #print-sheet .ps-chat-q, #print-sheet .ps-chat-a { margin: 6pt 0; padding: 6pt 9pt; border-radius: 6pt; break-inside: avoid; }
  #print-sheet .ps-chat-q { background: #eef2ff; }
  #print-sheet .ps-chat-a { border: 1px solid #ddd; }
  #print-sheet .ps-chat-who { margin: 0 0 2pt; font-size: 9.5pt; font-weight: 700; color: #4f46e5; }
  #print-sheet .ps-chat-q p, #print-sheet .ps-chat-a p { margin: 2pt 0; }
}
/* the tutor's header keeps its name on one line when its buttons need the room */
.tutor-names { min-width: 0; flex: 1; }
.tutor-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .tutor-sub { display: none; } }

/* ---- The tutor as a window of its own (on a computer): moved by its top bar, resized from any edge ---- */
body.tutor-floating .app { grid-template-columns: minmax(0, 1fr); }
body.tutor-floating .tutor { position: fixed; z-index: 45; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 24px 70px rgb(var(--shade) / .3), 0 2px 8px rgb(var(--shade) / .12); }
body.tutor-floating .tutor-head { cursor: grab; user-select: none; touch-action: none; }
body.tutor-moving { user-select: none; }
body.tutor-moving .tutor-head { cursor: grabbing; }
.float-toggle.on { color: var(--brand); background: var(--brand-soft); }
.tutor-grip { position: absolute; z-index: 10; touch-action: none; }
.tutor-grip.n, .tutor-grip.s { left: 14px; right: 14px; height: 7px; cursor: ns-resize; }
.tutor-grip.n { top: 0; }
.tutor-grip.s { bottom: 0; }
.tutor-grip.e, .tutor-grip.w { top: 14px; bottom: 14px; width: 7px; cursor: ew-resize; }
.tutor-grip.e { right: 0; }
.tutor-grip.w { left: 0; }
.tutor-grip.ne, .tutor-grip.nw, .tutor-grip.se, .tutor-grip.sw { width: 16px; height: 16px; }
.tutor-grip.ne { top: 0; right: 0; cursor: nesw-resize; }
.tutor-grip.sw { bottom: 0; left: 0; cursor: nesw-resize; }
.tutor-grip.nw { top: 0; left: 0; cursor: nwse-resize; }
.tutor-grip.se { bottom: 0; right: 0; cursor: nwse-resize; }

/* The whiteboard beside a book's page, in the tutor's place (book.js: its Whiteboard button): the whiteboard's own page in
   it, the tutor's parts hidden meanwhile (its edge, its strip when folded and a window's corners stay) */
.tutor-board { display: none; }
.tutor.board-mode > :not(.tutor-board, .tutor-edge, .tutor-rail, .tutor-grip) { display: none !important; }
.tutor.board-mode > .tutor-board { display: flex; flex: 1; min-height: 0; }
.tutor-board iframe { display: block; flex: 1; width: 100%; height: 100%; border: 0; background: var(--bg); }
/* (the board in the tutor's own window: a strip of its own on top, to move the window by, with ▣ to put it back at the
   side; at the side it isn't there. book.js showSideBoard, floating.js; rule 36's "window", the owner first) */
.tutor-board.with-bar { flex-direction: column; }
.tutor-board.with-bar iframe { height: auto; min-height: 0; }
.tutor-board-bar { display: none; }
body.tutor-floating .tutor-board-bar { display: flex; align-items: center; gap: 6px; flex: none; height: 36px; padding-inline: 10px 4px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: 600 13px var(--font); cursor: grab; user-select: none; -webkit-user-select: none; }
body.tutor-moving .tutor-board-bar { cursor: grabbing; }
.tbb-grip { display: inline-grid; color: var(--muted); }
.tbb-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbb-dock { width: 30px; height: 30px; }
body.tutor-sizing .tutor-board iframe, body.tutor-moving .tutor-board iframe { pointer-events: none; } /* (dragging its edge over it) */

/* The tutor at the side (a computer): its inner edge drags it wider or narrower (a line shows on it), and it folds
   away to a strip at its side, as the menu does on the other side (floating.js: sideTutor) */
.tutor-fold, .tutor-edge, .tutor-rail { display: none; }
[dir="rtl"] .tutor-fold svg, [dir="rtl"] .tutor-unfold svg { transform: scaleX(-1); }
@media (min-width: 1001px) {
  body:not(.tutor-floating) .tutor-fold { display: inline-grid; }
  body:not(.tutor-floating) .tutor-edge:not([hidden]) { display: block; position: absolute; z-index: 12; top: 0; bottom: 0; inset-inline-start: -5px; width: 10px; cursor: col-resize; touch-action: none; }
  .tutor-edge::after { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 4px; width: 3px; border-radius: 3px; background: var(--brand); opacity: 0; transition: opacity .15s; }
  .tutor-edge:hover::after { opacity: .75; transition-delay: .12s; }
  .tutor-edge:focus-visible::after, body.tutor-sizing .tutor-edge::after { opacity: 1; transition-delay: 0s; }
  .tutor-edge:focus-visible { outline: none; }
  body.tutor-sizing { cursor: col-resize; user-select: none; }
  /* its top row's buttons a little closer together, with room for the fold button */
  .tutor-head .icon-btn + .icon-btn { margin-inline-start: -6px; }
  .tutor.slim .tutor-head .icon-btn { width: 32px; }
  .tutor.slim .tutor-head { gap: 6px; }
  /* folded: a strip as wide as the folded menu, with the button to open it and the tutor's picture */
  body.tutor-folded:not(.tutor-floating) .app { grid-template-columns: minmax(0, 1fr) 68px; }
  body.tutor-folded:not(.tutor-floating) .tutor > :not(.tutor-rail) { display: none; }
  body.tutor-folded:not(.tutor-floating) .tutor-rail { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 10px; }
}
.tutor-rail-head { align-self: stretch; display: grid; justify-items: center; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.tutor-unfold, .tutor-rail-stop { display: grid; place-items: center; width: 48px; height: 40px; padding: 0; border: 0; border-radius: 12px; background: none; color: var(--muted); cursor: pointer; }
.tutor-unfold:hover { background: var(--surface-2); color: var(--ink); }
.tutor-rail-me { padding: 0; border: 0; cursor: pointer; }
.tutor-rail-me:hover { filter: brightness(1.08); }
.tutor-rail-stop { width: 40px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); border: 1px solid var(--brand-line); }
.tutor-rail-stop:hover { background: var(--brand-soft-2); }
.tutor-rail [hidden] { display: none; }
.tutor.short .tutor-model .tm-full { display: none; } /* (its whole name doesn't fit: floating.js) */
.tutor.short .tutor-model .tm-short { display: inline; }
/* a little grip in the bottom corner, so it's clear the window can be resized */
.tutor-grip.se::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 9px; height: 9px; background: linear-gradient(135deg, transparent 45%, var(--faint) 45% 55%, transparent 55% 70%, var(--faint) 70% 80%, transparent 80%); }

/* ---- Credit: what's left, how it works, plans and packs, checkout (public/credits.html) ---- */
.credits { max-width: 1040px; margin: 0 auto; padding: 28px 16px 80px; }
/* Settings (settings.js): a tab for each part (Admin's tab bar, .ad-tabs), and under it a line per setting (what it
   is, what it is now, a button). Its own names start with sg- (st- is the first steps' page). */
.settings { max-width: 800px; margin: 0 auto; padding: 28px 16px 80px; }
.sg-tabs { margin: 18px 0 14px; }
.sg-card { container-type: inline-size; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 6px 20px; box-shadow: var(--shadow); }
.sg-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.sg-card > .sg-row:first-child { border-top: 0; }
.sg-what { display: grid; gap: 4px; min-width: 0; flex: 1 1 220px; }
.sg-label { font-weight: 700; font-size: 14.5px; color: var(--ink); }
/* an icon before a row (Account's: the first steps' own role icons; 6 November 2026) */
.sg-icon { flex: none; width: 34px; font-size: 22px; line-height: 1; text-align: center; align-self: center; }
.sg-has-icon .sg-what { flex-basis: 180px; }
.sg-wide.sg-has-icon .sg-what { flex-basis: calc(100% - 50px); } /* (a wide one, colours or a choice: beside its icon) */
.sg-wide.sg-has-icon .sg-icon { align-self: flex-start; margin-top: 1px; }
.sg-value { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.sg-what bdi.sg-value { justify-self: start; } /* (a username in an Arabic page: under its name, not at the far side) */
.sg-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-acts:empty { display: none; }
.sg-wide .sg-what { flex-basis: 100%; gap: 8px; }
/* (the seven colours: all in one row when the card has room for "Navy and gold" on one line, a computer's screen; else
   four and three under them, so none sits alone on a line; smaller words on the smallest phones) */
.settings .am-looks-row { padding: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 510px; }
@container (min-width: 722px) { .settings .am-looks-row { grid-template-columns: repeat(7, minmax(0, 1fr)); max-width: none; } }
.settings .am-look { align-content: start; background: var(--surface); font: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer; } /* (the menu's buttons had these from .account-menu button; a name on two lines leaves the others at the top) */
@container (max-width: 289px) { .settings .am-look { padding-inline: 2px; font-size: 11px; } }
.sg-langs { justify-self: start; }
.sg-langs button { padding: 6px 16px; font-size: 14px; }
.sg-goal .goal-pick { margin-top: 2px; }
/* Explain aloud, in writing, Meaning and Listen: a row each, Both / Always English / Always Arabic (7 November 2026) */
.sg-help { display: grid; gap: 8px; }
.sg-help-row { display: grid; grid-template-columns: minmax(130px, 170px) minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.sg-help-name { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.sg-help .goal-pick { margin-top: 0; }
.sg-help .sg-value { margin: 2px 0 0; }
@media (max-width: 560px) { .sg-help-row { grid-template-columns: 1fr; } }
.sg-phone { display: block; }
.sg-phone.sg-has-icon { display: flex; align-items: flex-start; gap: 10px 16px; } /* (Settings: its 📱 in the icons' column) */
.sg-phone.sg-has-icon .ph-grid { flex: 1 1 0; min-width: 0; }
.sg-phone h3 { margin: 0 0 8px; font-size: 14.5px; }
.credits > .back { margin-block: -14px 12px; margin-inline-start: -8px; }
.credits > .back span { display: inline; } /* (its words even on a phone, unlike the reader's own "‹ Library") */
.cr-top { display: grid; gap: 16px; }
/* (the credit left: a short box, its number beside what it means; How credit works is at the page's end: 11 November 2026) */
.cr-balance-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 40px; }
.cr-balance-main { flex: none; }
.cr-balance-info { flex: 1 1 320px; min-width: 0; }
.cr-balance-info > :first-child { margin-top: 0; }
.cr-how-end .cr-card { padding: 20px 24px; }
.cr-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); }
.cr-balance-card .eyebrow { margin-bottom: 10px; }
.cr-balance { display: flex; align-items: baseline; gap: 10px; }
.cr-balance strong { font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -.03em; color: var(--brand-ink); }
.cr-balance span { font-size: 16px; font-weight: 600; color: var(--muted); }
.cr-about, .cr-used, .cr-ordered { margin: 10px 0 0; color: var(--ink-2); }
.cr-about:empty { display: none; }
.cr-used { font-size: 14px; color: var(--muted); }
.cr-ordered { padding: 10px 12px; border-radius: 12px; background: var(--orange-soft); color: var(--orange-ink); font-size: 14px; font-weight: 600; }
.cr-ordered[hidden], .cr-history[hidden] { display: none; }
.cr-how h3 { margin: 0 0 10px; font-size: 16px; }
.cr-how ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 8px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.cr-h2 { margin: 34px 0 16px; font-size: 24px; }
.cr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.cr-plan { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.cr-plan.best { border: 2px solid var(--brand); box-shadow: 0 8px 30px rgb(var(--brand-rgb) / .18); }
.cr-plan.monthly { background: linear-gradient(180deg, var(--brand-soft), var(--surface) 65%); }
.cr-best { position: absolute; top: -11px; inset-inline-start: 18px; padding: 3px 10px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; }
.cr-plan h3 { margin: 0; font-size: 17px; }
.cr-price { margin: 6px 0 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.cr-price strong { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.cr-price span { color: var(--muted); font-size: 13.5px; }
.cr-credits { margin: 0; font-weight: 700; color: var(--brand-ink); }
.cr-answers, .cr-renews { margin: 0; color: var(--muted); font-size: 13.5px; }
.cr-buy { width: 100%; margin-top: auto; }
/* offers (8 November 2026): said above the packs; a pack with one has its tag (opposite Best value), the price before it
   crossed out or the credit it adds; an offer's code typed under them; the offer at checkout */
.cr-offers { display: grid; gap: 6px; margin: -4px 0 16px; padding: 12px 16px; border: 1px solid var(--orange-line); border-radius: 16px; background: var(--orange-soft); color: var(--orange-ink); font-size: 14.5px; font-weight: 600; }
.cr-offers p { margin: 0; display: flex; gap: 8px; align-items: baseline; }
.cr-plan.has-offer:not(.best) { border-color: var(--orange-line); }
.cr-offer-tag { position: absolute; top: -11px; inset-inline-end: 18px; padding: 3px 10px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; }
.cr-price s, .cr-total s { color: var(--muted); font-size: 15px; font-weight: 600; }
.cr-free { display: inline-block; margin-inline-start: 4px; padding: 1px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok-ink); font-size: 12.5px; font-weight: 700; }
.cr-code { margin-top: 14px; font-size: 14px; }
.cr-code summary { display: inline-block; cursor: pointer; color: var(--brand-ink); font-weight: 600; }
.cr-code-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cr-code-form input { width: 12em; max-width: 100%; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.cr-code-form input:focus { outline: none; border-color: var(--brand); }
.cr-code-note { margin: 6px 0 0; color: var(--bad); }
.cr-code-note[hidden] { display: none; }
.cr-code-on { margin: 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; color: var(--orange-ink); font-weight: 600; }
.cr-order-offer { color: var(--orange-ink) !important; font-weight: 600; }
.cr-code-off { padding: 0; border: 0; background: none; color: var(--brand-ink); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.cr-plan > p:nth-last-of-type(1) { margin-bottom: 12px; }
/* where your credit went (11 November 2026): what each kind took, then each line as the history's, newest first */
.cr-spent { scroll-margin-top: calc(var(--topbar) + 8px); } /* (opened at #spent, from Settings: its heading below the top bar) */
.cr-spent-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin: 34px 0 14px; }
.cr-spent-head .cr-h2 { margin: 0; }
.cr-month select { padding: 8px 34px 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; background-color: var(--surface); color: var(--ink); font: 600 14.5px/1.2 var(--font); }
.cr-month select:disabled { opacity: 1; } /* (one month only: shown, not chosen) */
.cr-spent-body { display: grid; gap: 14px; }
.cr-kinds { margin: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.cr-kinds > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 16px; font-size: 14.5px; }
.cr-kinds > div + div { border-top: 1px solid var(--line); }
.cr-kinds dt { color: var(--ink-2); }
.cr-kinds dd { margin: 0; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.cr-kinds .cr-kinds-all { background: var(--surface-2); }
.cr-kinds .cr-kinds-all :is(dt, dd) { color: var(--ink); font-weight: 800; }
.cr-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cr-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 14px; }
.cr-lines li > span { display: grid; gap: 2px; min-width: 0; }
.cr-line-book { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-lines li strong { color: var(--ok); font-variant-numeric: tabular-nums; }
.cr-lines li strong.minus { color: inherit; }
.cr-lines li time { color: var(--muted); white-space: nowrap; }
.cr-spent-none, .cr-spent-note { margin: 0; color: var(--muted); font-size: 14px; }
.cr-history { margin-top: 30px; }
.cr-history h3 { margin: 0 0 8px; font-size: 16px; }
.cr-history ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cr-history li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 14px; }
.cr-history li strong { color: var(--ok); }
.cr-history li strong.minus { color: inherit; } /* (taken back: not green, it isn't more) */
.cr-history li time { color: var(--muted); }
/* checkout */
.cr-checkout { max-width: 560px; margin: 0 auto; display: grid; gap: 14px; }
.cr-back { justify-self: start; }
.cr-checkout h2 { margin: 0; font-size: 26px; }
.cr-checkout h3 { margin: 8px 0 0; font-size: 15px; }
.cr-order { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cr-order > div { display: grid; gap: 4px; }
.cr-order .eyebrow { justify-self: start; margin: 0 0 4px; }
.cr-order strong { font-size: 18px; }
.cr-order span { color: var(--muted); font-size: 14px; }
.cr-total { margin: 0; display: grid; text-align: end; }
.cr-total strong { font-size: 24px; }
.cr-methods { display: grid; gap: 8px; }
.cr-method { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.cr-method:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.cr-method input { flex: none; width: 18px; height: 18px; accent-color: var(--brand); }
.cr-logo { flex: none; min-width: 74px; padding: 6px 8px; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 800; text-align: center; white-space: nowrap; }
.cr-logo-knet { background: #1d4e89; }
.cr-logo-card { background: #1a1f71; }
.cr-logo-applepay { background: #111; }
.cr-mtext { display: grid; }
.cr-mtext span { color: var(--muted); font-size: 13px; }
.cr-pay { width: 100%; }
.cr-secure { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.cr-error { margin: 0; color: var(--bad); font-weight: 600; }
.cr-error[hidden] { display: none; }
.cr-sent .cr-card { display: grid; justify-items: center; gap: 10px; padding: 30px 24px; text-align: center; }
.cr-sent-icon { font-size: 40px; }
.cr-sent h2 { font-size: 22px; }
.cr-sent p { max-width: 440px; margin: 0; color: var(--ink-2); line-height: 1.55; }
@media (max-width: 760px) {
  .cr-balance strong { font-size: 44px; }
}
/* the tutor, out of credit: the way to more */
.credit-btn { margin-top: 8px; }
/* admin: each account's credit, and the prices */
.ad-credits { display: grid; gap: 18px; max-width: 750px; } /* (wide enough for "Credits for each US$ the AI costs" on one line) */
.ad-credit-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.ad-credit-fields label { display: grid; align-content: start; gap: 5px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.ad-credits input { width: 100%; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; }
.ad-per-hint { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.ad-price-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.ad-price-grid b { color: var(--muted); font-size: 13px; }
.ad-small { margin: 0; color: var(--muted); font-size: 13px; }
/* Admin → Books: how long a page is open before it counts as read (3, 4 or 5 seconds) */
.ad-reading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 18px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ad-reading:empty { display: none; }
.ad-reading-label { font-weight: 600; color: var(--ink-2); }
.ad-reading-choices { display: inline-flex; gap: 6px; }
.ad-reading .ad-small { flex-basis: 100%; }
.ad-credits button[type=submit] { justify-self: start; }
/* Admin → Credits → Offers (8 November 2026): the list (each offer a card; one on now with a green edge) and Stop it */
.ad-offers { gap: 12px; }
.of-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.of-head h3 { margin: 0; }
.of-list { display: grid; gap: 10px; }
.of-item { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-inline-start: 5px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.of-item.on { border-inline-start-color: var(--ok); }
.of-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.of-state { padding: 1px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.of-item.on .of-state { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-ink); }
.of-name { font-weight: 700; color: var(--ink-2); }
.of-main { margin: 0; font-size: 14.5px; }
.of-meta { margin: 0; color: var(--muted); font-size: 13px; }
.of-stop { justify-self: start; margin-top: 4px; }
.of-done summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--brand-ink); }
.of-done .of-list { margin-top: 10px; }
/* making one, in its window: what it gives, who it's for (people found and chosen, or a code), the packs, its days and
   limits, and the table of what Kitabi keeps (red at a loss, and Make the offer greyed) */
.of-modal .modal-card { width: min(640px, 100%); }
.of-form { display: grid; gap: 14px; }
.of-form fieldset { display: grid; gap: 6px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.of-form legend { padding: 0 6px; font-weight: 700; font-size: 14px; }
.of-pick { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.of-pick input { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
.of-field { display: grid; gap: 5px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.of-field[hidden], .of-people[hidden], .of-error[hidden] { display: none; }
.of-form input:not([type=radio]):not([type=checkbox]) { width: 100%; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; }
.of-form input:focus { outline: none; border-color: var(--brand); }
.of-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .of-dates { grid-template-columns: 1fr; } }
.of-people { display: grid; gap: 8px; }
.of-found { display: grid; gap: 4px; }
.of-found:empty { display: none; }
.of-hit { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; text-align: start; cursor: pointer; }
.of-hit:hover { border-color: var(--brand); background: var(--brand-soft); }
.of-hit small { color: var(--muted); }
.of-chosen { display: flex; flex-wrap: wrap; gap: 6px; }
.of-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: 13.5px; font-weight: 600; }
.of-chip button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.of-chip button:hover { background: rgb(var(--brand-rgb) / .15); }
.of-keep-title { margin: 0 0 6px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.of-table { display: grid; grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr)); gap: 6px 12px; align-items: baseline; font-size: 13.5px; }
.of-table b { color: var(--muted); font-size: 12.5px; }
.of-table small { color: var(--muted); }
.of-table .bad { color: var(--bad); font-weight: 700; }
.of-error { margin: 0; color: var(--bad); font-weight: 600; font-size: 14px; }

/* Home: adding a book (one PDF, or a book in several files grouped into parts), and Edit details */
.add-modal { width: min(640px, 100%); }
.ab-as { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.ab-as-label { grid-column: 1 / -1; margin: 0; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.ab-as label { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.ab-as label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.ab-as input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); }
.ab-as label span { display: grid; gap: 2px; }
.ab-as b { font-size: 14.5px; color: var(--ink); }
.ab-as small { font-size: 13px; font-weight: 500; color: var(--muted); }
.ab-many .ab-file { padding: 4px 4px 4px 6px; }
.ab-many .ab-size { flex: 0 0 8.5em; text-align: end; } /* (the same width on every line, so the name boxes line up: number 88) */
.ab-bookname { flex: 1; min-width: 0; font: inherit; font-weight: 600; font-size: 14px; color: var(--ink); padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 9px; background: var(--surface); }
.ab-bookname:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgb(var(--brand-rgb) / .12); }
@media (max-width: 520px) { .ab-as { grid-template-columns: 1fr; } }
.ab-hint, .ab-paste-text { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.ab-one { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.ab-name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-size { flex: none; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ab-list { list-style: none; margin: 10px 0 0; padding: 6px; display: grid; gap: 2px; max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.ab-file { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 8px; border-radius: 9px; }
.ab-file:hover { background: var(--surface-2); }
.ab-n { flex: none; min-width: 22px; color: var(--muted); font-size: 12.5px; font-weight: 700; text-align: end; font-variant-numeric: tabular-nums; }
.ab-tools { flex: none; display: flex; align-items: center; gap: 2px; }
.ab-tools .icon-btn, .ab-part .icon-btn { width: 30px; height: 30px; font-size: 16px; }
.ab-addpart { border: 1px dashed var(--brand-mid); background: none; color: var(--brand); font: inherit; font-size: 12.5px; font-weight: 600; padding: 3px 9px; margin-inline-end: 4px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.ab-addpart:hover { background: var(--brand-soft); border-style: solid; }
.ab-part { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px; border-radius: 10px; background: var(--brand-soft); }
.ab-part:first-child { margin-top: 0; }
.ab-part input { flex: 1; min-width: 0; font: inherit; font-weight: 700; font-size: 14px; color: var(--brand-ink); padding: 7px 10px; border: 1.5px solid var(--brand-line); border-radius: 9px; background: var(--surface); }
.ab-part input:focus { outline: none; border-color: var(--brand); }
.ab-paste { margin-top: 10px; }
.ab-paste > summary { cursor: pointer; width: fit-content; color: var(--brand); font-weight: 600; font-size: 14px; }
.ab-paste[open] > summary { margin-bottom: 6px; }
.ab-paste textarea, .ab-field input, .ab-field textarea { width: 100%; font: inherit; font-size: 14.5px; font-weight: 500; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); resize: vertical; }
.ab-paste textarea { margin-top: 8px; }
.ab-paste textarea:focus, .ab-field input:focus, .ab-field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgb(var(--brand-rgb) / .12); }
.ab-paste-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ab-paste-note { color: var(--bad); font-size: 13px; font-weight: 600; }
.ab-details { display: grid; gap: 14px; margin-top: 4px; }
.ab-field { display: grid; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.ab-field small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
/* the grey line above the name and author when adding one file (number 83), like Cover picture's */
.ab-field .ab-from-cover { margin-top: -2px; font-size: 13px; line-height: 1.4; }
.ab-cover { display: flex; align-items: center; gap: 14px; }
.ab-cover img { flex: none; width: 76px; height: 104px; object-fit: cover; border-radius: 6px; background: var(--surface-2); box-shadow: 0 6px 16px rgb(var(--shade) / .2); }
.ab-cover-side p { margin: 0 0 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.ab-cover-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ab-error { margin: 0; color: var(--bad); font-weight: 600; font-size: 14px; }
.ab-actions { display: flex; justify-content: flex-end; gap: 10px; }
.add-modal .add-note { margin: 0; color: var(--muted); }
@media (max-width: 480px) { .ab-file .ab-size { display: none; } }
/* A recording (11 November 2026): the language it's spoken in (three side by side; one under another on a phone), its
   two ticks, and the note that Kitabi keeps only its text */
.ab-spoken { grid-template-columns: repeat(3, 1fr); margin-bottom: 0; }
@media (max-width: 520px) { .ab-spoken { grid-template-columns: 1fr; } }
.add-modal .ab-rec-note, .sp-rec-note { color: var(--ink-2); }
.sp-rec-note { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; }
/* the few words about a book its reader wrote, under its name */
.book-blurb { margin: 0 0 4px; max-width: 72ch; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* a book its reader lets Kitabi's team see for now, to check a problem they reported (rule 4), and Stop */
.book-help { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin: 6px 0 8px; padding: 8px 12px; border-radius: 10px; background: var(--cyan-soft); border: 1px solid var(--cyan-line); color: var(--cyan-ink); font-size: 13.5px; line-height: 1.45; }
.book-help span { flex: 1 1 180px; min-width: 0; }
.book-help-stop { border: 0; background: none; padding: 2px 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.book-help-stop:disabled { opacity: .5; cursor: default; }

/* The account menu: a new password */
.pw-modal { width: min(440px, 100%); }
/* which voice, the first time Listen is pressed (tutor.js firstVoice): a card for each company's natural voices, side by
   side (one under the other on a phone), and the free one under them */
.fv-modal { width: min(560px, 100%); }
.fv-intro { margin: 0 0 12px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.fv-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fv-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.fv-card h4 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0; font-size: 16px; }
.fv-uses { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.fv-name { margin: 0; font-weight: 600; font-size: 14px; }
.fv-about { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.45; flex: 1; }
.fv-cost { margin: 4px 0 0; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fv-cost:empty { display: none; }
.fv-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fv-btns .btn { flex: 1 1 110px; justify-content: center; }
.fv-note { margin-top: 12px; }
.fv-free { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13.5px; }
.fv-free button { border: 0; background: none; padding: 4px 8px; margin-inline-start: -8px; border-radius: 8px; font: inherit; font-weight: 700; color: var(--brand-ink); cursor: pointer; }
.fv-free button:hover { background: var(--brand-soft); }
.fv-free span { color: var(--muted); font-size: 13px; }
@media (max-width: 560px) {
  .fv-cards { grid-template-columns: 1fr; }
}
.pw-form { gap: 14px; }

/* Translate: the selected words, and the same in the other language */
.tr-from { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tr-out { margin-top: 10px; }
.tr-label { margin: 0 0 4px; color: var(--brand); font-size: 12.5px; font-weight: 700; }
/* the language it's translated into, picked like Google Translate's (practice.js: translate) */
.tr-into { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; color: var(--brand); font-size: 13px; font-weight: 700; }
.tr-into select {
  font: 600 14px/1.2 var(--font); color: var(--ink); padding: 7px 32px 7px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; -webkit-appearance: none; appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%2364748b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center;
}
[dir="rtl"] .tr-into select { padding: 7px 10px 7px 32px; background-position: left 11px center; }
.tr-to { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.6; color: var(--ink); }
.tr-to:lang(ar), .tr-note:lang(ar) { font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; }
.tr-note { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.tr-price { margin: -2px 0 8px; color: var(--muted); font-size: 12.5px; }
.tr-modal .pr-btns { margin-top: 12px; }

/* Choosing the voice (the natural voice or the balanced voice, a woman or a man, or the computer's own), in Listen's bar and the tutor's */
.voice-pick { max-width: 190px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-2); padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; text-overflow: ellipsis; }
.voice-pick:hover { border-color: var(--brand-mid); color: var(--brand-ink); }
.voice-pick:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.la-main { display: contents; } /* (drawn again after every sentence; the voice menu beside it stays) */
.la-voice { display: inline-flex; margin-inline: 4px 2px; }
.la-voice[hidden], .vb-voice:empty { display: none; }
/* (on its own line under the pause button, at the start: the left in English, the right in Arabic; 7 November 2026) */
.vb-voice { flex: 1 1 100%; min-width: 0; display: flex; justify-content: flex-start; padding-inline-start: 2px; }
.vb-voice .voice-pick { min-width: 0; max-width: min(240px, 100%); padding: 4px 6px; font-size: 12.5px; }
@media (max-width: 520px) { .la-voice .voice-pick { max-width: 130px; font-size: 12.5px; } }

/* ---- Listen like an audiobook (11 November 2026): the bar's sleep timer, Ask and big player; What to listen to; the big
   player over the page (the car); Ask's card ---- */
.la-more { display: inline-flex; align-items: center; gap: 2px; padding-inline-start: 4px; margin-inline-start: 2px; border-inline-start: 1px solid var(--line); }
.listen-bar.tight .la-voice { display: none; }
.la-sleep { display: inline-flex; align-items: center; gap: 3px; width: auto; min-width: 36px; padding-inline: 8px; border-radius: 999px; }
.la-sleep.on { color: var(--brand-ink); background: var(--brand-soft); }
.la-sleep-left { font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.la-sleep-left:empty { display: none; }
.la-ask { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font: 600 13.5px/1 var(--font); cursor: pointer; white-space: nowrap; }
.la-ask:hover { background: var(--brand-soft-2); }
.la-ask svg { width: 17px; height: 17px; flex: none; }
@media (max-width: 520px) {
  /* (the speed, the voice and the sleep timer are in the big player on a phone; the voice also in What to listen to) */
  .listen-bar .la-speed, .listen-bar .la-voice, .la-sleep { display: none; }
  .la-ask { width: 36px; padding: 0; justify-content: center; }
  .la-ask span { display: none; }
  .la-more { padding-inline-start: 2px; }
}

.lb-sheet .modal-body { display: grid; gap: 12px; }
.lb-cont { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--brand-soft); }
.lb-cont[hidden] { display: none; }
.lb-cont-text { display: grid; gap: 2px; min-width: 0; }
.lb-cont-text strong { color: var(--brand-ink); }
.lb-cont-text span { color: var(--ink-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-cont-go svg, .lb-go svg { flex: none; }
.lb-what { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; min-width: 0; }
.lb-what legend { padding: 0; margin-bottom: 6px; font-weight: 700; }
.lb-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.lb-row:has(input:checked) { border-color: var(--brand-mid); background: var(--brand-wash); }
.lb-row input { margin: 0; accent-color: var(--brand); }
.lb-w { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-weight: 600; }
.lb-ptitle { flex-basis: 100%; min-width: 0; color: var(--muted); font-weight: 500; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-pickers { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ink-2); }
.lb-pickers select { font: inherit; font-size: 13.5px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); max-width: 6.5em; }
.lb-row em { font-style: normal; font-size: 12.5px; color: var(--muted); white-space: nowrap; text-align: end; }
@media (max-width: 520px) {
  .lb-row { grid-template-columns: auto minmax(0, 1fr); }
  .lb-row em { grid-column: 2; text-align: start; white-space: normal; }
}
.lb-voicerow { display: flex; align-items: center; gap: 10px; }
.lb-voicerow[hidden] { display: none; }
.lb-voicelabel { font-weight: 700; }
.lb-price { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.lb-price:empty { display: none; }
.lb-ready { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.lb-ready.off { opacity: .5; cursor: default; }
.lb-ready input { margin: 0; accent-color: var(--brand); }
.lb-sheet .pr-btns { justify-content: flex-end; }

.lb-player { position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; overflow-y: auto; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); background: var(--bg); color: var(--ink); opacity: 0; transform: translateY(16px); transition: opacity .2s, transform .2s; }
.lb-player.open { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .lb-player { transition: none; transform: none; } }
body.lb-open { overflow: hidden; }
.lb-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.lb-titles { flex: 1; min-width: 0; display: grid; gap: 2px; text-align: center; }
.lb-titles strong, .lb-titles span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-titles strong { font-size: 15px; }
.lb-titles span { color: var(--muted); font-size: 13px; }
.lb-titles span:empty { display: none; }
.lb-middle { flex: 1; width: min(520px, 100%); margin: 0 auto; padding: 8px 20px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.lb-art { width: min(220px, 50vw); aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg); background: var(--surface-2); }
.lb-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lb-where { font-size: 18px; font-weight: 700; text-align: center; }
.lb-prog { width: 100%; display: grid; gap: 6px; }
.lb-prog[hidden] { display: none; }
.lb-track { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.lb-track i { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .4s; }
.lb-times { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.lb-controls { display: flex; align-items: center; justify-content: center; gap: 8px; }
.lb-controls button { display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.lb-controls button:hover { background: var(--surface-2); }
.lb-controls .lb-pg { width: 48px; height: 48px; color: var(--ink-2); }
.lb-controls .lb-btn { width: 60px; height: 60px; }
.lb-controls .lb-playbig { width: 84px; height: 84px; background: var(--brand); color: #fff; box-shadow: 0 8px 24px rgb(var(--brand-rgb) / .35); }
.lb-controls .lb-playbig:hover { background: var(--brand-ink); }
.lb-askbig { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 360px; min-height: 64px; border: 0; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font: 700 20px/1 var(--font); cursor: pointer; }
.lb-askbig:hover { background: var(--brand-soft-2); }
.lb-askbig svg { width: 26px; height: 26px; }
.lb-askbig[hidden] { display: none; }
.lb-askslot { width: 100%; }
.lb-askslot:empty { display: none; }
.lb-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.lb-speed { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 999px; }
.lb-speed .icon-btn { font-size: 18px; font-weight: 700; }
.lb-rate { min-width: 40px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.lb-voice:empty { display: none; }
.lb-sleepbig { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: 600 13.5px/1 var(--font); cursor: pointer; }
.lb-sleepbig.on { border-color: var(--brand-mid); background: var(--brand-soft); color: var(--brand-ink); }
.lb-told { margin: 0; padding: 8px 14px; border-radius: 14px; background: var(--tip); color: #fff; font-size: 13.5px; font-weight: 600; text-align: center; }
.lb-told[hidden] { display: none; }
.lb-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }
@media (max-height: 700px) {
  .lb-art { width: min(140px, 36vw); }
  .lb-middle { gap: 12px; }
}

.lb-askcard { position: fixed; z-index: 50; left: 50%; bottom: calc(150px + var(--bar-more, 0px) + var(--sheets-room, 0px)); transform: translateX(-50%); width: min(460px, calc(100vw - 24px)); display: grid; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); }
.lb-askcard.in-player { position: static; transform: none; width: 100%; box-shadow: none; }
.lb-ask-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lb-quote { margin: 0; padding: 8px 12px; border-inline-start: 3px solid var(--brand-mid); border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-size: 14px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lb-ask-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.lb-ask-btns .btn { flex: 1 1 auto; min-height: 44px; }
.lb-ask-btns .btn svg { width: 18px; height: 18px; flex: none; }
.lb-ask-form { display: flex; gap: 8px; }
.lb-ask-form input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; }
.lb-ask-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.lb-ask-langs { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; }
.lb-ask-langs button { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: 600 12.5px/1.4 var(--font); cursor: pointer; }
.lb-ask-langs button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.lb-heard, .lb-ask-state { min-height: 1.5em; margin: 0; color: var(--ink-2); font-size: 15px; font-weight: 600; }
.lb-dots { display: inline-block; width: 8px; height: 8px; margin-inline-end: 8px; border-radius: 50%; background: var(--brand); vertical-align: middle; animation: lb-pulse 1s ease-in-out infinite; }
@keyframes lb-pulse { 50% { opacity: .3; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { .lb-dots { animation: none; } }

/* Which AI answers you (account menu), and the models an admin offers (Admin → Credits) */
.ai-list { display: grid; gap: 8px; margin-top: 4px; }
.ai-option { display: grid; gap: 2px; text-align: start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; }
.ai-option:hover { border-color: var(--brand-mid); }
.ai-option.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.ai-option strong { font-size: 16px; }
.ai-what { color: var(--ink-2); font-size: 14px; }
.ai-cost { color: var(--brand-ink); font-size: 13px; font-weight: 600; }
.ai-cost:empty { display: none; }
.ad-ai { margin-top: 18px; }
.ad-ai h3 { margin: 0; }
.ad-ai-list { display: grid; gap: 6px; }
.ad-ai-list label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 14.5px; cursor: pointer; }
.ad-credits .ad-ai-list input { width: 18px; height: 18px; flex: none; align-self: center; accent-color: var(--brand); }
.ad-ai-list small { color: var(--muted); font-size: 13px; }
.ad-ai-standard { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.ad-ai-standard select { padding: 8px 34px 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; font-weight: 500; }
/* the AI cards: what each is best for, the recommended one, theirs; on the Credits page side by side */
.ai-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.ai-badge { padding: 2px 9px; border-radius: 999px; background: var(--ok-soft); color: var(--ok-ink); font-size: 12px; font-weight: 700; }
.ai-mine { padding: 2px 9px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; }
.ai-best { color: var(--ink); font-size: 14px; font-weight: 600; }
.ai-best:empty, .ai-what:empty { display: none; }
.cr-ai { margin-top: 28px; }
.cr-ai-text { margin: -4px 0 12px; color: var(--ink-2); font-size: 14.5px; }
.cr-ai .ai-list { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.cr-ai .ai-option { align-content: start; padding: 16px; border-radius: 18px; }

/* Admin → Overview: tiles, the AI's cost by month, which models answered, top spenders; one person in detail */
.ov-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 14px 0 16px; }
.ov-tile { display: grid; align-content: start; gap: 3px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.ov-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.ov-value { font-size: 28px; font-weight: 700; color: var(--ink); line-height: 1.15; }
.ov-sub { color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
.ov-tiles.small { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 10px 0 6px; }
.ov-tiles.small .ov-tile { padding: 12px; box-shadow: none; }
.ov-tiles.small .ov-value { font-size: 20px; }
.ov-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
@media (max-width: 860px) { .ov-row { grid-template-columns: 1fr; } }
.ov-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.ov-card h3 { margin: 0 0 10px; font-size: 15px; }
.ov-none { margin: 4px 0; color: var(--muted); font-size: 14px; }
.ov-chart { display: block; width: 100%; height: auto; overflow: visible; }
.ov-bar { fill: var(--brand); transition: fill .15s; }
.ov-col:hover .ov-bar, .ov-col:focus .ov-bar { fill: var(--brand-ink); }
.ov-col:focus { outline: none; }
.ov-col:focus-visible .ov-hit { stroke: var(--brand); stroke-width: 2; }
.ov-hit { fill: transparent; }
/* Admin → Overview: the AI work Kitabi pays for (6 November 2026) */
.ov-kitabi-pays h3 { margin: 0 0 4px; }
.ov-kitabi-pays .ov-note { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.kp-table td small { display: block; color: var(--muted); font-size: 12px; }
.kp-table .kp-total td { font-weight: 800; border-top: 1.5px solid var(--line); }
.kp-table .kp-students td { color: var(--ink-2); }
.kp-h { margin: 16px 0 8px; font-size: 14.5px; }
.ov-card .kp-table th, .kp-table td:first-child { white-space: normal; }
.kp-table td:first-child { min-width: 8.5em; }
/* (money by book, 7 November 2026: the difference, Kitabi's, kept or paid) */
.kp-table td.kp-up { color: var(--ok-ink); font-weight: 700; }
.kp-table td.kp-down { color: var(--bad-ink); font-weight: 700; }

/* Admin → Problems (7 November 2026): what Kitabi noticed by itself, in three lists, each one a row with its tag, whose
   book and when, what was found, and its buttons beside it (under it on a phone); how many are new, on the tab */
.ad-tab-n { display: inline-block; min-width: 1.5em; padding: 0 6px; margin-inline-start: 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; line-height: 1.6; text-align: center; }
.ad-problems > .ov-note { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.ad-problems .pr-foot { margin: 14px 0 0; }
.pr-lists { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.pr-list { font: inherit; font-size: 14px; font-weight: 700; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; }
.pr-list[aria-selected="true"] { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.pr-body { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px; }
.pr-body > .ov-none, .pr-body > .sum-wait, .pr-body > .ad-bad { margin: 12px 0; }
.pr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 0; }
.pr-row + .pr-row { border-top: 1px solid var(--line); }
.pr-main p { margin: 0; }
.pr-head { font-size: 14.5px; line-height: 1.5; }
.pr-chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: var(--surface-3); color: var(--ink-2); margin-inline-end: 4px; }
.pr-failed .pr-chip, .pr-unpaid .pr-chip, .pr-below .pr-chip { background: var(--bad-soft); color: var(--bad-ink); }
.pr-price .pr-chip, .pr-slow .pr-chip, .pr-words .pr-chip, .pr-oddwords .pr-chip { background: var(--amber-soft-2); color: var(--amber-ink); }
.pr-who { color: var(--muted); font-size: 12.5px; margin: 2px 0 4px !important; }
.pr-what { font-size: 13.5px; color: var(--ink-2); }
.pr-board { margin-top: 6px; font-size: 13.5px; } /* (Wrong? on the whiteboard: the board's answer, in words) */
.pr-board summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.pr-board-from { margin: 6px 0 0; color: var(--muted); }
.pr-board-lines { margin: 6px 0 0; padding-inline-start: 22px; color: var(--ink-2); display: grid; gap: 2px; }
.pr-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pr-state { color: var(--muted); font-size: 13px; }
/* (a problem a student reported: someone's words, and whether the team may open the book, rule 4) */
.pr-reported .pr-chip { background: var(--cyan-soft); color: var(--cyan-ink); }
.pr-main .pr-open { margin-top: 4px; color: var(--ok-ink); font-size: 12.5px; font-weight: 600; }
.pr-main .pr-open.closed { color: var(--muted); font-weight: 500; }
@media (max-width: 640px) {
  .pr-row { grid-template-columns: 1fr; }
  .pr-acts { justify-content: flex-start; }
}
.ov-base { stroke: var(--line); stroke-width: 1; }
.ov-axis { fill: var(--muted); font-size: 12px; }
.ov-val { fill: var(--ink); font-size: 12.5px; font-weight: 700; }
.ov-table { margin-top: 6px; font-size: 13.5px; }
.ov-table summary { cursor: pointer; color: var(--brand); font-weight: 600; width: fit-content; }
.ov-card table, .ov-person-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ov-card th, .ov-card td, .ov-person-table th, .ov-person-table td { padding: 7px 8px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ov-card th, .ov-person-table th { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ov-card td, .ov-person-table td { font-variant-numeric: tabular-nums; }
.ov-scroll { overflow-x: auto; }
/* Admin → Overview: the questions students replaced (admin.js replacedCard): the old one struck through, the new under it */
.ov-replaced { margin-top: 16px; }
.ov-replaced .ov-note { margin: -4px 0 10px; color: var(--muted); font-size: 13px; }
.ov-replaced td { vertical-align: top; }
.ov-replaced td small { display: block; color: var(--muted); font-size: 12px; }
.ov-replaced td.ov-replaced-q { white-space: normal; min-width: 320px; }
.ov-replaced-q s, .ov-replaced-q span { display: block; }
.ov-replaced-q s { color: var(--muted); }
.ov-replaced-body > .btn { margin-top: 8px; }
.ov-models-list { display: grid; gap: 10px; }
.ov-model { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 4px 10px; align-items: center; }
.ov-model-name { font-weight: 700; font-size: 14px; }
.ov-track { height: 8px; border-radius: 99px; background: var(--brand-soft); overflow: hidden; }
.ov-track i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.ov-model-n { grid-column: 2; color: var(--ink-2); font-size: 12.5px; }
.ov-person { width: min(760px, 100%); }
.ov-who { margin: 0; color: var(--ink-2); font-size: 14px; }
.ov-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ov-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.ov-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-list li strong { font-variant-numeric: tabular-nums; }
.ov-list li time { color: var(--muted); }

/* Overview: what needs the owner (each with a dot by kind and words that say it), and the reader's low-credit warnings */
.ov-alerts { margin: 14px 0 0; padding: 14px 16px; border: 1px solid var(--amber-line); border-radius: 16px; background: var(--amber-soft); }
.ov-alerts.ok { border-color: var(--ok-line); background: var(--ok-soft); }
.ov-alerts.ok p { margin: 0; color: var(--ok-ink); font-weight: 600; font-size: 14px; }
.ov-alerts h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; color: var(--amber-ink); }
.ov-alerts h3 .count { padding: 1px 8px; border-radius: 999px; background: var(--amber-2); color: #fff; font-size: 12px; }
.ov-alerts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ov-alerts li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface); font-size: 14px; }
.al-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.al-out .al-dot, .al-failed .al-dot { background: var(--bad); }
.al-low .al-dot { background: var(--amber-2); }
.al-heavy .al-dot { background: var(--orange); }
.al-order .al-dot { background: var(--brand); }
.al-text { flex: 1; min-width: 200px; color: var(--ink); }
.al-acts { display: flex; gap: 6px; }
.account-menu button.am-low svg, .account-menu button.am-low .am-value { color: var(--amber-ink); font-weight: 700; }
.msg.credit-low .msg-body { display: grid; gap: 8px; }
.credit-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.credit-done { color: var(--ok-ink); font-weight: 600; }
.cr-warn { margin-bottom: 16px; padding: 14px 18px; border: 1px solid var(--amber-line); border-radius: 16px; background: var(--amber-soft); color: var(--amber-ink); }
.cr-warn strong { display: block; font-size: 16px; }
.cr-warn p { margin: 4px 0 0; font-size: 14.5px; }
.cr-contact { color: var(--brand-ink); font-weight: 600; }
.ad-contact { display: grid; gap: 5px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.ad-contact small, .ad-credit-fields small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.ad-people-books { margin-top: 36px; }
/* Admin → Books → Most added books (8 November 2026): each book once (the same file), with its cover, how many added it
   and Who added it; on a phone the count and the button go under the name */
.ad-most { margin-top: 36px; }
.ad-most-list { display: grid; gap: 8px; }
.ad-most-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 8px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ad-most-cover { width: 44px; height: 58px; object-fit: cover; border-radius: 4px; box-shadow: 0 2px 6px rgb(var(--shade) / .18); }
.ad-most-text { display: grid; gap: 2px; min-width: 0; }
.ad-most-text strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ad-most-n { font-weight: 700; color: var(--brand-ink); white-space: nowrap; }
@media (max-width: 560px) {
  .ad-most-item { grid-template-columns: 44px minmax(0, 1fr); }
  .ad-most-cover { grid-row: span 3; }
  .ad-most-n, .ad-most-item > .btn { grid-column: 2; justify-self: start; }
}
.ad-same { padding: 0; border: 0; background: none; color: var(--brand-ink); font: inherit; text-decoration: underline; cursor: pointer; }
.ad-admin-tag { color: var(--muted); font-size: 12px; font-weight: 600; }

/* ---- No top bar is wider than a phone's screen (13 November 2026: MISTAKES.md numbers 326, 327, 348 and 317, and
   Admin's bar). Every bar was measured at 320, 344, 360, 375 and 390 wide, in English and Arabic, a book's with its
   page box saying "119 / 217": a book of few pages had hidden how full that bar is (22px too wide at 360 and 17 at 390
   with a real book's name in it). One order for every bar: its things come closer together; on the narrowest phones the
   bell is the account menu's first line, with a dot on the picture (as a book's bar has had it from 480 down); and a
   book's page box is cut with … before anything leaves the screen (the rule by .pg-short above). ---- */
/* a phone's reader, whose top bar is full: everything a little tighter */
@media (max-width: 480px) {
  .book-reader .topbar { gap: 3px; padding: 0 6px; }
  .book-reader .back { padding: 6px 4px; }
  .book-reader .topbar .icon-btn, .book-reader .pager .icon-btn { width: 30px; height: 30px; }
  .book-reader #lang button { padding-inline: 9px; }
  /* (a parent in their child's book has the way back, with the child's picture, where a reader has ☰: 30px more. The
     zoom buttons give way there: two fingers zoom a phone's page as before) */
  body.following .topbar .zoom { display: none; }
  /* (the whiteboard's bar as close together as Home's on a phone: at 390 its name had a sliver of room, one cut letter) */
  .board-page .topbar { gap: 8px; padding-inline: 12px; }
}
/* an ordinary phone and smaller (it was from 380 down: with a real book's page name the bar needs it at 390 too):
   tighter still, so the bar's end (the avatar) isn't pushed off the screen */
@media (max-width: 430px) {
  .book-reader .topbar { gap: 2px; padding: 0 4px; }
  .book-reader .pager, .book-reader .zoom { gap: 0; }
  .book-reader .pager { padding-inline: 1px; }
  .book-reader .topbar .icon-btn, .book-reader .pager .icon-btn { width: 28px; }
  .book-reader #lang button { padding-inline: 8px; }
}
/* the smallest phones (360 or 375 wide): the last few pixels, so "119 / 217" shows whole at 360, in Arabic too */
@media (max-width: 380px) {
  .book-reader .topbar .icon-btn, .book-reader .pager .icon-btn { width: 26px; }
  .book-reader .topbar .topfind.compact { width: 28px; }
  .book-reader .pg-short { padding-inline: 2px 0; font-size: 13px; }
  .book-reader #lang button { padding-inline: 6px; }
  /* every other page's bar: closer together, its language buttons as a book's */
  body:not(.book-reader) .topbar { gap: 6px; padding-inline: 8px; }
  .top-right { gap: 6px; }
  body:not(.book-reader) .topbar .site-langs button { padding-inline: 8px; }
}
/* narrower than that (an old small phone at 320, a folding phone closed at 344): a book's zoom buttons give way for
   everyone, and for a parent the search too (it finds the parent's own things, not the child's book) */
@media (max-width: 350px) {
  .book-reader .topbar .zoom { display: none; }
  body.following .topbar .topfind { display: none; }
}
/* a phone's tutor header: a little tighter, so which AI answers fits under the name */
.tutor-model .tm-short { display: none; }
@media (max-width: 480px) {
  .tutor-head { gap: 4px; padding: 10px 8px 10px 12px; }
  .tutor-head .avatar { width: 34px; height: 34px; }
  .tutor-head .icon-btn { width: 32px; height: 32px; }
  .tutor-model .tm-full { display: none; }
  .tutor-model .tm-short { display: inline; }
}

/* A new quiz: the kinds of question (ticked) and how many; then a heading for each kind when they're mixed,
   true or false side by side, a written answer's box and its mark (partly right in amber) */
.qs-form { display: grid; gap: 18px; }
.qs-form fieldset { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.qs-form legend { margin-bottom: 8px; padding: 0; font-weight: 700; color: var(--ink); }
.qs-kind { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.qs-kind:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.qs-kind input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }
.qs-kind > span { display: grid; gap: 2px; }
.qs-kind small { color: var(--muted); font-size: 13px; }
.qs-counts { display: flex; flex-wrap: wrap; gap: 8px; }
/* "Pages I choose": from one page to another */
.qs-range { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.qs-range label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); }
.qs-range select { min-width: 120px; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.qs-range select:focus { border-color: var(--brand); outline: none; }
.qs-counts label { position: relative; }
.qs-counts input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.qs-counts span { display: inline-grid; place-items: center; min-width: 48px; padding: 6px 13px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 700; } /* (a little smaller: the owner found them large) */
.qs-counts input:checked + span { border-color: var(--brand); background: var(--brand); color: #fff; }
.qs-counts input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
/* a practice exam's own number of questions or minutes, typed in a box shaped like the choices (picked: like them) */
.qs-counts .ex-own { display: inline-flex; align-items: center; gap: 4px; padding: 0 12px 0 2px; border: 1.5px dashed var(--line); border-radius: 999px; color: var(--muted); font-weight: 600; }
.qs-counts .ex-own input { position: static; opacity: 1; width: 64px; padding: 6px 8px; font-size: 14px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink); text-align: center; cursor: text; -moz-appearance: textfield; }
.qs-counts .ex-own input::-webkit-inner-spin-button, .qs-counts .ex-own input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qs-counts .ex-own input:focus { outline: none; }
.qs-counts .ex-own:focus-within { border-style: solid; border-color: var(--brand); }
.qs-counts .ex-own.on { border-style: solid; border-color: var(--brand); background: var(--brand); color: #fff; }
.qs-counts .ex-own.on input { color: #fff; }
.qs-counts .ex-own:not(:has(span)) { padding-inline-end: 4px; }
.qs-counts .ex-own span { display: inline; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font-weight: 600; } /* ("min" after it: not a choice of its own) */
.qs-error { margin: 0; color: var(--bad); font-weight: 600; }
.quiz-section { margin: 8px 0 -6px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
:lang(ar) .quiz-section { letter-spacing: 0; text-transform: none; font-size: 14px; }
.opts.tf { grid-template-columns: 1fr 1fr; }
.opts.tf .opt { justify-content: center; font-weight: 700; }
.quiz-q.partly { border-inline-start: 5px solid var(--amber); }
.feedback.mid { background: var(--amber-soft); color: var(--amber-ink); }
.qw-answer { width: 100%; min-height: 78px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; resize: vertical; }
/* a practice exam paper's Download: a small list under it (Word, PDF), like the tutor's export list */
.ex-dl { position: relative; display: inline-flex; }
.ex-caret { margin-inline-start: 2px; font-size: 11px; opacity: .7; }
.ex-dl-menu { top: calc(100% + 6px); inset-inline-start: 0; inset-inline-end: auto; min-width: 250px; }
.ex-dl-menu button { display: flex; align-items: flex-start; gap: 10px; }
.ex-dl-menu button svg { flex: none; margin-top: 1px; }
.ex-dl-menu button small { display: block; margin-top: 2px; color: var(--muted); font-weight: 500; font-size: 12.5px; }
/* handing in a practice exam with questions left: their numbers, each a way back to it, lit for a moment */
.ex-left-modal { width: min(460px, 100%); }
.ex-left-text { margin: 0 0 12px; color: var(--muted); }
.ex-left-nums { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ex-left-num { min-width: 46px; height: 42px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--brand); font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.ex-left-num:hover { border-color: var(--brand); background: var(--brand-soft); }
.quiz-q.ex-flash { animation: ex-flash 1.8s ease-out; }
@keyframes ex-flash { 0%, 45% { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-line); } 100% { box-shadow: 0 0 0 0 transparent; } }
/* a practice exam's essays: the setup's note, a bigger box to write in, how many words, the mark's parts, the key ideas */
.ex-essays-text { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.qe-answer { min-height: 220px; }
.qe-words { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; text-align: end; }
.feedback .qe-parts { display: block; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.qe-points { margin: 4px 0 0; padding-inline-start: 20px; font-size: 13.5px; }
.qw-answer:focus { outline: none; border-color: var(--brand-mid); }
.qw-answer[readonly] { background: var(--surface-2); }
.qw-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.qw-wait { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; }
.qw-error { margin: 0; color: var(--bad); font-size: 13.5px; }
.qw-model { flex-basis: 100%; }
.qr-grade { margin: 0; font-weight: 700; color: var(--brand-ink); }

/* The upload screen's tick box (their own copy, or the right to use it) */
.ab-rights { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.ab-rights:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.ab-rights input { flex: none; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--brand); }
.ab-rights a { color: var(--brand); font-weight: 600; }
/* A book Kitabi removed: when and why, until its reader takes it out */
.removed-book { border: 1.5px dashed var(--bad-line); background: var(--bad-faint); }
.removed-book .rm-when { color: var(--bad); font-weight: 600; }
.removed-book .rm-why, .removed-book .rm-note, .removed-book .rm-ask { margin: 8px 0 0; color: var(--ink-2); font-size: 14.5px; }
.removed-book .rm-note { font-style: italic; }
.removed-book .pr-btns { margin-top: 12px; }
/* (since 10 November 2026, the owner's design: a card like the others, a plain picture saying Removed where its cover was,
   Your work in this book, and Think this is a mistake?) */
.removed-book .rm-lines > :first-child { margin-top: 0; }
.removed-book .rm-until { margin: 8px 0 12px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.removed-book .rm-mistake { margin: 10px 0 0; font-size: 14px; }
.removed-book .rm-mistake a { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.rm-cover { box-shadow: none; }
.rm-paper { display: grid; place-items: center; align-content: center; gap: 8px; aspect-ratio: 3 / 4; padding: 10px; border: 1.5px dashed var(--bad-line); border-radius: 6px; background: var(--surface); color: var(--bad); font-weight: 700; font-size: 15px; text-align: center; }
#books.grid .with-cover.removed-book { grid-template: "pill tools" auto "cover cover" auto "name name" auto "lines lines" 1fr "go go" auto "mistake mistake" auto / minmax(0, 1fr) auto; }
#books.grid .removed-book .rm-lines { grid-area: lines; }
#books.grid .removed-book .rm-lines p { font-size: 13.5px; }
#books.grid .removed-book .rm-until { margin-bottom: 0; }
#books.grid .removed-book .rm-mistake { grid-area: mistake; margin: 0; font-size: 13.5px; }
/* Admin: removing a book, and reading a report */
.rm-form { display: grid; gap: 14px; }
.rm-form fieldset { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.rm-form legend { margin-bottom: 6px; padding: 0; font-weight: 700; }
.rm-choice { display: flex; align-items: flex-start; gap: 8px; font-size: 14.5px; cursor: pointer; }
.rm-choice input { margin-top: 3px; accent-color: var(--bad); }
.rm-note-field { display: grid; gap: 5px; font-weight: 600; font-size: 14px; }
.rm-note-field textarea { padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; font-weight: 400; resize: vertical; }
.rm-note-field small { color: var(--muted); font-weight: 500; }
.btn.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.btn-danger:hover { filter: brightness(.95); }
.al-report .al-dot { background: var(--violet); }
.rp-details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; }
.rp-details dt { color: var(--muted); font-weight: 600; font-size: 13.5px; }
.rp-details dd { margin: 0; overflow-wrap: anywhere; }
/* a forgotten password: check it's really them first */
.al-pass-check { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); border: 1px solid var(--amber-line); color: var(--amber-ink); font-size: 13.5px; line-height: 1.45; }
.rp-details a { color: var(--brand); font-weight: 600; }
.rp-message { white-space: pre-wrap; }
/* The terms of use, with the form to report a book (open without an account) */
.terms { max-width: 760px; margin: 0 auto; padding: 28px 20px 60px; }
.terms h1 { margin: 0 0 8px; font-size: 30px; }
.tm-lead { margin: 0 0 22px; color: var(--ink-2); font-size: 16.5px; }
.tm-updated { margin: -14px 0 22px; color: var(--muted); font-size: 13.5px; }
.tm-sec { margin-bottom: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.tm-sec h2 { margin: 0 0 6px; font-size: 18px; }
.tm-sec > p { margin: 0; color: var(--ink-2); line-height: 1.6; }
.tm-form { margin-top: 14px; }
.tm-fields textarea { width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; resize: vertical; }
.tm-fields textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgb(var(--brand-rgb) / .12); }
.tm-fields small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.ct-pass-hint { margin: -6px 0 0; color: var(--muted); font-size: 13.5px; } /* (I forgot my password: what happens next) */
.wl-forgot { color: var(--brand); font-weight: 600; text-decoration: none; }
.wl-forgot:hover { text-decoration: underline; }
.tm-sent { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--ok-soft); color: var(--ok-ink); font-weight: 600; }
.wl-terms { margin: 10px 0 0; text-align: center; font-size: 13.5px; }
.wl-terms a { color: var(--muted); text-decoration: underline; }
.rm-copies { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad-ink); font-size: 13.5px; }
.rm-copies[hidden] { display: none; }
/* The Contact page (and its link from the terms of use) */
.ct-direct { margin: -10px 0 18px; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.ct-more { margin: 4px 0 0; text-align: center; }
.ct-more a { color: var(--brand); font-weight: 600; }
.tm-fields select { padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; background: var(--surface); }
/* Contact us: two boxes a row (name and topic, then email and phone), one under the other on a phone; the topic's
   arrow a little in from the edge, as in Admin */
.ct-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 600px) { .ct-row { grid-template-columns: minmax(0, 1fr); } }
.ct-reach { display: grid; gap: 6px; }
.ct-row select {
  width: 100%; padding: 13px 40px 13px 14px; border-color: var(--line); font-weight: 500; color: var(--ink); cursor: pointer; -webkit-appearance: none; appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%2364748b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.ct-row select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgb(var(--brand-rgb) / .12); }
[dir="rtl"] .ct-row select { padding: 13px 14px 13px 40px; background-position: left 14px center; }
/* Contact us, a problem with a book: which one and its page; choosing your own says what it lets Kitabi's team do */
.ct-book { display: grid; gap: 8px; }
.ct-book[hidden], .ct-book-note[hidden] { display: none; }
.ct-book input:disabled { opacity: .5; cursor: not-allowed; }
/* (the book's own direction, so its name shows from its start; the arrow stays on the page's side) */
.ct-book select[dir] { text-align: start; }
.ct-book-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); font-size: 13.5px; line-height: 1.55; }
.al-contact .al-dot { background: var(--cyan); }
/* The monthly plan in a person's Details, and books used on the Credit page */
.pd-plan { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 12px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.pd-plan-main { display: grid; gap: 2px; min-width: 0; flex: 1 1 260px; }
.pd-plan-main strong { font-size: 15px; }
.pd-plan-when, .pd-plan-books { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.pd-plan-about { color: var(--muted); font-size: 12.5px; }
.pd-plan-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-plan-acts[hidden], .pd-plan-form[hidden] { display: none; }
.pd-plan-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 10px; flex: 1 1 100%; }
.pd-plan-form label { display: grid; gap: 3px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pd-plan-form input { font: inherit; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.pd-plan-btns { display: flex; gap: 6px; }
.pd-plan-form .ad-bad { flex: 1 1 100%; margin: 0; }
.cr-books { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; font-weight: 600; }
/* Choosing the currency (the Credit page), and the admin's prices in other currencies */
.cr-more-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.cr-currency { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); font-size: 14px; }
.cr-currency select { padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; background: var(--surface); color: var(--ink); }
.ad-add-currency { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 10px; }
.ad-add-currency select { padding: 7px 34px 7px 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; color: var(--ink); }
/* (the Admin's smaller boxes: their own arrow, a little in from the edge, like the Accounts' Show box) */
:is(.ad-add-currency, .ad-ai-standard, .bin-keep) select {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%2364748b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
}
[dir="rtl"] :is(.ad-add-currency, .ad-ai-standard, .bin-keep) select { padding-right: 12px; padding-left: 34px; background-position: left 12px center; }
.ad-add-currency small { color: var(--muted); font-size: 12.5px; }
.ad-price-grid b .ad-link { margin-inline-start: 4px; color: var(--bad); font-size: 15px; }
/* The translation panel beside the page (it follows the reader from page to page) */
.tp-panel { position: fixed; z-index: 34; inset-inline-start: 16px; bottom: 90px; width: min(420px, calc(100vw - 32px)); max-height: min(62vh, 560px); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 18px 50px rgb(var(--shade) / .22); }
.tp-head { display: flex; align-items: center; gap: 4px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
[dir="rtl"] .tp-head { padding: 10px 16px 10px 10px; }
.tp-head strong { flex: 1; min-width: 0; font-size: 14.5px; }
.tp-body { padding: 12px 16px; overflow-y: auto; }
.tp-text p { margin: 0 0 10px; line-height: 1.7; font-size: 15.5px; color: var(--ink); }
.tp-text[lang="ar"] p { font-size: 16.5px; line-height: 1.9; }
.tp-note { margin: 0; padding: 8px 16px 12px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .tp-panel { inset-inline: 8px; width: auto; bottom: 76px; max-height: 46vh; } }
/* Translate's menu over its button: this page, the whole book, or pages I choose (pagetranslate.js openMenu) */
.tp-menu { position: fixed; z-index: 60; display: grid; gap: 10px; width: min(360px, calc(100vw - 16px)); padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop2 .15s ease-out; }
.tp-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
/* the translation being made on the server for this book (or the last one), at the menu's top: Show opens it */
.tp-job { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--ink-2); font: 600 13px/1.35 var(--font); text-align: start; cursor: pointer; }
.tp-job.ready { border-color: var(--ok-line); background: var(--ok-faint); }
.tp-job-state { flex: 1; min-width: 0; }
.tp-job-show { flex: none; color: var(--brand); font-weight: 700; }
.tp-job:hover { border-color: var(--brand); }
.tp-run-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.tp-run-error a { color: inherit; font-weight: 700; }
.tp-choices button { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 12px 6px 10px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink-2); font: 600 13px/1.25 var(--font); text-align: center; cursor: pointer; }
.tp-choices button svg { color: var(--brand); }
.tp-choices button small { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.tp-choices button:hover, .tp-choices button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.tp-range { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 2px 2px 0; }
.tp-range .qs-range { flex: 1 1 auto; gap: 8px 12px; }
.tp-range .qs-range select { min-width: 92px; padding: 7px 8px; }
.tp-range .btn:disabled { opacity: .45; cursor: default; } /* (as the windows' buttons: more pages than it takes) */
.tp-range-warn { flex: 1 0 100%; margin: 0; font-size: 13px; line-height: 1.45; color: var(--bad); } /* (more pages than one translation takes) */
/* many pages being translated: how far it's got, under the panel's title */
.tp-run { display: grid; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tp-run-row { display: flex; align-items: center; gap: 10px; }
.tp-run-state { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.tp-run-error { margin: 0; font-size: 13px; color: var(--bad); }
/* Export: which pages, as what, how it looks */
.ex-what { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: 14.5px; } /* (what's exported: the pages and look chosen at the start) */
.ex-pages .qs-range { margin-top: 6px; }
.ex-pages label[for] { cursor: pointer; }
.ex-form .qs-kind > span > small, .ex-form .qs-kind > span > label + .qs-range { display: flex; }
/* Translate's window for many pages (pagetranslate.js #ask): how they want it, then what it will take */
.tp-form .tp-cost { display: grid; gap: 8px; min-height: 44px; }
.tp-cost-rows { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tp-cost-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 14px; font-size: 14px; }
.tp-cost-rows > div + div { border-top: 1px solid var(--line); }
.tp-cost-rows dt { color: var(--ink-2); }
.tp-cost-rows dd { margin: 0; font-weight: 600; color: var(--ink); text-align: end; }
.tp-cost-rows .tp-cost-main { background: var(--brand-soft); }
.tp-cost-rows .tp-cost-main :is(dt, dd) { color: var(--brand-ink); font-weight: 700; }
.tp-cost-note, .tp-cost-warn, .tp-cost-wait { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.tp-cost-warn { font-size: 13.5px; color: var(--bad); }
.tp-cost-warn a { color: inherit; font-weight: 700; }
.tp-cost-wait { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tp-choices button small.tp-this-cost:empty { display: none; }
/* a PDF like the book in parts: a button for each, ✓ once it's been made (the panel, the Export window) */
.tp-parts-box { display: grid; gap: 12px; }
.tp-parts-note { margin: 0; font-size: 13px; color: var(--ink-2); }
.tp-parts { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-parts .btn.done::before { content: "✓"; margin-inline-end: 6px; color: var(--ok); }
/* the translation like the book (tpexport.js): each page's picture, its words covered, the translation in their place */
.lb-page { position: relative; container-type: inline-size; aspect-ratio: var(--w) / var(--h); } /* (its shape before its picture has come: each translation is fitted to it then) */
.lb-page img { display: block; width: 100%; height: auto; }
.lb-cover { position: absolute; display: block; }
.lb-text { position: absolute; overflow: hidden; line-height: 1.25; font-family: var(--font); overflow-wrap: anywhere; }
.lb-text b { font-weight: 700; }
.lb-stage { position: fixed; left: -10000px; top: 0; width: 800px; visibility: hidden; pointer-events: none; }
@media print {
  #print-sheet .lb-page { width: 100%; max-width: calc(95vh * var(--w) / var(--h)); margin: 0 auto; break-after: page; }
  #print-sheet .lb-page:last-child { break-after: auto; }
  #print-sheet .lb-text { overflow: visible; }
  #print-sheet .ex-page { break-inside: auto; }
}
.ad-price-grid { overflow-x: auto; padding-bottom: 4px; }
@media (max-width: 520px) { .rp-details { grid-template-columns: minmax(0, 1fr); gap: 2px; } .rp-details dd { margin-bottom: 8px; } }
/* The tutor's quick prompts: the ✦ at the top drops down a list of them */
.tutor-head .quick-btn { color: var(--brand); }
/* the menu over the tutor's 🔊: every answer read aloud or not, and the voice */
.voice-menu { position: absolute; z-index: 30; width: min(270px, calc(100% - 24px)); display: grid; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop2 .15s ease-out; }
.voice-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; font-size: 14px; text-align: start; cursor: pointer; }
.voice-menu button:hover, .voice-menu button:focus-visible { background: var(--surface-2); outline: none; }
.vm-read { justify-content: space-between; font-weight: 600; }
.vm-switch { flex: none; position: relative; width: 36px; height: 21px; border-radius: 999px; background: var(--line-2); transition: background .15s; }
.vm-switch::after { content: ""; position: absolute; top: 2.5px; inset-inline-start: 2.5px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(var(--shade) / .3); transition: inset-inline-start .15s; }
.vm-read[aria-checked="true"] .vm-switch { background: var(--brand); }
.vm-read[aria-checked="true"] .vm-switch::after { inset-inline-start: 17.5px; }
.vm-title { margin: 6px 4px 2px; padding: 8px 6px 0; border-top: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
:lang(ar) .vm-title { letter-spacing: 0; text-transform: none; font-size: 13px; }
.vm-voice svg { flex: none; color: var(--brand); visibility: hidden; }
.vm-sep { margin: 3px 6px; border: 0; border-top: 1px solid var(--line); } /* (between the natural voices', the balanced voices' and the computer's voices) */
/* each company's voices under a heading: "Best · uses more credit", "Balanced · uses less credit", "Free" */
.vm-group { display: grid; gap: 2px; }
.vm-group-name { margin: 4px 10px 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.vm-group-name b { font-weight: 700; color: var(--ink-2); }
:lang(ar) .vm-group-name { font-size: 13px; }
.vm-voice[aria-checked="true"] { color: var(--brand-ink); font-weight: 600; }
.vm-voice[aria-checked="true"] svg { visibility: visible; }
.composer .speak-toggle.open { box-shadow: 0 0 0 2px var(--brand); }
.tutor-head .quick-btn[hidden] { display: none; }
.quick-menu { position: absolute; z-index: 30; grid-template-columns: minmax(0, 1fr); width: min(300px, calc(100% - 24px)); max-height: min(460px, calc(100% - 150px)); overflow-y: auto; display: grid; align-content: start; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop2 .15s ease-out; }
.quick-menu-title { margin: 6px 10px 4px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
:lang(ar) .quick-menu-title { letter-spacing: 0; text-transform: none; font-size: 13px; }
.quick-menu [role="menuitem"] { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 600; line-height: 1.35; text-align: start; cursor: pointer; }
.quick-menu [role="menuitem"] svg { flex: none; margin-top: 2px; color: var(--brand); }
.quick-menu [role="menuitem"]:hover, .quick-menu [role="menuitem"]:focus-visible { background: var(--brand-soft); color: var(--brand-ink); outline: none; }
/* the reader's own prompts: + by the title writes one, each has a × */
.quick-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-inline-end: 2px; }
.quick-menu-tools { display: flex; align-items: center; gap: 2px; }
/* the prompts' language: "ع" or "EN" */
.quick-lang { min-width: 34px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font: 700 12px/1 system-ui, sans-serif; letter-spacing: .02em; }
.quick-lang:lang(ar) { font-size: 16px; }
.quick-lang:hover { background: var(--brand-soft-2); }
.quick-add { width: 30px; height: 30px; color: var(--brand); }
.quick-add:disabled { opacity: .4; cursor: default; }
.quick-new { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 2px 4px 8px; }
.quick-new textarea { width: 100%; min-height: 56px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; line-height: 1.4; resize: none; }
.quick-new textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.quick-new-acts { display: flex; justify-content: flex-end; gap: 6px; }
.quick-mine { display: flex; align-items: flex-start; }
.quick-mine [role="menuitem"] { flex: 1; min-width: 0; }
.quick-mine [role="menuitem"] svg { color: var(--violet); }
.quick-edit, .quick-drop { flex: none; width: 28px; height: 28px; margin-top: 4px; color: var(--muted); opacity: .7; }
.quick-edit:hover { opacity: 1; color: var(--brand); background: var(--brand-soft); }
.quick-drop:hover { opacity: 1; color: var(--bad); background: var(--bad-soft); }
.quick-line { height: 1px; margin: 4px 8px; background: var(--line); }
/* every answer read aloud, or not: beside the mic */
.composer .speak-toggle { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.composer .speak-toggle:hover { background: var(--surface-3); color: var(--ink-2); }
.composer .speak-toggle.on { background: var(--brand-soft); color: var(--brand); }
.composer .speak-toggle.on:hover { background: var(--brand-soft-2); }
/* the tutor's language beside the mic: "ع" or "EN" */
.composer .lang-toggle { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font: 700 14px/1 system-ui, sans-serif; letter-spacing: .02em; }
.composer .lang-toggle:lang(ar) { font-size: 18px; }
.composer .lang-toggle:hover { background: var(--brand-soft-2); }
.composer .speak-toggle svg { width: 19px; height: 19px; }

/* ---- The menu on the left (nav.js): beside the page on a computer, folded to icons with a tap; over the page
   from ☰ on a phone. In the reader (a computer) it starts with "This book": contents, bookmarks, notebook. */
body.has-nav { --nav-w: 232px; padding-inline-start: var(--nav-w); }
body.has-nav.nav-folded { --nav-w: 68px; }
.has-nav .topbar { margin-inline-start: calc(-1 * var(--nav-w)); }
.side-nav { position: fixed; z-index: 28; top: var(--topbar); bottom: 0; inset-inline-start: 0; width: var(--nav-w); display: flex; flex-direction: column; gap: 4px; padding: 12px 10px; border-inline-end: 1px solid var(--line); background: var(--surface); overflow: hidden auto; }
.sn-items { display: flex; flex-direction: column; gap: 2px; }
.sn-book, .sn-places, .sn-group { padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--line); } /* (This book; the places to read and study; a parent's My children; each before the next group) */
.sn-book:last-child { border-bottom: 0; } /* (in a book, This book comes last, under Home) */
.sn-line { margin: 6px 0 8px; border: 0; border-top: 1px solid var(--line); } /* (a line inside This book, as between the groups: Book summary after its own, the owner's wish, 10 November 2026) */
.sn-title { margin: 4px 12px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
:lang(ar) .sn-title { letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.nav-folded .sn-title { display: none; }
.sn-head { padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.sn-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; color: var(--ink-2); font: 600 14.5px/1.2 var(--font); text-align: start; text-decoration: none; white-space: nowrap; cursor: pointer; }
.sn-item svg { flex: none; }
.sn-item:hover { background: var(--surface-2); color: var(--ink); }
.sn-item.on { background: var(--brand-soft); color: var(--brand-ink); }
[dir="rtl"] .sn-fold svg, .nav-folded .sn-fold svg { transform: scaleX(-1); }
[dir="rtl"] .nav-folded .sn-fold svg { transform: none; } /* (folded, its arrow points the way the menu opens) */
.sn-fold { color: var(--muted); font-weight: 500; }
.nav-folded .sn-label { display: none; }
.nav-folded .sn-item { justify-content: center; padding-inline: 0; }
/* Study's cards due: after its name, or on its icon's corner when the menu is folded */
.sn-item { position: relative; }
.sn-badge { margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }
.nav-folded .sn-badge { position: absolute; top: 4px; inset-inline-end: 8px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
.sn-open, .sn-shade { display: none; }
/* on a computer the book's contents and notebook are in the menu on the left, not the tool bar under the page */
@media (min-width: 1001px) { .has-nav #sb-contents, .has-nav #sb-summary, .has-nav #sb-notebook, .has-nav #sb-study, .has-nav #sb-from { display: none; } }
/* the book's contents (the reader): its parts under their modules, the one open now with its sections */
.ct-list { display: grid; gap: 6px; }
.ct-module { margin: 14px 4px 2px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ct-module:first-child { margin-top: 0; }
:lang(ar) .ct-module { letter-spacing: 0; text-transform: none; font-size: 13px; }
/* each part in a light colour of its own (.tint-N, in turn), the one open now outlined in its colour */
.ct-part { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--tint-line, var(--line)); border-radius: 12px; background: var(--tint, var(--surface)); color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.ct-part:hover { border-color: var(--tint-ink, var(--brand)); }
.ct-part.on { border-color: var(--tint-ink, var(--brand)); box-shadow: inset 0 0 0 1px var(--tint-ink, var(--brand)); }
.ct-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ct-text strong { font-size: 14.5px; }
.ct-text small { color: var(--muted); font-size: 12.5px; }
.ct-part svg { flex: none; color: var(--ok); }
.ct-sections { display: grid; gap: 2px; margin: 0 0 4px 14px; padding-inline-start: 10px; border-inline-start: 2px solid var(--tint-line, var(--brand-line)); }
[dir="rtl"] .ct-sections { margin: 0 14px 4px 0; }
.ct-section { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font: inherit; font-size: 13.5px; text-align: start; cursor: pointer; }
.ct-section:hover { background: var(--surface-2); color: var(--brand-ink); }
.ct-section span { flex: 1; }
.ct-section small { flex: none; color: var(--muted); }
.ct-section.on { color: var(--brand-ink); font-weight: 700; }
/* a part's sections open and shut with the arrow at its end; Open all and Close all in the top row, beside its ×
   (book.js: openContents) */
.ct-all { gap: 4px; padding-inline: 9px 11px; color: var(--ink-2); }
.ct-all:disabled { opacity: .4; cursor: default; }
.ct-part-wrap { position: relative; }
.ct-part-wrap .ct-part { padding-inline-end: 54px; }
.ct-fold { position: absolute; top: 50%; inset-inline-end: 8px; transform: translateY(-50%); border-radius: 10px; color: var(--tint-ink, var(--ink-2)); }
.ct-fold:hover { background: rgb(var(--glass) / .75); }
.ct-sections[hidden] { display: none; }
.has-nav .tp-panel { inset-inline-start: calc(var(--nav-w) + 16px); bottom: 20px; }
@media (max-width: 1000px) {
  body.has-nav, body.has-nav.nav-folded { --nav-w: 0px; padding-inline-start: 0; }
  .side-nav { top: 0; z-index: 70; width: min(280px, 84vw); transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  [dir="rtl"] .side-nav { transform: translateX(105%); }
  .side-nav.open { transform: none; }
  .nav-folded .side-nav .sn-label { display: inline; }
  .nav-folded .side-nav .sn-item { justify-content: flex-start; padding-inline: 12px; }
  .sn-head { display: none; }
  .sn-open { display: inline-grid; flex: none; }
  .sn-shade.open { display: block; position: fixed; inset: 0; z-index: 65; background: rgb(15 23 42 / .35); }
  /* (the book page has the menu too, ☰ first, in the place of the arrow back to the Library: the menu's Home goes there; the
     owner's report, 10 November 2026, "on the mobile version there is no icon where I click to show it": MISTAKES 192. A
     parent in their child's book keeps the child's picture there instead, as before: it's their only sign whose book it is) */
  body.book-reader:not(.following) .topbar .back { display: none; }
  body.book-reader.following .side-nav, body.book-reader.following .sn-open, body.book-reader.following .sn-shade.open { display: none; }
  .has-nav .tp-panel { inset-inline-start: 8px; bottom: 76px; }
}
/* My notebook for all the books (notebookhub.js): the book to show and Print, the notebook's tabs, then each book
   with its things page by page */
.nbh-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.nbh-pick { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; color: var(--ink-2); }
/* (its own arrow, a little in from the edge, as Safari's and Chrome's put theirs right against it; on the left in Arabic) */
.nbh-pick select {
  max-width: min(360px, 62vw); padding: 8px 10px; padding-inline-end: 38px; border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink); font: inherit;
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 12px 8px;
}
[dir="rtl"] .nbh-pick select { background-position: left 14px center; }
.nbh-pick select:focus { outline: none; border-color: var(--brand); }
.nbh .nb-tabs { position: static; margin: 0 0 10px; padding: 0 0 8px; background: none; }
.nbh-filters { margin-bottom: 14px; }
.nbh-books { display: grid; gap: 16px; }
.nbh-book { display: grid; gap: 8px; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.nbh-head { display: flex; align-items: center; gap: 12px; }
.nbh-head > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.nbh-head h2 { margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbh-head small { color: var(--muted); font-size: 13px; }
.nbh-cover img { display: block; width: 42px; border-radius: 4px; box-shadow: 0 4px 10px rgb(var(--shade) / .2); }
.nbh .nb-page, a.nb-act { text-decoration: none; }
.nbh-none { display: grid; gap: 12px; justify-items: start; }
.nbh-none p { margin: 0; }

/* The Quizzes and flashcards page: a row for each book's cards, and for each quiz */
.sh-list { display: grid; gap: 8px; margin-top: 10px; }
.sh-book + .sh-book { margin-top: 18px; } /* (a book's quizzes under its name) */
.sh-book h3 { margin: 12px 0 0; font-size: 15px; color: var(--ink-2); }
.sh-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sh-what { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sh-what strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-what small { color: var(--muted); font-size: 13px; }
.sh-empty { margin: 8px 0 0; color: var(--muted); }
/* the Practice page (studyhub.js): tabs like a book's Practice, a Book list and a list-or-side-by-side switch, each
   book's under its cover; a coloured label for where each stands; 🗑 to delete (askSure: .sure-modal) */
.sh-tabs { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 0 12px; }
.sh-tabs .pr-tab { font-size: 13.5px; padding: 10px 4px 9px; }
.sh-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sh-pick { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; color: var(--ink-2); font-weight: 600; font-size: 14px; } /* (no wider than its row: it was, by 22px on a 320-wide phone, number 317) */
.sh-pick select { min-width: 0; max-width: 280px; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; }
/* The drop-downs that had the browser's own arrow, close to the edge: Kitabi's arrow, a little in from it, as My
   notebook's Book box has (6 November 2026, the owner's wish): Practice's Book, a range's From and To, the currency */
:is(.sh-pick, .qs-range, .tm-fields, .cr-currency, .ad-payers, .px-filters, .hl-cap) select {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-inline-end: 36px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 12px 8px;
}
[dir="rtl"] :is(.sh-pick, .qs-range, .tm-fields, .cr-currency, .ad-payers, .px-filters, .hl-cap) select { background-position: left 14px center; }
.tp-range .qs-range select { padding-inline-end: 30px; background-position: right 10px center; }
[dir="rtl"] .tp-range .qs-range select { background-position: left 10px center; }
.sh-book h3 { display: flex; align-items: center; gap: 10px; }
.sh-cover { flex: none; width: 30px; height: 40px; object-fit: cover; border-radius: 4px; background: var(--surface-2); box-shadow: 0 1px 4px rgb(var(--shade) / .2); }
.sh-cover-blank { display: grid; place-items: center; color: var(--muted); } /* (a cover that couldn't load) */
.sh-cover-blank svg { width: 18px; height: 18px; }
.sh-acts { flex: none; display: flex; align-items: center; gap: 6px; }
.sh-chip { display: inline-block; margin-inline-end: 8px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.sh-chip.ok { background: var(--ok-soft); color: var(--ok-ink); }
.sh-chip.mid { background: var(--amber-soft); color: var(--amber-ink); }
.sh-chip.bad { background: var(--bad-soft); color: var(--bad-ink); }
.sh-del { color: var(--muted); }
.sh-del svg { width: 18px; height: 18px; }
.sh-del:hover { color: var(--bad); background: var(--bad-soft); }
.sh-body.grid .sh-list { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.sh-body.grid .sh-row { flex-direction: column; align-items: stretch; }
.sh-body.grid .sh-what strong { white-space: normal; }
/* a parent's look at their child's Practice: a quiz's answers, opened under it (across the row when side by side) */
.sh-item { display: grid; gap: 6px; min-width: 0; }
.sh-answers { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.sh-body.grid .sh-item:has(.sh-answers:not([hidden])) { grid-column: 1 / -1; }
.nbh-a.right { color: var(--ok); }
.sh-error { margin: 10px 0 0; color: var(--bad); font-weight: 600; }
.modal-card.sure-modal { width: min(440px, 100%); }
.sure-text { margin: 0; color: var(--ink-2); line-height: 1.55; }
.bin-hub .sh-row > svg { flex: none; color: var(--muted); }
.bin-empty { display: flex; align-items: center; gap: 10px; margin: 0; padding: 18px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }
.bin-empty svg { flex: none; }
/* The admin area, many people at once: lists found by name and filters, 50 at a time; each kind of alert's first few */
.ad-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.ad-filters .ad-search { flex: 1 1 260px; min-width: 0; }
/* (its own arrow, a little in from the edge: the browser's own sits against it) */
.ad-filters select, .pd-range select, .ad-msg-form select {
  font: inherit; padding: 9px 38px 9px 12px; border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink); max-width: 100%; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%2364748b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
}
[dir="rtl"] :is(.ad-filters, .pd-range, .ad-msg-form) select { padding: 9px 12px 9px 38px; background-position: left 14px center; }
.ad-count { margin: 0 0 10px; color: var(--muted); font-size: 13.5px; }
.ad-count:empty { display: none; }
.ad-more { justify-self: center; margin-top: 4px; }
.al-more { background: transparent !important; border: 1px dashed var(--amber-line); }
.al-more .al-text { color: var(--ink-2); font-weight: 600; }
/* The charts, drawn as the admin chose: columns or a line, bars or a ring; each AI model in its own colour */
.ov-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ov-card-head h3 { margin: 0; }
/* Online now: the number, the countries, the books being read, and who (Admin → Overview) */
.ov-live { margin-bottom: 16px; }
/* Server health (Admin → Overview): a meter for each, green, amber from 70%, red from 90%, with its numbers beside it */
.ov-health { margin-bottom: 16px; }
/* Pictures people chose (admin.js picturesCard): the three chosen most, big, then every character with how many */
.ov-pics { margin-top: 16px; }
.ov-pics .ov-card-head { flex-wrap: wrap; gap: 8px 16px; }
.px-filters { display: flex; flex-wrap: wrap; gap: 8px 14px; min-width: 0; }
.px-filters label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; font-size: .85rem; color: var(--muted); } /* (no wider than its row: with a phone's 16px letters its list was, by 2px at 320) */
.px-filters select { font: inherit; color: var(--ink); padding-block: 6px; padding-inline-start: 10px; border: 1.5px solid var(--line); border-radius: 10px; min-width: 0; max-width: 100%; } /* (the arrow: with Practice's Book box's, above) */
.px-line { margin: 2px 0 12px; color: var(--ink-2); }
.px-top { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.px-top li { position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; padding: 14px 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); text-align: center; }
.px-top img { width: 84px; height: 84px; border-radius: 50%; background: var(--surface-3); }
.px-top strong { line-height: 1.3; }
.px-top li > span:last-child { color: var(--muted); font-size: .85rem; }
.px-rank { position: absolute; inset-block-start: 8px; inset-inline-start: 12px; font-weight: 800; font-size: 1.1rem; color: var(--brand); }
.px-all { margin: 6px 0 4px; }
.px-all summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.px-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 14px; }
.px-list li { display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 8px; align-items: center; }
.px-list img { grid-row: span 2; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-3); }
.px-list small { color: var(--muted); }
.px-zero { opacity: .55; }
/* Who sees it (Admin → Books → ⋯): everyone, some people or nobody; the choices for some people; how many */
.au-modal { width: min(640px, 100%); }
.au-modes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.au-mode { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1.5px solid var(--line); border-radius: 999px; font-weight: 600; font-size: 14px; cursor: pointer; }
.au-mode:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.au-mode input, .au-tick input, .au-tell input { accent-color: var(--brand); margin: 0; }
.au-some[hidden] { display: none; }
.au-some fieldset { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.au-some legend { padding: 0 4px; font-weight: 700; font-size: 13.5px; color: var(--ink-2); }
.au-ticks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.au-tick { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.au-tick[hidden] { display: none; }
.au-chips { gap: 6px; }
.au-chips .au-tick { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.au-chips .au-tick:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.au-list { flex-direction: column; flex-wrap: nowrap; max-height: 180px; overflow-y: auto; }
.au-age { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; }
.au-age label { display: inline-flex; align-items: center; gap: 6px; }
.au-age input { width: 72px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.au-some input[type="search"] { width: 100%; padding: 7px 10px; margin-bottom: 8px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.au-found { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.au-found:empty { display: none; }
.au-hit { padding: 5px 10px; border: 1px dashed var(--brand-line); border-radius: 999px; background: var(--surface); color: var(--brand); font: inherit; font-size: 13px; cursor: pointer; }
.au-chosen { display: flex; flex-wrap: wrap; gap: 6px; }
.au-chosen .ov-note { margin: 0; }
.au-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: 13px; }
.au-chip-x { border: 0; background: none; color: inherit; cursor: pointer; font-size: 12px; padding: 2px 4px; }
.au-count { margin: 12px 0 6px; font-weight: 700; font-size: 15px; }
.au-tell { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.au-tell[hidden] { display: none; }
.au-take { display: flex; align-items: flex-start; gap: 8px; margin-top: 4px; font-size: 14px; cursor: pointer; }
.au-take[hidden] { display: none; }
.au-take input { accent-color: var(--bad); margin: 2px 0 0; }
.au-keepers { margin: 0 0 8px; font-size: 13.5px; color: var(--ink-2); }
.au-keepers:empty { display: none; }
.au-keepers.losing { color: var(--bad); font-weight: 600; }
.au-modal .ov-note { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.au-modal .pr-btns { margin-top: 14px; }
.hl-row { display: grid; grid-template-columns: minmax(110px, 180px) minmax(70px, 1fr) minmax(0, 1.5fr); gap: 4px 14px; align-items: center; padding: 8px 0; }
.hl-row + .hl-row { border-top: 1px solid var(--line); }
.hl-label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.hl-meter { display: block; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hl-meter i { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: var(--ok); }
.hl-meter.warn i { background: var(--amber); }
.hl-meter.bad i { background: var(--bad); }
.hl-value { font-size: 13.5px; color: var(--ink); }
.hl-cap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 12px 0 4px; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.hl-cap select { padding-block: 6px; padding-inline-start: 10px; border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink); font: inherit; font-weight: 500; } /* (the arrow: with Practice's Book box's, above) */
.ov-health .ov-note { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
@media (max-width: 640px) { .hl-row { grid-template-columns: 1fr; gap: 5px; } }
/* the AI and voice companies (9 November 2026): a line each, its dot green, amber (turned away now and then) or red (a
   problem only the team can fix), its words beside it (never the colour alone) */
.hl-own input { width: 110px; padding: 6px 10px; border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink); font: inherit; font-weight: 500; }
.hl-svc { margin: 10px 0 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.hl-svc h4 { margin: 0 0 6px; font-size: 13.5px; color: var(--ink-2); }
.hl-svc-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0; padding: 5px 0; font-size: 13.5px; color: var(--ink); }
.hl-svc-row b { font-weight: 600; color: var(--ink-2); }
.hl-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); align-self: center; }
.hl-svc-row.warn .hl-dot { background: var(--amber); }
.hl-svc-row.bad .hl-dot { background: var(--bad); }
.hl-svc-row.bad span:last-child { color: var(--bad); font-weight: 600; }
/* what a page may load (12 November 2026, number 289): what browsers reported, one thing a line, as they wrote it */
.hl-pages-more { margin: 2px 0 6px; font-size: 12.5px; color: var(--ink-2); }
.hl-pages-more summary { cursor: pointer; }
.hl-pages-list { margin: 2px 0 6px; padding-inline-start: 18px; max-height: 220px; overflow: auto; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; text-align: left; }
/* the price watch (9 November 2026): when it last checked, Check now, and the AI's "Use the new prices" */
.hl-prices h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.hl-prices h4 small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.hl-prices h4 .btn { margin-inline-start: auto; }
.hl-svc-row .btn { margin-inline-start: 4px; }
.hl-svc-row.bad .btn + span, .hl-svc-row.bad > span:nth-of-type(2) { color: var(--bad); font-weight: 600; }
.ov-live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ok); }
.ov-live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.ov-live-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.ov-live-n { font-size: 32px; line-height: 1; }
.ov-live-top span { color: var(--muted); }
.ov-countries { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; font-size: 14px; }
/* (each country a button: a tap shows only its people, more than one can be picked) */
.ov-country { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.ov-country:hover { border-color: var(--brand-line); }
.ov-country[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); box-shadow: 0 0 0 2px var(--brand-line); }
.ov-country b { font-variant-numeric: tabular-nums; }
/* (each row's name: where they're online from, and their own country, as they chose it) */
.ov-row-label { align-self: center; min-width: 6.5em; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ov-froms { margin-top: -4px; }
@media (max-width: 520px) { .ov-row-label { flex-basis: 100%; min-width: 0; } } /* (on a phone: the row's name on its own line, its countries under it) */
.ov-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: -2px 0 14px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); font-size: 14px; }
[dir="rtl"] .ov-picked { padding: 8px 14px 8px 8px; }
.ov-picked b { font-variant-numeric: tabular-nums; }
.ov-picked .ov-show-all { margin-inline-start: auto; }
/* (a person online: their picture, name and username; a tap opens their Details) */
.ov-who-name { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.ov-who-name .kid-avatar { width: 28px; height: 28px; font-size: 12px; }
.ov-who-name > span:last-child { display: grid; line-height: 1.25; }
.ov-who-name small { color: var(--muted); font-size: 12px; }
.ov-who-name:hover strong, .ov-who-name:focus-visible strong { color: var(--brand-ink); text-decoration: underline; }
.ov-live h4 { margin: 0 0 6px; font-size: 13.5px; color: var(--muted); }
.ov-live-books { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.ov-live-books li { display: flex; justify-content: space-between; gap: 12px; min-width: 0; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; } /* (min-width: a long book's name was never cut with …, and made the whole page wider than a phone: MISTAKES.md number 416) */
.ov-live-books li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-live-who summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 4px 0; }
.ov-live-note { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; }
.ov-views { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.ov-view { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ov-view[aria-pressed="true"] { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgb(var(--shade) / .12); }
.ov-view:hover { color: var(--ink); }
.ov-line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ov-dot { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.ov-col:hover .ov-dot, .ov-col:focus .ov-dot { fill: var(--brand-ink); }
.ov-model, .ov-legend, .ov-arc { --m: var(--brand); }
.ov-m-best { --m: #2a78d6; }
.ov-m-balanced { --m: #eb6834; }
.ov-m-light { --m: #1baf7a; }
.ov-track { background: var(--surface-2); }
.ov-track i { background: var(--m); }
.ov-total { margin: 10px 0 0; color: var(--ink-2); font-size: 13px; font-weight: 600; }
/* what was read aloud, under the AIs: each voice's characters and cost */
.ov-voice { display: grid; gap: 6px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.ov-voice h4 { margin: 0; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.ov-voice-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 14px; color: var(--muted); }
.ov-voice-row > :first-child { color: var(--ink); font-weight: 700; }
.ov-ring { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.ov-ring svg { width: 128px; height: 128px; flex: none; }
.ov-arc { fill: none; stroke: var(--m); stroke-width: 18; }
.ov-ring-n { fill: var(--ink); font-size: 20px; font-weight: 700; }
.ov-ring-l { fill: var(--muted); font-size: 11px; }
.ov-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; flex: 1 1 160px; min-width: 0; }
.ov-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 0 8px; align-items: center; font-size: 13.5px; }
.ov-legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--m); }
.ov-legend span { grid-column: 2; color: var(--ink-2); font-size: 12.5px; }
/* One person in detail: the window's rows keep their height (it scrolls instead of squeezing a table to nothing) */
.study-modal .modal-card.ov-person { width: min(820px, 100%); }
.ov-person .modal-body { grid-auto-rows: max-content; }
.ov-person .modal-body > .sum-h { margin: 12px 0 -6px; } /* (a heading close to what it's over, apart from what's before) */
.pd-note { margin: -4px 0 0; color: var(--muted); font-size: 12.5px; }
.pd-who .ov-value { font-size: 16px; overflow-wrap: anywhere; }
.pd-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.pd-h .sum-h { margin: 0; }
.pd-h-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-range { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.pd-range[hidden] { display: none; }
.pd-range label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.pd-ai { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.pd-books li { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.pd-book { display: grid; gap: 2px; min-width: 0; }
.pd-book strong { font-size: 14px; overflow-wrap: anywhere; }
.ov-list li .pd-book-meta { color: var(--muted); font-size: 12.5px; white-space: normal; }
.pd-book-read { display: grid; gap: 2px; justify-items: end; text-align: end; font-size: 13px; }
.pd-book-read time { font-size: 12px; }
/* The bin (Admin): Accounts or Books with a switch, then a table like Accounts' and Books' (6 November 2026) */
.bin-switch { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.bin-keep { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); font-size: 14px; }
.bin-keep select { font: inherit; padding: 8px 34px 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink); }
/* The history: when, who, what */
.hi-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hi-list li { display: grid; grid-template-columns: 150px 130px minmax(0, 1fr); gap: 4px 12px; align-items: baseline; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14px; }
.hi-list li.ad-empty, .hi-list li.sum-wait, .hi-list li.ad-bad { display: block; }
.hi-list time { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hi-who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hi-more { display: flex; justify-content: center; margin-top: 10px; }
@media (max-width: 640px) {
  .hi-list li { grid-template-columns: minmax(0, 1fr); }
}
/* Credit round the account button: a green ring for how much is left (amber when it's running low, red when it's gone),
   and in its menu the credit with a row of dots, what it is, the monthly plan and Get more */
.account-btn.ringed { position: relative; width: 42px; height: 42px; background: none; }
.account-btn.ringed:hover { background: none; }
.account-btn.ringed .ab-face { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); }
.account-btn.ringed:hover .ab-face { background: var(--brand-ink); }
.credit-ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cr-track { fill: none; stroke: var(--line); }
.cr-arc { fill: none; stroke: var(--ok); stroke-linecap: round; } /* (green, apart from the indigo of the initials) */
.credit-ring.low .cr-arc { stroke: var(--amber); }
.credit-ring.out .cr-track { stroke: var(--bad); }
.am-face.ringed { position: relative; width: 52px; height: 52px; background: none; box-shadow: none; }
.am-face.ringed > span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; }
.am-credit { display: grid; gap: 8px; padding: 9px 9px 7px; min-width: 0; }
.am-credit-top { display: flex; align-items: center; gap: 7px; }
.am-credit-label { font-weight: 700; font-size: 14.5px; color: var(--ink-2); }
.account-menu .am-help { flex: none; width: 20px; height: 20px; padding: 0; justify-content: center; border-radius: 50%; border: 1.5px solid var(--muted); color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1; }
.account-menu .am-help:hover, .account-menu .am-help[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); background: none; }
.am-credit-left { margin-inline-start: auto; color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.am-credit-left:hover { color: var(--brand); }
.am-credit-left .chev { display: inline-block; margin-inline-start: 5px; }
[dir="rtl"] .am-credit-left .chev { transform: scaleX(-1); }
.am-help-text { margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.am-help-text[hidden] { display: none; }
.am-dots { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; }
/* (minmax(0, …) and min-width: 0: Firefox sized each round dot from its own height, so the 24 of them pushed the credit
   box out of the menu, hiding "320 left" and Get more: number 111) */
.am-dots i { display: block; min-width: 0; aspect-ratio: 1; border-radius: 50%; background: var(--line); }
.am-dots i.on { background: var(--ok); }
.am-credit.low .am-dots i.on { background: var(--amber); }
.am-credit.low .am-credit-left { color: var(--amber-ink); }
.am-credit.out .am-credit-left { color: var(--bad); }
.am-credit-foot { display: flex; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.am-credit-foot a { margin-inline-start: auto; }
/* (a line under it too, like the one over "About … answers", when the AI that answers comes next in the box) */
.am-credit:not(:last-child)::after { content: ""; border-top: 1px solid var(--line); }
.am-credit-more { display: grid; gap: 1px; }
/* The natural voices: about what a page takes from the reader's credit, under each one's name, and asked once */
.vm-voice > span { display: grid; gap: 1px; }
.vm-voice small { color: var(--muted); font-size: 12px; font-weight: 500; }
.vm-voice small:empty { display: none; }
.vc-text { margin: 0; font-size: 15px; line-height: 1.55; }
/* Pictures on the accounts: a character or their photo, filling the circle where their initials were */
.ab-face, .am-face > span { overflow: hidden; }
.account-btn:not(.ringed) .ab-face { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; }
.has-picture { overflow: hidden; background: var(--surface-2) !important; }
.has-picture > img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; }
.am-face:not(.ringed) > span { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; }
.kid-avatar.has-picture { padding: 0; }
/* The picture chooser (the first steps, and My profile): the students, then the animals, then their own photo */
.pc { display: grid; gap: 10px; }
.pc h3 { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.pc-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.pc-tabs button { padding: 9px 8px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.pc-tabs button:hover { color: var(--brand); }
.pc-tabs button[aria-selected="true"] { background: var(--surface); color: var(--brand); box-shadow: 0 1px 4px rgb(var(--shade) / .12); }
.pc-sets { display: grid; gap: 10px; min-height: 160px; }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.pc-pick { aspect-ratio: 1; padding: 0; border: 3px solid transparent; border-radius: 50%; background: var(--surface-2); cursor: pointer; overflow: hidden; transition: transform .12s, border-color .12s; }
.pc-pick img { width: 100%; height: 100%; display: block; border-radius: 50%; }
.pc-pick:hover { transform: scale(1.06); border-color: var(--brand-soft); }
.pc-pick:focus-visible { outline: none; border-color: var(--brand); }
.pc-pick[aria-pressed="true"] { border-color: var(--ok); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ok); }
.pc-sets[hidden], .pc-mine[hidden] { display: none; }
/* the Your photo tab: their photo (or initials) big, its buttons beside it, and who sees it */
.pc-mine { display: grid; gap: 14px; align-content: start; min-height: 160px; padding-top: 6px; }
.pc-mine .pc-face { width: 84px; height: 84px; font-size: 26px; }
.pc-photo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pc-face, .pf-face { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; font-size: 18px; }
.pc-face.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ok); }
.pc-photo-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pc .ph-note { margin: 0; }
.study-modal .modal-card.pc-modal { width: min(560px, 100%); }
.pf-picture { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pf-picture > div { display: grid; gap: 6px; justify-items: start; }
.st-pictures { margin: 8px 0 14px; }
/* Choose your picture, at the top of Home until they do (or say not now) */
.picture-ask { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin: 0 0 18px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.picture-ask[hidden] { display: none; }
.pa-faces { display: flex; flex: none; }
.pa-faces img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--surface); background: var(--surface-2); }
.pa-faces img + img { margin-inline-start: -12px; }
.pa-text { display: grid; gap: 2px; flex: 1 1 240px; min-width: 0; }
.pa-text span { color: var(--muted); font-size: 13.5px; }
.pa-acts { display: flex; gap: 6px; }

/* ---- YouTube videos (8 November 2026, the owner's wish; ytvideos.js, videopage.js) ------------------------------------
   a video in a list (its picture with its length, its name, channel, state and book), Add a video's window, and the
   video page: YouTube's player, its tools, its chapters and its notes part by part, the tutor beside it as in a book */
.vd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.vd-card { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: inherit; text-decoration: none; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
@media (hover: hover) { a.vd-card:hover { transform: translateY(-2px); border-color: var(--brand-line); } }
.vd-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: #111827; color: #fff; }
.vd-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vd-len { position: absolute; bottom: 5px; inset-inline-end: 5px; padding: 1px 5px; border-radius: 5px; background: rgb(0 0 0 / .78); color: #fff; font: 600 11.5px/1.4 var(--font); }
.vd-what { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; min-width: 0; } /* (a long name ends in …, never wider than the card) */
.vd-what strong { font-size: 14.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vd-what small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.vd-foot:empty { display: none; }
.vd-state { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.vd-state.making { background: var(--amber-soft); color: var(--amber-ink); }
.vd-state.failed { background: var(--bad-faint); color: var(--bad); }
.vd-state.needs { background: var(--brand-soft); color: var(--brand-ink); }
.vd-book { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; color: var(--ink-2); font-size: 12.5px; }
.vd-book svg { flex: none; width: 14px; height: 14px; }
.vd-book span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-none { margin: 0; color: var(--muted); }
.my-videos { margin-top: 26px; }
/* Add a video */
.vd-find { display: grid; gap: 8px; }
.vd-find label { font-weight: 600; }
.vd-row { display: flex; gap: 8px; }
.vd-row input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.vd-row input:focus { outline: none; border-color: var(--brand); }
.vd-hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.vd-found { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.vd-preview { box-shadow: none; }
.vd-what-for, .vd-price, .vd-for { margin: 0; font-size: 14px; line-height: 1.5; }
.vd-price { font-weight: 700; }
.vd-for { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.vd-for svg { flex: none; width: 16px; height: 16px; }
.vd-err { margin: 0; color: var(--bad); font-weight: 600; }
.vd-in-book { grid-template-columns: 1fr; margin: 12px 0; }
.vd-add-btn { display: inline-flex; align-items: center; gap: 8px; justify-self: start; }
.vd-add-btn svg { width: 18px; height: 18px; }
/* the video page */
.video-page .vd-main { display: flow-root; padding: 18px 20px 40px; }
.video-page .vd-main > * + * { margin-top: 16px; } /* (a column of blocks, not a grid: a grid gave the player's row no height) */
/* (the player stays at the top while the notes scroll under it: what they read, they see playing) */
.vd-player { position: sticky; top: 0; z-index: 3; width: 100%; max-width: calc(52vh * 16 / 9); margin-inline: auto; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; box-shadow: var(--shadow-lg); }
.vd-player iframe, .vd-player #vd-yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vd-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.vd-meta { margin: 0; color: var(--muted); font-size: 13.5px; }
.vd-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.vd-tools .btn { display: inline-flex; align-items: center; gap: 6px; }
.vd-tools svg { width: 16px; height: 16px; }
.vd-making { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--brand-soft); color: var(--ink); }
.vd-making.failed { background: var(--bad-faint); }
.vd-making strong { display: block; margin-bottom: 2px; }
.vd-making p { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.vd-chapters h2, .vd-notes h2 { margin: 0 0 8px; font-size: 17px; }
.vd-chapter-list { display: flex; flex-wrap: wrap; gap: 8px; }
.vd-chapter { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.vd-chapter b { color: var(--brand); font-variant-numeric: tabular-nums; }
.vd-chapter span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-chapter.on, .vd-chapter:hover { border-color: var(--brand); background: var(--brand-soft); }
.vd-notes-lead { margin: 0 0 10px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.vd-parts { display: grid; gap: 10px; }
.vd-part { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); scroll-margin: 12px; scroll-margin-top: calc(var(--vd-sticky, 0px) + 30px); } /* (under the player, which stays at the top, its own space above it too) */
.vd-part.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.vd-at { grid-row: span 2; align-self: start; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 0; border-radius: 8px; background: var(--brand-soft); color: var(--brand-ink); font: 700 13px/1.4 var(--font); font-variant-numeric: tabular-nums; cursor: pointer; }
.vd-at svg { width: 15px; height: 15px; }
.vd-said { font-size: 15px; line-height: 1.65; white-space: pre-wrap; }
/* the video's words, pasted from YouTube's Show transcript (8 November 2026: the paste way) */
.vd-words { display: grid; gap: 12px; padding: 16px; border: 1.5px solid var(--brand-line); border-radius: 14px; background: var(--surface); scroll-margin-top: calc(var(--vd-sticky, 0px) + 16px); }
.vd-words.flash { animation: vd-flash 1.2s ease; }
@keyframes vd-flash { 0%, 60% { box-shadow: 0 0 0 4px var(--brand-soft); } 100% { box-shadow: none; } }
.vd-words h2 { margin: 0 0 4px; font-size: 17px; }
.vd-words-lead { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.vd-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: vd-step; }
.vd-steps li { position: relative; padding-inline-start: 34px; min-height: 26px; font-size: 14.5px; line-height: 1.6; counter-increment: vd-step; }
.vd-steps li::before { content: counter(vd-step); position: absolute; inset-inline-start: 0; top: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font: 700 13px/1 var(--font); }
.vd-steps .btn { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 0; margin-inline-start: 6px; vertical-align: middle; }
.vd-steps .btn svg { width: 15px; height: 15px; }
.vd-steps b { font-weight: 700; }
.vd-easier { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.vd-words textarea { width: 100%; min-height: 120px; resize: vertical; font: inherit; font-size: 15px; line-height: 1.5; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.vd-words textarea:focus { outline: none; border-color: var(--brand); }
.vd-own { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.45; cursor: pointer; }
.vd-own input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); }
.vd-plan { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; line-height: 1.5; }
.vd-plan p { margin: 0; }
.vd-plan .vd-plan-price { font-weight: 700; }
.vd-plan .vd-plan-first { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-words .pr-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.vd-tutor-wait { margin: 16px; padding: 14px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); line-height: 1.5; }
@media (max-width: 600px) {
  .vd-card { grid-template-columns: 112px minmax(0, 1fr); }
  .vd-part { grid-template-columns: 1fr; }
  .vd-at { grid-row: auto; justify-self: start; }
  .vd-words { padding: 14px 12px; }
  .video-page .vd-main { padding: 12px 12px 90px; }
}

/* ---- The whiteboard (8 November 2026, the owner's wish): a canvas that fills the page, moved with two fingers or by
   dragging and zoomed by pinching or with the buttons in its corner (the owner's wish, after Higgsfield's); each question a
   panel written as if by hand, joined to the one before by a curved line; the tools, the zoom buttons and the box to ask
   in float over it; and My boards (board.html, board.js). Its writing is Caveat, and Aref Ruqaa for Arabic (the hand Arab
   schools write in). */
.board-page { --bd-hl: rgb(250 204 21 / .45); --bd-blue: var(--info); --bd-green: var(--ok); --bd-red: var(--bad); --bd-purple: var(--brand); --bd-orange: var(--amber); --bd-label: var(--brand); overflow: hidden; overscroll-behavior: none; }
/* (Dark: the colours lighter, and the highlight softer, so writing on the dark board is as clear as on the white one) */
:root[data-theme="dark"] .board-page { --bd-hl: rgb(250 204 21 / .2); --bd-blue: #93b4ff; --bd-green: #7ee2a8; --bd-red: #ff9b9b; --bd-purple: #c4b5fd; --bd-orange: #fdba74; --bd-label: #c7d2fe; }
.bd-main { position: relative; height: calc(100dvh - var(--topbar)); overflow: hidden; container: bdmain / inline-size; }
.bd-board { position: absolute; inset: 0; overflow: hidden; touch-action: none; outline: none; background-color: var(--bg); background-image: radial-gradient(var(--line-2) 1px, transparent 1.4px); background-size: 22px 22px; -webkit-tap-highlight-color: transparent; }
.bd-board:focus-visible { box-shadow: inset 0 0 0 2px var(--brand); }
.bd-board.grab { cursor: grab; }
.bd-board.panning, .bd-board.panning * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.bd-world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; font-family: "Caveat", "Aref Ruqaa", "IBM Plex Sans Arabic", cursive; color: var(--ink); }
.bd-world.moving { will-change: transform; }
.bd-world[lang="ar"], .bd-panel[lang="ar"] { font-family: "Aref Ruqaa", "Caveat", "IBM Plex Sans Arabic", serif; }
.bd-panel[lang="en"] { font-family: "Caveat", "Aref Ruqaa", "IBM Plex Sans Arabic", cursive; } /* (each answer in its own hand and way: MISTAKES 149) */
.bd-panel { position: absolute; top: 0; box-sizing: border-box; min-height: 180px; padding: 20px 30px 40px; border: 1px solid var(--line); border-radius: 18px; background-color: var(--surface); background-image: radial-gradient(var(--line) 1px, transparent 1.3px); background-size: 22px 22px; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.bd-links { position: absolute; z-index: 1; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.bd-link { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; opacity: .5; }
.bd-port { fill: var(--surface); stroke: var(--brand); stroke-width: 2.5; }
.bd-step { margin: 0 0 12px; font-size: calc(26px * var(--bd-k, 1)); line-height: 1.35; }
.bd-panel[lang="ar"] .bd-step { font-size: calc(24px * var(--bd-k, 1)); line-height: 1.75; }
.bd-step bdi { unicode-bidi: isolate; }
.bd-title { font-size: calc(38px * var(--bd-k, 1)); font-weight: 700; }
.bd-panel[lang="ar"] .bd-title { font-size: calc(34px * var(--bd-k, 1)); }
.bd-title .bd-ink { border-bottom: 3px solid var(--brand); padding: 0 4px 2px; }
/* The title's line drawn by hand, in the handwriting style only (the owner's wish, 12 November 2026: "not perfectly
   straight", and "when I choose other fonts it should be straight"): a pen's stroke where the ruled line was, a little
   past the words at both ends, not quite level, thin where the pen lands and lifts; one of three (data-u, from the
   title's words: board2.js makeStep), so not every title has the same one; turned round on an Arabic board, where the
   pen starts at the right. The neat and typed styles (data-board-font) keep the ruled line, and so does a printed board.
   A change at its own step (rule 36, "handline"): :root[data-board-lines="hand"]. Each stroke is a filled shape in a
   box 100 by 10 stretched to the title's width, so it's as thick whatever the title's length. */
.bd-title { --bd-stroke: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M1 6.42L3.23 6.07L5.45 5.86L7.68 5.79L9.91 5.73L12.14 5.66L14.36 5.6L16.59 5.53L18.82 5.48L21.05 5.43L23.27 5.4L25.5 5.37L27.73 5.35L29.95 5.33L32.18 5.29L34.41 5.24L36.64 5.17L38.86 5.07L41.09 4.94L43.32 4.79L45.55 4.6L47.77 4.4L50 4.19L52.23 3.97L54.45 3.76L56.68 3.57L58.91 3.4L61.14 3.27L63.36 3.18L65.59 3.12L67.82 3.11L70.05 3.12L72.27 3.16L74.5 3.22L76.73 3.29L78.95 3.35L81.18 3.41L83.41 3.45L85.64 3.48L87.86 3.48L90.09 3.47L92.32 3.45L94.55 3.44L96.77 3.57L99 3.86L99 4.02L96.77 4.37L94.55 4.58L92.32 4.66L90.09 4.69L87.86 4.72L85.64 4.73L83.41 4.73L81.18 4.7L78.95 4.67L76.73 4.62L74.5 4.58L72.27 4.54L70.05 4.52L67.82 4.52L65.59 4.55L63.36 4.61L61.14 4.71L58.91 4.84L56.68 5L54.45 5.19L52.23 5.39L50 5.59L47.77 5.79L45.55 5.97L43.32 6.13L41.09 6.27L38.86 6.37L36.64 6.45L34.41 6.5L32.18 6.54L29.95 6.55L27.73 6.57L25.5 6.58L23.27 6.6L21.05 6.63L18.82 6.68L16.59 6.74L14.36 6.82L12.14 6.9L9.91 6.98L7.68 7.06L5.45 7.09L3.23 6.94L1 6.6Z'/%3E%3C/svg%3E"); }
.bd-title[data-u="1"] { --bd-stroke: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M1 4.63L3.23 4.29L5.45 4.1L7.68 4.02L9.91 3.93L12.14 3.8L14.36 3.65L16.59 3.5L18.82 3.37L21.05 3.27L23.27 3.23L25.5 3.25L27.73 3.31L29.95 3.42L32.18 3.55L34.41 3.69L36.64 3.82L38.86 3.94L41.09 4.03L43.32 4.1L45.55 4.16L47.77 4.22L50 4.28L52.23 4.37L54.45 4.48L56.68 4.62L58.91 4.78L61.14 4.94L63.36 5.1L65.59 5.22L67.82 5.3L70.05 5.33L72.27 5.29L74.5 5.21L76.73 5.08L78.95 4.94L81.18 4.8L83.41 4.67L85.64 4.58L87.86 4.54L90.09 4.54L92.32 4.58L94.55 4.68L96.77 4.94L99 5.36L99 5.53L96.77 5.79L94.55 5.9L92.32 5.88L90.09 5.86L87.86 5.88L85.64 5.94L83.41 6.05L81.18 6.2L78.95 6.36L76.73 6.53L74.5 6.67L72.27 6.77L70.05 6.82L67.82 6.8L65.59 6.73L63.36 6.6L61.14 6.44L58.91 6.27L56.68 6.1L54.45 5.94L52.23 5.81L50 5.7L47.77 5.62L45.55 5.54L43.32 5.46L41.09 5.37L38.86 5.25L36.64 5.12L34.41 4.97L32.18 4.82L29.95 4.68L27.73 4.57L25.5 4.5L23.27 4.49L21.05 4.55L18.82 4.65L16.59 4.8L14.36 4.97L12.14 5.14L9.91 5.29L7.68 5.4L5.45 5.43L3.23 5.25L1 4.83Z'/%3E%3C/svg%3E"); }
.bd-title[data-u="2"] { --bd-stroke: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M1 5.03L3.23 4.67L5.45 4.43L7.68 4.3L9.91 4.18L12.14 4.05L14.36 3.93L16.59 3.83L18.82 3.75L21.05 3.71L23.27 3.72L25.5 3.76L27.73 3.84L29.95 3.94L32.18 4.06L34.41 4.18L36.64 4.29L38.86 4.38L41.09 4.44L43.32 4.47L45.55 4.48L47.77 4.47L50 4.45L52.23 4.44L54.45 4.44L56.68 4.46L58.91 4.51L61.14 4.59L63.36 4.68L65.59 4.79L67.82 4.9L70.05 4.99L72.27 5.06L74.5 5.09L76.73 5.08L78.95 5.03L81.18 4.93L83.41 4.81L85.64 4.66L87.86 4.51L90.09 4.36L92.32 4.23L94.55 4.16L96.77 4.26L99 4.57L99 4.76L96.77 5.16L94.55 5.41L92.32 5.53L90.09 5.64L87.86 5.77L85.64 5.9L83.41 6.03L81.18 6.14L78.95 6.22L76.73 6.27L74.5 6.27L72.27 6.24L70.05 6.18L67.82 6.09L65.59 6L63.36 5.91L61.14 5.83L58.91 5.77L56.68 5.75L54.45 5.74L52.23 5.77L50 5.8L47.77 5.83L45.55 5.86L43.32 5.87L41.09 5.84L38.86 5.79L36.64 5.71L34.41 5.6L32.18 5.47L29.95 5.35L27.73 5.23L25.5 5.14L23.27 5.07L21.05 5.05L18.82 5.07L16.59 5.12L14.36 5.2L12.14 5.31L9.91 5.41L7.68 5.51L5.45 5.57L3.23 5.47L1 5.2Z'/%3E%3C/svg%3E"); }
@media screen {
  :root[data-board-lines="hand"]:not([data-board-font]) .bd-title .bd-ink { position: relative; border-bottom-color: transparent; }
  :root[data-board-lines="hand"]:not([data-board-font]) .bd-title .bd-ink::after {
    content: ""; position: absolute; inset-inline: -0.2em; bottom: -0.3em; height: 0.62em; background: var(--brand); pointer-events: none;
    -webkit-mask: var(--bd-stroke) no-repeat center / 100% 100%; mask: var(--bd-stroke) no-repeat center / 100% 100%;
  }
  :root[data-board-lines="hand"]:not([data-board-font]) .bd-panel[dir="rtl"] .bd-title .bd-ink::after { transform: scaleX(-1); }
}
.bd-math { font-size: calc(28px * var(--bd-k, 1)); }
.bd-panel[dir="rtl"] > .bd-step[dir="ltr"] { text-align: right; } /* (a formula left to right in an Arabic answer: at its side all the same) */
.bd-text.size-big { font-size: calc(32px * var(--bd-k, 1)); }
.bd-text.size-small { font-size: calc(21px * var(--bd-k, 1)); }
.bd-ink { -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* (each written line one box: Firefox reveals a line of mixed Arabic and maths by its first piece only otherwise) */
.bd-step .bd-ink { display: inline-block; max-width: 100%; vertical-align: top; }
.bd-ink.hl { background-image: linear-gradient(var(--bd-hl), var(--bd-hl)); background-repeat: no-repeat; background-size: 100% 100%; border-radius: 6px; padding: 0 6px; }
.bd-panel[dir="rtl"] .bd-ink.hl { background-position: right; }
.bd-world .c-blue { color: var(--bd-blue); }
.bd-world .c-green { color: var(--bd-green); }
.bd-world .c-red { color: var(--bd-red); }
.bd-world .c-purple { color: var(--bd-purple); }
.bd-world .c-orange { color: var(--bd-orange); }
.bd-boxes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.bd-boxes.bd-other { justify-content: flex-end; } /* (a row in the board's other language, on the board's side: MISTAKES 186) */
.bd-box { border: 2px solid currentColor; border-radius: 12px; padding: 2px 14px; font-size: calc(22px * var(--bd-k, 1)); }
.bd-arrow { font-size: calc(26px * var(--bd-k, 1)); color: var(--muted); }
.bd-list { list-style: none; padding: 0; }
.bd-list li { display: flex; gap: .4em; margin: 2px 0; }
.bd-mark-n { flex: none; min-width: 1.1em; color: var(--bd-purple); }
.bd-table { border-collapse: collapse; font-size: calc(22px * var(--bd-k, 1)); }
.bd-table th, .bd-table td { border: 1.5px solid var(--ink-2); padding: 2px 12px; text-align: center; }
.bd-table th { color: var(--bd-purple); }
.bd-tip, .bd-mistake { display: flex; align-items: flex-start; gap: 8px; font-size: calc(24px * var(--bd-k, 1)); }
.bd-tip { color: var(--bd-green); }
.bd-mistake { color: var(--bd-red); }
.bd-mark { flex: none; margin-top: 7px; }
.bd-divider { border: 0; border-top: 2px dashed var(--line-2); margin: 18px 0; transform-origin: left; }
.bd-panel[dir="rtl"] .bd-divider { transform-origin: right; }
.bd-page { display: inline-flex; align-items: center; gap: 6px; color: var(--bd-purple); font-size: calc(22px * var(--bd-k, 1)); text-decoration: none; border-bottom: 1.5px solid currentColor; }
.bd-shape, .bd-plot { margin: 4px 0 14px; }
.bd-drawing { display: block; width: min(250px, 70%); height: auto; color: var(--ink-2); overflow: visible; }
.bd-graph { width: min(440px, 100%); }
.bd-label { font: 600 15px "Inter", "IBM Plex Sans Arabic", sans-serif; fill: var(--bd-label); stroke: var(--surface); stroke-width: var(--halo, 3px); stroke-linejoin: round; paint-order: stroke; }
.bd-num { fill: var(--muted); font-weight: 500; font-size: 12px; }
.bd-grid path { stroke: var(--line); stroke-width: 1; }
.bd-curve { stroke: currentColor; color: var(--bd-blue); }
.bd-label.c-blue { fill: var(--bd-blue); }
.bd-label.c-green { fill: var(--bd-green); }
.bd-label.c-red { fill: var(--bd-red); }
.bd-label.c-orange { fill: var(--bd-orange); }
.bd-dot { fill: var(--bd-purple); stroke: none; }
/* (the newest diagrams, rule 36: a graph's key points, their dashed lines to the axes, and its axes' names; boxes that come
   together, joined by +, and what makes them into what they make, written over the arrow: MISTAKES 179) */
.bd-guide { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.bd-mark-name { fill: var(--bd-purple); }
.bd-axis-name { font-size: 13px; fill: var(--ink-2); }
.bd-plus { font-weight: 600; }
.bd-by { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.05; }
.bd-by-words { font-size: calc(17px * var(--bd-k, 1)); color: var(--ink-2); padding: 0 6px; white-space: nowrap; }
.bd-by .bd-arrow { font-size: calc(32px * var(--bd-k, 1)); line-height: .8; }
.bd-caption { display: block; font-size: calc(20px * var(--bd-k, 1)); color: var(--muted); }
/* (pictures: ready ones in a row, each with its label, or one with notes pointing at it; and the AI's own sketches; a
   light colour inside their shapes) */
.bd-picture { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 28px; margin: 4px 0 14px; }
.bd-picture.with-notes { flex-wrap: nowrap; align-items: center; gap: 18px; }
.bd-pic { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 76px; }
.bd-drawing.bd-pic-svg { height: 76px; color: var(--ink); }
.bd-pic-label { font-size: calc(22px * var(--bd-k, 1)); text-align: center; }
.bd-notes { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bd-note { font-size: calc(22px * var(--bd-k, 1)); }
.bd-note-arrow { color: var(--muted); margin-inline-end: 8px; }
.bd-drawing.bd-sketch { height: auto; color: var(--ink); margin: 4px 0 6px; }
.bd-tint { stroke: none; }
.f-yellow { fill: #fac775; fill-opacity: .75; }
.f-green { fill: #97c459; fill-opacity: .6; }
.f-blue { fill: #85b7eb; fill-opacity: .55; }
.f-red { fill: #f09595; fill-opacity: .6; }
.f-purple { fill: #afa9ec; fill-opacity: .65; }
.f-orange { fill: #ef9f27; fill-opacity: .6; }
.f-pink { fill: #ed93b1; fill-opacity: .6; }
.f-gray { fill: #b4b2a9; fill-opacity: .45; }
.f-brown { fill: #c8a27a; fill-opacity: .6; }
.f-teal { fill: #5dcaa5; fill-opacity: .55; }
/* (Wrong?: on each answer that's whole, to send it to Kitabi's team) */
.bd-panel > .bd-q { max-width: calc(100% - 210px); } /* (clear of Replay and Wrong? in its corner) */
/* (an answer's corner: Replay, this answer again, and Wrong?, the owner's wishes) */
.bd-panel > .bd-panel-tools { position: absolute; top: 14px; inset-inline-end: 14px; display: flex; gap: 6px; }
.bd-panel-tools > button { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font: 500 12.5px "Inter", "IBM Plex Sans Arabic", sans-serif; cursor: pointer; }
.bd-panel-tools > .bd-wrong:hover:not(:disabled) { color: var(--bad); border-color: var(--bad); }
.bd-panel-tools > .bd-wrong:disabled { cursor: default; color: var(--ok); border-color: transparent; }
.bd-panel-tools > .bd-replay-one:hover:not(:disabled) { color: var(--brand); border-color: var(--brand); }
.bd-panel-tools > .bd-replay-one:disabled { opacity: .45; cursor: default; }
/* (Export after them, the tutor's, rule 36's "export" (the owner first): three in the corner, the question clear of them;
   on a narrow answer (a phone's, or one beside a book) they stand in a row of their own at its top, its question under them) */
.bd-panel.bd-has-export > .bd-q { max-width: calc(100% - 270px); }
.bd-panel-tools > .bd-export:hover, .bd-panel-tools > .bd-export[aria-expanded="true"] { color: var(--brand); border-color: var(--brand); }
/* (its menu: the tutor's look, over the board, not on the canvas; a choice that can't be made yet greyed) */
.bd-main > .bd-export-menu { z-index: 9; }
.export-menu button:disabled { opacity: .45; cursor: default; background: none; color: var(--ink-2); }
.bd-world.bd-slim > .bd-panel.bd-has-export > .bd-panel-tools { position: static; flex-wrap: wrap; justify-content: flex-end; gap: 5px; margin: -6px -6px 10px; }
.bd-world.bd-slim > .bd-panel.bd-has-export > .bd-panel-tools > button { padding: 3px 9px; }
.bd-world.bd-slim > .bd-panel.bd-has-export > .bd-q { max-width: 100%; }
.bd-wrong-sheet { display: grid; gap: 10px; }
.bd-wrong-text { margin: 0; color: var(--ink-2); line-height: 1.5; }
.bd-wrong-sheet textarea { width: 100%; min-height: 84px; resize: vertical; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; background: var(--surface); color: var(--ink); font: 400 15px/1.5 "Inter", "IBM Plex Sans Arabic", sans-serif; }
.bd-wrong-err { margin: 0; color: var(--bad); font-size: 13.5px; }
.bd-wrong-err[hidden] { display: none; }
.bd-wrong-acts { display: flex; flex-wrap: wrap; gap: 8px; }
/* (Send to a child: a button for each child, one under another, and under one a small line when it was sent before) */
.bd-give-list { display: grid; gap: 8px; justify-items: start; }
.bd-give-list .btn { max-width: 100%; overflow-wrap: anywhere; }
.bd-give-note { margin: -2px 2px 4px; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
/* (My boards: how many are kept, said at the top when the list is nearly full) */
.bd-mine-count { margin: 0 4px 10px; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.bd-q { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin: 0 0 14px; padding: 4px 12px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font: 500 14px/1.5 "Inter", "IBM Plex Sans Arabic", sans-serif; }
.bd-q img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
.bd-q img[src=""] { display: none; }
.bd-thinking { display: flex; align-items: center; gap: 10px; color: var(--muted); font: 500 15px "Inter", "IBM Plex Sans Arabic", sans-serif; }
.bd-error { margin: 10px 0; padding: 12px 14px; border-radius: 12px; background: var(--bad-faint); color: var(--bad-ink); font: 500 15px/1.5 "Inter", "IBM Plex Sans Arabic", sans-serif; text-align: start; }
.bd-error p { margin: 0 0 8px; }
.bd-error p:last-child { margin: 0; }
/* (number 484: Kitabi's own words when the AI declines to answer: a plain note, never the red of something that went wrong) */
.bd-declined { margin: 10px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font: 500 15px/1.5 "Inter", "IBM Plex Sans Arabic", sans-serif; text-align: start; }
.bd-declined p { margin: 0; }
.bd-pen { position: absolute; top: 0; left: 0; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font: 600 12px "Inter", "IBM Plex Sans Arabic", sans-serif; pointer-events: none; white-space: nowrap; }
.bd-pen[hidden] { display: none; }
.bd-wait { visibility: hidden; } /* (a piece of a step not written yet: it shows as it's written, never before: MISTAKES 152) */
/* (Pause, Play and Stop while a board is read aloud: the tutor's own bar, over the box to ask in) */
/* (Pause and Stop side by side, with how it's going, in a short bar over the box to ask in, floating as the board's other
   bars do. It's the tutor's bar, which measures itself by the room it's given (container-type): centred here it was given
   none, so it shrank to a thin upright stripe with the two buttons one above the other: MISTAKES 170) */
.bd-ask .bd-voicebar { justify-self: center; margin: 0; container-type: normal; flex-wrap: nowrap; padding: 4px; padding-inline-end: 14px; border-color: var(--line); background: rgb(var(--glass) / .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.bd-side > .bd-voicebar { margin: 0 12px 10px; }
@media (max-width: 1000px) { .bd-side > .bd-voicebar { order: 3; margin: 6px 12px; justify-self: center; } }
/* (no board yet: a hello and questions to try, over the empty canvas) */
.bd-hello-box { position: absolute; z-index: 3; inset: 64px 0 calc(var(--bd-ask-h, 90px) + 20px); display: grid; place-content: center; justify-items: center; gap: 18px; padding: 0 20px; text-align: center; pointer-events: none; font-family: "Caveat", "Aref Ruqaa", "IBM Plex Sans Arabic", cursive; color: var(--ink-2); }
.bd-hello-box:lang(ar) { font-family: "Aref Ruqaa", "Caveat", "IBM Plex Sans Arabic", serif; }
.bd-hello-box[hidden] { display: none; }
.bd-hello-box > * { pointer-events: auto; }
.bd-hello-box > .bd-hello, .bd-hello-box > .bd-tries, .bd-hello-box > .bd-declined { pointer-events: none; } /* (dragged or pinched there, the board under them moves: only the questions to try are buttons; MISTAKES 146 and 168) */
.bd-hello-box .bd-try { pointer-events: auto; }
.bd-hello-box .bd-error, .bd-hello-box .bd-declined { max-width: 480px; margin: 0; }
/* (a short screen, and the board has something to say above the hello, Kitabi's words when the AI declined or what went
   wrong: it comes first and whole, the hello and the examples after it. Centred, a message of five or six lines pushed
   its own first line up under the tools on a small phone: 19 November 2026, number 484) */
@media (max-height: 700px) { .bd-hello-box.bd-hello-said { align-content: start; } }
.bd-hello { margin: 0; font-size: calc(34px * var(--bd-k, 1)); }
.bd-tries { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.bd-try { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 6px 14px; font: 500 14px "Inter", "IBM Plex Sans Arabic", sans-serif; cursor: pointer; }
.bd-try:hover { border-color: var(--brand); color: var(--brand); }
/* (the tools, the zoom buttons and Back to the writing, floating over the canvas) */
.bd-tools { position: absolute; z-index: 6; top: 12px; inset-inline: 12px; display: flex; align-items: flex-start; gap: 8px; pointer-events: none; }
.bd-tools-gap { flex: 1; }
.bd-tools-group, .bd-zoom { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: rgb(var(--glass) / .9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: var(--shadow); pointer-events: auto; }
.bd-tool { display: inline-flex; align-items: center; gap: 6px; }
.bd-tool[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-ink); }
.bd-zoom { position: absolute; z-index: 6; bottom: 14px; inset-inline-end: 12px; flex-wrap: nowrap; }
.bd-zoom[hidden] { display: none; }
.bd-zoom .icon-btn { width: 32px; height: 32px; }
/* (in the top bar, after the board's own buttons: the owner's wish, rule 36's "layout"; board.js placeZoom) */
.bd-tools > .bd-zoom.bd-zoom-top { position: static; flex: none; align-self: flex-start; }
/* (back to the AI tutor beside a book's page: its own picture, as at the top of the tutor; rule 36's "window") */
.bd-tool .bd-tutor-face { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, #6366f1, #06b6d4); color: #fff; }
.bd-tool .bd-tutor-face svg { width: 13px; height: 13px; }
.bd-tool.bd-tutor-btn { padding-inline: 6px; }
.bd-tool.bd-tutor-btn span { padding-inline-end: 4px; }
/* (quick prompts, ⚡: in the box before the picture button, the box's words making room for both; its list over it, the
   tutor's look, board.js openQuick) */
.bd-ask .composer .bd-quick { margin-inline: -80px 0; }
.bd-ask .composer .bd-quick:not([hidden]) + .attach { margin-inline-start: -6px; }
.bd-ask .bd-row.bd-has-quick textarea { padding-inline-end: 80px; }
/* (the room for the picture button, and ⚡, stays on their side whichever way the question is typed: the board's box takes
   the way of its words, dir="auto", so an Arabic question on the English site ran under them, but the buttons keep the
   site's way: MISTAKES 190) */
html[dir="ltr"] .bd-ask .composer textarea { padding-left: 12px; padding-right: 40px; }
html[dir="rtl"] .bd-ask .composer textarea { padding-right: 12px; padding-left: 40px; }
html[dir="ltr"] .bd-ask .bd-row.bd-has-quick textarea { padding-right: 80px; }
html[dir="rtl"] .bd-ask .bd-row.bd-has-quick textarea { padding-left: 80px; }
/* (the roomier box to ask in, the board's and the tutor's alike: when it's narrow, under 520 (ui.js .composer-narrow), the
   question goes across all of it and its buttons in a row under it, Send at the row's end; the picture button and ⚡ are
   round buttons in that row, never over the words. While it's tried, for whoever has it: html[data-box="roomy"], rule 36;
   the owner's "yes, build it", 10 November 2026: on a phone the words had 65 to 120 wide: MISTAKES 191) */
html[data-box="roomy"] .composer { flex-wrap: wrap; row-gap: 8px; }
html[data-box="roomy"] .composer textarea { flex: 1 1 0; }
html[data-box="roomy"] .composer.composer-narrow { align-items: center; }
html[data-box="roomy"][dir] .composer.composer-narrow > textarea { order: -1; flex: 1 0 100%; padding-left: 12px; padding-right: 12px; }
html[data-box="roomy"][dir] .composer.composer-narrow > .attach, html[data-box="roomy"][dir] .bd-ask .composer.composer-narrow > .bd-quick, html[data-box="roomy"][dir] .bd-ask .composer.composer-narrow > .bd-quick + .attach { margin: 0; width: 44px; height: 44px; background: var(--surface-2); }
html[data-box="roomy"] .composer.composer-narrow > .send { margin-inline-start: auto; }
.bd-quick.on { color: var(--brand); background: var(--brand-soft); }
.bd-quick:disabled { opacity: .4; cursor: default; }
.quick-menu-sub { margin: 8px 10px 2px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
/* (Back, first in the top bar on the board's own page come from a book: not on a phone, where the top bar's back is beside it) */
@media (max-width: 700px) { .bd-back-btn, .bd-back-btn + .bd-zoom-bar { display: none; } }
/* (beside a book's page while the zoom buttons are up there: spaced as on a small phone, and where its buttons show their
   pictures only, as narrow as the tutor's; where their words and the zoom buttons haven't room together, their pictures
   only: board.js placeZoom) */
.bd-embed .bd-tools-zoom { gap: 6px; }
.bd-embed .bd-tools-zoom .bd-zoom-bar { margin: 0 1px; }
.bd-embed .bd-tools-zoom .bd-zoom-pct { padding-inline: 4px; }
@media (max-width: 800px) {
  .bd-embed .bd-tools-zoom .bd-tool { padding-inline: 8px; }
  .bd-embed .bd-tools-zoom .bd-surface-btn { padding: 0 3px 0 5px; }
}
.bd-embed .bd-tools-tight .bd-tool { padding-inline: 8px; }
.bd-embed .bd-tools-tight .bd-surface-btn { padding: 0 3px 0 5px; }
.bd-embed .bd-tools-tight .bd-tool span { display: none; }
/* The board's ground (the owner's wishes, 9 November 2026, as Whiteboard 3, which the owner chose to be the whiteboard):
   the board is one plain surface, no dots and no paper, the writing straight on it: on white in
   Kitabi's own colours (as a book's page, with Dark round it too), on black in chalk colours (Dark's, on greys with no
   blue in them); its welcome words are on the board, growing, shrinking and moving with it (board1.js applyView).
   Printed, it's white as always (these are for screens). The chooser, in the top bar after New board (the owner's wishes):
   one circle showing the board it's on, with a small arrow; pressed, the four boards by name, the dotted ones first */
/* (beside a book's page, ?embed=1: no top bar or menu, the board the frame's whole height; the page it's about said in a
   chip over the box to ask in; the tutor's, the board's own page's and Close's buttons show their pictures only, and in a
   narrow frame the others too, so the top bar stays one row) */
.bd-embed .board-page .topbar { display: none; }
.bd-embed .bd-main { height: 100dvh; }
.bd-embed .board-page .reader-toast { top: 12px; }
.bd-chip.bd-chip-info { padding: 4px 10px; box-shadow: none; }
.bd-tool.bd-tool-icon { padding-inline: 8px; }
.bd-tool.bd-tool-icon span { display: none; }
@media (max-width: 800px) { .bd-embed .bd-tool span { display: none; } }
.bd-surface-pick { position: relative; display: flex; align-self: stretch; }
/* (on a small phone the top bar stays one row, with the board's two buttons and, once there's an answer, Follow, Replay all
   and Print: its buttons a little narrower) */
@media (max-width: 420px) {
  .bd-tools .bd-tool { padding-inline: 8px; }
  .bd-tools .bd-surface-btn { padding: 0 3px 0 5px; }
  .bd-tools-group .bd-zoom-bar { margin: 0 1px; }
}
/* (the sheet's button: only where the board is wider than a portrait sheet, so choosing changes something; its menu's
   pages shown as on a word processor's) */
@media (max-width: 900px) { .bd-sheet-pick { display: none; } }
.bd-sheet-icon { flex: none; color: var(--ink-2); }
/* (the writing's button and its menu: each style shown in itself, Aa or أب) */
.bd-font-sample { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; color: var(--ink); font-size: 17px; line-height: 1; }
.bd-font-sample[data-font="hand"] { font-family: "Caveat", "Aref Ruqaa", cursive; font-size: 21px; font-weight: 600; }
.bd-font-sample[data-font="hand"]:lang(ar) { font-family: "Aref Ruqaa", "Caveat", serif; font-size: 17px; }
.bd-font-sample[data-font="neat"] { font-family: "Comic Neue", "Noto Naskh Arabic", sans-serif; font-size: 17px; font-weight: 700; }
.bd-font-sample[data-font="neat"]:lang(ar) { font-family: "Noto Naskh Arabic", "Comic Neue", serif; font-size: 15px; }
.bd-font-sample[data-font="print"] { font-family: "Inter", "IBM Plex Sans Arabic", sans-serif; font-size: 15px; font-weight: 600; }
.bd-font-sample[data-font="print"]:lang(ar) { font-family: "IBM Plex Sans Arabic", "Inter", sans-serif; font-size: 14px; }
/* (the writing, chosen in the board menu: handwriting as before; neat, Comic Neue (its ² as big as a typed one's: Patrick Hand's was too small to read) and Naskh, the school books' Arabic; or
   typed, Kitabi's own Inter and IBM Plex Sans Arabic. Each at the size that takes about the room handwriting does: --bd-k,
   measured 9 November 2026. Sarah's idea, the owner's account first: rule 36) */
:root[data-board-font="neat"] .bd-world, :root[data-board-font="neat"] .bd-panel[lang="en"], :root[data-board-font="neat"] .bd-hello-box { font-family: "Comic Neue", "Noto Naskh Arabic", "IBM Plex Sans Arabic", sans-serif; --bd-k: .82; }
:root[data-board-font="neat"] .bd-world[lang="ar"], :root[data-board-font="neat"] .bd-panel[lang="ar"], :root[data-board-font="neat"] .bd-hello-box:lang(ar) { font-family: "Noto Naskh Arabic", "Comic Neue", "IBM Plex Sans Arabic", serif; --bd-k: .87; }
:root[data-board-font="print"] .bd-world, :root[data-board-font="print"] .bd-panel[lang="en"], :root[data-board-font="print"] .bd-hello-box { font-family: "Inter", "IBM Plex Sans Arabic", sans-serif; --bd-k: .74; }
:root[data-board-font="print"] .bd-world[lang="ar"], :root[data-board-font="print"] .bd-panel[lang="ar"], :root[data-board-font="print"] .bd-hello-box:lang(ar) { font-family: "IBM Plex Sans Arabic", "Inter", sans-serif; --bd-k: .82; }
.bd-surface-btn { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; padding: 0 5px 0 7px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.bd-surface-btn:hover, .bd-surface-btn[aria-expanded="true"] { background: var(--surface-3); color: var(--ink); }
.bd-surface-btn svg { transition: transform .15s; }
.bd-surface-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.bd-surface-btn:focus-visible, .bd-surface-opt:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.bd-surface-menu { position: absolute; z-index: 8; top: calc(100% + 10px); inset-inline-start: -4px; display: grid; gap: 2px; min-width: 196px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); }
.bd-surface-menu[hidden] { display: none; }
.bd-surface-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: 500 14px "Inter", "IBM Plex Sans Arabic", sans-serif; text-align: start; white-space: nowrap; cursor: pointer; }
.bd-surface-opt:hover { background: var(--surface-3); }
.bd-surface-name { flex: 1; }
.bd-surface-opt > svg:last-child { visibility: hidden; color: var(--brand); } /* (the tick, on the one it's on: the option's own picture, a sheet's page, stays) */
.bd-surface-opt[aria-checked="true"] { background: var(--brand-soft); color: var(--brand-ink); }
.bd-surface-opt[aria-checked="true"] > svg:last-child { visibility: visible; }
/* (each circle: its ground, and its dots in a grid centred in it, three by three) */
.bd-swatch { flex: none; box-sizing: border-box; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.bd-swatch[data-surface="white"] { background: #fff; }
.bd-swatch[data-surface="black"] { background: #121212; }
.bd-swatch[data-surface="white-dots"] { background: #f4f6fb radial-gradient(#7d8aa0 1px, transparent 1.45px) center / 5px 5px; }
.bd-swatch[data-surface="black-dots"] { background: #121212 radial-gradient(#a1a1a6 1px, transparent 1.45px) center / 5px 5px; }
:root[data-board-surface] .bd-hello-box { transform-origin: 0 0; }
@media screen {
  :root[data-board-surface="white"] .bd-main { --bd-ground: #fff; --bd-dot: #cbd5e1; color-scheme: light; --bd-hl: rgb(250 204 21 / .45); --bd-blue: var(--info); --bd-green: var(--ok); --bd-red: var(--bad); --bd-purple: var(--brand); --bd-orange: var(--amber); --bd-label: var(--brand); }
  :root[data-board-surface="black"] .bd-main { --bd-ground: #121212; --bd-dot: #4c4c50; --surface: #1c1c1e; --surface-2: #19191b; --surface-3: #2c2c2e; --ink: #f2f2f2; --ink-2: #dcdcdc; --muted: #a1a1a6; --faint: #6e6e73; --line: #38383a; --line-2: #4c4c50; --glass: 28 28 30; --tone: 242 242 242; --bd-hl: rgb(250 204 21 / .26); --bd-blue: #93b4ff; --bd-green: #7ee2a8; --bd-red: #ff9b9b; --bd-purple: #c4b5fd; --bd-orange: #fdba74; --bd-label: #c7d2fe; }
  :root[data-board-surface] .bd-board { background: var(--bd-ground); }
  /* (with dots, the owner's wish: as Whiteboards 1 and 2, the white one on their light ground, moving and growing with the
     board as theirs do: board1.js applyView) */
  :root[data-board-surface="white"][data-board-dots] .bd-main { --bd-ground: #f4f6fb; }
  :root[data-board-surface][data-board-dots] .bd-board { background-image: radial-gradient(var(--bd-dot) 1px, transparent 1.4px); background-size: 22px 22px; }
  /* (the plain boards: the writing straight on them, no sheets of paper; on the dotted ones each answer is on its sheet of
     paper, as on Whiteboards 1 and 2: white on the white board, a dark one on the black: the owner's wish) */
  :root[data-board-surface]:not([data-board-dots]) .bd-panel { border-color: transparent; background: none; box-shadow: none; }
  :root[data-board-surface]:not([data-board-dots]) .bd-world { --surface: var(--bd-ground); } /* (the labels' halo and the joins' dots in the board's own colour) */
  :root[data-board-surface] .bd-link, :root[data-board-surface] .bd-port { stroke: var(--bd-label); }
}
.bd-zoom-pct { min-width: 52px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font: 600 13px var(--font); font-variant-numeric: tabular-nums; cursor: pointer; }
.bd-zoom-pct:hover { background: var(--surface-2); }
.bd-zoom-bar { width: 1px; height: 20px; margin: 0 2px; background: var(--line); }
.bd-back-to { position: absolute; z-index: 6; left: 50%; bottom: calc(var(--bd-ask-h, 64px) + 24px); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 0; border-radius: 999px; background: var(--brand); color: #fff; font: 600 13.5px var(--font); white-space: nowrap; box-shadow: var(--shadow-lg); cursor: pointer; }
.bd-back-to[hidden] { display: none; }
/* (the box to ask in: medium, centred at the bottom) */
.bd-ask { position: absolute; z-index: 7; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(640px, calc(100% - 24px)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
/* (its row is the tutor's own box, .composer: the same buttons and picture button, the owner's wish; here it floats) */
.bd-ask .bd-row.composer { gap: 6px; padding: 6px; border: 1px solid var(--line-2); border-radius: 30px; background: var(--surface); box-shadow: var(--shadow-lg); }
.bd-ask .bd-input { width: 100%; max-height: 120px; }
/* (room for the picture button on the page's side, whichever way what's typed runs: the box follows its words, dir=auto,
   and an empty one runs left to right, so its own "end" isn't the button's in Arabic: number 140) */
:root[dir="ltr"] .bd-ask .bd-input { padding-left: 12px; padding-right: 40px; }
:root[dir="rtl"] .bd-ask .bd-input { padding-left: 40px; padding-right: 12px; }
:root[dir="rtl"] .bd-ask .bd-input:placeholder-shown { direction: rtl; } /* (empty: its words start on the right, as the tutor's) */
.bd-price { justify-self: center; max-width: 100%; margin: 0; padding: 1px 10px; border-radius: 999px; background: rgb(var(--glass) / .82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); text-align: center; color: var(--muted); font-size: 12px; }
.bd-price:empty { display: none; }
.bd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-chips[hidden] { display: none; }
.bd-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font: 500 13px "Inter", "IBM Plex Sans Arabic", sans-serif; box-shadow: var(--shadow); }
[dir="rtl"] .bd-chip { padding: 4px 10px 4px 4px; }
.bd-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-chip img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
.bd-chip svg { flex: none; }
.bd-chip-off { flex: none; border: 0; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; padding: 4px; border-radius: 50%; }
.bd-chip-off:hover { background: rgb(var(--brand-rgb) / .12); }
.board-page .reader-toast { top: calc(var(--topbar) + 66px); } /* (under the tools) */
.bd-mine { display: grid; gap: 6px; }
.bd-mine-row { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.bd-mine-open { flex: 1; min-width: 0; text-align: start; border: 0; background: transparent; padding: 6px 8px; cursor: pointer; display: grid; gap: 2px; color: var(--ink); font: inherit; }
.bd-mine-open strong, .bd-mine-open small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-mine-open small { color: var(--muted); }
/* (grouped by book: the book's name over its boards, then Other boards) */
.bd-mine-group { display: grid; gap: 6px; }
.bd-mine-group + .bd-mine-group { margin-top: 14px; }
.bd-mine-head { display: flex; align-items: center; gap: 8px; margin: 0 4px 2px; font-size: 13.5px; font-weight: 700; line-height: 1.35; color: var(--ink-2); }
.bd-mine-head svg { flex: none; color: var(--brand); }
.bd-mine-head span { min-width: 0; }
/* (each group its own colour, the owner's wish: a light panel of its tint, its name in its colour, and each board with a
   stripe of it at its start) */
.bd-mine-group[class*="tint-"] { padding: 10px; border-radius: 16px; background: var(--tint); border: 1px solid var(--tint-line); }
.bd-mine-group[class*="tint-"] + .bd-mine-group { margin-top: 12px; }
.bd-mine-group[class*="tint-"] .bd-mine-head { margin-top: 2px; color: color-mix(in srgb, var(--tint-ink) 72%, var(--ink)); }
.bd-mine-group[class*="tint-"] .bd-mine-head svg { color: var(--tint-ink); }
.bd-mine-group[class*="tint-"] .bd-mine-row { background: var(--surface); border-color: var(--tint-line); border-inline-start: 4px solid var(--tint-ink); }
/* (a narrow canvas: the zoom buttons go above the box to ask in, and Back to the writing above them) */
@container bdmain (max-width: 1040px) {
  .bd-zoom { bottom: calc(var(--bd-ask-h, 64px) + 24px); }
  .bd-back-to { bottom: calc(var(--bd-ask-h, 64px) + 74px); }
}
/* (and the reading bar on their line, at the box's start, instead of a line of its own over the box: the owner's wish, 10
   November 2026, "make it smaller and move it to the left side, so the − 100% + is on its right, all in one line"; for
   whoever the change is on, me.boardNext.readbar, rule 36. On a phone, its buttons smaller and no words: the wave says it's
   reading) */
@container bdmain (max-width: 1040px) {
  .bd-oneline .bd-ask .bd-voicebar { position: absolute; bottom: calc(100% + 14px); inset-inline-start: 0; justify-self: auto; }
}
@container bdmain (max-width: 700px) {
  .bd-oneline .bd-ask .bd-voicebar { gap: 6px; padding-inline-end: 12px; }
  .bd-oneline .bd-ask .bd-voicebar .vb-text { display: none; }
  .bd-oneline .bd-ask .bd-voicebar .vb-play { width: 32px; height: 32px; }
  .bd-oneline .bd-ask .bd-voicebar .vb-stop { width: 30px; height: 30px; }
}
@media (max-width: 700px), (pointer: coarse) {
  .bd-input { font-size: 16px; } /* (16 on a phone: smaller, and Safari zooms the whole page in when it's touched) */
}
@media (max-width: 700px) {
  .bd-panel { padding: 16px 16px 30px; border-radius: 14px; }
  .bd-step { font-size: calc(22px * var(--bd-k, 1)); }
  .bd-title { font-size: calc(30px * var(--bd-k, 1)); }
  .bd-math { font-size: calc(23px * var(--bd-k, 1)); }
  .bd-hello { font-size: calc(28px * var(--bd-k, 1)); }
  .bd-tools { top: 8px; inset-inline: 8px; }
  .bd-tool span { display: none; }
  .bd-ask { bottom: 10px; width: calc(100% - 20px); }
  .bd-ask .composer :is(.speak-toggle, .lang-toggle, .mic, .send) { width: 40px; height: 40px; }
  html[data-box="roomy"][dir] .bd-ask .composer.composer-narrow > :is(.attach, .bd-quick), html[data-box="roomy"][dir] .bd-ask .composer.composer-narrow > .bd-quick + .attach { width: 40px; height: 40px; }
  .bd-zoom { inset-inline-end: 10px; }
  .bd-zoom-pct { min-width: 46px; }
  /* (boxes one under another, each arrow pointing down to the next) */
  .bd-boxes { flex-direction: column; align-items: flex-start; }
  .bd-boxes[dir="ltr"] .bd-arrow { transform: rotate(90deg); }
  .bd-boxes[dir="rtl"] .bd-arrow { transform: rotate(-90deg); }
  .bd-arrow { margin-inline-start: 18px; line-height: 1; }
  .bd-by { flex-direction: row-reverse; gap: 8px; margin-inline-start: 18px; }
  .bd-by .bd-arrow { margin-inline-start: 0; }
  .bd-boxes.bd-other { align-items: flex-end; }
  .bd-boxes.bd-other > .bd-arrow, .bd-boxes.bd-other > .bd-by { margin-inline: 0 18px; }
}
/* (printed: the panels one under another, without the canvas, its lines or the tools) */
@media print {
  body.board-page { overflow: visible; padding: 0 !important; background: #fff; }
  .board-page .topbar, .board-page .side-nav, .board-page .sn-shade, .bd-tools, .bd-zoom, .bd-back-to, .bd-ask, .bd-hello-box, .bd-links, .bd-pen, .bd-thinking, .bd-wrong, .bd-panel-tools, .bd-export-menu, #toast { display: none !important; }
  .bd-main { height: auto; overflow: visible; container-type: normal; }
  .bd-board { position: static; overflow: visible; background: none; }
  .bd-world { position: static; width: auto; height: auto; transform: none !important; }
  .bd-panel { position: static; width: auto !important; min-height: 0; margin: 0 0 28px; padding: 0; border: 0; background: none; box-shadow: none; }
  .bd-step, .bd-step * { clip-path: none !important; }
  .bd-wait { visibility: visible !important; }
  .bd-voicebar { display: none !important; }
  .bd-step { break-inside: avoid; }
  /* (PDF: that answer alone, its question as wide as the page) */
  body.bd-print-one .bd-panel:not(.bd-print-this) { display: none !important; }
  .bd-panel.bd-has-export > .bd-q { max-width: 100%; }
}

/* Your work in a book Kitabi removed (/work, work.js; the owner's design, 10 November 2026): when and why, until when,
   Save all, then the reader's own work in it, kind by kind, read only (My notebook's look, without ways to open pages) */
.wk-back { margin: 0 0 14px; font-size: 14.5px; }
.wk-back a { color: var(--brand); font-weight: 600; text-decoration: none; }
.wk h1 { overflow-wrap: anywhere; }
.wk-author { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.wk-state { padding: 14px 16px; border: 1.5px dashed var(--bad-line); border-radius: 14px; background: var(--bad-faint); }
.wk-state p { margin: 6px 0 0; color: var(--ink-2); font-size: 14.5px; }
.wk-state .wk-when { margin: 0; color: var(--bad); font-weight: 600; }
.wk-state .wk-note { font-style: italic; }
.wk-state .wk-until { color: var(--ink); font-weight: 600; }
.wk-acts { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
.wk-mistake { margin: 12px 0 0; font-size: 14.5px; }
.wk-mistake a { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.wk-list { display: grid; gap: 22px; margin-top: 26px; }
.wk-sec { display: grid; gap: 10px; }
.wk-sec h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 19px; }
.wk-sec h2 .count { padding: 1px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700; }
.wk-page { cursor: default; }
.wk-line p, .wk-none { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.wk-answer p { margin: 0 0 4px; white-space: pre-wrap; font-size: 14.5px; }
.wk-on { margin: 0; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.wk-words { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); font-size: 14.5px; }
.wk-words th, .wk-words td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.wk-words th { background: var(--surface-2); font-size: 13px; color: var(--muted); }
.wk-chat { padding: 0; }
.wk-chat summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 12px; cursor: pointer; }
.wk-chat summary strong { font-size: 14.5px; }
.wk-chat summary span { color: var(--muted); font-size: 13px; }
.wk-msgs { display: grid; gap: 10px; padding: 0 12px 12px; }
.wk-q, .wk-a { padding: 8px 12px; border-radius: 12px; font-size: 14.5px; }
.wk-q { background: var(--brand-soft, var(--surface-2)); }
.wk-a { background: var(--surface-2); }
.wk-q p, .wk-a p { margin: 4px 0 0; }
.wk-who { margin: 0 !important; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.wk-pic { color: var(--muted); font-style: italic; font-size: 13px; }
a.wk-board { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 12px; color: var(--ink); text-decoration: none; }
a.wk-board:hover { border-color: var(--brand); }
a.wk-board span { color: var(--muted); font-size: 13px; }
@media (max-width: 560px) {
  .wk-acts .btn { flex: 1 1 100%; }
}

/* Contact us: Think this is a mistake? on a book Kitabi removed (the book, and what can and can't change) */
.ct-removed { padding: 12px 14px; border: 1.5px dashed var(--bad-line); border-radius: 12px; background: var(--bad-faint); }
.ct-removed p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.ct-removed p + p { margin-top: 6px; }

/* Messages (/messages, messages.js; and in Admin: the Read window's conversation and Admin → Messages' list; 10 November
   2026): conversations with Kitabi's team, each a line with what it's about, its last words, when, and how it stands */
.ms-new-msg { margin: 0 0 18px; }
.ms-list, .ad-convs { display: grid; gap: 10px; }
.ms-line, .ad-conv { display: grid; gap: 4px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.ms-line:hover, .ad-conv:hover { border-color: var(--brand); }
.ms-line.unread, .ad-conv.open { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); }
[dir="rtl"] :is(.ms-line.unread, .ad-conv.open) { box-shadow: inset -4px 0 0 var(--brand); }
.ms-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.ms-top strong { font-size: 15px; }
.ms-state { padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ms-state.ms-new { background: var(--brand); color: #fff; }
.ms-state.ms-wait { background: var(--amber-soft-2); color: var(--amber-ink); }
.ms-state.ms-done { background: var(--surface-2); color: var(--muted); }
.ms-last { color: var(--ink-2); font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ms-when { color: var(--muted); font-size: 12.5px; }
.ad-conv-sub { color: var(--muted); font-size: 13.5px; }
.ms-none { color: var(--ink-2); }
.ms-started { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.ms-thread { display: grid; gap: 10px; margin: 0 0 18px; }
.ms-msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; }
.ms-msg.me { justify-self: end; background: var(--brand-soft); border-end-end-radius: 6px; }
.ms-msg.team { justify-self: start; background: var(--surface-2); border-end-start-radius: 6px; }
.ms-who { margin: 0 0 4px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.ms-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.ms-reply { display: grid; gap: 8px; }
.ms-reply textarea, .al-answer textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; resize: vertical; }
.ms-reply label span, .al-answer label span { display: block; margin-bottom: 6px; font-weight: 600; }
.ms-note { margin: 12px 0 0; color: var(--muted); font-size: 13.5px; }
.al-talk { margin: 14px 0 4px; }
.al-thread-h { margin: 0 0 10px; font-size: 15px; }
.al-talk .ms-thread { max-height: 340px; overflow: auto; padding: 2px; }
.al-answer { display: grid; gap: 8px; }
.ad-head-2 { margin-top: 28px; }
@media (max-width: 560px) {
  .ms-msg { max-width: 96%; }
}
.wk-kicker { margin: 0 0 4px; color: var(--brand); font-size: 14px; font-weight: 700; }
.ms-book { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.ms .ms-book { margin: -4px 0 6px; font-size: 16px; }

/* Add a book: photos (11 November 2026): a small picture of each, numbered in the order they'll be pages, with buttons
   to move it earlier or later, or take it out; one this browser can't open is marked in red */
.ab-photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 8px 0 10px; padding: 0; list-style: none; max-height: 340px; overflow: auto; }
.ab-photo { display: grid; gap: 4px; justify-items: center; }
.ab-photo-pic { position: relative; display: grid; place-items: center; width: 96px; height: 120px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.ab-photo-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ab-photo-pic b { position: absolute; inset-inline-start: 4px; top: 4px; min-width: 20px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; text-align: center; }
.ab-photo.bad .ab-photo-pic { border: 2px solid var(--bad); background: var(--bad-faint); }
.ab-photo-tools { display: flex; gap: 2px; }
.ab-photo-tools .icon-btn { width: 28px; height: 28px; font-size: 17px; line-height: 1; }
.ab-photo-tools .icon-btn:disabled { opacity: .3; }
.ab-photo-bad { margin: 6px 0 0; color: var(--bad); font-size: 14px; font-weight: 600; }
.ab-photo-kind { color: var(--bad); font-size: 13px; font-weight: 800; letter-spacing: .04em; }

/* Admin → Helpers (11 November 2026): the problems helper's reports, each a card like a problem's, with the cause in a
   coloured label, the report, the questions asked and their answers */
.ad-helpers .hp-h { margin: 18px 0 4px; font-size: 18px; }
.hp-list { display: grid; gap: 14px; margin-top: 12px; }
.hp-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.hp-card.focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.hp-card .pr-head { margin: 0; }
.hp-card .pr-who { margin: 2px 0 8px; color: var(--muted); font-size: 13px; }
.hp-said { margin: 0 0 10px; padding: 6px 12px; border-inline-start: 4px solid var(--line); background: var(--surface-2); border-radius: 6px; font-size: 14px; color: var(--ink-2); white-space: pre-wrap; }
.hp-wait { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.hp-cause { margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hp-chip { padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--ink); }
.hp-c-ai, .hp-c-reading, .hp-c-fault { background: var(--bad-faint); color: var(--bad); }
.hp-c-student { background: var(--brand-soft); color: var(--brand); }
.hp-sure { color: var(--muted); font-size: 13px; font-weight: 600; }
.hp-report { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 10px; font-size: 14.5px; }
.hp-report dt { color: var(--muted); font-weight: 700; font-size: 13px; padding-top: 2px; }
.hp-report dd { margin: 0; }
.hp-report ul { margin: 0; padding-inline-start: 18px; }
/* (a helper's lines are in the words it wrote them in, each its own way round: in Arabic, an English line starts on the
   left, its bullet beside it, not across the page; browsers line a list's items up with the list, not with themselves) */
.hp-report li[dir] { text-align: start; }
html[dir="rtl"] .hp-report :is(ul, ol) { padding-left: 18px; }
.hp-tofix span { font-style: italic; }
.hp-more { display: grid; gap: 8px; margin: 0 0 10px; }
.hp-qa { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.hp-q { margin: 0 0 4px; font-weight: 700; }
.hp-a { margin: 0; white-space: pre-wrap; }
.hp-ask { display: grid; gap: 6px; margin: 0 0 10px; }
.hp-ask label span { display: block; margin-bottom: 4px; font-weight: 600; font-size: 14px; }
.hp-ask textarea { width: 100%; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; resize: vertical; }
.hp-acts { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) {
  .hp-report { grid-template-columns: 1fr; }
}

/* the complaint helper's cards (Admin → Helpers, 11 November 2026) */
.cp-mail { margin: -4px 0 8px; color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }
.cp-v-real { background: var(--bad-faint); color: var(--bad); }
.cp-v-fake { background: var(--surface-2); color: var(--ink); }
.cp-v-unsure { background: var(--amber-soft-2); color: var(--amber-ink); }
.cp-books li { margin-bottom: 6px; }
.cp-books small { color: var(--muted); }
.cp-books .btn { margin-inline-start: 6px; }
.cp-reply { margin: 0 0 6px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); white-space: pre-wrap; font-size: 14px; }
.cp-reply-acts { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cp-none { margin: 0; color: var(--muted); }
/* the legal helper (11 November 2026): its window (the letter pasted, or its files; how and when it came), and its cards */
.lg-modal { width: min(560px, 100%); }
.lg-form { display: grid; gap: 14px; }
.lg-form label > span { display: block; margin-bottom: 4px; font-weight: 600; font-size: 14px; }
.lg-form small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.lg-form textarea, .lg-form select, .lg-form input[type=date] { width: 100%; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.lg-form textarea { resize: vertical; min-height: 140px; }
.lg-form input[type=file] { max-width: 100%; font: inherit; font-size: 14px; }
.lg-form :is(textarea, select, input):focus { outline: none; border-color: var(--brand); }
.lg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .lg-row { grid-template-columns: 1fr; } }
.lg-add-row { margin: 10px 0 0; }
.lg-letter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.lg-letter details { flex: 1 0 100%; }
.lg-letter summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 14px; }
.lg-letter .hp-said { margin-top: 8px; max-height: 320px; overflow: auto; }
.lg-u-now, .lg-l-now { background: var(--bad-faint); color: var(--bad); }
.lg-u-days, .lg-l-soon { background: var(--amber-soft-2); color: var(--amber-ink); }
.lg-steps { margin: 0; padding-inline-start: 20px; }
.lg-steps li, .lg-avoid li { margin-bottom: 4px; }
.lg-card.lg-handled { background: var(--surface-2); }
.lg-done > summary { cursor: pointer; margin: 4px 0; color: var(--ink-2); font-weight: 700; }
.lg-done > .hp-list { margin-top: 10px; }

/* Admin → Money (11 November 2026): the finance helper's report, the months, the expenses, the rates */
.fn-report { margin: 12px 0 6px; }
.fn-summary { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.fn-tip { padding: 8px 12px; margin: 0 0 8px; border-radius: 10px; background: var(--surface-2); }
.fn-tip p { margin: 2px 0; font-size: 14px; }
.fn-tip-title { font-weight: 700; }
.fn-tip-effect { color: var(--muted); }
.fn-months { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fn-months th, .fn-months td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.fn-months th { background: var(--surface-2); color: var(--muted); font-size: 13px; }
/* how people use Kitabi (the testers' report, 11 November 2026): the time and Download, three cards (typical, heavy,
   average), where the credits went, each person, the packs against it */
.us-sec { margin: 30px 0; }
.us-bar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 16px; margin: 10px 0 14px; }
.us-people :is(th, td) { white-space: normal; min-width: 72px; } /* (each person's line wraps in its cells, so it fits the page) */
.us-bar label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.us-bar select { padding: 7px 30px 7px 10px; border: 1.5px solid var(--line); border-radius: 10px; background-color: var(--surface); color: var(--ink); font: 600 14px/1.2 var(--font); }
.us-body { display: grid; gap: 10px; }
.us-body .sum-h { margin: 12px 0 0; }
.us-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.us-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.us-card p { margin: 0; }
.us-card-h { color: var(--muted); font-size: 13px; font-weight: 700; }
.us-card-n { margin-top: 4px !important; font-size: 20px; font-weight: 800; color: var(--ink); }
.us-card-cost { color: var(--ink-2); font-size: 14px; }
.us-card-split { margin-top: 4px !important; color: var(--muted); font-size: 12.5px; }
.us-kinds dd small { margin-inline-start: 6px; color: var(--muted); font-weight: 600; }
.us-people td small, .us-people td strong { display: block; }
.us-people td small { color: var(--muted); font-size: 12px; }
.us-packs td.fn-loss { color: var(--bad); font-weight: 700; }
.us-packs td.fn-gain { color: var(--ok); font-weight: 700; }
.fn-loss { color: var(--bad); font-weight: 700; }
.fn-gain { color: var(--ok, #15803d); font-weight: 700; }
.fn-expenses { display: grid; gap: 8px; margin: 8px 0 14px; }
.fn-expense { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fn-expense p { margin: 0 0 4px; font-size: 14px; }
.fn-x-kind, .fn-x-sum, .fn-x-note { color: var(--muted); font-size: 13px; }
.fn-add, .fn-rates { display: grid; gap: 8px; max-width: 640px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.fn-row label, .fn-add > label { display: grid; gap: 4px; flex: 1 1 140px; font-size: 13px; font-weight: 600; }
.fn-add input, .fn-add select, .fn-rates input { padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 400; }
.pd-sees { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.pd-sees-list { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 8px; font-size: 14px; }
@media (max-width: 560px) {
  /* the month table on a phone: all five columns in view, its words wrapping (the profit or loss can't hide off the side) */
  .fn-months th, .fn-months td { white-space: normal; padding: 6px 5px; font-size: 12.5px; }
}

/* Admin → Agents (11 November 2026): the team's updates, a card for each agent (its picture, name, AI tag, job, what's
   waiting, its latest, its brain), and an agent's page (its head; Updates, Talk to it, Settings) */
.ad-agents .hp-h { margin: 18px 0 6px; font-size: 18px; }
.ag-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ag-line { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ag-line.ag-go { cursor: pointer; }
.ag-line.ag-go:hover, .ag-line.ag-go:focus-visible { border-color: var(--brand-line); background: var(--brand-soft); outline: none; }
.ag-line.ag-out { border-inline-start: 4px solid var(--amber-line); }
.ag-line-body { min-width: 0; flex: 1; }
.ag-line-body strong { font-size: 14px; }
.ag-line-text { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ag-when { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ag-face { display: inline-grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 16px; background: var(--brand-soft); font-size: 28px; line-height: 1; }
.ag-face-sm { width: 34px; height: 34px; border-radius: 11px; font-size: 18px; }
.ag-face-lg { width: 68px; height: 68px; border-radius: 20px; font-size: 38px; }
.ag-kitabi { background: var(--surface-3); }
.ag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.ag-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.ag-card-head, .ag-head { display: flex; gap: 12px; align-items: center; }
.ag-card-name { min-width: 0; }
.ag-card h4 { margin: 0; font-size: 17px; }
.ag-name { overflow-wrap: anywhere; }
.ag-ai { display: inline-block; vertical-align: 2px; padding: 1px 7px; border-radius: 6px; background: var(--brand-soft-2); color: var(--brand-ink); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.ag-role { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.ag-wait { margin: 4px 0 0; font-weight: 700; font-size: 14px; color: var(--ink); }
.ag-wait.ag-quiet { color: var(--muted); font-weight: 600; }
.ag-wait.ag-urgent { color: var(--bad-ink); }
.ag-latest { margin: 0; font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ag-brain { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.ag-fell { margin: 2px 0; padding: 6px 10px; border-radius: 10px; background: var(--amber-soft-2); color: var(--amber-ink); font-size: 13.5px; font-weight: 600; }
.ag-card .hp-acts { margin-top: auto; padding-top: 6px; }
.ag-back { margin: 0 0 8px; }
.ag-head { margin-bottom: 12px; align-items: flex-start; }
.ag-head h2 { margin: 0; font-size: 22px; }
.ag-head .ag-role { font-size: 14px; }
.ag-parts { margin: 4px 0 12px; }
.ag-ran { margin: 4px 0 0; color: var(--faint); font-size: 12.5px; font-weight: 600; }
.ag-ran-fell { color: var(--amber-ink); }
/* talking to an agent */
.ag-chat { display: grid; gap: 10px; margin: 8px 0 12px; max-height: min(60vh, 560px); overflow-y: auto; overscroll-behavior: contain; padding-inline-end: 4px; }
.ag-qa { display: grid; gap: 2px; }
.ag-q-who, .ag-a-who { margin: 0; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.ag-a-who { margin-top: 6px; color: var(--brand-ink); }
.ag-a { line-height: 1.55; }
.ag-ideas { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.ag-idea { font: inherit; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.ag-idea:hover, .ag-idea:focus-visible { border-color: var(--brand); color: var(--brand); }
.ag-cost { color: var(--muted); font-size: 13px; margin-inline-start: 6px; }
/* an agent's settings */
.ag-settings { display: grid; gap: 14px; max-width: 640px; }
.ag-field span, .ag-settings legend { display: block; margin-bottom: 6px; font-weight: 700; font-size: 14px; }
.ag-field input { width: 100%; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.ag-settings fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.ag-faces { display: flex; flex-wrap: wrap; gap: 6px; }
.ag-faces legend { width: 100%; }
.ag-face-pick { position: relative; }
.ag-face-pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ag-face-pick span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-size: 22px; }
.ag-face-pick input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.ag-face-pick input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft-2); }
.ag-models, .ag-efforts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.ag-models legend, .ag-efforts legend { grid-column: 1 / -1; }
.ag-choice { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.ag-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.ag-choice input { margin: 3px 0 0; accent-color: var(--brand); }
.ag-choice-text { display: grid; gap: 1px; }
.ag-choice-text small { color: var(--muted); font-size: 12.5px; }
.ag-estimate { margin: 0; font-weight: 700; }
.ag-fallback { margin: 0; }
/* the support agent: each message's view, and the weeks */
.sp-said { margin: 8px 0; padding: 6px 12px; border-inline-start: 4px solid var(--line); background: var(--surface-2); border-radius: 6px; font-size: 14px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-card.sp-urgent { border-color: var(--bad-line); box-shadow: inset 4px 0 0 var(--bad); }
html[dir="rtl"] .sp-card.sp-urgent { box-shadow: inset -4px 0 0 var(--bad); }
.sp-done { font-size: 12.5px; font-weight: 700; }
.sp-is-open { color: var(--amber-ink); }
.sp-is-done { color: var(--ok-ink); }
.sp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.sp-tag { padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); }
.sp-u-now, .sp-f-child-safety { background: var(--bad-soft); color: var(--bad-ink); }
.sp-u-today, .sp-f-upset, .sp-f-refund { background: var(--amber-soft-2); color: var(--amber-ink); }
.sp-f-idea, .sp-kind { background: var(--brand-soft); color: var(--brand-ink); }
.sp-summary { margin: 0 0 8px; font-size: 14.5px; }
.sp-reply { padding: 8px 12px; border: 1px dashed var(--brand-line); border-radius: 10px; background: var(--surface-2); margin: 0 0 6px; }
.sp-reply-h { margin: 0 0 4px; font-size: 13px; color: var(--brand-ink); }
.sp-reply-text { margin: 0; white-space: pre-wrap; font-size: 14.5px; }
.sp-reach { margin: 6px 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.sp-weeks { display: grid; gap: 10px; }
.sp-week > summary { cursor: pointer; }
.sp-week-sum { margin: 8px 0; }
.sp-count { color: var(--muted); font-size: 13px; }

/* Only some pages of a book (11 November 2026): in the price window, All the pages or Only pages … to …, with a picture
   of the first and the last page chosen; and the owner's switch in Admin → Credits */
.pgr { margin: 12px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.pgr legend { font-weight: 700; padding: 0 6px; }
.pgr-room { margin: 0 0 8px; font-size: 14px; color: var(--amber-ink); background: var(--amber-soft); padding: 6px 10px; border-radius: 8px; }
.pgr-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.pgr-opt { display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.pgr-opt input { accent-color: var(--brand); margin: 0; width: 18px; height: 18px; }
.pgr-opt:has(input:disabled) { color: var(--faint); cursor: not-allowed; }
.pgr-some { margin-top: 10px; }
.pgr-pick { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 10px; align-items: end; }
.pgr-pick label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pgr-pick input { width: 7.5em; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; font-size: 16px; background: var(--surface); color: var(--ink); text-align: center; }
.pgr-pick input:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft-2); }
.pgr-peeks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 340px; }
.pgr-peeks figure { margin: 0; display: grid; gap: 4px; justify-items: center; min-width: 0; }
.pgr-peeks img { display: block; width: 100%; aspect-ratio: 1 / 1.414; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.pgr-peeks img:not([src]) { visibility: hidden; }
.pgr-peeks img.pgr-loading { opacity: .4; }
.pgr-peeks figcaption { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.pgr-note { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
.pgr-note.pgr-bad { color: var(--bad-ink); font-weight: 600; }
.ad-range .ad-check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.ad-range .ad-check input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }

/* The top bar's search (11 November 2026): a box in the middle of the bar on a wide screen, a 🔍 on a phone and beside
   a book's own tools; its window (at the top of the screen; the whole screen on a phone), the results in groups */
.topfind { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; max-width: 520px; height: 40px; margin-inline: auto; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--muted); font: inherit; cursor: pointer; text-align: start; }
.topfind:hover, .topfind:focus-visible { border-color: var(--brand-line); background: var(--surface); color: var(--ink-2); outline: none; }
.topfind:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft-2); }
.topfind-icon { display: inline-flex; flex: none; }
.topfind-icon svg { width: 18px; height: 18px; }
.topfind-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.topfind-key { flex: none; font: inherit; font-size: 11.5px; font-weight: 700; padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); }
.topbar.has-find .logo { margin-inline-end: 0; }
.topfind.compact { flex: none; width: 40px; height: 40px; justify-content: center; padding: 0; margin-inline: 0; border-color: transparent; background: none; }
.topfind.compact .topfind-text, .topfind.compact .topfind-key { display: none; }
@media (max-width: 760px) {
  .topfind { flex: none; width: 40px; justify-content: center; padding: 0; margin-inline: 0; border-color: transparent; background: none; }
  .topfind .topfind-text, .topfind .topfind-key { display: none; }
  .topbar.has-find .logo { margin-inline-end: auto; }
}
.modal:has(.find-modal) { place-items: start center; padding-top: max(16px, 8vh); }
.find-modal { width: min(680px, 100%); }
.find-modal .modal-body { display: flex; flex-direction: column; }
.fd-field { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); }
.fd-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft-2); }
.fd-icon { display: inline-flex; color: var(--muted); }
.fd-icon svg { width: 20px; height: 20px; }
.fd-input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 12px 0; background: transparent; color: var(--ink); font: inherit; font-size: 17px; }
.fd-input::-webkit-search-cancel-button { cursor: pointer; }
.fd-out { margin-top: 10px; max-height: min(62vh, 560px); overflow-y: auto; overscroll-behavior: contain; transition: opacity .15s; }
.fd-out.fd-busy { opacity: .55; }
.fd-hint, .fd-none { margin: 6px 4px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.fd-recent { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 4px 0; }
.fd-recent .fd-h { width: 100%; margin: 0 0 2px; }
.fd-chip { display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; }
.fd-chip:hover, .fd-chip:focus-within { border-color: var(--brand-line); }
.fd-chip-go { font: inherit; padding: 5px 2px; padding-inline-start: 12px; border: 0; background: none; color: inherit; cursor: pointer; border-radius: 999px; }
.fd-chip-go:hover, .fd-chip-go:focus-visible { color: var(--brand); outline: none; }
.fd-chip-x { display: inline-grid; place-items: center; min-width: 28px; height: 28px; margin-inline-end: 2px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 17px; line-height: 1; cursor: pointer; }
.fd-chip-x:hover, .fd-chip-x:focus-visible { background: var(--bad-soft); color: var(--bad-ink); outline: none; }
.fd-group { margin: 4px 0 10px; }
.fd-h { margin: 8px 4px 4px; color: var(--muted); font-size: 12.5px; font-weight: 800; letter-spacing: .02em; }
.fd-n { font-weight: 600; color: var(--faint); }
.fd-list { display: grid; gap: 2px; }
.fd-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.fd-item:hover, .fd-item:focus-visible { background: var(--brand-soft); outline: none; }
.fd-mark { flex: none; width: 24px; text-align: center; font-size: 17px; line-height: 1.4; }
.fd-mark[data-color] { width: 12px; height: 12px; margin: 5px 6px 0; border-radius: 4px; font-size: 0; background: #fde047; }
.fd-mark[data-color="green"] { background: #86efac; }
.fd-mark[data-color="blue"] { background: #93c5fd; }
.fd-mark[data-color="pink"] { background: #f9a8d4; }
.fd-mark[data-color="red"] { background: #fca5a5; }
.fd-mark[data-color="orange"] { background: #fdba74; }
.fd-mark[data-color="purple"] { background: #c4b5fd; }
.fd-body { display: grid; gap: 2px; min-width: 0; }
.fd-title { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fd-said { color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fd-sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-pages .fd-title { font-weight: 500; }
.find-modal mark { background: var(--amber-soft-2); color: inherit; border-radius: 3px; padding: 0 1px; }
.fd-more, .fd-inbook { justify-self: start; margin: 2px 10px 4px; padding: 4px 0; border: 0; background: none; color: var(--brand); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; text-decoration: none; }
.fd-more:hover, .fd-inbook:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .modal:has(.find-modal) { padding: 0; place-items: stretch; }
  .study-modal .modal-card.find-modal { width: 100%; height: 100dvh; max-height: none; border-radius: 0; }
  .find-modal .modal-body { flex: 1; min-height: 0; }
  .fd-out { max-height: none; flex: 1; min-height: 0; }
}
/* a phone, the 🔍 in the bar too: a little tighter (as number 118 did for the Admin tag); on the smallest phones (360 or
   375 wide) the logo's mark without its word, still read out by a screen reader. A book's own bar is tighter already: its
   🔍 as small as its buttons */
@media (max-width: 480px) {
  .home-top.has-find { gap: 8px; padding-inline: 12px; }
  .home-top.has-find .topfind { width: 36px; height: 36px; }
  .book-reader .topfind.compact { width: 30px; height: 30px; }
}
@media (max-width: 380px) {
  .home-top.has-find .logo > span:not(.logo-mark):not(.admin-tag) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* a note at the top (Your translation is ready, Your practice exam is ready) gives way while a window is open, and shows
   again once it's closed: it covered a window's name and ✕, and the search's box on a phone (MISTAKES 241) */
body:has(.modal) .exam-note { visibility: hidden; }
/* ---- A phone's boxes have letters of 16px (13 November 2026, MISTAKES.md number 419). An iPhone's Safari zooms the
   whole page in when a box whose letters are smaller is tapped, and stays zoomed in; about sixty kinds of box were 13 to
   15px (sign in and sign up, the tutor's, Listen's lists, Credit, Contact us, the whiteboard's, most of Admin's). So on
   a phone (a touch screen 760 wide or less, or one held sideways) every box to type in or pick from is 16px, whatever
   its own rule says. The few boxes whose letters are bigger are named after it, to keep them: a new rule that gives a
   box bigger letters must be added there too, which tools/test/guards-check.mjs looks for. (Each kind of box is named,
   with no :not() list, so that an old iPhone reads the rule too.) ---- */
@media (pointer: coarse) and (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
  input:not([type]), input[type="text"], input[type="search"], input[type="number"], input[type="password"], input[type="email"], input[type="tel"], input[type="url"],
  input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="datetime-local"], textarea, select { font-size: 16px !important; }
  input.fd-input { font-size: 17px !important; }
  .kid-link input { font-size: 18px !important; }
  input.lc-code { font-size: 20px !important; }
  .st-code input { font-size: 22px !important; }
}
/* Every drop-down in Kitabi is Kitabi's own box (rule 46: the owner's "A, Kitabi's box", 12 November 2026): the same in
   every browser, its arrow set in from the edge (on the left in Arabic). Never the browser's own, which Chrome draws
   against the edge and Safari as two small arrows: three times a box was made and left out of the lists above (MISTAKES
   63, 113 and 267). So every select gets it at once, and no other rule may take it off: the !important lines, which
   tools/test/selects-check.mjs keeps an eye on. While it's being tried it's for whoever has the change (me.next.selects,
   rule 44): theme.js puts data-selects="own" on the page. Its size stays each place's own (its font and the room above
   and below its words); the box, the arrow and the room at its sides are the same everywhere */
:root[data-selects="own"] select {
  --sel-pad: 12px; --sel-arrow: 11px; --sel-end: 30px;
  -webkit-appearance: none !important; appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%2364748b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-size: 12px 12px !important; background-position: right var(--sel-arrow) center !important;
  padding-right: var(--sel-end) !important; padding-left: var(--sel-pad) !important;
  border: 1.5px solid var(--line); border-radius: 10px; background-color: var(--surface); text-overflow: ellipsis; cursor: pointer;
}
:root[data-selects="own"][dir="rtl"] select { background-position: left var(--sel-arrow) center !important; padding-left: var(--sel-end) !important; padding-right: var(--sel-pad) !important; }
/* (the small ones, in bars and windows: a little closer to their edges) */
:root[data-selects="own"] :is(.voice-pick, .lb-pickers select, .pager select) { --sel-pad: 9px; --sel-arrow: 9px; --sel-end: 26px; border-radius: 9px; }
/* (the big ones of a form keep their rounder corners, like the boxes to type in beside them) */
:root[data-selects="own"] :is(select.pick-box, .birth-pick select, .ct-row select, .nbh-pick select) { border-radius: 12px; }
:root[data-selects="own"] select:hover:not(:disabled) { border-color: var(--brand-mid); }
:root[data-selects="own"] select:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgb(var(--brand-rgb) / .14); }
/* (one that can't be opened shows no arrow) */
:root[data-selects="own"] select:disabled { background-image: none !important; padding-right: var(--sel-pad) !important; cursor: default; }
:root[data-selects="own"][dir="rtl"] select:disabled { padding-left: var(--sel-pad) !important; }
