/* The Fluent Hāfidh portal: one stylesheet. Rules for whoever edits it are in docs/DESIGN_SYSTEM.md.
   Every colour, corner, shadow and font is a token below. Screens never write a colour of their own, so the
   whole look changes here. Default: "Academy" (light: warm page, white cards with depth, navy sidebar, gold marks).
   Night is the data-theme="night" set, chosen per device on the account screen.
   Design pass 3 (12 Nov): one colour per course (the .tone-* classes), gradient icon tiles, one badge family,
   designed cards with a header, a back button, and conversations drawn as chat bubbles. */
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  color-scheme: light;
  --bg: #f4f1ea; --bar: #ffffff; --card: #ffffff; --well: #faf8f3; --tint: #eef3fb;
  --line: #e7e1d4; --line-strong: #ddd6c6; --line-field: #8d8676;
  --tx: #121a2c; --tx-2: #4b5568; --tx-3: #5d6676;
  --gold: #a8781f; --gold-tx: #8a6212; --on-gold: #ffffff; --gold-hi: #e3b26d;
  --key: #2358b8; --key-2: #5b4bd6; --btn: #14274a; --on-btn: #ffffff; --btn-line: #c9d3e6; --chosen: #e4edfb;
  --alert: #9a2b1c; --alert-bg: #fbe9e5;
  /* What a word or badge means, everywhere: good, needs a look, a problem, information, a plan, nothing yet. */
  --ok: #1f9d63; --ok-tx: #16683f; --ok-bg: #e5f6ec;
  --warn: #d99a1e; --warn-tx: #87560a; --warn-bg: #fcf1d9;
  --bad: #d4553f; --bad-tx: #9a2b1c; --bad-bg: #fbe9e5;
  --info: #3a7be0; --info-tx: #1f55a8; --info-bg: #e6effc;
  --plan: #7a62f0; --plan-tx: #4e3cc0; --plan-bg: #efecfd;
  --mute: #b4ad9d; --mute-tx: #5d6676; --mute-bg: #f0ede6;
  /* The default tone (used where no course applies): navy and blue. Each .tone-* class below replaces it. */
  --tone: #3a6fd0; --tone-2: #1d3a72; --tone-tx: #24509e; --tone-bg: #e7eefa;
  /* the navy sidebar and the "next lesson" banner */
  --side: #0f1b33; --side-tx: #bccae3; --side-hi: #ffffff; --side-on: #1b2d52; --side-line: #22345a; --star: #e3b26d;
  --hero: #14274a; --hero-tx: #ffffff; --hero-sub: #c5d3ec; --hero-mark: #e3b26d; --hero-btn: #ffffff; --on-hero-btn: #14274a;
  /* Depth: a hairline of light on the top edge, a near shadow and a soft far one, so cards sit a little above the page. */
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(18, 26, 44, .06), 0 10px 24px -12px rgba(18, 26, 44, .16);
  --shadow-up: inset 0 1px 0 rgba(255, 255, 255, .9), 0 2px 4px rgba(18, 26, 44, .06), 0 22px 44px -18px rgba(18, 26, 44, .30);
  --card-bg: linear-gradient(180deg, #ffffff 0%, #fdfcf9 100%);
  --btn-bg: linear-gradient(180deg, #24447e 0%, #14274a 100%);
  --gold-bg: linear-gradient(180deg, #c99a3e 0%, #a8781f 100%);
  --mine-bg: linear-gradient(180deg, #e8f0fd 0%, #dce8fb 100%);
  --tick-read: #1479d6; --send: linear-gradient(145deg, #22a875, #0f7f58);
  --chat-bg: radial-gradient(60% 50% at 100% 0%, rgba(88, 166, 255, .08), transparent 70%),
             radial-gradient(50% 40% at 0% 100%, rgba(227, 178, 109, .10), transparent 70%), #f7f4ee;
  /* The look of the website's mockup A: navy, a blue glow, a gold glow, a few fine stars, and a soft light that follows the pointer. */
  --side-bg: radial-gradient(120% 55% at 0% 0%, rgba(88, 166, 255, .26), transparent 60%),
             radial-gradient(100% 45% at 100% 100%, rgba(227, 178, 109, .18), transparent 62%),
             radial-gradient(1px 1px at 22% 18%, rgba(255, 255, 255, .55), transparent 60%),
             radial-gradient(1px 1px at 78% 31%, rgba(255, 255, 255, .4), transparent 60%),
             radial-gradient(1px 1px at 46% 64%, rgba(255, 255, 255, .35), transparent 60%),
             radial-gradient(1px 1px at 86% 78%, rgba(255, 255, 255, .45), transparent 60%),
             linear-gradient(180deg, #11203f 0%, #0c1830 55%, #0a1326 100%);
  --side-active: linear-gradient(90deg, rgba(88, 166, 255, .28), rgba(88, 166, 255, .05));
  --hero-bg: radial-gradient(70% 90% at 100% 0%, rgba(227, 178, 109, .24), transparent 60%),
             radial-gradient(60% 80% at 0% 100%, rgba(88, 166, 255, .24), transparent 65%),
             linear-gradient(160deg, #1b3563 0%, #14274a 55%, #0f1f3d 100%);
  --page-glow: radial-gradient(55% 38% at 85% -8%, rgba(88, 166, 255, .13), transparent 65%),
               radial-gradient(40% 30% at 0% 100%, rgba(227, 178, 109, .10), transparent 70%);
  --r-card: 18px; --r-well: 14px; --r-field: 12px; --r-btn: 99px;
  --disp: 'Cormorant Garamond', Georgia, serif;
  --body: 'Nunito Sans', system-ui, -apple-system, sans-serif;
  --pad: 16px; --gap: 14px; --wide: 1160px; --side-w: 252px;
}
/* One colour per course. A course's name, chips, rows, icon tiles and learners all take it.
   --tone-tx is the colour for words and passes 4.5:1 on white and on --tone-bg. */
.tone-hifdh   { --tone: #14b087; --tone-2: #0a7259; --tone-tx: #0b6b52; --tone-bg: #e2f6ee; }
.tone-circle  { --tone: #8a73f5; --tone-2: #4f3cc9; --tone-tx: #4a3bbf; --tone-bg: #eeebfd; }
.tone-qaida   { --tone: #f5a945; --tone-2: #d0661a; --tone-tx: #8f4b08; --tone-bg: #fdefdc; }
.tone-reading { --tone: #44aff2; --tone-2: #1a6fc4; --tone-tx: #135e9e; --tone-bg: #e2f1fc; }
.tone-tajweed { --tone: #f0739f; --tone-2: #bd3468; --tone-tx: #a32855; --tone-bg: #fce7ef; }
.tone-general { --tone: #dcb05a; --tone-2: #a8781f; --tone-tx: #8a6212; --tone-bg: #f8efdc; }
.tone-ok   { --tone: #2bb673; --tone-2: #157a4b; --tone-tx: var(--ok-tx); --tone-bg: var(--ok-bg); }
.tone-warn { --tone: #f0b43c; --tone-2: #c07a12; --tone-tx: var(--warn-tx); --tone-bg: var(--warn-bg); }
.tone-bad  { --tone: #ea7560; --tone-2: #b73a26; --tone-tx: var(--bad-tx); --tone-bg: var(--bad-bg); }
.tone-plan { --tone: #8a73f5; --tone-2: #4f3cc9; --tone-tx: var(--plan-tx); --tone-bg: var(--plan-bg); }
.tone-mute { --tone: #b8b1a2; --tone-2: #7b7466; --tone-tx: var(--mute-tx); --tone-bg: var(--mute-bg); }
.tone-navy { --tone: #3a6fd0; --tone-2: #1d3a72; --tone-tx: #24509e; --tone-bg: #e7eefa; }
.tone-gold { --tone: #e3b26d; --tone-2: #a8781f; --tone-tx: var(--gold-tx); --tone-bg: #f8efdc; }

:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #070c16; --bar: #0a111e; --card: #101a2c; --well: #0c1423; --tint: #0f1b30;
  --line: #1c2c47; --line-strong: #22375a; --line-field: #2a3f63;
  --tx: #eef4ff; --tx-2: #9db0cd; --tx-3: #8fa2c0;
  --gold: #e3b26d; --gold-tx: #e3b26d; --on-gold: #1a1206;
  --key: #93c8ff; --key-2: #b9a8ff; --btn: #6aaeff; --on-btn: #041020; --btn-line: #2a4470; --chosen: #12233f;
  --alert: #ffb4a8; --alert-bg: #2a1512;
  --ok-tx: #7fd6a4; --ok-bg: #0f2a1d; --warn-tx: #f3c46d; --warn-bg: #2a2010; --bad-tx: #ffb4a8; --bad-bg: #2a1512;
  --info-tx: #93c8ff; --info-bg: #10223d; --plan-tx: #c3b5ff; --plan-bg: #1c1840; --mute-tx: #9db0cd; --mute-bg: #141f33;
  --tone-tx: #93c8ff; --tone-bg: #10223d;
  --side: #0a111e; --side-tx: #9db0cd; --side-hi: #eef4ff; --side-on: #12233f; --side-line: #1c2c47;
  --hero: #12233f; --hero-tx: #eef4ff; --hero-sub: #9db0cd; --hero-btn: #6aaeff; --on-hero-btn: #041020;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 12px 28px -16px rgba(0, 0, 0, .7);
  --shadow-up: inset 0 1px 0 rgba(255, 255, 255, .05), 0 22px 44px -18px rgba(0, 0, 0, .8);
  --card-bg: linear-gradient(180deg, #121e33 0%, #0f182a 100%);
  --btn-bg: linear-gradient(180deg, #8cc2ff 0%, #5fa4f7 100%);
  --gold-bg: linear-gradient(180deg, #f0c98e 0%, #e3b26d 100%);
  --mine-bg: linear-gradient(180deg, #17345e 0%, #132c50 100%);
  --tick-read: #62c4ff; --send: linear-gradient(145deg, #2bbd86, #14946a);
  --chat-bg: radial-gradient(60% 50% at 100% 0%, rgba(88, 166, 255, .08), transparent 70%), #0a1220;
  --side-bg: radial-gradient(120% 55% at 0% 0%, rgba(88, 166, 255, .16), transparent 60%), linear-gradient(180deg, #0a111e, #080e19);
  --hero-bg: radial-gradient(70% 90% at 100% 0%, rgba(227, 178, 109, .14), transparent 60%), linear-gradient(160deg, #15294a, #0f1d36);
  --page-glow: radial-gradient(55% 38% at 85% -8%, rgba(88, 166, 255, .10), transparent 65%);
}
:root[data-theme="night"] .tone-hifdh   { --tone-tx: #6fdcb9; --tone-bg: #0d2a23; }
:root[data-theme="night"] .tone-circle  { --tone-tx: #c3b5ff; --tone-bg: #1c1840; }
:root[data-theme="night"] .tone-qaida   { --tone-tx: #f7c27a; --tone-bg: #2b1f0e; }
:root[data-theme="night"] .tone-reading { --tone-tx: #8fd0ff; --tone-bg: #0e2438; }
:root[data-theme="night"] .tone-tajweed { --tone-tx: #ffa5c4; --tone-bg: #321324; }
:root[data-theme="night"] .tone-general, :root[data-theme="night"] .tone-gold { --tone-tx: #e3b26d; --tone-bg: #2a2010; }
:root[data-theme="night"] .tone-navy { --tone-tx: #93c8ff; --tone-bg: #10223d; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 400 16px/1.55 var(--body); min-height: 100dvh; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1, h2, .disp { font-family: var(--disp); font-weight: 500; line-height: 1.1; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 2.75rem); letter-spacing: -.005em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1rem; font-weight: 700; }
em.key, h1 em { font-style: italic; color: var(--key); }
@supports (-webkit-background-clip: text) or (background-clip: text) {
  h1 em { background: linear-gradient(95deg, var(--key) 10%, var(--key-2) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
}
a { color: var(--key); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--key); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }

/* ---------- the frame ----------
   Phone: a slim top bar, the page, and tabs at the bottom where a thumb is.
   Computer (900px and up): a navy sidebar on the left holds the logo, the tabs and who you are. */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.side-nav { display: none; }
.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--page-glow), var(--bg); }
.top { position: sticky; top: 0; z-index: 6; background: var(--bar); border-bottom: 1px solid var(--line); }
.top > div { max-width: var(--wide); margin: 0 auto; padding: 4px var(--pad); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font: 500 1.35rem/1 var(--disp); color: var(--tx); text-decoration: none; min-height: 44px; }
.logo svg { width: 24px; height: 24px; stroke: var(--gold); fill: none; stroke-width: 2.2; }
.who { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.page { flex: 1; width: 100%; max-width: var(--wide); margin: 0 auto; padding: 20px var(--pad) 40px; display: flex; flex-direction: column; gap: 22px; }
.page.narrow { max-width: 36rem; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* A thin bar at the very top while a screen is loading. */
.loadbar { position: fixed; z-index: 40; left: 0; top: 0; height: 3px; width: 100%; pointer-events: none; opacity: 0; background: linear-gradient(90deg, transparent, var(--gold-hi), #58a6ff, transparent); background-size: 50% 100%; background-repeat: no-repeat; transition: opacity .2s; }
.loadbar.on { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .loadbar.on { animation: sweep 1.1s ease-in-out infinite; }
  @keyframes sweep { from { background-position: -60% 0; } to { background-position: 160% 0; } }
}

/* tabs at the bottom (phone) */
.tabs { display: flex; gap: 2px; }
.tabs a { min-height: 56px; padding: 6px 2px; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .72rem; font-weight: 600; color: var(--tx-2); text-decoration: none; text-align: center; white-space: nowrap; position: relative; }
.tabs a[aria-current="page"] { color: var(--tx); font-weight: 800; }
.tabs.bottom a[aria-current="page"] .ico { stroke: var(--gold); }
.tabs.bottom a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold-bg); }
.tabs.bottom { position: sticky; bottom: 0; z-index: 5; background: var(--bar); border-top: 1px solid var(--line); padding: 2px 4px max(8px, env(safe-area-inset-bottom)); box-shadow: 0 -6px 18px rgba(18, 26, 44, .06); }

/* The navy menu: the sidebar on a computer, the drawer from the left on a phone. */
.side-nav { display: flex; flex-direction: column; gap: 6px; width: var(--side-w); flex: none; position: sticky; top: 0; height: 100dvh; background: var(--side-bg), var(--side); color: var(--side-tx); padding: 22px 14px 18px; box-shadow: 1px 0 0 var(--side-line), 8px 0 30px rgba(10, 19, 38, .10); }
.side-nav .logo { color: var(--side-hi); padding: 0 10px; margin-bottom: 18px; font-size: 1.45rem; }
.side-nav .logo svg { stroke: var(--star); filter: drop-shadow(0 0 8px rgba(227, 178, 109, .55)); }
.tabs.side { flex-direction: column; gap: 3px; }
.tabs.side a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: .95rem; font-weight: 600; color: var(--side-tx); }
.tabs.side a:hover { background: rgba(255, 255, 255, .07); color: var(--side-hi); }
.tabs.side a[aria-current="page"] { background: var(--side-active); color: var(--side-hi); box-shadow: inset 0 0 0 1px rgba(147, 200, 255, .16); }
.tabs.side a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--star); box-shadow: 0 0 12px rgba(227, 178, 109, .7); }
.tabs.side a[aria-current="page"] .ico { stroke: var(--star); }
.side-nav .me { margin-top: auto; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--side-line); border-radius: 14px; background: rgba(255, 255, 255, .05); text-decoration: none; color: var(--side-hi); min-height: 64px; }
.side-nav .me:hover { background: rgba(255, 255, 255, .09); }
.side-nav .me .av { --tone-bg: #1b2d52; --tone-tx: #e3b26d; }
.side-nav .me b { display: block; font-size: .92rem; font-weight: 700; overflow-wrap: anywhere; line-height: 1.25; }
.side-nav .me span.role { display: block; font-size: .78rem; color: var(--side-tx); }
@media (min-width: 900px) {
  .app { flex-direction: row; }
  .top, .tabs.bottom { display: none; }
  .page { padding: 40px 44px 56px; gap: 28px; }
  .page.narrow { max-width: 40rem; margin: 0; }
}

/* A visitor who is not signed in: the page is one card in the middle, under a navy band. */
.guest .main-col { background: radial-gradient(80% 50% at 50% 0%, rgba(88, 166, 255, .12), transparent 70%), var(--page-glow), var(--bg); }
.guest .top { position: static; background: var(--side-bg), var(--side); border: 0; }
.guest .top .logo { color: var(--side-hi); }
.guest .top .logo svg { stroke: var(--star); filter: drop-shadow(0 0 8px rgba(227, 178, 109, .55)); }
.guest .page.narrow { margin: 0 auto; justify-content: center; padding-top: 36px; max-width: 30rem; }
@media (min-width: 900px) {
  .app.guest { flex-direction: column; }
  .guest .top { display: block; }
  .guest .top > div { padding: 10px 44px; }
}

/* ---------- words ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-tx); }
.eyebrow::before { content: ""; width: 7px; height: 7px; flex: none; transform: rotate(45deg); border-radius: 1px; background: var(--gold-bg); box-shadow: 0 0 8px rgba(227, 178, 109, .6); }
.label { font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--tx-3); }
.tag { font-size: .8rem; font-weight: 700; color: var(--gold-tx); }
.sub { color: var(--tx-2); font-size: .92rem; }
.small { color: var(--tx-3); font-size: .82rem; }
.strong { font-weight: 700; color: var(--tx); }
.quote { font: italic 500 1.3rem/1.25 var(--disp); color: var(--tx); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.lead { color: var(--tx-2); max-width: 64ch; font-size: .98rem; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.stack.tight { gap: 4px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.cols > .main { flex: 999 1 520px; min-width: 0; }
.cols > .side { flex: 1 1 300px; min-width: 0; }
.cols.even > .main, .cols.even > .side { flex: 1 1 340px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.page > .stack { gap: 20px; }
@media (min-width: 900px) { .page > .stack { gap: 26px; } }

/* The heading block of a screen: an eyebrow, the h1, a lead line; set apart by a rule. Actions may sit at its right. */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); position: relative; }
.head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 72px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--gold-hi), transparent); }
.head > .stack { gap: 6px; min-width: 0; }
.head .row { flex: none; }

/* ---------- the back button: top left of every screen you click into ---------- */
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px 0 10px; border-radius: 99px; background: var(--card-bg); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--tx); font-weight: 700; font-size: .9rem; text-decoration: none; }
.back .ico { width: 20px; height: 20px; color: var(--key); }
.back:hover { border-color: var(--line-field); }
.page > .stack > .back + .head, .page > .stack > .back + * { margin-top: -6px; }

/* ---------- icon tiles and avatars: the small "3D" pieces ---------- */
.itile { flex: none; width: 42px; height: 42px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, .38), transparent 55%), linear-gradient(145deg, var(--tone) 0%, var(--tone-2) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 0 rgba(0, 0, 0, .12), 0 6px 14px -6px color-mix(in srgb, var(--tone-2) 70%, transparent); }
.itile .ico { width: 21px; height: 21px; stroke-width: 2; }
.itile.sm { width: 34px; height: 34px; border-radius: 11px; }
.itile.sm .ico { width: 18px; height: 18px; }
/* Umar, 19 Nov: icon size follows importance. The next lesson has the big tile; the rows of things to do (homework,
   the revision plan, the circle) take the same small tile as the other lesson rows, so they do not compete with it. */
.t-b1 .list .item > .itile, .t-b2 .list .item > .itile, .tw-todo .list .item > .itile { width: 34px; height: 34px; border-radius: 11px; }
.t-b1 .list .item > .itile .ico, .t-b2 .list .item > .itile .ico, .tw-todo .list .item > .itile .ico { width: 18px; height: 18px; }
.itile.lg { width: 52px; height: 52px; border-radius: 16px; }
.itile.lg .ico { width: 26px; height: 26px; }
/* A person: their initial on the soft tone, ringed with the tone's gradient. */
.av { flex: none; width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; color: var(--tone-tx); border: 2px solid transparent; background: linear-gradient(var(--tone-bg), var(--tone-bg)) padding-box, linear-gradient(145deg, var(--tone), var(--tone-2)) border-box; box-shadow: 0 4px 10px -6px color-mix(in srgb, var(--tone-2) 70%, transparent); }
.av.sm { width: 32px; height: 32px; font-size: .82rem; }
.av.lg { width: 64px; height: 64px; font-size: 1.5rem; border-width: 3px; }

/* ---------- badges: one family, coloured by what they mean ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 800; line-height: 1; padding: 6px 10px; border-radius: 99px; white-space: nowrap; color: var(--info-tx); background: var(--info-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent); }
.pill.ok { color: var(--ok-tx); background: var(--ok-bg); }
.pill.warn, .pill.gold { color: var(--warn-tx); background: var(--warn-bg); }
.pill.bad { color: var(--bad-tx); background: var(--bad-bg); }
.pill.plan { color: var(--plan-tx); background: var(--plan-bg); }
.pill.info { color: var(--info-tx); background: var(--info-bg); }
.pill.mute { color: var(--mute-tx); background: var(--mute-bg); }
.pill.tone { color: var(--tone-tx); background: var(--tone-bg); }
.pill.solid { color: #fff; background: linear-gradient(145deg, var(--tone), var(--tone-2)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.pill .ico { width: 13px; height: 13px; stroke-width: 2.4; }
.pill.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
/* A course's name as a chip: a small gradient dot and the name in the course colour. */
.cchip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; font-size: .78rem; font-weight: 800; color: var(--tone-tx); background: var(--tone-bg); padding: 5px 11px 5px 9px; border-radius: 99px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cchip::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(145deg, var(--tone), var(--tone-2)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tone) 25%, transparent); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; font-size: .74rem; font-weight: 800; color: #fff; background: linear-gradient(145deg, var(--tone), var(--tone-2)); }
.tabs .count { min-width: 20px; height: 20px; margin-left: 5px; }

/* ---------- boxes ---------- */
.card { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); position: relative; }
/* A coloured bar along the top edge, in the card's tone. */
.card.accent, .panel.accent { overflow: hidden; }
.card.accent::after, .panel.accent::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--tone), var(--tone-2)); }
a.card { color: inherit; text-decoration: none; }
.card.hero { background: var(--hero-bg), var(--hero); border-color: transparent; color: var(--hero-tx); padding: 22px; box-shadow: var(--shadow-up); overflow: hidden; }
.card.hero::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px; background: conic-gradient(from var(--ang), rgba(255, 255, 255, .08) 0 62%, var(--hero-mark) 76%, #58a6ff 86%, rgba(255, 255, 255, .08) 96%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.card.hero[class*="tone-"] { background: radial-gradient(60% 90% at 100% 0%, color-mix(in srgb, var(--tone) 42%, transparent), transparent 62%), var(--hero-bg), var(--hero); }
.card.hero .label, .card.hero .eyebrow { color: var(--hero-mark); }
.card.hero .sub, .card.hero .small { color: var(--hero-sub); }
.card.hero .strong { color: var(--hero-tx); }
.card.hero .btn.pri { background: var(--hero-btn); color: var(--on-hero-btn); }
.card.hero .cchip { color: #fff; background: rgba(255, 255, 255, .12); }
.card.hero .pill { color: #fff; background: rgba(255, 255, 255, .14); }
/* The hero's shining edge stays still (speed, 16 Nov): a turning edge repainted the card on every frame, forever. */
.card.hero::after { --ang: 200deg; }
.well { background: var(--well); border: 1px solid var(--line); border-radius: var(--r-well); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
a.well { color: var(--tx); text-decoration: none; }
.private { border: 1px dashed var(--line-field); border-radius: var(--r-field); padding: 10px 12px; background: var(--well); }

/* A designed card: a header strip (icon tile, title, a badge) on a soft tone gradient, then the body. */
.panel { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); position: relative; display: flex; flex-direction: column; min-width: 0; }
.phead { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--tone-bg) 85%, transparent), transparent); border-radius: var(--r-card) var(--r-card) 0 0; }
.phead > .stack { flex: 1; min-width: 0; gap: 1px; }
.phead h2 { font: 600 1.32rem/1.15 var(--disp); color: var(--tx); font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
.phead .sub { font-size: .84rem; }
.pbody { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.pbody.flush { padding: 0; gap: 0; }
.pfoot { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--well); border-radius: 0 0 var(--r-card) var(--r-card); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* A list is one table: rows divided by thin lines, the whole thing rounded. */
.list { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.list > * { padding: 14px 18px; border-top: 1px solid var(--line); }
.list > *:first-child { border-top: 0; }
.pbody.flush > * { padding: 13px 18px; border-top: 1px solid var(--line); }
.pbody.flush > *:first-child { border-top: 0; }
a.rowlink { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--tx); text-decoration: none; min-height: 56px; }
a.rowlink:hover { background: var(--tint); }
a.rowlink::after { content: "›"; color: var(--key); font-size: 1.5rem; line-height: 1; }

/* A row: an icon tile or a person on the left, a title and a line under it, and something at the right. */
.item { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--tx); min-height: 66px; position: relative; }
.item .words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item .words > .strong { overflow-wrap: anywhere; }
.item .words > .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; font-size: .84rem; color: var(--tx-2); }
.item .end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; text-align: right; }
.item .end .date { font-size: .82rem; font-weight: 800; color: var(--tx-2); white-space: nowrap; }
a.item:hover, button.item:hover { background: var(--tint); }
a.item::after { content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--tx-3); border-top: 2px solid var(--tx-3); transform: rotate(45deg); margin: 0 4px 0 -2px; opacity: .6; }
/* A coloured edge on the left in the row's course colour. */
.item.toned::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, var(--tone), var(--tone-2)); }
.item.unread { background: color-mix(in srgb, var(--warn-bg) 55%, transparent); }
.item.unread .words > .strong::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--key); vertical-align: middle; }
@media (max-width: 599px) {
  .item { gap: 12px; }
  .item .words > .sub { white-space: normal; }
  .list > *, .pbody.flush > * { padding-left: 14px; padding-right: 14px; }
}
/* A day heading inside a list, with the full date. */
.day { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--tx-2); padding: 9px 18px !important; background: linear-gradient(90deg, var(--well), color-mix(in srgb, var(--tint) 60%, var(--well))); }
.day b { color: var(--tx); }
.day.today b { color: var(--gold-tx); }
.day .small { letter-spacing: 0; text-transform: none; font-weight: 700; }
.list > .day:first-child { border-top: 0; }

/* Counts a screen opens with: tiles with an icon, the number in the tile's colour, a word under it. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 15px; border-radius: var(--r-well); border: 1px solid var(--line); text-decoration: none; color: var(--tx); overflow: hidden; background: radial-gradient(90% 80% at 100% 0%, color-mix(in srgb, var(--tone-bg) 90%, transparent), transparent 70%), var(--card-bg); box-shadow: var(--shadow); }
.stat .top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat b { display: block; font: 600 2.1rem/1 var(--disp); font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; color: var(--tone-tx); }
.stat span.w { font-size: .84rem; color: var(--tx-2); font-weight: 600; }
.stat .go { font-size: .78rem; font-weight: 800; color: var(--key); }
a.stat:hover { border-color: var(--line-field); }
@media (max-width: 599px) { .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat b { font-size: 1.8rem; } .stat { padding: 12px 13px; } }

/* A section: a label (with a count) above one card or table, so side-by-side sections line up. */
.section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sechead { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
.sechead .label { display: inline-flex; align-items: center; gap: 8px; }
.sechead .btn.quiet { min-height: 32px; font-size: .85rem; }

/* Empty states that still look finished: an icon tile, one line of what it means, and one thing to do. */
.empty { color: var(--tx-2); background: var(--card-bg); border: 1px dashed var(--line-field); border-radius: var(--r-well); padding: 22px; text-align: center; }
.empty.rich { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 20px; }
.empty.rich .itile { margin-bottom: 4px; }
.empty.rich .btn { margin-top: 4px; min-height: 44px; }
.notice { border-radius: var(--r-field); padding: 10px 14px; background: var(--alert-bg); color: var(--alert); font-weight: 700; }
.saved { display: inline-flex; align-items: center; gap: 8px; color: var(--ok-tx); background: var(--ok-bg); border-radius: var(--r-field); padding: 10px 14px; font-weight: 700; }
.note-box { display: flex; gap: 12px; align-items: flex-start; background: linear-gradient(135deg, var(--tint), color-mix(in srgb, var(--tint) 40%, var(--card))); border: 1px solid var(--line); border-radius: var(--r-well); padding: 12px 14px; color: var(--tx-2); font-size: .9rem; }
.note-box > .ico { color: var(--key); margin-top: 1px; }
.note-box b { color: var(--tx); }

/* ---------- a lesson report as tidy rows (covered, went well, to improve, next steps, a private note) ---------- */
/* Pass 4: no loose text under labels. Each part is a small card with a coloured edge, a small icon tile, the label
   above, then the words at reading size with a comfortable line length. */
.recap { display: flex; flex-direction: column; gap: 10px; }
.rc { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px 13px 16px; border-radius: var(--r-well); border: 1px solid var(--line); background: linear-gradient(100deg, color-mix(in srgb, var(--tone-bg) 70%, transparent), transparent 55%), var(--card); }
.rc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: var(--r-well) 0 0 var(--r-well); background: linear-gradient(180deg, var(--tone), var(--tone-2)); }
.rc.private { border-style: dashed; }
.rc-w { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rc-k { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--tone-tx); }
.rc .pre, .mcard .pre { font-size: .98rem; line-height: 1.6; color: var(--tx); max-width: 62ch; }
.itile.xs { width: 30px; height: 30px; border-radius: 10px; }
.itile.xs .ico { width: 16px; height: 16px; }
.lbl { justify-self: start; display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 800; letter-spacing: .04em; padding: 5px 10px; border-radius: 8px; color: var(--tone-tx); background: var(--tone-bg); }
.lbl .ico { width: 14px; height: 14px; stroke-width: 2.2; }
.pbody { container-type: inline-size; }
@container (max-width: 440px) { .rc { padding: 11px 12px 12px 14px; gap: 10px; } }

/* A mistake: where it was as a chip, the kind as a badge, what was heard, then "Practise" on its own violet line. */
.loc { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .86rem; color: var(--tx); background: var(--well); border: 1px solid var(--line); padding: 5px 11px 5px 8px; border-radius: 9px; }
.loc .ico { width: 15px; height: 15px; color: var(--tone-tx); }

/* Mistakes and homework to keep an eye on: a coloured edge, the kind as a badge, the words. */
.watch { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 13px 14px 13px 18px; border-radius: var(--r-well); background: var(--card); border: 1px solid var(--line); }
.watch::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: var(--r-well) 0 0 var(--r-well); background: linear-gradient(180deg, var(--tone), var(--tone-2)); }
.watch .row { gap: 6px; }
.watch .sub { font-size: .88rem; }

/* ---------- things to press ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: var(--r-btn); border: 1px solid transparent; font-weight: 800; font-size: .95rem; text-decoration: none; cursor: pointer; white-space: nowrap; background: none; color: var(--key); }
.btn .ico { width: 19px; height: 19px; stroke-width: 2.1; }
.btn.pri { background: var(--btn-bg), var(--btn); color: var(--on-btn); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 8px 18px -8px rgba(20, 39, 74, .55); }
.btn.gold { background: var(--gold-bg), var(--gold); color: var(--on-gold); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 8px 18px -8px rgba(168, 120, 31, .6); }
.btn.sec { border-color: var(--btn-line); color: var(--key); background: var(--card-bg); box-shadow: var(--shadow); }
.btn.quiet { padding: 0 8px; color: var(--key); }
.btn.round { width: 46px; padding: 0; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.wide { width: 100%; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .btn.pri:not([disabled]):hover, .btn.gold:not([disabled]):hover, .btn.sec:not([disabled]):hover, a.card:hover, a.stat:hover, .back:hover { transform: translateY(-2px); }
  .btn.pri:not([disabled]):hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 12px 24px -10px rgba(20, 39, 74, .6); }
  a.card:hover, a.stat:hover { box-shadow: var(--shadow-up); }
}
/* One choice from a few (attendance, a mistake's state, which student). aria-pressed marks the chosen one. */
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; padding: 4px; border-radius: calc(var(--r-field) + 4px); background: var(--well); border: 1px solid var(--line); }
.seg button { min-height: 44px; padding: 0 10px; border-radius: var(--r-field); border: 1px solid transparent; background: transparent; color: var(--tx-2); font-weight: 700; font-size: .88rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.seg button:hover { background: var(--card); }
.seg button .ico { width: 18px; height: 18px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--tx); border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(18, 26, 44, .08), 0 4px 10px -4px rgba(18, 26, 44, .18); }
.seg button[aria-pressed="true"] .ico { color: var(--key); }
.seg.gold button[aria-pressed="true"] { background: var(--gold-bg), var(--gold); color: var(--on-gold); border-color: transparent; }
.seg.gold button[aria-pressed="true"] .ico { color: var(--on-gold); }
/* A row of choices that filter what is below (course tabs). Scrolls sideways on a phone. */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.chips button { flex: none; min-height: 44px; padding: 0 16px 0 12px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--card-bg); color: var(--tx-2); font-weight: 700; font-size: .9rem; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; box-shadow: var(--shadow); }
.chips button::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(145deg, var(--tone), var(--tone-2)); }
.chips button[aria-pressed="true"] { background: linear-gradient(145deg, var(--tone), var(--tone-2)); color: #fff; border-color: transparent; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.chips button[aria-pressed="true"]::before { background: #fff; }
.chips button .n { font-size: .75rem; font-weight: 800; padding: 2px 7px; border-radius: 99px; background: color-mix(in srgb, currentColor 14%, transparent); }
/* Picking who (a student on the lesson page): people as chips with their initial. */
.people { display: flex; gap: 8px; flex-wrap: wrap; }
.people button { min-height: 52px; padding: 4px 16px 4px 5px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--card-bg); color: var(--tx); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; box-shadow: var(--shadow); }
.people button[aria-pressed="true"] { border-color: var(--key); box-shadow: 0 0 0 3px color-mix(in srgb, var(--key) 20%, transparent), var(--shadow); }
.people button .pill { margin-left: 2px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .lab { font-size: .85rem; font-weight: 700; color: var(--tx-2); }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; background: var(--card); border: 1px solid var(--line-field); border-radius: var(--r-field); padding: 10px 12px; box-shadow: inset 0 1px 2px rgba(18, 26, 44, .06); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--key); box-shadow: 0 0 0 4px color-mix(in srgb, var(--key) 18%, transparent); }
.field textarea { resize: vertical; line-height: 1.45; }
.field.private-field textarea { background: var(--well); border-style: dashed; }
.field.tinted > label { display: inline-flex; align-items: center; gap: 8px; }
.field.tinted > label::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: linear-gradient(145deg, var(--tone), var(--tone-2)); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--btn); }
.code { font-size: 1.6rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.savebar { position: sticky; bottom: 0; z-index: 5; background: var(--bar); border-top: 1px solid var(--line-strong); margin: 0 calc(var(--pad) * -1); padding: 12px var(--pad) max(14px, env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; box-shadow: 0 -10px 24px -12px rgba(18, 26, 44, .2); }
.savebar .btns { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 280px; justify-content: flex-end; min-width: 0; }
.savebar .btns .btn { flex: 1 1 auto; }
.savebar .small { display: inline-flex; align-items: center; gap: 8px; }
@media (min-width: 900px) { .savebar { margin: 0 -44px; padding-inline: 44px; } .savebar .btns .btn { flex: none; } }
/* A page with a save bar is a working page: the bottom tabs step aside so the two never stack. The logo leads home. */
.app:has(.savebar) .tabs.bottom { display: none; }
.page:has(.savebar) { padding-bottom: 0; }

/* The six code boxes on the sign-in page. */
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.otp input { width: 100%; min-width: 0; height: 58px; text-align: center; font: 600 1.7rem/1 var(--body); font-variant-numeric: tabular-nums; border-radius: 14px; border: 1px solid var(--line-field); background: var(--card); box-shadow: inset 0 1px 2px rgba(18, 26, 44, .08); caret-color: var(--key); }
.otp input:focus { outline: none; border-color: var(--key); box-shadow: 0 0 0 4px color-mix(in srgb, var(--key) 18%, transparent); }
.otp input.filled { border-color: var(--gold); background: linear-gradient(180deg, var(--card), color-mix(in srgb, var(--warn-bg) 60%, var(--card))); }
.otp.wrong input { border-color: var(--bad); }
@media (max-width: 380px) { .otp { gap: 5px; } .otp input { height: 50px; font-size: 1.4rem; } }
.signin { padding: 30px 26px 26px; border-radius: 24px; background: var(--card-bg); border: 1px solid var(--line); box-shadow: var(--shadow-up); display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.signin::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--gold-hi), #58a6ff, var(--key-2)); }
.signin .mark { width: 56px; height: 56px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; background: var(--hero-bg), var(--hero); box-shadow: 0 10px 22px -10px rgba(20, 39, 74, .7), inset 0 1px 0 rgba(255, 255, 255, .2); }
.signin .mark svg { width: 30px; height: 30px; stroke: var(--star); fill: none; stroke-width: 2.2; filter: drop-shadow(0 0 6px rgba(227, 178, 109, .6)); }
.signin .foot { border-top: 1px solid var(--line); padding-top: 14px; }

/* ---------- conversations, drawn like a phone chat ---------- */
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--r-card) var(--r-card) 0 0; box-shadow: var(--shadow); }
.chat-head .words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-head .chat-title { font: 800 1.05rem/1.25 var(--body); color: var(--tx); }
.chat { display: flex; flex-direction: column; padding: 14px 14px 18px; background: var(--chat-bg); border: 1px solid var(--line); border-top: 0; min-height: 280px; }
.chat-day { align-self: center; margin: 14px 0 8px; padding: 5px 12px; border-radius: 99px; font-size: .74rem; font-weight: 800; color: var(--tx-2); background: var(--card); box-shadow: 0 1px 2px rgba(18, 26, 44, .1); }
.chat-day:first-child { margin-top: 2px; }
.bubble { align-self: flex-start; max-width: min(36rem, 84%); margin-top: 3px; padding: 7px 12px 6px; border-radius: 18px; background: var(--card); color: var(--tx); box-shadow: 0 1px 1px rgba(18, 26, 44, .08), 0 2px 8px -4px rgba(18, 26, 44, .12); display: flex; flex-direction: column; }
.bubble.first { margin-top: 10px; border-top-left-radius: 6px; }
.bubble.mine { align-self: flex-end; background: var(--mine-bg); }
.bubble.mine.first { border-top-left-radius: 18px; border-top-right-radius: 6px; }
.bubble .who { font-size: .78rem; font-weight: 800; color: var(--tone-tx); margin-bottom: 1px; }
.bubble .txt { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.bubble .time { align-self: flex-end; margin-top: 1px; margin-left: 18px; font-size: .7rem; font-weight: 600; color: var(--tx-3); font-variant-numeric: tabular-nums; }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 10px 12px; background: var(--card-bg); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r-card) var(--r-card); box-shadow: var(--shadow); }
.composer textarea { flex: 1; height: var(--h, auto); min-height: 46px; max-height: 180px; resize: none; border-radius: 22px; border: 1px solid var(--line-field); background: var(--card); padding: 11px 16px; line-height: 1.4; }
.composer textarea:focus { outline: none; border-color: var(--key); box-shadow: 0 0 0 4px color-mix(in srgb, var(--key) 18%, transparent); }
.composer .btn { flex: none; }
.chat-note { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--tx-3); padding: 2px 4px; }
.chat-note .ico { width: 16px; height: 16px; }
.chat-closed { padding: 14px 16px; background: var(--well); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r-card) var(--r-card); color: var(--tx-2); font-size: .9rem; }

/* ---------- recording and listening ---------- */
.rec { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-well); background: linear-gradient(135deg, var(--tone-bg), color-mix(in srgb, var(--tone-bg) 30%, var(--card))); border: 1px solid color-mix(in srgb, var(--tone) 30%, var(--line)); }
.rec .row { gap: 12px; flex-wrap: nowrap; }
.rec-btn { flex: none; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: radial-gradient(120% 90% at 30% 0%, rgba(255, 255, 255, .4), transparent 55%), linear-gradient(145deg, #ea6a55, #b8321f); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 10px 20px -8px rgba(184, 50, 31, .7); }
.rec-btn .ico { width: 24px; height: 24px; stroke-width: 2.2; }
.rec-btn.on { background: linear-gradient(145deg, #3b4a66, #14274a); }
@media (prefers-reduced-motion: no-preference) {
  .rec-btn.on { animation: pulse 1.4s ease-out infinite; }
  @keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(234, 106, 85, .55); } 100% { box-shadow: 0 0 0 16px rgba(234, 106, 85, 0); } }
}
.rec .status { font-weight: 700; color: var(--tx); font-size: .92rem; }
audio { width: 100%; max-width: 100%; height: 44px; border-radius: 99px; }
.listen { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--r-well); background: var(--well); border: 1px solid var(--line); }
.listen .row { gap: 8px; }
.listen .rec-video { width: 100%; max-height: 60vh; border-radius: 8px; background: #000; }
.listen audio.rec-video { background: none; }

/* ---------- progress ---------- */
.bar { height: 10px; border-radius: 99px; background: var(--mute-bg); overflow: hidden; box-shadow: inset 0 1px 2px rgba(18, 26, 44, .1); }
.bar > span { display: block; height: 100%; width: var(--w, 0%); border-radius: 99px; background: linear-gradient(90deg, var(--tone), var(--tone-2)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
/* The 30 Juz: one small tile each, coloured by how strong it is. */
.juzgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.juzgrid > span { height: 46px; border-radius: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: .95rem; color: var(--tone-tx); background: var(--tone-bg); border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent); font-variant-numeric: lining-nums; }
.juzgrid > span.none { color: var(--tx-3); background: var(--well); border-color: var(--line); font-weight: 600; }
.juzgrid > span.part { background: repeating-linear-gradient(135deg, var(--tone-bg) 0 6px, var(--card) 6px 9px); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--tx-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; background: linear-gradient(145deg, var(--tone), var(--tone-2)); }
.steps { display: flex; flex-direction: column; }
.steps > div { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); }
.steps > div:first-child { border-top: 0; }
.steps .n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800; color: var(--tone-tx); background: var(--tone-bg); }
.steps .t { flex: 1; min-width: 0; }

/* ---------- small fittings ---------- */
.mini { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.mini > span { font-size: .85rem; color: var(--tx-2); }
.mini b { color: var(--tx); font-weight: 700; }
.disp .big { font-size: 1.95rem; }
.profile { display: flex; align-items: center; gap: 16px; }
.profile .words { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.profile h1 { font-size: clamp(1.8rem, 4vw, 2.3rem); }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; display: inline-flex; align-items: center; gap: 8px; background: var(--btn-bg), var(--btn); color: var(--on-btn); padding: 11px 20px; border-radius: 99px; font-weight: 800; box-shadow: var(--shadow-up); max-width: calc(100vw - 32px); }
.toast .ico { width: 18px; height: 18px; color: var(--gold-hi); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* A row that opens: a summary line, then more underneath. Used by the School screen. */
details.acc { border-top: 1px solid var(--line); }
details.acc:first-child { border-top: 0; }
details.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 12px 18px; min-height: 64px; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--tx-3); border-bottom: 2px solid var(--tx-3); transform: rotate(45deg); margin: 0 4px 3px 6px; transition: transform .15s; }
details.acc[open] > summary::after { transform: rotate(225deg); margin-bottom: -2px; }
details.acc > summary:hover { background: var(--tint); }
details.acc > .more { padding: 4px 18px 18px 74px; display: flex; flex-direction: column; gap: 14px; }
details.acc.card-acc { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card-bg); box-shadow: var(--shadow); overflow: hidden; position: relative; }
details.acc.card-acc > summary { padding-left: 20px; }
details.acc.card-acc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--tone), var(--tone-2)); }
details.acc > .more.flush { padding: 0; gap: 0; }
details.acc[open] > .more.flush { border-top: 1px solid var(--line); }
details.acc > .more.flush > details.acc > summary { padding-left: 22px; }
details.acc > .more.flush > p { padding: 16px 22px; }
.acc-group { display: flex; flex-direction: column; gap: 12px; }
.coursehead { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.coursehead h3 { font: 600 1.3rem/1.1 var(--disp); color: var(--tone-tx); }
@media (max-width: 599px) { details.acc > .more { padding-left: 18px; } }

/* Class cards. */
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.classcard { padding-top: 20px; }
.classcard h2 { font-size: 1.5rem; }
.classnext { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--tx-2); }
.classnext .strong { font-size: .9rem; }

/* Waiting for a screen: a few grey shapes in the same places the real ones will appear, never a blank page. */
.skel { display: flex; flex-direction: column; gap: 14px; }
.skel > i { display: block; border-radius: 14px; background: linear-gradient(90deg, var(--line) 0%, var(--tint) 50%, var(--line) 100%); background-size: 200% 100%; opacity: .8; }
.skel > i.t { height: 14px; width: 110px; }
.skel > i.h { height: 42px; width: min(400px, 72%); }
.skel > i.s { height: 92px; }
.skel > i.c { height: 150px; }
.skel > .g { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.skel > .g > i { display: block; height: 96px; border-radius: 14px; background: linear-gradient(90deg, var(--line) 0%, var(--tint) 50%, var(--line) 100%); background-size: 200% 100%; opacity: .8; }

/* The soft light that followed the pointer over cards is gone (speed, 16 Nov): it repainted cards while scrolling under the mouse. */

/* ---------- movement: small, quick, and none at all when the device asks for less ---------- */
@media (prefers-reduced-motion: no-preference) {
  .btn, .seg button, .chips button, .people button, .tabs a, a.rowlink, a.item, a.card, a.stat, .back, details.acc > summary { transition: background-color .15s, border-color .15s, color .15s, transform .18s ease, box-shadow .2s; }
  .page > * { animation: rise .32s ease-out both; }
  .skel > i, .skel > .g > i { animation: shimmer 1.3s ease-in-out infinite; }
  .bubble:last-child { animation: pop .22s ease-out both; }
  .toast { animation: toast .28s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
  @keyframes shimmer { to { background-position: -200% 0; } }
  @keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
  @keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
}
.watch .seg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.watch .seg button { font-size: .8rem; padding: 0 4px; white-space: nowrap; }
body:has(.savebar) .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
.stack > .cchip, .stack > .pill, .card > .cchip { align-self: flex-start; }
@media (min-width: 900px) { body:has(.side-nav) .toast { left: calc(50% + var(--side-w) / 2); } }
.pbody.flush > .steps { padding: 0; }
/* On a phone, a row coloured by its course drops the icon tile (the coloured edge already says which course), and a course name may wrap. */
@media (max-width: 599px) {
  .item.toned > .itile { display: none; }
  .item.toned { padding-left: 18px !important; }
  .item .cchip { white-space: normal; }
  .phead { padding: 12px 14px; }
  .pbody { padding: 14px; }
  .card.hero { padding: 18px; }
}
a.list.item { padding: 12px 18px; }

/* ---------- design pass 4 (12 Nov evening) ---------- */
/* Six tiles stay a tidy 3 by 2 at every computer width, 2 by 3 on a phone (never five and one alone). */
.stats.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 599px) { .stats.six { grid-template-columns: 1fr 1fr; } }
.stat .w { overflow-wrap: anywhere; }

/* School and Finance: two views of one tab. */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px; border-radius: 14px; background: var(--well); border: 1px solid var(--line); align-self: flex-start; }
.subtabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px; font-weight: 800; font-size: .9rem; color: var(--tx-2); text-decoration: none; }
.subtabs a .ico { width: 17px; height: 17px; }
.subtabs a[aria-current="page"] { background: var(--card-bg); color: var(--tx); box-shadow: var(--shadow); }
.subtabs a:hover { color: var(--tx); }

/* An explanation inside the panel it explains: a small info line in the panel header, never a loose paragraph. */
.why { display: inline-flex; align-items: flex-start; gap: 6px; color: var(--tx-2); }
.why .ico { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--key); }

/* Small sizes. */
.av.xs { width: 22px; height: 22px; font-size: .66rem; border-width: 1.5px; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: .88rem; }
.pill.pkg { color: var(--tone-tx, var(--info-tx)); background: var(--card-bg); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tone, #3a6fd0) 55%, transparent); }

/* One piece of homework on the class page. */
.hw { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 14px 20px; border-radius: var(--r-well); background: var(--card-bg); border: 1px solid var(--line); box-shadow: var(--shadow); }
.hw::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: var(--r-well) 0 0 var(--r-well); background: linear-gradient(180deg, var(--plan), color-mix(in srgb, var(--plan) 60%, #000)); }
.hw-top { display: flex; gap: 12px; align-items: flex-start; }
.hw-top .end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.hw-top .strong { font-size: 1.02rem; }
.hw-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 599px) { .hw-top { flex-wrap: wrap; } .hw-top .end { flex-direction: row; align-items: center; width: 100%; } }

/* One to one learners of one course on one card, each learner a row inside. */
.classcard.grouped { gap: 12px; }
.glist { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.gitem { display: flex; align-items: center; gap: 12px; padding: 10px 2px; min-height: 52px; color: var(--tx); text-decoration: none; border-bottom: 1px solid var(--line); }
.gitem:last-child { border-bottom: 0; }
.gitem .words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gitem > .ico { color: var(--key); }
.gitem:hover { background: var(--tint); }

/* Course chips on School: the count is learners, marked with a person. */
.chips .n { display: inline-flex; align-items: center; gap: 3px; }
.chips .n .ico { width: 13px; height: 13px; }

/* ---------- finance: figures with a share bar, and the month by month columns ---------- */
/* Chart marks, one step per course, checked with the dataviz validator against both surfaces (12 Nov). */
:root { --mark-navy: #2f5fb8; --mark-hifdh: #048060; --mark-circle: #4f3cc9; --mark-qaida: #d0661a; --mark-reading: #1a6fc4; --mark-tajweed: #bd3468; --mark-general: #a8781f; }
:root[data-theme="night"] { --mark-navy: #5b8fe0; --mark-hifdh: #109c78; --mark-circle: #8a73f5; --mark-qaida: #c97d1c; --mark-reading: #2f98dc; --mark-tajweed: #e0608c; --mark-general: #c99a3c; }
.share { display: flex; flex-direction: column; gap: 14px; }
.srow { display: flex; flex-direction: column; gap: 6px; }
.srow .row { gap: 8px; min-width: 0; }
.srow b.num { font-size: 1rem; color: var(--tx); }
.sbar { display: block; height: 10px; border-radius: 99px; background: var(--well); overflow: hidden; }
.sbar i { display: block; height: 100%; width: var(--w, 0%); border-radius: 0 4px 4px 0; background: var(--m); }
.mark-navy { --m: var(--mark-navy); } .mark-hifdh { --m: var(--mark-hifdh); } .mark-circle { --m: var(--mark-circle); } .mark-qaida { --m: var(--mark-qaida); }
.mark-reading { --m: var(--mark-reading); } .mark-tajweed { --m: var(--mark-tajweed); } .mark-general { --m: var(--mark-general); }

.colchart { display: grid; grid-template-columns: auto 1fr; gap: 10px; height: 220px; padding-top: 22px; }
.cc-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: .72rem; color: var(--tx-3); text-align: right; padding-bottom: 26px; margin-top: -7px; }
.cc-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; border-bottom: 1px solid var(--line-strong); position: relative; background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 50%; margin-bottom: 26px; }
.cc-col { position: relative; display: flex; flex-direction: column; align-items: center; outline: none; }
.cc-plot { position: relative; flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.cc-bar { position: relative; width: min(24px, 60%); height: var(--h, 0%); border-radius: 4px 4px 0 0; background: var(--mark-navy); transition: filter .15s; }
.cc-v { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 4px; font-size: .74rem; font-weight: 800; color: var(--tx); white-space: nowrap; }
.cc-x { position: absolute; top: 100%; padding-top: 6px; font-size: .74rem; color: var(--tx-2); }
.cc-col .tip { position: absolute; bottom: calc(100% + 26px); left: 50%; transform: translateX(-50%); display: none; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--card-bg); border: 1px solid var(--line); box-shadow: var(--shadow-up, var(--shadow)); font-size: .8rem; white-space: nowrap; z-index: 2; color: var(--tx); }
.cc-col:hover .tip, .cc-col:focus-visible .tip { display: flex; }
.cc-col:hover .cc-bar, .cc-col:focus-visible .cc-bar { filter: brightness(1.15); }
.cc-col:focus-visible .cc-x { color: var(--tx); font-weight: 800; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 8px; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tbl .num { text-align: right; }
@media (prefers-reduced-motion: reduce) { .cc-bar { transition: none; } }
/* Headings in Cormorant use lining figures, so "1 to 1" and "11" never read as letters. */
h1, h2, h3, .disp { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }

/* ---------- pass 4 follow-up (Umar's look at staging, 12 Nov late) ---------- */
/* On a computer Finance has its own tab in the sidebar, so the School / Finance switch is for phones only. */
@media (min-width: 900px) { .subtabs { display: none; } }
/* A class card: the course's icon with the course name and format right beside it (less height). */
.cc-top { display: flex; align-items: center; gap: 12px; }
.cc-top .stack { min-width: 0; align-items: flex-start; }
.classcard h2 { display: flex; align-items: center; gap: 8px; }
.classcard h2 a { color: inherit; text-decoration: none; }
.classcard h2 a:hover { text-decoration: underline; }
.gitem .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
a.classnext { text-decoration: none; }
/* A row that is one link, with a button (Join) that sits above that link. */
.stretch { color: var(--tx); text-decoration: none; }
.stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.item:has(.stretch):hover { background: var(--tint); }
.item .join { position: relative; z-index: 1; flex: none; }
@media (max-width: 599px) { .item:has(> .end) > .join { grid-column: 1 / -1; grid-row: auto; width: 100%; margin: 8px 0 0; } }
/* Finance: a course that opens to its packages and learners; the teaching time panel. */
.fopen > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.fopen > summary::-webkit-details-marker { display: none; }
.fopen > summary .ico { width: 15px; height: 15px; color: var(--key); transition: transform .15s; }
.fopen[open] > summary .ico { transform: rotate(90deg); }
.fin { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--well); border: 1px solid var(--line); }
.fpack { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.fpack:last-child { border-bottom: 0; padding-bottom: 0; }
.frow { gap: 10px; min-height: 36px; }
.frow .row { gap: 8px; min-width: 0; }
.fsum { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.fsum > span { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; background: var(--well); border: 1px solid var(--line); color: var(--tx-2); font-size: .82rem; }
.fsum b { font-size: 1.05rem; color: var(--tx); }
.flist { display: flex; flex-direction: column; }
.flist > .frow { padding: 8px 0; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .fopen > summary .ico { transition: none; } }
/* Row layout (Umar, 12 Nov, settled after seeing it on his own screen): a grid of lines, so it holds at any width.
   Line 1: the icon tile starts here, the title ("18:00 · Hifdh one-to-one"), the date at the right.
   Line 2: the course bullet line ("• Hifdh and revision"), the badge at the right ("tomorrow", "in 2 days").
   Anything after (a "1 learner" that wraps, a third line) goes under, and never moves the badge off the bullet line.
   The chevron and a Join button sit in the middle at the far right. */
.item:has(> .end) { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; column-gap: 0; row-gap: 3px; align-items: start; align-content: center; }
.item:has(> .end) > .words, .item:has(> .end) > .end { display: contents; }
.item:has(> .end) > .itile, .item:has(> .end) > .av { grid-column: 1; grid-row: 1 / span 2; align-self: start; margin-right: 14px; }
.item:has(> .end) > .words > * { grid-column: 2; min-width: 0; }
.item:has(> .end) > .end > * { grid-column: 3; justify-self: end; margin-left: 12px; }
.item:has(> .end) > .end > :first-child { grid-row: 1; align-self: start; margin-top: 2px; }
.item:has(> .end) > .end > :nth-child(2) { grid-row: 2; align-self: start; margin-top: 3px; }
.item:has(> .end) > .btn, a.item:has(> .end)::after, details.acc > summary.item:has(> .end)::after { grid-column: 4; grid-row: 1 / span 2; align-self: center; margin-left: 12px; }
.fline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fline .strong { min-width: 0; overflow-wrap: anywhere; }
.fline b.num { margin-left: auto; font-size: 1rem; color: var(--tx); }
.fsum { grid-template-columns: 1fr 1fr; }
/* Finance in even rows: two panels a row on a computer, the same height; one column on a phone. */
.fgrid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: stretch; }
@media (min-width: 1000px) { .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; } }
.fgrid > .panel > .pbody { flex: 1; }
.more-rows > summary { padding: 12px 18px; cursor: pointer; color: var(--key); list-style: none; }
.more-rows > summary::-webkit-details-marker { display: none; }
.more-rows[open] > summary { border-bottom: 1px solid var(--line); }
.more-rows > div > .item { padding: 14px 18px; border-top: 1px solid var(--line); }
.more-rows > div > .item:first-child { border-top: 0; }
.pbody.flush > .more-rows { padding: 0; }
.fsum > span { gap: 1px; }
.frow.tt { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.more-rows.flat > summary { padding: 10px 0 4px; }
.more-rows.flat .frow { padding: 8px 0; border-top: 1px solid var(--line); }
.panel .chips { flex-wrap: wrap; }
/* Filters for a panel: a compact period switch and a course dropdown on one line (they wrap on a phone). */
.ffilters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ffilters .seg { flex: 1 1 260px; }
.ffilters .seg button { min-height: 38px; font-size: .85rem; padding: 0 8px; }
.fsel { flex: 1 1 160px; min-height: 42px; border-radius: var(--r-field); border: 1px solid var(--line-field); background: var(--card-bg); color: var(--tx); font: inherit; font-size: .9rem; font-weight: 700; padding: 0 12px; }
.ffilters .seg { flex: 1 1 100%; display: flex; flex-wrap: nowrap; }
.ffilters .seg button { flex: 1 1 0; white-space: nowrap; }
.frange { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.frange label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; font-weight: 800; color: var(--tx-2); }
.frange input { min-height: 40px; border-radius: var(--r-field); border: 1px solid var(--line-field); background: var(--card-bg); color: var(--tx); font: inherit; padding: 0 10px; }
.frange[hidden] { display: none; }

/* ---------- pass 4 Part B: the learner's file, homework history, the chat ---------- */
.trail { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.trail > .small { display: flex; align-items: center; gap: 6px; }
.trail > .small .ico { width: 15px; height: 15px; }
.trail .watch .pre, .trail .private .pre { font-size: .98rem; line-height: 1.6; max-width: 62ch; }
.hw > .recap { padding-top: 12px; border-top: 1px solid var(--line); }
.hw a.strong, .item a.strong, .phead h2 a, .pbody > .strong a { color: var(--tx); text-decoration: none; }
.hw a.strong:hover, .item a.strong:hover, .phead h2 a:hover, .pbody > .strong a:hover { color: var(--key); text-decoration: underline; }
.hw-foot > .row { gap: 6px 8px; flex-wrap: wrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.signs { display: flex; flex-direction: column; gap: 7px; }
.sign { display: flex; align-items: center; gap: 10px; font-size: .93rem; color: var(--tx-2); }
.sign b { min-width: 1.7em; text-align: right; font-size: 1.05rem; color: var(--tx); font-variant-numeric: tabular-nums lining-nums; }
.stat .num { overflow-wrap: anywhere; }
details.acc.flat { border-top: 1px solid var(--line); }
details.acc.flat > summary { min-height: 44px; padding: 8px 2px; }
details.acc.flat > .stack { padding: 6px 0 2px; }
.sub.one { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.bubble .time { display: inline-flex; align-items: center; gap: 4px; }
.bubble .time .ed { font-style: italic; }
.bubble .time > .ico { width: 16px; height: 16px; opacity: .7; }
.ticks { display: inline-flex; color: var(--tx-3); }
.ticks .ico { width: 17px; height: 17px; stroke-width: 2.3; }
.ticks.read { color: var(--tick-read); }
.bubble.can { cursor: pointer; }
.bubble.can:focus-visible { outline: 3px solid color-mix(in srgb, var(--key) 45%, transparent); outline-offset: 2px; }
.bubble.gone .txt { font-style: italic; color: var(--tx-3); }
.b-menu { align-self: flex-end; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin: 6px 0 8px; }
.b-menu:not(.x)[hidden] { display: none; }
.b-audio { width: min(270px, 62vw); height: 42px; margin: 2px 0; }
.b-img img { display: block; max-width: min(280px, 62vw); max-height: 260px; border-radius: 12px; margin: 2px 0 4px; }
.b-file { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; margin: 2px 0; border-radius: 12px; background: color-mix(in srgb, var(--tx) 7%, transparent); color: var(--tx); text-decoration: none; font-weight: 700; overflow-wrap: anywhere; }
.b-file .ico { width: 18px; height: 18px; color: var(--key); }
.said { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 2px; padding: 8px 10px; border: 1px dashed var(--line-field); border-radius: 10px; background: var(--well); font-size: .92rem; }
.said .rc-k { display: inline-flex; align-items: center; gap: 5px; }
.said .rc-k .ico { width: 13px; height: 13px; }
.c-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; background: var(--well); border: 1px solid var(--line); border-top: 0; font-size: .88rem; }
.c-bar[hidden], .composer[hidden], .voice-box[hidden] { display: none; }
.c-bar .row { min-width: 0; gap: 8px; flex-wrap: nowrap; }
.c-bar .strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-bar .ico { width: 17px; height: 17px; color: var(--key); }
.composer .btn.round { height: 46px; min-height: 46px; border-radius: 50%; }
.composer .btn.round[hidden] { display: none; }
.btn.send { color: #fff; border: 0; background: var(--send); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 16px -8px rgba(15, 127, 88, .7); }
.btn.send:disabled { opacity: .6; }
.ico.fill { fill: currentColor; stroke-width: 1.2; }
.voice-box { display: flex; flex-direction: column; gap: 12px; padding: 12px; background: var(--card-bg); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r-card) var(--r-card); box-shadow: var(--shadow); }
/* The period choices never push a panel wider than its column: they wrap instead. */
.ffilters .seg { flex-wrap: wrap; min-width: 0; }
.ffilters .seg button { flex: 1 1 auto; }
.item > .acts { display: flex; gap: 8px; flex: none; }
@media (max-width: 599px) { .item:has(> .acts) { flex-wrap: wrap; } .item > .acts { width: 100%; justify-content: flex-end; } .item > .acts .btn { min-height: 40px; } }

/* pass 5 */
/* Section headings that read as headings */
.sh { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; margin-bottom: 4px; border-bottom: 2px solid var(--line); }
.sh .sh-t { font: 800 1.35rem/1.2 var(--body); letter-spacing: -.01em; color: var(--tx); flex: 1; min-width: 0; margin: 0; }
.sh .count { flex: none; }
.section > .sh + * { margin-top: 10px; }
/* Set and due, each in its own small place */
.dates { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.dt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 12px; border-radius: 10px; background: var(--well); border: 1px solid var(--line); min-height: 40px; }
.dt-k { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); }
.dt-v { font-weight: 800; color: var(--tx); font-size: .95rem; }
.dt-v.mute { color: var(--tx-3); font-weight: 600; }
/* A moment: label, bold date, time in a chip */
.stamp { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.stamp .ico { width: 16px; height: 16px; color: var(--key); }
.stamp .dt-v { font-size: .98rem; }
.time-chip { display: inline-block; padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, var(--key) 14%, transparent); color: var(--tx); font-size: .88rem; font-weight: 800; }
.card.hero .pill .ico { width: 14px; height: 14px; }
/* A card that folds: one row you press, the detail under it */
.hw.fold { padding: 0; gap: 0; }
.hw.fold > summary.fold-s { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 20px; cursor: pointer; min-height: 56px; border-radius: var(--r-well); }
.hw.fold > summary.fold-s::-webkit-details-marker { display: none; }
.hw.fold > summary.fold-s:hover { background: var(--well); }
.hw.fold > summary.fold-s:focus-visible { outline: 3px solid color-mix(in srgb, var(--key) 45%, transparent); outline-offset: -3px; }
.hw.fold > summary .end { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; flex: none; }
.hw.fold > summary > .ico { flex: none; width: 18px; height: 18px; color: var(--tx-3); transition: transform .15s; }
.hw.fold[open] > summary > .ico { transform: rotate(90deg); }
.hw.fold > summary .strong { font-size: 1.02rem; }
.fold-b { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 14px 20px; border-top: 1px solid var(--line); }
@media (max-width: 599px) { .hw.fold > summary.fold-s { flex-wrap: wrap; } .hw.fold > summary .end { order: 3; width: 100%; justify-content: flex-start; } .hw.fold > summary > .ico { margin-left: auto; } }
/* A review card header follows the class page header */
.rev-head .eyebrow { margin: 0; }
.rev-head h2 a { color: var(--tx); text-decoration: none; }
.rev-head h2 a:hover { color: var(--key); text-decoration: underline; }
/* pass 5: messages, closer to WhatsApp */
.c-tools { display: flex; gap: 4px; flex: none; }
.c-tools .btn.round { width: 44px; min-height: 44px; height: 44px; padding: 0; border-radius: 50%; }
.c-tools .ico, .composer .btn.quiet.round .ico { width: 22px; height: 22px; }
.chat-head { cursor: pointer; }
.c-search { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; background: var(--card-bg); border: 1px solid var(--line); border-top: 0; }
.c-search[hidden], .c-info[hidden], .emoji-pop[hidden] { display: none; }
.c-srow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.c-srow > .ico { width: 20px; height: 20px; color: var(--tx-3); flex: none; }
.c-srow input[type="search"] { flex: 1; min-width: 140px; min-height: 44px; border-radius: 22px; border: 1px solid var(--line-field); background: var(--card); padding: 8px 16px; }
.c-srow input[type="date"] { min-height: 44px; border-radius: 12px; border: 1px solid var(--line-field); background: var(--card); padding: 6px 10px; }
.c-srow .btn.round { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
.c-count { margin-left: auto; }
.bubble mark { background: color-mix(in srgb, var(--gold) 55%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.bubble mark.cur { background: var(--gold); color: var(--on-gold, #1a1a1a); outline: 2px solid var(--gold); }
.bubble.flash { animation: cflash 1.8s ease; }
/* Umar, 24 Nov: the notice opened from the bell, lit up on the Notices page. */
.list .item.lit { background: color-mix(in srgb, var(--gold) 12%, var(--card)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--gold) 70%, transparent); animation: cflash 1.8s ease; }
@keyframes cflash { 0%, 60% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 70%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.c-info { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px; background: var(--card-bg); border: 1px solid var(--line); border-top: 0; max-height: 70vh; overflow: auto; }
.c-itop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.c-it { font: 800 1.1rem/1.2 var(--body); margin: 0; }
.c-grp { display: flex; flex-direction: column; gap: 8px; }
.c-gt { display: flex; align-items: center; gap: 8px; font: 800 .95rem/1.2 var(--body); margin: 0; color: var(--tx); }
.c-gt .ico { width: 18px; height: 18px; color: var(--key); }
.c-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.c-pic { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.c-thumb { padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--well); cursor: zoom-in; min-height: 44px; }
.c-thumb img { display: block; width: 100%; height: 104px; object-fit: cover; }
.c-pic.big { grid-column: 1 / -1; }
.c-pic.big .c-thumb { cursor: zoom-out; }
.c-pic.big .c-thumb img { height: auto; max-height: 60vh; object-fit: contain; }
.c-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.c-row audio { height: 42px; width: min(280px, 100%); }
.c-bgs { display: flex; flex-wrap: wrap; gap: 10px; }
.bgsw { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; min-height: 64px; padding: 6px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; color: var(--tx-2); }
.bgsw::before { content: ""; width: 40px; height: 24px; border-radius: 8px; background: var(--chat-bg); border: 1px solid var(--line-strong); }
.bgsw[aria-pressed="true"] { border-color: var(--key); }
.chat.bg-sand, .bgsw.bg-sand { --chat-bg: color-mix(in srgb, #c9a24d 16%, var(--bg)); }
.chat.bg-sage, .bgsw.bg-sage { --chat-bg: color-mix(in srgb, #3f9b6c 16%, var(--bg)); }
.chat.bg-sky, .bgsw.bg-sky { --chat-bg: color-mix(in srgb, #4a90d9 16%, var(--bg)); }
.chat.bg-rose, .bgsw.bg-rose { --chat-bg: color-mix(in srgb, #d0617f 15%, var(--bg)); }
.chat.bg-slate, .bgsw.bg-slate { --chat-bg: color-mix(in srgb, #5b6b86 24%, var(--bg)); }
.emoji-pop { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 2px; padding: 8px; background: var(--card-bg); border: 1px solid var(--line); border-top: 0; max-height: 180px; overflow: auto; }
.emoji-pop .emo { min-height: 44px; font-size: 1.5rem; line-height: 1; border: 0; background: none; border-radius: 10px; cursor: pointer; font-family: inherit; }
.emoji-pop .emo:hover, .emoji-pop .emo:focus-visible { background: var(--well); }
.composer .btn.send, .composer .btn.round { touch-action: manipulation; }
.composer .btn.send[aria-label="Record a voice note"] { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.voice-box.slide { outline: 2px solid var(--alert, #c0392b); outline-offset: -2px; }
.voice-box.slide::after { content: "Let go to throw it away"; font-size: .85rem; font-weight: 800; color: var(--alert, #c0392b); }
@media (max-width: 599px) { .c-itop .btn { min-height: 44px; } .c-row .btn.quiet { min-height: 40px; } }

/* Goals: a card with the date as a badge and the goal in strong, upright type. Practices carry a number. */
.goal { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--plan, #7c5cd6); border-radius: 12px; background: var(--card, #fff); }
.goal-t { margin: 0; font-size: 1.1rem; font-weight: 700; font-style: normal; line-height: 1.35; }
.mk-n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--tx-1, #1a2540); color: #fff; font-size: .8rem; font-weight: 700; }

/* Your own messages can be edited or deleted: show it on a computer (13 Nov, Umar could not find it). */
.bubble.can { cursor: pointer; }
.bubble.can:hover { box-shadow: 0 0 0 2px var(--line, #d6dbe6); }
.bubble.can .meta svg, .bubble.can > svg, .bubble.can [class*="ic"] { opacity: 1; }
@media (hover: hover) { .bubble.can:hover::before { content: "Press to edit or delete"; position: absolute; top: -22px; right: 6px; font-size: .72rem; color: var(--tx-3, #667); background: var(--card, #fff); border: 1px solid var(--line, #d6dbe6); border-radius: 6px; padding: 1px 6px; white-space: nowrap; } }
.bubble.can { position: relative; }

/* The portal's own date picker (public/datepick.js). */
input[type="date"] { cursor: pointer; }
.dp { position: absolute; z-index: 90; width: 292px; padding: 14px; background: var(--card, #fff); border: 1px solid var(--line-strong, #ddd6c6); border-radius: var(--r-well, 14px); box-shadow: var(--shadow-up, 0 12px 32px rgba(18, 26, 44, .18)); color: var(--tx, #121a2c); }
.dp-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-n { width: 36px; height: 36px; border: 1px solid var(--line, #e7e1d4); border-radius: 50%; background: var(--well, #faf8f3); font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--tx, #121a2c); }
.dp-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-w { text-align: center; font-size: .72rem; font-weight: 700; color: var(--tx-3, #5d6676); padding: 4px 0; }
.dp-d { height: 36px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: .9rem; color: var(--tx, #121a2c); cursor: pointer; }
.dp-d:hover:not(:disabled) { background: var(--tint, #eef3fb); }
.dp-d.now { box-shadow: inset 0 0 0 1.5px var(--key, #2358b8); }
.dp-d.on { background: var(--btn, #14274a); color: var(--on-btn, #fff); font-weight: 700; }
.dp-d:disabled { opacity: .3; cursor: default; }
.dp-f { display: flex; justify-content: space-between; margin-top: 10px; }
.dp-t { border: 0; background: none; color: var(--key, #2358b8); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 4px; }
.dp-t:disabled { opacity: .3; cursor: default; }

/* mushaf (build 1): the page picture, the word boxes and the five kinds of mark. Each kind is a colour and a shape. */
:root { --mk-mistake: #d23f2c; --mk-revise: #c2820a; --mk-memorised: #17935a; --mk-tajweed: #2d6fe0; --mk-mixup: #7b4fd8; --mk-hesitation: #0f8b8d; }
.mpage-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; max-width: 780px; width: 100%; margin: 0 auto; box-shadow: var(--shadow); }
svg.mpage { display: block; width: 100%; height: auto; -webkit-tap-highlight-color: transparent; }
svg.mpage.boxmode { touch-action: none; cursor: crosshair; }
.mw { fill: transparent; cursor: pointer; outline: none; }
.mw:hover, .mw:focus-visible { fill: rgba(35, 88, 184, .14); }
.mw.sel { fill: rgba(35, 88, 184, .3); }
.readonly .mw { cursor: default; }
.readonly .mw:hover { fill: transparent; }
.readonly .mw.has { cursor: pointer; }
.readonly .mw.has:hover, .readonly .mw.has:focus-visible { fill: rgba(35, 88, 184, .12); }
svg .mk { fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.mk-tint { opacity: .13; pointer-events: none; }
.mk-tint.memorised { opacity: .08; }
.mk-box { fill-opacity: .1; }
.mk.mistake, .mk-box.mistake { stroke: var(--mk-mistake); } .mk-tint.mistake, .mk-box.mistake { fill: var(--mk-mistake); }
.mk.revise, .mk-box.revise { stroke: var(--mk-revise); } .mk-tint.revise, .mk-box.revise { fill: var(--mk-revise); }
.mk.memorised, .mk-box.memorised { stroke: var(--mk-memorised); } .mk-tint.memorised, .mk-box.memorised { fill: var(--mk-memorised); }
.mk.tajweed, .mk-box.tajweed { stroke: var(--mk-tajweed); } .mk-tint.tajweed, .mk-box.tajweed { fill: var(--mk-tajweed); }
.mk.mixup, .mk-box.mixup { stroke: var(--mk-mixup); } .mk-tint.mixup, .mk-box.mixup { fill: var(--mk-mixup); }
.mk.hesitation, .mk-box.hesitation { stroke: var(--mk-hesitation); } .mk-tint.hesitation, .mk-box.hesitation { fill: var(--mk-hesitation); }
.mk-box.revise { stroke-dasharray: 14 9; } .mk-box.tajweed { stroke-dasharray: 2 9; stroke-linecap: round; }
.mk-letter { font-family: var(--body); font-weight: 900; fill: var(--mk-tajweed); pointer-events: none; }
.mk-sw { width: 40px; height: 18px; flex: none; overflow: visible; }
.mk-sw .mk { stroke-width: 2.4; }
.mk-sw .mk-letter { font-size: 11px; }
.mk-tools, .mk-key, .mk-pages { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-tools button { min-height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px 0 10px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--card); color: var(--tx); font: inherit; font-weight: 800; font-size: .9rem; cursor: pointer; }
.mk-tools button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--key); background: var(--chosen); }
.mk-tools button.plain { padding: 0 14px; color: var(--tx-2); }
.mk-pill { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 800; padding: 5px 11px 5px 8px; border-radius: 99px; background: var(--well); border: 1px solid var(--line); color: var(--tx); white-space: nowrap; }
.mk-notebox input, .mnav input, .mnav select { min-height: 44px; border: 1px solid var(--line-field); border-radius: var(--r-field); background: var(--card); color: var(--tx); padding: 0 12px; font: inherit; }
.mk-notebox input { width: 100%; }
.mnav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.mnav input { width: 5.6em; text-align: center; font-weight: 800; }
.mk-row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-well); background: var(--card); }
.mk-row.on { border-color: var(--key); box-shadow: inset 0 0 0 1px var(--key); }
.mk-note { font-size: .95rem; color: var(--tx); }
.mk-page { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--tx); font: inherit; font-size: .86rem; cursor: pointer; }
.mk-page[aria-current="page"] { border-color: var(--key); box-shadow: inset 0 0 0 1px var(--key); }
.mk-count { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.mk-count .mk-sw { width: 26px; }
.mushaf > p[role="status"] { min-height: 1.5em; text-align: center; font-weight: 700; color: var(--tx); }

/* range marks: a bar in the page margin (Revise dashed stripe, Memorised tick) and a frame for a whole page */
.mk-band { opacity: .9; pointer-events: none; } .mk-frame { fill: none; opacity: .75; pointer-events: none; }
.mk-band.revise, .mk-frame.revise { fill: var(--mk-revise); } .mk-frame.revise { fill: none; stroke: var(--mk-revise); stroke-dasharray: 22 12; }
.mk-band.memorised { fill: var(--mk-memorised); } .mk-frame.memorised { fill: none; stroke: var(--mk-memorised); }
.mk-bandline { stroke: #fff; fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.mk-tools button.plain.portion { color: var(--tx); border-color: var(--key); }
.mk-portion { padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--r-well); background: var(--well); }
.mk-portion[hidden] { display: none; }
.mk-portion .seg { flex-wrap: wrap; }
.mk-pk { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 8px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--card); color: var(--tx); font: inherit; font-weight: 800; cursor: pointer; }
.mk-pk[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--key); background: var(--chosen); }
.mk-fields { display: flex; flex-wrap: wrap; gap: 10px; }
.mk-fields label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 700; color: var(--tx-2); min-width: 0; flex: 1 1 130px; }
.mk-fields input, .mk-fields select { min-height: 44px; width: 100%; min-width: 0; border: 1px solid var(--line-field); border-radius: var(--r-field); background: var(--card); color: var(--tx); padding: 0 10px; font: inherit; }
.mk-whole { font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--tx-2); }

/* pages with marks: wrap inside the box; highlight mode; page place line */
.mk-pages { flex-direction: column; flex-wrap: nowrap; max-height: 360px; overflow-y: auto; }
.mk-page { width: 100%; min-width: 0; flex-wrap: wrap; justify-content: space-between; row-gap: 4px; padding: 8px 12px; text-align: left; }
.mk-pg { display: flex; flex-direction: column; min-width: 0; }
.mk-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-place { font-weight: 700; color: var(--tx-2); }
.mpage.hlmode .mw { touch-action: none; cursor: crosshair; }
.mpage.hlmode { user-select: none; -webkit-user-select: none; }

/* sign and free-hand marks (build 1b part 2): a ring on one sign, or the line the teacher drew */
.mk.mk-ring { fill-opacity: .13; }
.mk.mk-ring.mistake { fill: var(--mk-mistake); } .mk.mk-ring.tajweed { fill: var(--mk-tajweed); } .mk.mk-ring.mixup { fill: var(--mk-mixup); }
.mk.mk-ring.mixup { fill-opacity: .07; }
.mk.mk-ring.hesitation { fill: var(--mk-hesitation); fill-opacity: .07; }
.mk-live { opacity: .75; }
.mk-sw.pen { width: 20px; height: 20px; }
.mk-sw.pen * { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mk-tools button.plain:has(.pen) { padding-left: 10px; }
.mpage.penmode { cursor: crosshair; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.mpage.penmode .mw { pointer-events: none; }
/* Mark a sign is a tap, so the page still scrolls under the finger. Draw by hand keeps the finger: one finger
   draws, two fingers still zoom (Safari does not know pinch-zoom, so it gets none). */
.mpage.penmode.sign { touch-action: manipulation; }
.mpage.penmode.free { touch-action: none; touch-action: pinch-zoom; }

/* two-page spread and typed zoom */
.mpage-wrap.spread { display: flex; max-width: 1560px; }
svg.mpage.side { opacity: .97; }
.mk-zoom { gap: 6px; flex-wrap: wrap; align-items: center; }
.mk-zoomin { width: 72px; min-height: 36px; border: 1px solid var(--line-field); border-radius: var(--r-field); background: var(--card); color: var(--tx); padding: 0 8px; font: inherit; text-align: center; }
.mk-zoom .btn[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--key); background: var(--chosen); }

.mpage-wrap { touch-action: pan-x pan-y; }

/* Printing a learner's file for a parents' meeting (the "Print this file" button on the file): plain, no menus, no buttons, no private notes. */
@media print {
  .side-nav, .tabs, header.top, .viewbar, .btn, button, form, input, select, textarea, .private, .x-added, .toast, .no-print { display: none !important; }
  html, body, .app, .main-col, .page { background: #fff !important; box-shadow: none !important; }
  .page { padding: 0 !important; max-width: none !important; }
  .card, .panel, .hw, .rc, .mk { box-shadow: none !important; break-inside: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
}

/* Choices above a book page (kind of mistake, which sign): big enough to hit on a small phone. */
.mk-notebox select { min-height: 44px; width: 100%; }

/* Mushaf and book screens, tidied (Umar, 14 Nov: it felt clunky). One card for the marking tools (kinds, then tools with Undo and Redo at the end),
   one card for finding the page (previous, page box, next; surah and Juz side by side; zoom). */
.mk-bar { gap: 8px; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.mk-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-kinds button { min-height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px 0 8px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card); color: var(--tx); font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; }
.mk-kinds button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--key); background: var(--chosen); }
.mk-tools { gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.mk-tools button { min-height: 40px; padding: 0 10px; border-radius: 10px; font-size: .88rem; }
.mk-tools .hist { min-height: 40px; }
.mk-tools .hist.first { margin-left: auto; }
.mnav { display: grid; gap: 8px; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; justify-content: stretch; justify-items: stretch; }
.mnav-page { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.mnav-num { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: .9rem; color: var(--tx-2); min-width: 0; flex-wrap: wrap; }
.mnav input { width: 5.5em; min-height: 40px; }
.mnav-jump { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mnav-jump select { width: 100%; min-width: 0; min-height: 40px; }
.mnav .mk-place { text-align: center; }
.mnav .mk-zoom { justify-content: center; }
.mk-notebox input { min-height: 40px; }
.mnav .mk-zoom { gap: 4px; flex-wrap: nowrap; }
.mnav .mk-zoom .btn { padding: 0 9px; min-height: 38px; font-size: .84rem; white-space: nowrap; }
.mnav .mk-zoomin { width: 54px; }
@media (max-width: 380px) { .mnav .mk-zoom .btn { padding: 0 7px; font-size: .8rem; } }

/* Memory map (build 4). Pages in their Juz, the page number in each square, three plain states. */
.mm-map { display: grid; gap: 2px; margin-top: 10px; }
.mm-juz { display: grid; grid-template-columns: 1.6em 1fr; align-items: center; gap: 4px; }
.mm-n { font-size: .66rem; font-weight: 700; color: var(--tx-2); text-align: right; font-variant-numeric: tabular-nums; }
.mm-cells { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 2px; }
.mm-sq { display: block; min-width: 0; aspect-ratio: 1; padding: 0; border-radius: 2px; border: 1px solid transparent; background: var(--mute-bg); cursor: pointer; font: inherit; }
.mm-sq.s-yes { background: #2fa56b; } .mm-sq.s-half { background: #eeac5a; } .mm-sq.s-no { background: #d4553f; }
.mm-sq.rev { border: 1px dashed var(--info-tx); box-shadow: inset 0 0 0 1px var(--info-tx); }
.mm-sq:focus-visible { outline: 2px solid var(--key); outline-offset: 1px; }
.mm-key { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--tx-2); }
.mm-key li { display: flex; align-items: center; gap: 6px; }
.mm-key .mm-sq { width: 16px; height: 16px; cursor: default; flex: none; }
.mm-list { margin: 0; padding: 12px 16px 12px 30px; display: grid; gap: 6px; }
.mm-list.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); }
.mm-big { font-size: 1.5rem; margin: 0; } .mm-more { margin: 0; font-weight: 700; color: var(--plan-tx); }
.mm-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mm-day { display: grid; grid-template-columns: 5.5em 5.5em 1fr auto; gap: 4px 8px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--well); }
.mm-day.st-today { border-color: var(--key); background: var(--chosen); } .mm-day.st-missed .mm-st { color: var(--bad-tx); } .mm-day.st-done .mm-st { color: var(--ok-tx); }
.mm-st { font-size: .8rem; font-weight: 700; color: var(--tx-2); }
.mm-pgs { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .88rem; } .mm-pg.moved { color: var(--plan-tx); font-weight: 700; }
.mm-min { font-size: .85rem; color: var(--tx-2); white-space: nowrap; }
@media (max-width: 480px) { .mm-day { grid-template-columns: 1fr auto; } .mm-pgs { grid-column: 1 / -1; } .mm-st { text-align: right; } }

/* Memory map: the framed grid, the Juz column (gold) against the page numbers (plain), zoom and page numbers. */
.mm-frame { margin-top: 10px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--well); padding: 8px 6px 8px 8px; }
.mm-tools { align-items: center; gap: 8px; margin-top: 10px; }
.mm-zoom { display: inline-flex; align-items: center; gap: 6px; }
.mm-zoom .btn { min-width: 40px; padding: 0 12px; font-size: 1.1rem; }
.mm-scroll { overflow: auto; max-height: 70vh; touch-action: pan-x pan-y; padding-bottom: 2px; --b: 10px; --h: 10px; --z: 1; }
.mm-scroll .mm-map { margin-top: 0; gap: 3px; }
.mm-head { padding-bottom: 6px; margin-bottom: 3px; border-bottom: 1px solid var(--line-strong); align-items: end; }
.mm-hj { font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-tx); text-align: center; }
.mm-hp { font-size: .7rem; font-weight: 700; color: var(--tx-2); }
.mm-juz { grid-template-columns: 2em 1fr; gap: 6px; }
.mm-n { display: grid; place-items: center; height: 1.7em; min-width: 1.7em; border-radius: 99px; background: var(--warn-bg); color: var(--gold-tx); font-size: .68rem; font-weight: 800; text-align: center; position: sticky; left: 0; z-index: 1; }
.mm-sq { font-size: 0; color: transparent; border-radius: 3px; }
.mm-scroll.fixed .mm-map { width: max-content; }
.mm-scroll.fixed .mm-cells { grid-template-columns: repeat(var(--cols), calc(var(--b) * var(--z))); }
.mm-scroll.fixed .mm-sq { width: calc(var(--b) * var(--z)); height: calc(var(--h) * var(--z)); aspect-ratio: auto; }
.mm-scroll.nums { --b: 28px; --h: 24px; }
.mm-scroll.nums .mm-sq { font-size: calc(.64rem * var(--z)); font-weight: 600; color: var(--tx); font-variant-numeric: tabular-nums; }
.mm-scroll.nums .mm-sq.s-yes, .mm-scroll.nums .mm-sq.s-no { color: #fff; }
.mm-key .mm-sq { font-size: 0; }

/* Memory map: back to the basic look (Umar, 15 Nov): a light frame, flat colours, no glow, no gradients, no movement. */
.mm-n { background: var(--well); color: var(--tx-2); border: 1px solid var(--line); }
.mm-sq.rev { border-color: var(--info-tx); }
.mm-scroll .mm-sq:hover, .mm-scroll .mm-sq:focus-visible { outline: 2px solid var(--key); outline-offset: 1px; }

/* "See it on a phone": only on a wide screen. The memory screen is held to a phone's width. */
.mm-phonebtn { display: none; align-self: flex-start; }
@media (min-width: 900px) {
  .mm-phonebtn { display: inline-flex; }
  .mm-page.phone-preview { max-width: 390px; margin-inline: auto; padding: 14px; border: 10px solid #121a2c; border-radius: 34px; box-shadow: var(--shadow-up); background: var(--bg); }
  .mm-page.phone-preview .mm-day { grid-template-columns: 1fr auto; }
  .mm-page.phone-preview .mm-pgs { grid-column: 1 / -1; } .mm-page.phone-preview .mm-st { text-align: right; }
}

/* ---------- compact pass (Umar, 15 Nov): smaller buttons, fields and padding, same layout ----------
   Buttons were 46px tall and cards 18px deep, so a screen of controls ran to several screens of scroll. Kept
   last in the file so it wins over the earlier sizes. A finger still gets 40px on a phone. */
.btn { min-height: 36px; padding: 0 14px; font-size: .88rem; gap: 6px; }
.btn .ico { width: 16px; height: 16px; }
.btn.round, .c-tools .btn.round, .c-srow .btn.round { width: 36px; min-height: 36px; height: 36px; }
.composer .btn.round { height: 40px; min-height: 40px; width: 40px; }
.btn.sm { min-height: 30px; padding: 0 11px; font-size: .82rem; }
.btn.quiet { padding: 0 8px; }
.sechead .btn.quiet { min-height: 28px; font-size: .82rem; }
.seg button { min-height: 34px; font-size: .84rem; gap: 6px; }
.seg button .ico { width: 16px; height: 16px; }
.chips button { min-height: 34px; padding: 0 13px 0 10px; font-size: .84rem; gap: 6px; }
.people button { min-height: 44px; }
.field { gap: 3px; }
.field input, .field select, .field textarea { min-height: 38px; padding: 7px 11px; }
.mk-tools button, .mk-page, .mk-pk { min-height: 34px; font-size: .84rem; gap: 6px; }
.mk-tools, .mk-key, .mk-pages { gap: 6px; }
.mk-notebox input, .mnav input, .mnav select, .mk-fields input, .mk-fields select { min-height: 36px; }
.phead { padding: 9px 14px; }
.phead h2 { font-size: 1.15rem; }
.pbody { padding: 12px 14px 14px; gap: 10px; }
.pbody.flush > * { padding: 10px 14px; }
.pfoot { padding: 8px 14px; }
.card { padding: 13px 14px; gap: 9px; }
.stat { padding: 10px 13px 11px; gap: 4px; }
.stat b { font-size: 1.7rem; }
.stat .itile { width: 32px; height: 32px; border-radius: 10px; }
.stat .itile .ico { width: 17px; height: 17px; }
.note-box { padding: 9px 12px; font-size: .86rem; }
.grid2 { gap: 9px; }
@media (max-width: 599px) {
  .btn, .seg button, .chips button, .mk-tools button, .mk-page { min-height: 40px; }
  .phead { padding: 9px 12px; } .pbody { padding: 11px 12px 12px; }
}
/* School: whole sections that start closed, and a field with its Save button on one line */
details.acc.fold > .more { padding: 6px 14px 14px; }
details.acc.fold > summary.item { padding-top: 10px; padding-bottom: 10px; }
details.acc.fold details.acc.fold { box-shadow: none; }
.savegrid { align-items: end; }
.savegrid > .row { align-items: center; flex-wrap: wrap; min-height: 38px; }
.grid2 .field .seg { display: flex; }
.grid2 .field .seg button { flex: 1 1 0; padding: 0 6px; white-space: nowrap; min-width: 0; }
/* A class or course name beside a person's name: same line, lighter and smaller */
.h2-sub { font: 600 .82rem/1.2 var(--body); color: var(--tx-2); }
.phead.rev-head h2 { font-size: 1.1rem; }
/* Mushaf tools on a phone: the buttons were half the screen, so the page started below the fold */
@media (max-width: 599px) {
  .mk-tools { gap: 5px; }
  .mk-tools button { min-height: 36px; padding: 0 9px 0 7px; font-size: .8rem; gap: 5px; border-radius: 10px; }
  .mk-tools button.plain { padding: 0 10px; }
  .mk-tools .mk-sw { width: 24px; }
  .mk-tools .mk-sw.pen { width: 16px; }
  .mk-notebox input { min-height: 34px; }
  .mnav { gap: 6px; }
  .mnav .btn { min-height: 34px; }
}
.sub.one .ticks { vertical-align: -3px; margin-right: 4px; }
.sub.one .ticks .ico { width: 15px; height: 15px; }
/* A panel that opens from its header (the learner's file) */
.panel.collapsible > .phead { cursor: pointer; position: relative; padding-right: 40px; }
.panel.collapsible > .phead::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--tx-2); border-bottom: 2px solid var(--tx-2); transform: translateY(-70%) rotate(45deg); transition: transform .15s; }
.panel.collapsible.closed > .phead::after { transform: translateY(-50%) rotate(-45deg); }
.panel.collapsible.closed > :not(.phead) { display: none; }
.panel.collapsible.closed > .phead { border-bottom-color: transparent; border-radius: var(--r-card); }
@media print { .panel.collapsible.closed > :not(.phead) { display: flex !important; flex-direction: column; } .panel.collapsible > .phead::after { display: none; } }
.collapsible-sec > :first-child { cursor: pointer; position: relative; padding-right: 30px; }
.collapsible-sec > :first-child::after { content: ""; position: absolute; right: 8px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--tx-2); border-bottom: 2px solid var(--tx-2); transform: translateY(-70%) rotate(45deg); transition: transform .15s; }
.collapsible-sec.closed > :first-child::after { transform: translateY(-50%) rotate(-45deg); }
.collapsible-sec.closed > :not(:first-child) { display: none; }
@media print { .collapsible-sec.closed > :not(:first-child) { display: block !important; } .collapsible-sec > :first-child::after { display: none; } }
/* Mushaf and book viewers: one more step down on a computer */
.mk-tools button, .mk-page, .mk-pk { min-height: 31px; font-size: .8rem; padding-top: 0; padding-bottom: 0; }
.mk-tools button .mk-sw { width: 28px; }
.mnav .btn, .mnav input, .mnav select { min-height: 31px; font-size: .82rem; }
.mk-notebox input { min-height: 31px; }
.mushaf .panel > .pbody, .mushaf .card { padding: 10px 12px; gap: 8px; }
@media (max-width: 599px) { .mk-tools button, .mk-page { min-height: 34px; } }
/* Mushaf on a phone: the kinds and tools are ONE row you swipe along, and the long intro is hidden, so the page itself is on screen at once */
@media (max-width: 599px) {
  .mk-tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .mk-tools::-webkit-scrollbar { display: none; }
  .mk-tools > * { flex: none; }
  .mk-tools hr, .mk-tools .sep { display: none; }
  :has(> .mushaf) > .head .sub { display: none; }
  .mnav { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .mnav > * { flex: none; }
}
@media (max-width: 599px) {
  .mk-kinds { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 5px; scrollbar-width: none; }
  .mk-kinds::-webkit-scrollbar { display: none; }
  .mk-kinds > * { flex: none; }
  .stack:has(.mk-kinds) > .head .lead { display: none; }
}
.mk-kinds button { min-height: 31px; font-size: .8rem; padding: 0 9px 0 7px; }
@media (max-width: 599px) { .mk-kinds button { min-height: 34px; } }
.hh-scroll { overflow-x: auto; }
.hh-cols { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 560px; }
.hh-cols th, .hh-cols td { padding: 7px 10px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); font-size: .86rem; }
.hh-cols thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--tx-2); border-top: 0; }
.hh-cols td.sabaq { background: color-mix(in srgb, var(--ok-bg, #e6f4ec) 50%, transparent); }
.hh-cols tr.none td, .hh-cols tr.none th { opacity: .55; }

/* ---------- the proof loop (build 5, public/proof.js) ---------- */
/* A slip the teacher has cleared: still on the page, faint and green. */
svg .mk-done { opacity: .55; }
svg .mk-done .mk, svg .mk-done .mk-box { stroke: var(--mk-memorised); }
svg .mk-done .mk-tint, svg .mk-done .mk-box { fill: var(--mk-memorised); }
.pf { display: grid; gap: 8px; min-width: 0; }
.pf > .row { flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.pf-box { display: grid; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--well); min-width: 0; }
.pf-box audio, .pf-card audio { width: 100%; max-width: 420px; height: 40px; }
.pf-att { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); min-width: 0; }
.pf-att:first-child { padding-top: 0; border-top: 0; }
.pf-att input[type="text"] { width: 100%; max-width: 420px; }
.pf-card { display: grid; gap: 8px; padding: 14px 16px; }
.mm-sq.prac { box-shadow: inset 0 0 0 2px var(--info-tx); }
.mm-sq.clr { box-shadow: inset 0 0 0 2px #2fa56b; }
.mm-proof { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0 0 4px; }
.pf-att input[type="text"] { min-height: 38px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); color: var(--tx); font: inherit; }

/* ---------- the student side's one layout (15 Nov, docs/archive/STUDENT_LAYOUT_15NOV.md) ---------- */
/* "Your tools": the first card of the right column on Today and on a course, rows always in the same order. */
.tools { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.tools-h { font: 800 .78rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--tx-2); margin: 0; padding: 16px 18px 6px; }
.acts { display: flex; flex-direction: column; }
.act { display: flex; align-items: center; gap: 12px; padding: 11px 18px; min-height: 56px; text-decoration: none; color: var(--tx); border-top: 1px solid var(--line); }
.acts > .act:first-child { border-top: 0; }
.act:hover, .act:focus-visible { background: var(--well); }
.act-i { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--key); }
.act-i .ico { width: 17px; height: 17px; }
.act-w { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.act-t { font-weight: 800; color: var(--key); font-size: .95rem; }
.act-s { font-size: .82rem; color: var(--tx-2); line-height: 1.35; }
.act-go { flex: none; color: var(--tx-3); display: grid; }
.act-go .ico { width: 16px; height: 16px; }
/* The last lesson report: plain words, no italics. */
.rep-card { text-decoration: none; color: var(--tx); gap: 8px; }
.rep-q { margin: 0; font-weight: 700; font-size: 1rem; line-height: 1.45; color: var(--tx); }
/* The Mushaf: one compact bar, groups centred together, no stretched boxes (Umar, 15 Nov). Comes last so it wins. */
.mnav.mnav-tight { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 18px; padding: 10px 12px; overflow: visible; }
.mnav-tight .mnav-g { display: flex; align-items: center; gap: 6px; flex: none; }
.mnav-tight .mnav-num { display: flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--tx-2); white-space: nowrap; }
.mnav-tight input { width: 4.2em; min-height: 34px; padding: 0 6px; }
.mnav-tight select { width: auto; max-width: 12em; min-height: 34px; padding: 0 8px; }
.mnav-tight .btn { min-height: 34px; padding: 0 12px; }
.mnav-tight .mk-zoom { display: flex; gap: 4px; flex-wrap: nowrap; }
.mnav-tight .mk-zoomin { width: 48px; }
.mnav-tight .mk-place { flex-basis: 100%; text-align: center; margin: 0; }
@media (max-width: 599px) { .mnav.mnav-tight { gap: 8px 10px; overflow: visible; } .mnav-tight .mnav-g { flex-wrap: wrap; justify-content: center; } }
/* The key to the marks: a small card, a slight heading, the kinds centred. */
.mk-legend { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px 16px; display: grid; gap: 8px; justify-items: center; text-align: center; }
.mk-legend-h { margin: 0; font: 800 .74rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--tx-2); }
.mk-legend .mk-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.mk-more { width: 100%; max-width: 640px; text-align: left; }
.mk-more summary { cursor: pointer; font-size: .84rem; font-weight: 700; color: var(--key); text-align: center; list-style-position: inside; }
.mk-more p { margin: 6px 0 0; }
/* Resources page: one card per heading, in an even grid. */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.res-sub { margin: 0; padding: 0 18px 8px; font-size: .82rem; color: var(--tx-2); }
.panel .acts .act { padding-inline: 0; }
.act.on { background: var(--tint); }
.act.on .act-go { visibility: hidden; }

/* ======================================================================================================
   PLAIN PASS (15 Nov, Umar: "consistency beats over designing", after the Mizmaar portal).
   One box, one heading, one badge, one icon, one font rule, on every page of both sides. It comes last so it wins.
   - Fonts: the page title (h1) is the brand's display font; everything else is the body font.
   - Boxes: white card, 1px line, the same corner and the same soft shadow. No coloured edges, bars or gradients.
   - Box headings: the body font, bold, one size. No icon tile in a box heading.
   - Icons: one flat round tint. Badges: one shape; colour only for meaning (done, to do, needs care).
   ====================================================================================================== */
h1 em, .head h1 em { font-style: normal; } /* one blue key word in every page title (head() in app.js), never italic */
.head::after { display: none; }
.eyebrow { color: var(--tx-3); letter-spacing: .12em; }
.eyebrow::before { display: none; }
.label, .sechead .label { color: var(--tx-2); letter-spacing: .08em; }

/* Boxes */
.card, .panel, .list, .stat, .hw, .mk, .watch, .goal, .tools, .mk-legend, .classcard { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); }
.card.accent::after, .panel.accent::after, .item.toned::before, .rc::before, .mk::before, .watch::before, .hw::before { display: none; }
.card::before, .stat::before, .panel::before { display: none; }
.goal { border-left: 1px solid var(--line); }
a.card:hover, a.stat:hover { transform: none; border-color: var(--line-strong); }
.phead { background: none; padding: 14px 18px; }
.phead h2, .classcard h2 { font: 800 1rem/1.3 var(--body); color: var(--tx); }
.phead .sub { font-size: .82rem; color: var(--tx-2); }

/* The next lesson keeps the navy card (Umar, 15 Nov: "I liked the blue on the next lesson"). */
.disp, .card .disp { font-family: var(--body); font-weight: 800; }
.disp .big { font-size: 1.35rem; }

/* Icons: one flat round tint everywhere. */
/* Icons: the coloured course and meaning tiles (Umar liked them), the same everywhere. */

/* Numbers */
.stat { padding: 14px 16px; }
.stat b { font: 800 1.6rem/1 var(--body); }

/* Badges: one shape. Course chips are neutral with the course's dot. */
.pill.solid { box-shadow: none; }

/* Labelled lines (reports, a mistake, homework): a small grey label over plain words. No tinted boxes. */
.rc { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 10px 0 0; }
.recap > .rc:first-child { border-top: 0; padding-top: 0; }
.rc > .itile { display: none; }
.rc-k, .mk-heard .rc-k, .mk-do .rc-k { color: var(--tx-3); font-size: .7rem; letter-spacing: .08em; }
.mk { padding: 14px 16px; gap: 8px; }
.mk-do { background: none; padding: 0; }
.mk-do > .itile { display: none; }
.loc { background: none; border: 0; padding: 0; font-size: .95rem; }
.mk-n { background: var(--tint); color: var(--key); }

/* Day headings in lists, steps, the 30 Juz: flat. */
.day { background: var(--well); }
.steps .n { background: var(--tint); color: var(--key); }
.juzgrid > span { background-image: none; }

/* No lifting, glowing or turning on any box. */
@media (prefers-reduced-motion: no-preference) { .card.hero::after { animation: none; } }
.empty { border: 1px solid var(--line); box-shadow: var(--shadow); }
/* One heading rule: the page title (h1) in the brand font, every heading inside a page (h2) in the body font at one size. */
h1.disp, .head h1 { font-family: var(--disp); font-weight: 600; }
#main h2 { font: 800 1rem/1.3 var(--body); letter-spacing: 0; }
#main .tools-h, #main .mk-legend-h { font: 800 .78rem/1 var(--body); letter-spacing: .08em; }

/* The tools card uses the same coloured icon tiles as everywhere else (public/tools.js passes a tone). */
.act-i.itile { width: 34px; height: 34px; border-radius: 11px; color: #fff; background: radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, .38), transparent 55%), linear-gradient(145deg, var(--tone) 0%, var(--tone-2) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 4px 10px -6px color-mix(in srgb, var(--tone-2) 70%, transparent); }
.act-t { color: var(--tx); }
.act:hover .act-t, .act.on .act-t { color: var(--key); }

/* One layout, remaining pages (15 Nov): labelled lines inside a tools card (School today). */
.lines { padding: 2px 18px 12px; display: grid; }
.lines > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.lines > div:first-child { border-top: 0; }
.lines span { color: var(--tx-2); font-size: .88rem; }
.lines b { font-weight: 800; }
.lines-note { padding: 0 18px 14px; color: var(--tx-2); }
/* Shorter tools card (15 Nov): one line under each title, so the right column is never much longer than the left. */
.act { min-height: 46px; padding: 7px 18px; gap: 11px; }
.act-s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-i, .act-i.itile { width: 30px; height: 30px; }
.act-i .ico { width: 15px; height: 15px; }
.tools-h { padding: 14px 18px 4px; }
/* Your tools (Umar, 16 Nov): back to one flat round tint for every icon, not a colour per row. */

/* ---------- NAV PREVIEW (16 Nov): header with search and bell, and the sub-tab row ---------- */
.hbar > div { gap: 8px; }
.hbar .logo { margin-right: auto; }
.hsearch { display: none; }
.hicon { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; color: var(--tx); text-decoration: none; flex: none; }
.hicon .ico { width: 20px; height: 20px; }
.bell-n { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bar); }
.subrow { display: flex; gap: 2px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; margin: -6px calc(-1 * var(--pad)) 0; padding: 0 calc(var(--pad) - 6px); }
.subrow::-webkit-scrollbar { display: none; }
.subrow > a, .subrow > span { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; font-weight: 800; font-size: .93rem; color: var(--tx-2); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subrow a[aria-current="page"] { color: var(--tx); border-bottom-color: var(--key); }
.subrow a:hover { color: var(--tx); }
.subrow .soon { color: var(--tx-3); opacity: .55; }
.head:has(+ .subrow) { border-bottom: 0; padding-bottom: 0; }
.head:has(+ .subrow)::after { display: none; }
.hwgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 16px; align-items: start; }
@media (min-width: 900px) {
  .top.hbar { display: block; }
  .hbar > div { max-width: none; padding: 12px 44px; }
  .hbar .logo, .hsearch-btn { display: none; }
  .hsearch { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 560px; margin-right: auto; border: 1px solid var(--line-strong); background: var(--well); border-radius: var(--r-btn); padding: 0 16px; color: var(--tx-3); }
  .hsearch input { border: 0; background: none; font: inherit; color: var(--tx); flex: 1; min-height: 42px; outline: none; }
  .subrow { margin: -10px 0 0; padding: 0; }
}

.subn { font-size: .74rem; font-weight: 800; border-radius: 99px; padding: 1px 8px; background: var(--mute-bg); color: var(--mute-tx); }
a[aria-current="page"] > .subn { background: var(--chosen); color: var(--key); }

/* Phone: a menu button at the top opens the navy menu from the left, like the website. No tabs at the bottom. */
.hmenu { display: none; }
.scrim { display: none; }
@media (max-width: 899px) {
  .hmenu { display: grid; }
  .side-nav { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; height: 100dvh; width: min(304px, 86vw); overflow-y: auto; transform: translateX(-104%); visibility: hidden; transition: transform .26s ease, visibility 0s linear .26s; }
  html.menu-open .side-nav { transform: none; visibility: visible; transition: transform .26s ease; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(8, 14, 28, .48); opacity: 0; pointer-events: none; transition: opacity .26s ease; }
  html.menu-open .scrim { opacity: 1; pointer-events: auto; }
  html.menu-open body { overflow: hidden; }
  .side-close { position: absolute; top: 18px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--side-line); background: rgba(255, 255, 255, .06); color: var(--side-hi); display: grid; place-items: center; }
  .hbar .logo { font-size: 1.2rem; }
}
@media (min-width: 900px) { .side-close { display: none; } }
@media (prefers-reduced-motion: reduce) { .side-nav, .scrim { transition: none !important; } }
@media (max-width: 899px) {
  .hbar .logo { white-space: nowrap; font-size: 1.15rem; gap: 7px; }
  .hbar .logo svg { width: 20px; height: 20px; }
  .hbar .who { display: none; }
  .side-nav .logo { font-size: 1.3rem; padding-right: 48px; }
  .side-close { width: 36px; height: 36px; top: 24px; right: 12px; }
  .side-close .ico { width: 18px; height: 18px; }
}

/* Nav rework: two cards side by side on a computer, one under the other on a phone. */
.duo { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 1000px) { .duo { grid-template-columns: 1.4fr 1fr; } }
.lessonbar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); }
.lessonbar .words { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Today: the month's lessons as one full-width card (16 Nov). */
.ls { gap: 16px; }
.ls-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.ls-big { margin: 0; font-size: 1.05rem; color: var(--tx-2); }
.ls-big b { font: 700 1.7rem/1 var(--disp); color: var(--tx); margin-right: 4px; }
.ls-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.ls-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--mute-bg); border: 2px solid var(--line-strong); }
.ls-dot.ok { background: var(--ok); border-color: var(--ok); }
.ls-dot.warn { background: var(--warn); border-color: var(--warn); }
.ls-dot.navy { background: var(--card); border-color: var(--info); }
.ls-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); border-top: 1px solid var(--line); }
.ls-n { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 2px 0; }
.ls-n + .ls-n { padding-left: 14px; border-left: 1px solid var(--line); }
.ls-n b { font: 700 1.6rem/1 var(--disp); }
.ls-n b.tone-ok { color: var(--ok-tx); } .ls-n b.tone-warn { color: var(--warn-tx); } .ls-n b.tone-navy { color: var(--info-tx); } .ls-n b.tone-mute { color: var(--tx-3); }
.ls-n span { font-size: .82rem; font-weight: 700; color: var(--tx-3); }

/* The bell's list (16 Nov). */
.bellwrap { position: relative; }
.bellpop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(360px, calc(100vw - 24px)); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-well); box-shadow: var(--shadow-up); overflow: hidden; }
.bellpop[hidden] { display: none; }
/* Umar, 24 Nov: a long list stops at the bottom of the screen and scrolls inside itself; the page behind stays still. */
.bellpop { max-height: calc(100dvh - var(--bell-top, 84px) - 12px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.bp-h { margin: 0; padding: 12px 16px; font-weight: 800; border-bottom: 1px solid var(--line); }
.bp-row { display: flex; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--tx); }
.bp-row:hover { background: var(--well); }
.bp-row .words { display: flex; flex-direction: column; min-width: 0; }
.bp-none { padding: 14px 16px; margin: 0; }
.bp-foot { display: flex; justify-content: space-between; padding: 10px 16px; font-weight: 800; font-size: .88rem; }
.bp-foot a { color: var(--key); text-decoration: none; }
.phoneview { display: none; }
@media (min-width: 900px) { .phoneview { display: inline-flex; } }
@media (max-width: 899px) { .bellpop { position: fixed; right: 12px; top: 64px; --bell-top: 64px; } }

/* Search: words or a date; each result opens in place (16 Nov). */
.searchbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.searchbar .field { flex: 1 1 220px; margin: 0; }
.hitmore { display: block; padding: 0; }
.hitmore > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; }
.hitmore > summary::-webkit-details-marker { display: none; }
.hitmore > summary .words { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hm-body { padding: 0 16px 14px 60px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ls-n b, .ls-big b { font-family: var(--body); font-weight: 800; letter-spacing: -.01em; }
.ls-n b { font-size: 1.45rem; }
.ls-big b { font-size: 1.5rem; }

/* A lesson to come: the Join button on the same line as "in 5 days" (Umar, 16 Nov). */
.end-row { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.end-row .join { position: relative; z-index: 1; }
/* Today: the month card beside the upcoming lessons; its numbers in two columns there. */
.duo .ls-nums { grid-template-columns: repeat(2, 1fr); }
.duo .ls-n:nth-child(odd) { padding-left: 0; border-left: 0; }
.duo .ls-n:nth-child(n+3) { border-top: 1px solid var(--line); }

/* ---------- Polish, 16 Nov: one rectangle, equal boxes, one heading style ---------- */
/* Side-by-side sections are the same height: the last box in each stretches. */
.duo { align-items: stretch; }
.duo > .section { display: flex; flex-direction: column; }
.duo > .section > :last-child { flex: 1; }
.duo > .section > .ls { justify-content: space-between; }
.duo.even { grid-template-columns: 1fr; }
@media (min-width: 1000px) { .duo.even { grid-template-columns: 1fr 1fr; } }
/* The next lesson and the lessons after it, as one block. */
.lessonstack { display: flex; flex-direction: column; }
.lessonstack.has-later > .hero { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.lessonstack > .list { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; flex: 1; }
.lessonstack .after { margin: 0; padding: 10px 16px 4px; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--tx-3); }
/* Two columns end level: the last box of the shorter column stretches. */
.cols { align-items: stretch; }
.cols > .main, .cols > .side { display: flex; flex-direction: column; }
.cols > .side > :last-child, .cols > .main > :last-child { flex-grow: 1; }
/* A row of number tiles always fills the row evenly. */
.stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
/* A lone card fills the row instead of leaving half of it empty. */
.hwgrid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }

/* The month card fills its height with an even 2 by 2 grid of numbers, no gap in the middle. */
.duo > .section > .ls .ls-nums { flex: 1; grid-auto-rows: 1fr; }
.ls-n { justify-content: center; }
.duo .ls-n:nth-child(n+3) { border-top: 1px solid var(--line); }
.duo .ls-n:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line); }
/* Cards side by side in a grid are the same height. */
.hwgrid { align-items: stretch; }

/* ---------- Reports (16 Nov): one card per lesson, four coloured parts side by side ---------- */
.rpt { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.rpt-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.rpt-h .words { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rpt-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.rpt-c { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px 18px; box-shadow: inset 0 3px 0 var(--tone); border-left: 1px solid var(--line); background: color-mix(in srgb, var(--tone-bg) 35%, transparent); }
.rpt-c:first-child { border-left: 0; }
.rpt-c .pre { font-size: .98rem; line-height: 1.5; }
@media (max-width: 640px) { .rpt-c { border-left: 0; } }
.cols > .main.section { display: flex; flex-direction: column; }
.cols > .main.section > .rpt { flex-grow: 1; }
.cols > .main.section > .rpt > .rpt-g { height: 100%; align-items: stretch; }
.rpt-g.two { grid-template-columns: repeat(2, 1fr); }
.rpt-g.two > .rpt-c:nth-child(odd) { border-left: 0; }
.rpt-g.two > .rpt-c:nth-child(n+3) { border-top: 1px solid var(--line); }
.rpt-g.two > .rpt-c:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 640px) { .rpt-g.two { grid-template-columns: 1fr; } .rpt-g.two > .rpt-c:nth-child(n+2) { border-top: 1px solid var(--line); } }
/* Course page: a list of steps with its bar on top; side column sections stretch so the two columns end level. */
.steps-bar { padding: 14px 18px 4px; }
.cols > .side > .section:last-child, .cols > .main > .section:last-child { flex-grow: 1; display: flex; flex-direction: column; }
.cols > .side > .section:last-child > :last-child, .cols > .main > .section:last-child > :last-child { flex: 1; }
.cols > .main.stack > .section { display: flex; flex-direction: column; }

/* ---------- Conversation (16 Nov): name first, the next lesson under it, the time beside the words ---------- */
.chat-head { padding: 14px 18px; gap: 14px; }
.chat-head .av { width: 48px; height: 48px; font-size: 1.15rem; }
.chat-head .chat-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 1.12rem; }
.chat-class { font-size: .82rem; font-weight: 600; color: var(--tx-3); display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-left: 8px; }
.chat-next { font-size: .88rem; font-weight: 700; color: var(--tx-2); }
.chat-head .seen { font-size: .78rem; }
/* Bigger search and gallery buttons, each with a visible edge. */
.chat-head .c-tools { gap: 8px; }
.chat-head .c-tools .btn.round { width: 48px; height: 48px; min-height: 48px; border: 1px solid var(--line-strong); background: var(--well); }
.chat-head .c-tools .btn.round[aria-expanded="true"] { background: var(--chosen); border-color: var(--key); }
.chat-head .c-tools .ico { width: 25px; height: 25px; }
/* The time inside the bubble, at the end of the words (as a chat app does); it drops to the next line only when it must. */
.bubble { display: block; }
.bubble .txt { display: inline; }
.bubble .who, .bubble .said, .bubble .b-pic, .bubble audio { display: block; }
.bubble .time { float: right; margin: 8px 0 -3px 14px; }
.bubble::after { content: ""; display: table; clear: both; }
.bubble .txt:empty + .time { margin-top: 0; }
@media (max-width: 899px) { .chat-head { flex-wrap: wrap; align-items: flex-start; row-gap: 12px; } .chat-head .c-tools .btn.round { width: 44px; height: 44px; min-height: 44px; } .chat-head .av { width: 42px; height: 42px; } .chat-head .words { flex: 1 1 0; } .chat-head > .btn.pri { order: 3; margin-top: 2px; } .chat-head .c-tools { order: 4; margin-left: auto; } }

/* ---------- My Mushaf (16 Nov) ---------- */
.mk-top { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: stretch; }
@media (min-width: 1000px) { .mk-top { grid-template-columns: minmax(300px, 420px) 1fr; } }
.mk-top > .section { display: flex; flex-direction: column; }
.mk-top > .section > :last-child { flex: 1; }
.mk-top .seg { grid-template-columns: 1fr 1fr; }
.mk-top .seg button { white-space: normal; line-height: 1.2; min-height: 44px; }
.mk-top .mk-legend { align-content: center; justify-items: start; text-align: left; }
.mk-top .mk-legend .mk-key { justify-content: flex-start; }
/* Surah, Juz and the zoom box are one width. */
.mnav-tight select, .mnav-tight .mk-zoomin { width: 9.5em; max-width: none; }
.mnav-tight .mk-zoomin { text-align: left; }
/* Pages with marks, one fold per Juz. */
.mk-juz { border-top: 1px solid var(--line); }
.mk-juz:first-child { border-top: 0; }
.mk-juz > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 9px 2px; cursor: pointer; }
.mk-juz > summary::-webkit-details-marker { display: none; }
.mk-juz > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--tx-3); border-bottom: 2px solid var(--tx-3); transform: rotate(-45deg); transition: transform .15s; flex: none; }
.mk-juz[open] > summary::before { transform: rotate(45deg); }
.mk-juz > summary .mk-counts { margin-left: auto; }
.mk-juz-rows { display: flex; flex-direction: column; gap: 6px; padding: 0 0 10px; }

/* Hifdh journal (16 Nov): Date, Sabaq, Sabaq Para, Dhor as even columns. */
.hh-cols { width: 100%; table-layout: fixed; }
.hh-cols th[scope="col"] { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--tx-2); }
.hh-cols th[scope="col"]:first-child, .hh-cols th[scope="row"] { width: 22%; }

/* Resources (16 Nov): label outside, boxes in a row the same height. */
.res-grid { align-items: stretch; }
.res-grid > .section { display: flex; flex-direction: column; }
.res-grid > .section > .tools { flex: 1; }

/* ---------- THE mistake card (POLISH2 part 1): one look for every mistake and Mushaf mark ---------- */
.mcard { position: relative; container-type: inline-size; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 13px 18px; border-radius: var(--r-well);
  border: 1px solid color-mix(in srgb, var(--tone) 28%, var(--line)); background: linear-gradient(100deg, color-mix(in srgb, var(--tone) 9%, transparent), transparent 45%), var(--card); }
.mcard::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 5px; border-radius: var(--r-well) 0 0 var(--r-well); background: var(--tone); }
.mcard.k-mistake { --tone: var(--mk-mistake); } .mcard.k-revise { --tone: var(--mk-revise); } .mcard.k-memorised { --tone: var(--mk-memorised); }
.mcard.k-tajweed { --tone: var(--mk-tajweed); } .mcard.k-mixup { --tone: var(--mk-mixup); } .mcard.k-hesitation { --tone: var(--mk-hesitation); }
.mcard.cleared { opacity: .72; }
.mcard.on { box-shadow: 0 0 0 2px var(--key); }
.mc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 26px; }
.mc-title { font-size: 1rem; font-weight: 800; color: var(--tx); flex: 1 1 auto; min-width: 0; }
.mc-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mc-badges:empty { display: none; }
.mc-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 800; line-height: 1; padding: 5px 9px; border-radius: 99px; white-space: nowrap;
  color: var(--tx-2); background: var(--well); border: 1px solid var(--line); }
.mc-badge.hot { color: var(--bad-tx); background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad-tx) 25%, transparent); }
.mc-badge .mk-sw { width: 26px; height: 12px; }
.mc-parts { display: grid; grid-template-columns: 1fr; gap: 8px; }
@container (min-width: 520px) { .mc-parts:has(> :nth-child(2)) { grid-template-columns: 1fr 1fr; } }
.mc-part { display: flex; flex-direction: column; gap: 3px; padding: 9px 12px 10px; border-radius: 10px; background: var(--well); }
.mc-part .rc-k { color: var(--tx-3); }
.mc-part[class*="tone-"] { background: var(--tone-bg); } .mc-part[class*="tone-"] .rc-k { color: var(--tone-tx); }
.mc-part .pre { font-size: .95rem; line-height: 1.55; }
.mc-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.mcard > .row:last-child, .mcard > .mc-foot { margin-top: 2px; }
.mc-badge.kind { color: color-mix(in srgb, var(--tone) 80%, var(--tx)); background: color-mix(in srgb, var(--tone) 10%, var(--card)); border-color: color-mix(in srgb, var(--tone) 30%, transparent); }
.mc-badge.kind::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tone); }
/* Cards in a list: two across on a wide screen, each pair the same height (one rectangle). */
.mc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; align-items: stretch; }
.mc-foot > .pf { flex: 1 1 auto; }

/* ---------- POLISH2 parts 2 and 3: Today, the report look everywhere, past lessons ---------- */
.rpt-g.framed { border: 1px solid var(--line); border-radius: var(--r-well); overflow: hidden; background: var(--card); }
.rpt-c.tone-mute.private { background: var(--well); }
.rpt-b { display: grid; grid-template-columns: minmax(0, 1fr); }
.rpt-b.has-rec { grid-template-columns: minmax(0, 1fr) 220px; }
.rpt-none { margin: 0; padding: 14px 18px; }
.rpt-rec { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-left: 1px solid var(--line); background: var(--well); }
@media (max-width: 760px) { .rpt-b.has-rec { grid-template-columns: 1fr; } .rpt-rec { border-left: 0; border-top: 1px solid var(--line); } }
.rec-tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-height: 112px; padding: 12px 14px; border-radius: 12px;
  background: var(--hero-bg), var(--hero); color: #fff; text-decoration: none; }
.rec-tile .strong { color: #fff; font-size: .9rem; }
.rec-tile .small { color: rgba(255, 255, 255, .75); }
.rec-play { position: absolute; top: 12px; left: 14px; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .16); }
.rec-play .ico { width: 20px; height: 20px; color: #fff; }
/* Today: the right-hand column holds the goal over the month, and ends level with the lessons on the left. */
@media (min-width: 1000px) { .duo:has(> .side-col) { align-items: stretch; } .side-col > .section:last-child { flex: 1; } .side-col > .section:last-child > .card { flex: 1; } }
.side-col { gap: 16px; }
.side-col > .section { display: flex; flex-direction: column; }
.ls { gap: 12px; }
.ls-nums { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ls-n { padding: 10px 10px 0 0; } .ls-n + .ls-n { padding-left: 10px; }
.ls-n b { font-size: 1.35rem; } .ls-n span { font-size: .82rem; color: var(--tx-2); }
.gb { gap: 10px; }
.gb-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.gb-t { margin: 0; font: 700 1.25rem/1.2 var(--disp); color: var(--tx); }
.gb-n { margin: 0; color: var(--tx-2); font-size: .95rem; } .gb-n b { font: 700 1.35rem/1 var(--disp); color: var(--ok-tx); margin-right: 2px; }
.gb-bar { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; }
.gb-j { display: block; height: 18px; border-radius: 4px; background: var(--mute-bg); border: 1px solid var(--line); }
.gb-j.full { background: var(--ok); border-color: var(--ok); }
.gb-j.part { background: repeating-linear-gradient(135deg, var(--ok) 0 4px, color-mix(in srgb, var(--ok) 25%, var(--card)) 4px 8px); border-color: var(--ok); }
.gb-ends { display: flex; justify-content: space-between; margin-top: -4px; }
.gb-goals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gb-goals.under { padding-top: 10px; border-top: 1px solid var(--line); }
.gb-goal { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--tx); }
.gb-goal .ico { width: 16px; height: 16px; flex: none; color: var(--plan-tx); }
.gb-goal > span:first-of-type { flex: 1; min-width: 0; }
.gb-by { flex: none; font-size: .75rem; font-weight: 800; padding: 4px 9px; border-radius: 99px; color: var(--plan-tx); background: var(--plan-bg); }
/* Homework due and Practise next side by side, the same height. */
.duo.even.todo { align-items: stretch; }
@media (min-width: 1000px) { .duo.even.todo { grid-template-columns: 1fr 1.4fr; } }
.duo .side-col .ls-nums { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: auto; }
.duo .side-col .ls-n { border-top: 0; padding: 10px 10px 0 10px; border-left: 1px solid var(--line); }
.duo .side-col .ls-n:first-child { padding-left: 0; border-left: 0; }
.gb-n b.num { font: 800 1.35rem/1 var(--body); }
.stack > div[role="status"]:empty { display: none; }

/* ---------- POLISH2 part 4: My Mushaf (and the teacher's) ---------- */
.mk-legend .mk-key { justify-content: center; }
.mk-legend { text-align: center; }
.mk-legend .mk-more > summary { justify-content: center; }
.mk-legend .mk-more p { text-align: left; }
.mk-filter { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mk-filter[hidden] { display: none; }
.mk-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--card); color: var(--tx-2);
  font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer; }
.mk-chip[aria-pressed="true"] { color: var(--tx); border-color: var(--key); box-shadow: inset 0 0 0 1px var(--key); background: var(--chosen, var(--well)); }
.mk-chip-n { font-size: .72rem; color: var(--tx-3); background: var(--well); border-radius: 99px; padding: 2px 7px; }
.mk-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--tx-3); }
.mk-dot.mistake { background: var(--mk-mistake); } .mk-dot.revise { background: var(--mk-revise); } .mk-dot.memorised { background: var(--mk-memorised); }
.mk-dot.tajweed { background: var(--mk-tajweed); } .mk-dot.mixup { background: var(--mk-mixup); } .mk-dot.hesitation { background: var(--mk-hesitation); }
.mk-dots { display: inline-flex; gap: 3px; align-items: center; }
.mk-pages { max-height: none; overflow: visible; gap: 8px; }
.mk-pchips { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; padding-top: 8px; }
.mk-pchip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 46px; padding: 4px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--tx); font: inherit; font-size: .88rem; cursor: pointer; }
.mk-pchip[aria-current="page"] { border-color: var(--key); box-shadow: inset 0 0 0 1px var(--key); background: var(--chosen, var(--well)); }
.mk-juz > summary { display: flex; align-items: center; gap: 10px; }
.mk-juz > summary .mk-dots { margin-left: auto; }
.mk-portions { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.mk-portion { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--tx);
  font: inherit; font-size: .88rem; text-align: left; cursor: pointer; }
.mk-portion .small { margin-left: auto; text-align: right; }
.mk-onpage > summary { cursor: pointer; list-style: none; }
.mk-onpage > summary::-webkit-details-marker { display: none; }
.mk-onpage > summary .mk-fold::after { content: "Fold"; font-weight: 700; color: var(--key); }
.mk-onpage:not([open]) > summary .mk-fold::after { content: "Open"; }
.mk-onpage .count:empty { display: none; }
.mk-onpage .mc-grid { grid-template-columns: 1fr; }
.mk-more-btn { align-self: center; }
/* The two lists under the page end level, without stretching one into empty space. */
.mushaf .cols { align-items: start; }
.mk-top .mk-legend { justify-items: center; align-content: center; text-align: center; }
.mk-top .mk-legend .mk-key { justify-content: center; }
.mk-legend .mk-pill { padding: 4px 9px 4px 6px; font-size: .76rem; gap: 5px; }
.mk-legend .mk-pill .mk-sw { width: 28px; height: 14px; }
/* POLISH2 part 5: the journal's Mistakes column. */
.hh-slips { min-width: 130px; }
.hh-sl { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; }
.hh-sl b { font-weight: 800; color: var(--bad-tx); }
.hh-slips .small { display: block; margin-top: 2px; }
.mk-dot.done { opacity: .35; }

/* ======================================================================================================
   POLISH3 part 0 (16 Nov): ONE TYPE SET AND ONE CARD PADDING UNDER THE PAGE HEAD (docs/DESIGN_SYSTEM.md "One type set").
   Five text styles and one padding, used on every page. It comes last so it wins.
   title  700 1rem      a card's or a row's title (a homework title, a lesson's date, "Marked: new Sabaq", a mistake's place)
   body   400 .94rem    the words of a card (a report's parts, what was heard, practice, a message)
   label  700 .7rem     UPPERCASE grey, above a box or a part (UPCOMING LESSONS, COVERED, HEARD)
   meta   400 .82rem    the grey line under a title (course, teacher, dates)
   num    700 1.35rem   a number (1 of 30, Taken 1)
   ====================================================================================================== */
:root {
  --t-title: 700 1rem/1.35 var(--body); --t-body: 400 .94rem/1.55 var(--body); --t-label: 700 .7rem/1.2 var(--body);
  --t-meta: 400 .82rem/1.45 var(--body); --t-num: 700 1.35rem/1 var(--body);
  --cpy: 16px; --cpx: 18px; --cpad: var(--cpy) var(--cpx);
  --shadow: 0 1px 2px rgba(18, 26, 44, .05), 0 6px 16px -10px rgba(18, 26, 44, .14);
}
:root[data-theme="night"] { --shadow: 0 1px 2px rgba(0, 0, 0, .3); }
@media (max-width: 599px) { :root { --cpy: 14px; --cpx: 14px; } }

/* title */
.item .words > .strong, .rpt-h .strong, .mc-title, .gb-t, .act-t, .phead h2, #main h2, .classcard h2, .gb-goal, .hw-top .strong,
.hw.fold > summary .strong, .chat-head .chat-title, .ls-big, .mk-portion b, .fline .strong, .rpt-h a.strong { font: var(--t-title); color: var(--tx); letter-spacing: 0; }
.card.hero .strong { color: var(--hero-tx); }
/* body */
.pre, .rc .pre, .mcard .pre, .rpt-c .pre, .mc-part .pre, .trail .watch .pre, .trail .private .pre, .lines-note { font: var(--t-body); color: var(--tx); }
/* label */
.label, .sechead .label, .rc-k, .mc-part .rc-k, .lessonstack .after, .hh-cols th[scope="col"], #main .tools-h, #main .mk-legend-h, .day .label {
  font: var(--t-label); letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); }
.card.hero .label { color: var(--hero-mark); }
/* meta */
.meta, .item .meta, .sub, .phead .sub, .small, .act-s, .gb-ends, .ls-n span, .gb-n, .chat-class, .watch .sub { font: var(--t-meta); color: var(--tx-2); }
.card.hero .sub, .card.hero .small { color: var(--hero-sub); }
/* num */
.num, .stat b, .ls-n b, .gb-n b, .gb-n b.num, .ls-big b.num { font: var(--t-num); font-variant-numeric: lining-nums tabular-nums; }

/* One card padding */
.card:not(.hero):not(.guest-card), .mcard, .gb, .ls, .stat, .hw, .tools-h, .lines, .watch { padding: var(--cpad); }
.phead, .rpt-h, .rpt-c, .rpt-none, .chat-head { padding: var(--cpad); }
.item { padding-left: var(--cpx); padding-right: var(--cpx); }
.lessonstack .after { padding: 12px var(--cpx) 4px; }
.card, .panel, .list, .stat, .hw, .mk, .mcard, .watch, .goal, .tools, .mk-legend, .classcard, .rpt, .empty { border-radius: var(--r-card); }
:root { --r-card: 16px; }

/* POLISH3 part 4: two initials fit their circle */
.av { font-size: .9rem; letter-spacing: -.01em; }
.av.sm { font-size: .72rem; } .av.xs { font-size: .56rem; } .av.lg { font-size: 1.3rem; }
.chat-head .av { font-size: 1rem; }

/* POLISH3 part 5: sub-tabs that read as tabs, not as more heading. A light bar under the head; each tab a soft
   rounded button; the open one blue on a pale blue ground with the blue line under it (kept, Umar likes it). */
.subrow { gap: 4px; border-bottom: 1px solid var(--line-strong); padding-top: 6px; }
.subrow > a, .subrow > span { min-height: 42px; padding: 0 14px; font-weight: 600; font-size: .9rem; color: var(--tx-2); border-radius: 10px 10px 0 0; border-bottom-width: 3px; }
.subrow a:hover { color: var(--key); background: color-mix(in srgb, var(--chosen) 55%, transparent); }
.subrow a[aria-current="page"] { color: var(--key); font-weight: 700; background: var(--chosen); border-bottom-color: var(--key); }
.subrow .soon { font-weight: 600; }

/* POLISH3 part 6: My Mushaf (and the teacher's): the tools, the live line, the page and the filters are one card. */
.mk-viewer { display: flex; flex-direction: column; gap: 12px; padding: var(--cpad); background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); min-width: 0; }
.mk-viewer > .mnav, .mk-viewer > .mnav.mnav-tight { background: var(--well); border: 1px solid var(--line); border-radius: 12px; box-shadow: none; margin: 0; }
.mk-viewer > .mpage-wrap { box-shadow: none; }
.mk-viewer > p[role="status"]:empty { display: none; }
.mk-live { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; min-height: 0; }
.mk-live .live-line { margin: 0; display: inline-flex; align-items: center; gap: 7px; }
.mk-live .live-line::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mute); }
.mk-live .live-line:empty { display: none; }
.mk-live .live-follow { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.mk-live .live-follow[hidden], .mk-live .btn[hidden] { display: none; }
.mushaf:has(.mk-live) .live-line { color: var(--tx-2); }
/* Open / Fold is a small button with a chevron, not loose text. */
.mk-onpage > summary .mk-fold { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--btn-line); background: var(--card); font: 700 .8rem/1 var(--body); color: var(--key); }
.mk-onpage > summary .mk-fold::after { color: var(--key); font-weight: 700; }
.mk-onpage > summary .mk-fold::before { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-135deg) translate(-1px, -1px); }
.mk-onpage:not([open]) > summary .mk-fold::before { transform: rotate(45deg) translate(-1px, -1px); }
/* A divider between "On this page" and "Pages with marks". */
@media (min-width: 900px) { .mushaf > .cols { gap: 0; } .mushaf > .cols > .main { padding-right: 22px; } .mushaf > .cols > .side { padding-left: 22px; border-left: 1px solid var(--line-strong); } }
@media (max-width: 899px) { .mushaf > .cols > .side { padding-top: 18px; border-top: 1px solid var(--line-strong); } }
/* Phone: the tools wrap inside their bar, never past its edge (checked at 360, 390, 414). */
@media (max-width: 599px) {
  .mk-viewer { padding: 10px; gap: 10px; }
  .mk-viewer > .mnav.mnav-tight { display: flex; flex-wrap: wrap; overflow: visible; justify-content: center; gap: 8px; padding: 8px; }
  .mnav-tight .mnav-g { flex: 1 1 100%; justify-content: center; flex-wrap: wrap; min-width: 0; }
  .mnav-tight select, .mnav-tight .mk-zoomin { width: auto; min-width: 0; flex: 1 1 0; max-width: 11em; }
  .mnav-tight .mk-zoom { flex-wrap: wrap; justify-content: center; }
  .mk-viewer .mk-filter { justify-content: flex-start; }
}
.mk-live .live-line[data-on="1"]::before { background: var(--ok); }

/* POLISH3 part 2: Today's top as a 2 by 2 grid. Headings line up across; each row's two boxes end level. */
.tgrid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.tgrid > .section { display: flex; flex-direction: column; min-width: 0; }
.tgrid > .section > :last-child { flex: 1; }
@media (min-width: 1000px) {
  .tgrid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "a b" "c d"; gap: 18px 20px; align-items: stretch; }
  .tg-a { grid-area: a; } .tg-b { grid-area: b; } .tg-c { grid-area: c; } .tg-d { grid-area: d; }
  .tgrid > .tg-a > .hero { justify-content: center; }
  .tgrid .ls-nums { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: auto; }
  .tgrid .ls-n { border-top: 0; padding: 10px 10px 0 10px; border-left: 1px solid var(--line); }
  .tgrid .ls-n:first-child { padding-left: 0; border-left: 0; }
  .tgrid > .tg-c > .list { display: flex; flex-direction: column; } .tgrid > .tg-c > .list > .item { flex: 1; }
}
@media (max-width: 999px) { .tg-a { order: 1; } .tg-c { order: 2; } .tg-b { order: 3; } .tg-d { order: 4; } }
.tgrid .ls { justify-content: space-between; }
.tgrid .ls-n { justify-content: flex-start; }

/* POLISH3 part 2: THE mistake card sits like every other card: no coloured strip on the left (it never lined up),
   one plain card with the same padding. Its colour is a dot before the title, or the number's circle. */
.mcard { padding: var(--cpad); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card-bg); box-shadow: var(--shadow); gap: 12px; }
.mcard::before { display: none; }
.mc-head { gap: 10px; }
.mc-head::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--tone); }
.mcard:has(.mk-n) .mc-head::before { display: none; }
.mcard .mk-n { width: 26px; height: 26px; background: color-mix(in srgb, var(--tone) 14%, var(--card)); color: color-mix(in srgb, var(--tone) 75%, var(--tx)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tone) 45%, transparent); font-size: .8rem; }
.mcard.tone-bad { --tone: var(--bad); } .mcard.tone-warn { --tone: var(--warn); }
.mc-part { padding: 10px 12px; border-radius: 12px; gap: 4px; }
.mcard.on { box-shadow: 0 0 0 2px var(--key); }
/* Today: the lessons after the next one are one line each on a computer (date, course, teacher, how far off), and the
   month card centres its two parts, so neither box of the second row has a gap. Words in a card: 500, not thin 400. */
:root { --t-body: 500 .94rem/1.55 var(--body); }
@media (min-width: 1000px) {
  .tg-c .item .words { flex-direction: row; align-items: center; gap: 14px; flex-wrap: wrap; }
  .tgrid .ls { justify-content: center; gap: 18px; }
}
@media (min-width: 1000px) {
  .tgrid .tg-c .item:has(> .end) { display: flex; align-items: center; min-height: 56px; }
  .tgrid .tg-c .item:has(> .end) > .words { display: flex; flex-direction: row; align-items: center; gap: 6px 16px; flex-wrap: wrap; }
  .tgrid .tg-c .item:has(> .end) > .words > * { grid-column: auto; }
  .tgrid .tg-c .item:has(> .end) > .end { display: flex; }
  .tgrid .tg-c .item:has(> .end) > .end > * { margin: 0; }
}
@media (max-width: 599px) { .rpt-h { flex-wrap: wrap; } .rpt-h .words { flex: 1 1 calc(100% - 64px); } .rpt-h > .btn { margin-left: 56px; } }
/* POLISH3 part 3: a past lesson's head on a phone: the date keeps its line, the pill goes under it, lined up with the words. */
@media (max-width: 599px) { .rpt-h > .pill { margin-left: 56px; } .rpt-h { row-gap: 8px; } }
.rpt-h a.strong { text-decoration: none; } .rpt-h a.strong:hover { text-decoration: underline; }
/* POLISH3 part 6: goals, one look everywhere (the line on Today): icon, the goal in the title style, the date as a badge. */
.goal.gb-goal { flex-direction: row; align-items: center; gap: 10px; padding: var(--cpad); border-left: 1px solid var(--line); }
.goalgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 12px; }
.gb-goal > span:first-of-type { font: var(--t-title); }
/* POLISH3 part 6: the Hifdh journal: each part has its colour (a dot in the column head, a soft band on the day's words),
   and a slip on a part's pages shows under it. */
.hh-h::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--tx-3); }
.hh-h.sabaq::before { background: var(--ok); } .hh-h.para::before { background: var(--info); } .hh-h.dhor::before { background: var(--gold); } .hh-h.slips::before { background: var(--bad); }
.hh-cols td.hh-c.sabaq, .hh-cols td.hh-c.para, .hh-cols td.hh-c.dhor { font: var(--t-body); }
.hh-cols tr:not(.none) td.hh-c.sabaq { background: color-mix(in srgb, var(--ok-bg) 45%, transparent); }
.hh-cols tr:not(.none) td.hh-c.para { background: color-mix(in srgb, var(--info-bg) 45%, transparent); }
.hh-cols tr:not(.none) td.hh-c.dhor { background: color-mix(in srgb, var(--gold) 7%, transparent); }
.hh-in { display: flex; align-items: center; gap: 6px; margin-top: 6px; font: 700 .76rem/1.2 var(--body); color: var(--bad-tx); }
.hh-cols th[scope="row"] b { font: var(--t-title); }
/* POLISH3 part 7: homework cards, all three lists: an icon tile in the state's colour, the parts side by side. */
.hwcard > .pbody { container-type: inline-size; padding: 0 var(--cpx) var(--cpy); display: flex; flex-direction: column; gap: 12px; }
.hwcard > .pbody:empty { display: none; }
.hwcard > .phead { border-bottom: 0; }
.hw-parts { display: grid; grid-template-columns: 1fr; gap: 8px; }
@container (min-width: 560px) { .hw-parts { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.hwgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); }
.hwgrid:has(> :only-child) { grid-template-columns: 1fr; }
@container (min-width: 560px) { .mc-parts.hw-parts { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.hwcard > .pbody > :empty { display: none; }

/* POLISH3 part 8: a conversation. Join, search and the gallery together at the right of the head. */
.chat-head .c-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.chat-head .c-join { min-height: 48px; padding: 0 18px; }
.chat-nextrow { display: none; }
@media (max-width: 899px) {
  /* Phone: the head is the person only (initials and name) with search and the gallery; the next lesson and Join
     sit in their own row under it, with room around them; the conversation fills the rest of the screen. */
  .chat-head { flex-wrap: nowrap; align-items: center; row-gap: 0; padding: 10px 12px; }
  .chat-head .chat-next, .chat-head .chat-class, .chat-head .c-join { display: none; }
  .chat-head .words { flex: 1 1 auto; }
  .chat-head .c-tools { order: 0; margin-left: auto; gap: 6px; }
  .chat-head .chat-title { font: var(--t-title); font-size: 1.05rem; }
  .chat-nextrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 6px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card-bg); }
  .chat-nextrow > .ico { width: 20px; height: 20px; color: var(--key); flex: none; }
  .chat-nextrow .words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .chat-nextrow .btn { flex: none; }
  /* Full screen: the conversation runs down to just above the bottom edge (no empty band under the message box). */
  .page:has(.chatview) { padding-top: 10px; padding-bottom: 12px; }
  .chatview { min-height: calc(100dvh - 80px); }
  .chatview > .chat { flex: 1; }
}
@media (max-width: 899px) {
  /* Full screen on a phone: no sub-tab row over a conversation, and the way back is the arrow at the left of the head. */
  .page:has(.chatview) .subrow { display: none; }
  .stack:has(> .chatview) { position: relative; }
  .stack:has(> .chatview) > .back { position: absolute; top: 14px; left: 6px; z-index: 2; width: 38px; height: 38px; min-height: 38px; padding: 0; justify-content: center; font-size: 0; border: 0; background: none; box-shadow: none; }
  .stack:has(> .chatview) > .back .ico { width: 22px; height: 22px; }
  .stack:has(> .chatview) .chat-head { padding-left: 44px; }
}
/* POLISH3: a long "Watch the recording (label)" button wraps instead of running past a 360px screen. */
a.btn.sm { max-width: 100%; white-space: normal; text-align: left; line-height: 1.25; }

/* ---------- N1b booking (public/booking.js) ---------- */
.bk-days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.bk-days button { flex: none; min-height: 52px; min-width: 84px; padding: 6px 12px; border-radius: var(--r-field); border: 1px solid var(--line-strong); background: var(--card); color: var(--tx-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .82rem; }
.bk-days button b { color: var(--tx); font-size: .9rem; }
.bk-days button[aria-pressed="true"] { border-color: var(--key); background: var(--info-bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--key) 18%, transparent); }
.bk-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.bk-slot { min-height: 52px; border-radius: var(--r-field); border: 1px solid var(--line-strong); background: var(--card); color: var(--tx); font-weight: 800; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.bk-slot span { font-size: .72rem; font-weight: 600; color: var(--tx-3); }
.bk-slot:hover, .bk-slot:focus-visible { border-color: var(--key); }
.bk-confirm { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--r-field); background: var(--well); border: 1px solid var(--line); }
.bk-row { padding: 14px 18px; }
.bk-ask { padding-top: 6px; }
.hours-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
@media (max-width: 600px) { .hours-row { grid-template-columns: 1fr 1fr; } .hours-row .field:nth-child(3) { grid-column: 1 / -1; } }

/* Point 0 (Umar, 17 Nov): ONE heading for every box, above it and outside: a small coloured icon tile, the label in
   capitals, a count, and at most one grey line under it. A panel() keeps its markup; only the body is the white box.
   A homework card (.hwcard) keeps its title inside, since the title is the homework itself, not a box heading. */
.sechead .label .itile.xs, .panel:not(.hwcard) > .phead .itile { width: 22px; height: 22px; min-width: 22px; border-radius: 7px; }
.sechead .label .itile.xs .ico, .panel:not(.hwcard) > .phead .itile .ico { width: 13px; height: 13px; }
.panel:not(.hwcard) { background: none; border: 0; box-shadow: none; border-radius: 0; gap: 10px; overflow: visible; }
.panel:not(.hwcard) > .phead { background: none; border: 0; border-radius: 0; padding: 0; gap: 8px; min-height: 28px; align-items: center; }
.panel:not(.hwcard) > .phead h2 { font: var(--t-label); text-transform: uppercase; letter-spacing: .08em; color: var(--tx-2); }
.panel:not(.hwcard) > .phead > .stack { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 2px; }
.panel:not(.hwcard) > .phead .sub { font: var(--t-meta); font-size: .8rem; color: var(--tx-3); text-transform: none; letter-spacing: 0; }
.panel:not(.hwcard) > .pbody { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); }
.panel.collapsible:not(.hwcard) > .phead { padding-right: 28px; }
.panel.collapsible:not(.hwcard) > .phead::after { right: 6px; }
.panel.collapsible.closed:not(.hwcard) > .phead { border-radius: 0; }
.tools-sec > .tools { flex: 1; }
.tools-sec .acts { padding-top: 4px; }

/* Point 2 (17 Nov): Today in two columns like Mizmaar, lessons on the right; on a phone the lessons come first. */
.today-cols > .side { flex: 1 1 340px; }
@media (max-width: 899px) { .today-cols > .side { order: -1; } }
.today-cols .section > .card.hero + .list { margin-top: 0; }
.card.hero.nl { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.nl-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nl-top .disp { margin: 0; }
.nl-top .big { font-size: 1.35rem; }
.nl-meta { gap: 8px; }
.before { gap: 14px; }
.bgroup { display: flex; flex-direction: column; gap: 8px; }
.bgroup > .label { display: inline-flex; align-items: center; gap: 8px; font: var(--t-label); text-transform: uppercase; letter-spacing: .08em; color: var(--tx-3); }
.today-cols > .side, .today-cols > .main { align-self: flex-start; }
.today-cols > .side .section > .card, .today-cols > .side .ls { flex: none; }
.nl-top { flex-wrap: nowrap; }
.nl-top .big { font-size: 1.2rem; white-space: nowrap; }
.nl-top .btn { flex: none; }
.nl-top .nl-words { flex: 1 1 auto; min-width: 0; } /* Polish 6: the course icon is back on the left, as on Upcoming lessons */
.book-btn { align-self: flex-start; }
@media (max-width: 380px) { .nl-top { flex-wrap: wrap; } }
/* Umar, 18 Nov: on a phone the white Join button ran over the date. The date may wrap to two lines, and the button
   says only "Join" (the staff twin's says only "Open"). */
@media (max-width: 599px) { .nl-top .big { white-space: normal; } .nl-top .nl-words .disp { overflow-wrap: anywhere; } }
/* Point 11: what the monthly fee covers. */
.covers { padding: var(--cpad); display: flex; flex-direction: column; gap: 8px; }
.covers > .label { font: var(--t-label); text-transform: uppercase; letter-spacing: .08em; color: var(--tx-3); margin: 0; }
.covers-l { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.covers-l li { display: flex; gap: 10px; align-items: flex-start; font: var(--t-body); }
.covers-l .ico { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--key); }
/* Point 12: who is signed in, beside the avatar, on a computer only. */
.who { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tx); }
.who-w { display: none; flex-direction: column; line-height: 1.2; }
.who-w b { font: 700 .88rem/1.2 var(--body); }
.who-w span { font: var(--t-meta); font-size: .76rem; color: var(--tx-2); }
@media (min-width: 900px) { .who-w { display: flex; } }
/* Point 6: the filter and sort row over "Still to fix". */
.fixbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.fixsort { display: inline-flex; align-items: center; gap: 8px; }
.fixsort select { min-height: 36px; border: 1px solid var(--line-field); border-radius: var(--r-field); background: var(--card-bg); color: var(--tx); padding: 0 10px; font: inherit; font-size: .88rem; }
.mk-onkinds { font: var(--t-meta); font-size: .8rem; color: var(--tx-2); margin: 0 auto 0 4px; }
.hspace { flex: 1 1 auto; }
/* Point 14: the book's bar has the Mushaf's shape: the kind of mistake and the sign beside the note, styled like it. */
.mk-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-fields > .mk-notebox { flex: 0 1 240px; }
.mk-fields > .mk-notewide { flex: 1 1 260px; }
.mk-fields > [hidden] { display: none; }
.mk-notebox select { min-height: 40px; width: 100%; border: 1px solid var(--line-field); border-radius: var(--r-field); background: var(--card); color: var(--tx); padding: 0 12px; font: inherit; font-size: .95rem; }
.mk-msg:not(:empty), .mk-say:not(:empty) { text-align: center; }
.mk-fields input, .mk-fields select { height: 42px; min-height: 42px; box-sizing: border-box; }
/* Point 6: the marked words as a snapshot of the Mushaf page (the page image cut round them, never retyped). */
.pf-snapbox { background: #fff; border: 1px solid var(--line); border-radius: var(--r-well); padding: 6px; overflow: hidden; }
.pf-snap { display: block; width: 100%; height: auto; max-height: 120px; }
.pf-hit { fill: rgba(214, 69, 65, .14); stroke: rgba(214, 69, 65, .7); stroke-width: 3; }
.pf-hit.k-tajweed { fill: rgba(47, 111, 214, .12); stroke: rgba(47, 111, 214, .7); }
.pf-hit.k-mixup { fill: rgba(124, 77, 214, .12); stroke: rgba(124, 77, 214, .7); }
.sh-link { font: 700 .82rem/1.2 var(--body); color: var(--key); text-decoration: none; white-space: nowrap; } .sh-link:hover { text-decoration: underline; }

/* Mizmaar as the guide (Umar, 17 Nov evening): a narrow icon rail, the logo, school name and a role chip in the top bar,
   sub-pages as a vertical list beside the page, and a smaller plain title. See docs/archive/MIZMAAR_GUIDE_17NOV.md. */
.rolechip { display: none; }
@media (min-width: 900px) {
  /* Umar, 17 Nov: our own sidebar and serif titles stay (Mizmaar is a guide for organisation, not a look to copy).
     The top bar carries the logo, the school's name and a chip saying who is signed in. */
  .side-nav > .logo { display: none; }
  .hbar .logo { display: inline-flex; align-items: center; gap: 10px; margin-right: 0; color: var(--tx); font-size: 1.25rem; white-space: nowrap; }
  .hbar .logo svg { stroke: var(--gold); }
  .rolechip { display: inline-flex; align-items: center; margin: 0 20px 0 4px; padding: 3px 10px; border-radius: 99px; background: var(--tint); color: var(--key); font: 700 .74rem/1.2 var(--body); white-space: nowrap; }
}
/* On a phone the sub-tabs scroll sideways: the right edge fades so it is plain that there is more (Umar's worry). */
@media (max-width: 899px) { .subrow { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); padding-right: 40px; } }
.today-cols > .main { flex: 999 1 480px; }
.today-cols > .side { flex: 1 1 300px; }
.today-cols .bgroup > .mc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.today-cols .ls-n span { white-space: nowrap; }
.cols.today-cols > .main.section, .cols.today-cols > .side.section { min-width: 0; }

/* ---------- Polish 5 (Umar, 17 Nov): Today as rows, so the heads on the left and right line up ---------- */
.tgrid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); column-gap: 24px; row-gap: 22px;
  grid-template-areas: "up act" "b1 month" "b2 goal" "rep rep"; align-items: start; }
.tgrid > .t-up { grid-area: up; } .tgrid > .t-act { grid-area: act; } .tgrid > .t-b1 { grid-area: b1; } .tgrid > .t-b2 { grid-area: b2; }
.tgrid > .t-month { grid-area: month; } .tgrid > .t-goal { grid-area: goal; } .tgrid > .t-rep { grid-area: rep; }
.tgrid > [role="status"] { display: none; } .tgrid > [role="status"]:not(:empty) { display: block; grid-column: 1 / -1; }
.tgrid > .t-month:empty, .tgrid > .t-goal:empty { display: none; }
.tgrid > * > .section, .tgrid > .section { margin: 0; }
.tgrid .section > .card.hero + .list { margin-top: 0; }
/* The parts of "Before your next lesson": a rail under the heading, each part a small title-case line on it. */
.brail { display: flex; flex-direction: column; gap: 16px; padding-left: 14px; border-left: 2px solid color-mix(in srgb, var(--plan) 35%, transparent); }
.t-b2 .brail { margin-top: -22px; padding-top: 22px; }
.bg-h { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 700 .9rem/1.3 var(--body); color: var(--tx); text-transform: none; letter-spacing: 0; }
.bg-h .ico { width: 16px; height: 16px; color: var(--plan-tx); }
.bgroup { gap: 0; }
@media (max-width: 899px) {
  .tgrid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "up" "act" "b1" "b2" "month" "goal" "rep"; }
  .t-b2 .brail { margin-top: -22px; }
}
.gb-nums { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; margin-top: -6px; font: 600 .68rem/1 var(--body); color: var(--tx-3); }
.gb-num { text-align: center; white-space: nowrap; }
.gb-num.c1 { grid-column: 1; } .gb-num.c5 { grid-column: 5; } .gb-num.c10 { grid-column: 10; } .gb-num.c15 { grid-column: 15; }
.gb-num.c20 { grid-column: 20; } .gb-num.c25 { grid-column: 25; } .gb-num.c30 { grid-column: 30; }
.gb-key { display: flex; flex-wrap: wrap; gap: 6px 14px; font: var(--t-meta); color: var(--tx-2); }
.gb-key > span { display: inline-flex; align-items: center; gap: 6px; }
.gb-key .gb-j { width: 14px; height: 14px; }
.gb-key > .gb-per { font-weight: 700; color: var(--tx); }
.cc-short { gap: 10px; }
.cc-row { display: flex; align-items: center; gap: 12px; }
.cc-row > .words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cc-row h2 { margin: 0; } .cc-row .sub { margin: 0; }
.juzgrid > span.part { background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--card) 75%, transparent) 6px 10px); }
.legend i.part { background: repeating-linear-gradient(135deg, var(--tone) 0 3px, color-mix(in srgb, var(--tone) 25%, var(--card)) 3px 6px); }
/* Marks to fix (Umar, 17 Nov): cards in a row the same size, the page picture in the same space on each, the foot at the bottom. */
.mc-grid > .mcard { height: 100%; }
.mcard > .mc-foot { margin-top: auto; }
.pf-snapbox { height: 96px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pf-snapbox .pf-snap { width: 100%; height: 100%; }
.pf-snapbox.empty { border-radius: var(--r-well); background: var(--well); }
.mc-ref { margin: -4px 0 0; }
.chips .chip .mk-dot { width: 9px; height: 9px; margin-right: 6px; display: inline-block; border-radius: 50%; }
.tgrid .item .end { display: flex; flex-direction: row; align-items: center; gap: 8px; flex-wrap: nowrap; }
/* Phone view (Polish 5): the page inside a drawn phone. */
.in-phone .phoneview { display: none !important; }
.phonebox { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; gap: 24px; background: rgba(12, 20, 40, .55); }
.phone-dev { position: relative; width: 414px; height: 868px; padding: 12px; border-radius: 56px; background: #111; box-shadow: 0 0 0 2px #3a3a3c, 0 30px 80px rgba(0, 0, 0, .45);
  transform: scale(var(--s)); transform-origin: center; flex: none; margin: calc((1 - var(--s)) * -434px) calc((1 - var(--s)) * -207px); }
.phonebox { --s: 1; }
.phone-dev iframe { width: 390px; height: 844px; border: 0; border-radius: 44px; background: var(--bg, #f6f3ee); display: block; }
.phone-notch { position: absolute; top: 22px; left: 50%; width: 120px; height: 32px; margin-left: -60px; border-radius: 20px; background: #111; z-index: 2; }
.phone-side { display: flex; flex-direction: column; gap: 10px; max-width: 220px; color: #fff; }
.phone-side .small { color: rgba(255, 255, 255, .85); }
@media (max-width: 899px) { .phoneview { display: none !important; } }
/* Hifdh journal (Polish 5): plain white cells (the tints had no meaning), the dot in the head says which part is which. */
.hh-cols tr:not(.none) td.hh-c.sabaq, .hh-cols tr:not(.none) td.hh-c.para, .hh-cols tr:not(.none) td.hh-c.dhor, .hh-cols td.sabaq { background: none; }
.hh-cols tr.none td, .hh-cols tr.none th { opacity: 1; }
.hh-cols tr.none th b { color: var(--tx-2); font-weight: 600; }
.hh-cols td.hh-nothing { color: var(--tx-3); font: var(--t-meta); }
.hj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; align-items: start; }
.hj-f { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.hj-l { margin: 0; font-size: .85rem; }
.hj-in { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hj-in input[type="number"] { width: 4.2em; min-width: 0; padding: 8px 6px; }
.hj-in select { min-width: 0; flex: 1 1 110px; }
@media (max-width: 600px) {
  .mnav.mnav-tight { gap: 8px; padding: 8px; }
  .mnav-tight .zq { display: none !important; }
  .mnav-tight .mnav-g { gap: 4px; }
  .mnav-tight select { max-width: 6.6em; padding: 0 4px; font-size: .8rem; min-height: 32px; }
  .mnav-tight .mk-zoom .btn { padding: 0 8px; font-size: .78rem; min-height: 32px; }
}
/* The second version of Lessons (#/lessons/side), for Umar to compare. */
.lgrid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.lg-past { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 899px) { .lgrid { grid-template-columns: minmax(0, 1fr); } .lgrid > :last-child { order: -1; } }
.chips button:has(.mk-dot)::before { display: none; }
@media (min-width: 900px) { .hj-grid { grid-template-columns: 170px minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1.3fr); } }
.hj-in { flex-wrap: nowrap; } .hj-in input[type="number"] { width: 3.4em; }
@media (max-width: 420px) { .hj-in { flex-wrap: wrap; } }
/* F2 (25 Nov): Dhor's "or pages" sits on its own line under the Juz and its part, so neither is squeezed. */
.hj-in:has(.hj-or) { flex-wrap: wrap; }
.hj-or { display: flex; align-items: center; gap: 6px; flex-basis: 100%; }
.lgrid > :last-child .item { flex-wrap: wrap; }
.lgrid > :last-child .item .words { flex: 1 1 140px; }
.lgrid > :last-child .item .end { flex: 1 1 100%; justify-content: flex-end; }
.lgrid > :last-child .item .end-row { display: flex; gap: 8px; align-items: center; }
/* The page starts under the phone's top bar, as on a real phone (the island never covers the logo). */
.phone-dev { height: auto; padding: 44px 12px 14px; }
.phone-dev iframe { height: 800px; border-radius: 6px 6px 40px 40px; }
.phone-notch { top: 11px; width: 104px; height: 26px; margin-left: -52px; background: #000; }
.phone-dev { margin: calc((1 - var(--s)) * -429px) calc((1 - var(--s)) * -207px); }

/* Calendar (Polish 6, Umar 17 Nov): one bar where every control is the same height (34px), so its top and bottom are
   straight lines; Day and Week as a time grid on a computer; the whole week as a strip on a phone; today in a blue circle. */
.cal-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.cal-nav, .cal-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cal-ctl { all: unset; box-sizing: border-box; height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); font: 700 .84rem/1 var(--body); color: var(--tx); cursor: pointer; white-space: nowrap; }
.cal-ctl:hover { border-color: var(--key); color: var(--key); }
.cal-ctl:focus-visible { outline: 2px solid var(--key); outline-offset: 2px; }
.cal-ctl:disabled { color: var(--tx-3); border-color: var(--line); cursor: default; }
.cal-ctl.icon { width: 34px; padding: 0; } .cal-ctl .ico { width: 17px; height: 17px; }
.cal-ctl.pri { background: var(--btn-bg), var(--btn); color: var(--on-btn); border-color: transparent; }
.cal-ctl.pri:hover { color: var(--on-btn); filter: brightness(1.1); }
.cal-range { margin: 0 0 0 4px; height: 34px; box-sizing: border-box; padding: 0 14px; display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); font: 700 .92rem/1 var(--body); color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-seg { display: inline-flex; height: 34px; padding: 3px; gap: 2px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--well); box-sizing: border-box; }
.cal-seg button { all: unset; box-sizing: border-box; height: 26px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 7px; font: 700 .8rem/1 var(--body); color: var(--tx-2); cursor: pointer; }
.cal-seg button[aria-pressed="true"] { background: var(--card); color: var(--key); box-shadow: 0 1px 2px rgba(18, 26, 44, .12); }
.cal-seg button:focus-visible { outline: 2px solid var(--key); }
.cal-num { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 4px; box-sizing: border-box; border-radius: 99px; font: 700 .9rem/1 var(--body); color: var(--tx); font-variant-numeric: tabular-nums; }
.cal-num.now { background: var(--key); color: #fff; }
/* the time grid */
.cal-grid { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow); overflow: auto; max-height: max(420px, calc(100dvh - 240px)); overscroll-behavior: contain; }
.cal-gh, .cal-gb { display: grid; }
.cal-gh { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3; background: var(--card); box-shadow: 0 4px 10px -8px rgba(18, 26, 44, .25); }
.cal-gd { margin: 0; padding: 10px 8px; display: flex; align-items: center; justify-content: center; gap: 6px; border-left: 1px solid var(--line); }
.cal-gw { font: var(--t-label); letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); }
.cal-gd.now .cal-gw { color: var(--key); }
.cal-hours span { display: block; box-sizing: border-box; padding: 0 8px 0 0; text-align: right; font: 600 .72rem/1 var(--body); color: var(--tx-3); transform: translateY(-5px); }
.cal-hours span:first-child { transform: none; padding-top: 4px; }
.cal-col { position: relative; border-left: 1px solid var(--line); }
.cal-col.now { background-color: color-mix(in srgb, var(--key) 4%, transparent); }
.cal-col .cal-b { position: absolute; left: 4px; right: 4px; box-sizing: border-box; overflow: hidden; z-index: 1; }
/* a lesson block */
.cal-b { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 8px; background: var(--tone-bg); border-left: 3px solid var(--tone); min-width: 0; cursor: pointer; }
.cal-b .cal-t { font: 700 .76rem/1.25 var(--body); color: var(--tone-tx); text-decoration: none; }
/* the whole block is the link (Umar, 18 Nov); Join sits above it */
.cal-b .cal-t::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.cal-b .cal-t:focus-visible { outline: none; } .cal-b:has(.cal-t:focus-visible) { outline: 2px solid var(--key); outline-offset: 1px; }
.cal-b:hover { filter: brightness(.97); } .cal-b:hover .cal-n { text-decoration: underline; }
.cal-b .cal-join { position: relative; z-index: 2; }
/* in the time grid a block is exactly its length, so a short lesson keeps time and name, Join small at the top right */
.cal-col .cal-b { padding: 4px 8px; }
.cal-col .cal-b .cal-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-col .cal-b .cal-join { position: absolute; top: 4px; right: 4px; margin: 0; min-height: 0; width: 26px; height: 26px; padding: 0; justify-content: center; border-radius: 99px; }
.cal-col .cal-b .cal-join .ico { width: 14px; height: 14px; margin: 0; }
.cal-col .cal-b .cal-join .jw { display: none; }
.cal-col .cal-b:has(.cal-join) .cal-t, .cal-col .cal-b:has(.cal-join) .cal-n { padding-right: 28px; }
.cal-col .cal-b.short .cal-s { display: none; }
/* the chosen day's lessons: wide and short, a row each (Umar, 18 Nov) */
.cal-b.row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 10px 14px; }
.cal-b.row .cal-t { flex: none; min-width: 7.5em; }
.cal-b.row .cal-n { flex: 1 1 12em; min-width: 0; }
.cal-b.row .cal-s { flex: 0 1 auto; }
.cal-b.row .cal-join { margin: 0 0 0 auto; }
.cal-b .cal-n { font: 700 .8rem/1.25 var(--body); color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-b .cal-s { font: 400 .74rem/1.3 var(--body); color: var(--tx-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-b.past { opacity: .7; } .cal-b.off { opacity: .55; } .cal-b.off .cal-n { text-decoration: line-through; }
/* month */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.cal-wd { margin: 0; padding: 10px 8px; font: var(--t-label); letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); border-bottom: 1px solid var(--line); text-align: center; }
.cal-mday { all: unset; box-sizing: border-box; min-height: 100px; padding: 6px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: stretch; gap: 3px; cursor: pointer; min-width: 0; }
.cal-mday > .cal-num { align-self: flex-start; }
.cal-mday:nth-child(7n + 8) { border-left: 0; }
.cal-mday:nth-child(-n + 14) { border-top: 0; }
.cal-mday:hover { background: var(--well); }
.cal-mday:focus-visible { outline: 2px solid var(--key); outline-offset: -2px; }
.cal-mday.out .cal-num { color: var(--tx-3); }
.cal-mday[aria-pressed="true"] { background: var(--chosen); }
.cal-chip { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 2px 6px; border-radius: 6px; background: var(--tone-bg); font: 600 .72rem/1.35 var(--body); color: var(--tone-tx); }
.cal-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); }
.cal-chip.off { opacity: .55; text-decoration: line-through; }
.cal-more { font: 600 .7rem/1.3 var(--body); color: var(--tx-3); padding-left: 6px; }
/* the chosen day's list (under the month, and the phone's day and week) */
.cal-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.cal-list-h { margin: 0; display: flex; align-items: center; gap: 8px; font: var(--t-title); color: var(--tx); }
.cal-list-b { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.cal-list-b .cal-b .cal-n { font-size: .9rem; } .cal-list-b .cal-b .cal-t { font-size: .82rem; }
.cal-list-h.now { color: var(--key); }
/* a phone's Week: the seven days one under another */
.cal-agenda { display: flex; flex-direction: column; gap: 4px; }
.cal-agenda .cal-list { margin-top: 0; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.cal-agenda .cal-list:first-child { border-top: 0; padding-top: 0; }
.cal-list.small .cal-list-h { font: 700 .88rem/1.3 var(--body); }
.cal-list.small .cal-none { padding: 0; border: 0; font-size: .8rem; }
.cal-none { margin: 0; padding: 14px var(--cpx); border: 1px dashed var(--line-strong); border-radius: var(--r-well); font: var(--t-meta); color: var(--tx-3); }
/* the phone's week strip */
.cal-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow); }
.cal-sd { all: unset; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 5px; border-radius: 10px; cursor: pointer; }
.cal-sd[aria-pressed="true"] { background: var(--chosen); }
.cal-sd:focus-visible { outline: 2px solid var(--key); }
.cal-sw { font: var(--t-label); color: var(--tx-3); }
.cal-sd i { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.cal-sd i.has { background: var(--key); }
@media (max-width: 699px) {
  .cal-bar { gap: 8px; }
  .cal-nav { flex: 1 1 100%; }
  .cal-range { flex: 1 1 auto; justify-content: center; padding: 0 10px; font-size: .86rem; }
  .cal-right { flex: 1 1 100%; justify-content: space-between; }
  .cal-mday { min-height: 48px; padding: 4px 2px; align-items: center; }
  .cal-mday > .cal-num { align-self: center; min-width: 26px; height: 26px; font-size: .84rem; }
  .cal-mday { min-height: 58px; gap: 2px; }
  /* a phone: a small coloured bar with the time in place of a bare dot (Umar, 18 Nov) */
  .cal-mday .cal-chip { align-self: stretch; justify-content: center; padding: 1px 0; border-radius: 4px; background: var(--tone); color: #fff; font: 700 .58rem/1.3 var(--body); }
  .cal-mday .cal-chip i { display: none; }
  .cal-mday .cal-chip > span { overflow: hidden; text-overflow: clip; }
  .cal-mday .cal-chip > span > b { font-weight: 700; }
  .cal-mday .cal-chip > span { font-size: 0; } .cal-mday .cal-chip > span > b { font-size: .58rem; }
  .cal-mday .cal-chip:nth-of-type(n + 4) { display: none; }
  .cal-mday .cal-more { display: none; }
  .cal-wd { padding: 8px 2px; }
  .cal-list-b { grid-template-columns: minmax(0, 1fr); }
}
/* My Qur'an strip (Polish 6, Umar): one straight strip, every control 34px, groups divided by a thin line. */
.mk-viewer > .mnav.mstrip { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 0; padding: 8px 10px; overflow: visible; }
.mstrip .mnav-g { display: flex; align-items: center; gap: 6px; flex: none; padding: 0 14px; border-left: 1px solid var(--line-strong); flex-wrap: nowrap; }
.mstrip .mnav-g:first-child { border-left: 0; padding-left: 0; } .mstrip .mnav-g:last-child { padding-right: 0; }
.mstrip .btn, .mstrip input, .mstrip select, .mstrip .mk-zoomin { height: 34px; min-height: 34px; box-sizing: border-box; border-radius: 10px; font: 700 .82rem/1 var(--body); }
.mstrip .btn { padding: 0 12px; }
.mstrip input { width: 4.2em; padding: 0 6px; }
.mstrip select { width: auto; max-width: 13em; padding: 0 8px; }
.mstrip .mk-zoom { display: flex; gap: 4px; flex-wrap: nowrap; }
.mstrip .mk-zoom .zq { display: inline-flex !important; align-items: center; }
.mstrip .mk-zoomin { width: 52px; text-align: center; }
.mstrip .mnav-num { font: 600 .82rem/1 var(--body); color: var(--tx-2); white-space: nowrap; gap: 6px; }
@media (max-width: 899px) {
  .mk-viewer > .mnav.mstrip { flex-wrap: wrap; row-gap: 8px; }
  .mstrip .mnav-g { border-left: 0; padding: 0; }
  .mstrip .mnav-g:first-child { flex: 1 1 100%; justify-content: center; }
  .mstrip .mnav-g + .mnav-g { margin-left: 6px; }
  .mstrip .mnav-g:first-child + .mnav-g { margin-left: 0; }
  .mstrip select { max-width: 9.5em; }
}
@media (max-width: 599px) {
  .mstrip .mk-zoom .zq { display: none !important; }
  /* Umar, 18 Nov: the Surah and Juz boxes were far too wide; they share the row with Two pages, which shows on a phone too. */
  .mk-viewer > .mnav.mstrip { flex-wrap: wrap; justify-content: flex-start; }
  .mstrip .mnav-g:nth-child(2) { flex: 1 1 180px; min-width: 0; gap: 4px; } .mstrip .mnav-g:nth-child(2) select { flex: 1 1 0; min-width: 0; max-width: none; padding: 0 4px; font-size: .76rem; }
  .mstrip .mnav-g:nth-child(3) { flex: none; margin-left: 4px; }
  .mstrip .mnav-g:nth-child(3) .btn { padding: 0 8px; font-size: .76rem; }
}
/* Marks to fix bar (Polish 6, Umar: "Sort: newest first" was loose text). The filters and the sort are one row of
   controls 34px high; a sort or Juz choice is one bordered box with its small label inside it. */
.fixbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.fixbar .chips .chip { height: 34px; min-height: 34px; box-sizing: border-box; border-radius: 10px; font: 700 .8rem/1 var(--body); }
.fixbar .row { gap: 8px; }
.fixsort { display: inline-flex; align-items: center; gap: 6px; height: 34px; box-sizing: border-box; padding: 0 2px 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); }
.fixsort > .small { font: var(--t-label); letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); }
.fixsort select { all: unset; box-sizing: border-box; height: 32px; padding: 0 26px 0 2px; font: 700 .82rem/32px var(--body); color: var(--tx); cursor: pointer;
  background: no-repeat right 8px center / 10px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235d6676' stroke-width='1.6'/%3E%3C/svg%3E"); }
.fixsort:focus-within { outline: 2px solid var(--key); outline-offset: 1px; }

/* Polish 6 (Umar, 17 Nov): every box heading the same, the small grey label with its icon tile ("Hifdh history, day by
   day" was right). A "#main h2" rule made Consistency, Goals and the 30 Juz big and black; this wins over it. */
#main .panel:not(.hwcard) > .phead h2 { font: var(--t-label); letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); }
/* Set, Due and Handed in: three labelled places that start in the same spot on every homework card. */
.hw-dates { display: grid; grid-template-columns: repeat(3, minmax(0, 190px)); gap: 10px 18px; margin: 2px 0 0; }
.hw-dates .hd { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hw-dates .hd-v { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font: var(--t-meta); color: var(--tx); }
@media (max-width: 480px) { .hw-dates { grid-template-columns: 1fr 1fr; } }
/* A card that says one thing and opens a page: the words on the left, the buttons on the right (on a phone, under). */
.x-open { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.x-open > .sub { margin: 0; }

/* Polish 6 (Umar, 17 Nov): Today without the random gaps. Two columns that each flow on their own; on a phone one
   line in the order up, your lesson, before, mistakes, this month, goal, report. */
.tgrid { grid-template-areas: none; grid-template-rows: auto; }
.tcol { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.tcol > .section, .tcol > div { margin: 0; }
.tcol > .section > :last-child { flex: initial; }
@media (max-width: 899px) {
  .tgrid { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 22px; }
  .tcol { display: contents; }
  .t-up { order: 1; } .t-act { order: 2; } .t-b1 { order: 3; } .t-b2 { order: 4; } .t-month { order: 5; } .t-goal { order: 6; } .t-rep { order: 7; }
}
/* Hifdh journal (Umar, 17 Nov): one look for every date, black first; the cells in plain body text; the Mistakes
   column a small count, then which part the marks were in, each part a row of its own. */
.hh-cols th[scope="row"] { white-space: nowrap; }
.hh-cols th[scope="row"] b { font: 700 .88rem/1.3 var(--body); color: var(--tx); }
.hh-cols td.hh-c { font: 400 .86rem/1.45 var(--body); color: var(--tx); }
.hh-cols td.hh-nothing { color: var(--tx-3); font-style: italic; }
.hh-today { margin-left: 6px; font-size: .68rem; padding: 1px 7px; vertical-align: 1px; }
.hh-slips .hh-n { display: inline-flex; margin-bottom: 4px; }
.hh-sp { display: flex; justify-content: space-between; gap: 8px; max-width: 150px; font: 400 .8rem/1.5 var(--body); color: var(--tx-2); }
.hh-sp b { font: 700 .8rem/1.5 var(--body); color: var(--tx); }

/* Polish 6 (17 Nov): staff This week, the twin of Today. The columns are as tall as what is in them. */
.cols.week-cols { align-items: flex-start; }
.cols.week-cols > .main > :last-child, .cols.week-cols > .side > :last-child,
.cols.week-cols > .side > .section:last-child > :last-child, .cols.week-cols > .main > .section:last-child > :last-child { flex-grow: 0; flex: none; }
.cols.week-cols > .side .tools { padding: 0; }
.strong.one { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nl-more { white-space: nowrap; } /* a flex item: the gap is the space between the words */
@media (max-width: 599px) { .nl-more { display: none; } }
/* Your hours: one card, a row per day. */
.hours-card { padding: 0; }
.hours-day { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.hours-day:first-child { border-top: 0; }
.hours-day.off .hd-name { color: var(--tx-3); }
.hours-day .hours-row .field label { font-size: .78rem; }
@media (max-width: 600px) { .hours-day { grid-template-columns: 1fr auto; } .hours-day .hd-rows { grid-column: 1 / -1; grid-row: 2; } }
/* Finance (Polish 6): two columns that flow on their own, like Today, so no box stretches round empty space. */
@media (min-width: 1000px) {
  .fgrid { display: block; columns: 2; column-gap: 22px; }
  .fgrid > .panel { break-inside: avoid; margin-bottom: 22px; display: flex; width: 100%; }
}
.bk-top { align-items: flex-start; flex-wrap: nowrap; gap: 12px; }
/* Learners (Polish 6): the list in one white card; the name search a 34px control like the Marks to fix bar. */
.card.flush { padding: 6px 10px; }
.fixfind { padding: 0 12px; gap: 8px; min-width: min(320px, 100%); }
.fixfind .ico { width: 15px; height: 15px; color: var(--tx-3); }
.fixfind input { all: unset; box-sizing: border-box; height: 32px; flex: 1; min-width: 0; font: 600 .86rem/32px var(--body); color: var(--tx); }
/* A class's homework card: the who and how as one grey line, not two bold boxes that wrap. */
.hw .mk-top { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: flex-start; }
.hw .mk-top .loc { font-weight: 600; font-size: .84rem; color: var(--tx-2); }
.item > .acts { flex-direction: row; align-items: center; }
.card.flush > .glist { border-top: 0; }
/* Recordings rows (Mizmaar's Recordings): tile, title over "date, time · teacher", then the course chip and a blue Watch
   button side by side in the middle of the row, in the same place on every row. Phone: Watch stays at the right, the
   chip goes under the grey line. */
.item.recrow { align-items: center; }
.item.recrow:has(> .end) > .end > * { grid-row: 1 / span 2; align-self: center; margin-top: 0; }
.item.recrow:has(> .end) > .end > .cchip { grid-column: 3; }
.item.recrow:has(> .end) > .end > .btn { grid-column: 4; }
.list.recrows { container-type: inline-size; }
@container (max-width: 540px) {
  .item.recrow:has(> .end) > .end > .cchip { grid-column: 2; grid-row: 3; justify-self: start; margin: 4px 0 0; }
  .item.recrow:has(> .end) > .end > .btn { grid-column: 3; grid-row: 1 / span 3; }
}
.list.recrows { gap: 0; }
.list.recrows > .item { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; }
.list.recrows > .item:last-child { border-bottom: 0; }
.item.recrow:has(> .end) > .end > .btn + .btn { grid-column: 5; margin-left: 8px; }
@container (max-width: 540px) {
  .item.recrow:has(> .end) > .end > .btn:has(+ .btn) { grid-row: 1 / span 2; }
  .item.recrow:has(> .end) > .end > .btn + .btn { grid-column: 3; grid-row: 3; margin: 6px 0 0; }
}
/* A very narrow box (the staff lesson page's side column): the buttons go on their own line under the words. */
@container (max-width: 380px) {
  .item.recrow:has(> .end) > .end { display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; align-items: center; gap: 8px; grid-column: 2 / -1; grid-row: 3; margin-top: 8px; }
  .item.recrow:has(> .end) > .end > * { margin: 0; }
}
/* N1a: Your hours, the time zone box and the days off form. */
.hours-zone { display: grid; grid-template-columns: auto minmax(0, 320px) minmax(0, 1fr); gap: 8px 16px; align-items: center; margin-bottom: 12px; }
.hours-zone select { width: 100%; }
.hours-off { display: grid; grid-template-columns: repeat(2, minmax(0, 180px)) minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 10px; }
@media (max-width: 600px) {
  .hours-zone { grid-template-columns: 1fr; }
  .hours-off { grid-template-columns: 1fr 1fr; }
  .hours-off > :nth-child(3), .hours-off > :nth-child(4) { grid-column: 1 / -1; }
}
@media (max-width: 600px) { .item.lenrow:has(> .end) > .end > * { grid-column: 2 / -1; grid-row: 3; justify-self: start; margin: 8px 0 0; } }
/* N1c: the time zone shown read-only on the staff Account, in the same box as the family's Zone select. */
.fixsort > .strong { padding-right: 12px; font: 700 .82rem var(--body); color: var(--tx); }

/* N1e: a website enquiry's answers (School), question over answer, two columns on a computer */
.enq-a { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 6px 16px; margin: 0; }
.enq-a dt { color: var(--mute-tx); font-size: .85rem; }
.enq-a dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .enq-a { grid-template-columns: 1fr; gap: 2px; } .enq-a dd { margin-bottom: 8px; } }

/* Build 10: the "before your lesson" card (Today, and its twin on the staff lesson page). */
.panel.prep .prep-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 24px; margin-bottom: 14px; }
.prep-q { margin: 4px 0 6px; font-size: 1rem; line-height: 1.5; color: var(--tx); }
.prep-log { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.prep-log .pl-c { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: .9rem; overflow-wrap: anywhere; }
.prep-log .pl-c b { color: var(--plan-tx); font-weight: 700; font-size: .8rem; }
.panel.prep .bgroup + .bgroup { margin-top: 0; }
.panel.prep .bgroup > a.small, .brail .bgroup > a.small { display: inline-block; margin-top: 6px; }
/* Build 11: the weekly summary and its staff twin. The week sits in a box like the buttons beside it. */
.weekbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.weekbar .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.wk-box { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font: 600 .9rem var(--body); color: var(--tx); }
.wk-box .ico { width: 16px; height: 16px; color: var(--mute-tx); }
.wk-short { display: none; }
@media (max-width: 600px) { .wk-long { display: none; } .wk-short { display: inline; } .weekbar { flex-wrap: nowrap; } .wk-box { flex: 1; justify-content: center; padding: 0 8px; font-size: .82rem; } }
.wk-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wk-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: .78rem; color: var(--mute-tx); }
.wk-day b { font-size: .8rem; color: var(--tx); }
.wk-day .ico { width: 16px; height: 16px; }
.wk-day.done { background: var(--ok-bg, #e8f6ee); border-color: transparent; color: var(--ok-tx, #17633a); }
.wk-day.missed { background: var(--warn-bg, #fdf1e3); border-color: transparent; color: var(--warn-tx, #8a4b0f); }
.wk-note { margin: 0; }
.wk-note blockquote { margin: 0 0 4px; font-size: 1.02rem; line-height: 1.5; color: var(--tx); }
.item.wk-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(260px, 1.1fr); gap: 8px 14px; align-items: center; }
.item.wk-row .words .row { gap: 8px; flex-wrap: wrap; }
.wk-say { display: flex; gap: 8px; }
.wk-say input { flex: 1; min-width: 0; }
@media (max-width: 760px) { .item.wk-row { grid-template-columns: auto minmax(0, 1fr); } .wk-say { grid-column: 1 / -1; } }
@media (max-width: 600px) { .weekbar .wk-w { display: none; } .weekbar .btn { min-width: 40px; justify-content: center; } }
.wk-say input { min-height: 34px; background: var(--card); border: 1px solid var(--line-field); border-radius: var(--r-field); padding: 6px 11px; font: .9rem var(--body); color: var(--tx); box-shadow: inset 0 1px 2px rgba(18, 26, 44, .06); }
.wk-say input:focus { outline: none; border-color: var(--key); box-shadow: 0 0 0 4px color-mix(in srgb, var(--key) 18%, transparent); }
.item.wk-row .small .ico { width: 13px; height: 13px; vertical-align: -2px; color: var(--gold, #b8860b); }

/* A section that folds away (foldSec, Umar 18 Nov): Hide / Show at the right of its heading. */
.foldbtn { all: unset; box-sizing: border-box; margin-left: auto; height: 28px; padding: 0 10px 0 8px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--card); font: 700 .74rem/1 var(--body); color: var(--tx-2); cursor: pointer; flex: none; }
.foldbtn:hover { border-color: var(--key); color: var(--key); }
.foldbtn:focus-visible { outline: 2px solid var(--key); outline-offset: 2px; }
.foldbtn .ico { width: 15px; height: 15px; }
.sechead .sh-link + .foldbtn { margin-left: 10px; }
.section.folded > :not(.sechead) { display: none; }
@media print { .section.folded > :not(.sechead) { display: revert; } .foldbtn { display: none; } }

/* Consistency: Lessons and Homework side by side, so the two grey labels no longer read as one heading (Umar, 18 Nov). */
.rc-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.rc-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rc-col + .rc-col { border-top: 1px solid var(--line); padding-top: 12px; }
/* side by side only where the panel is wide enough for the longer lines */
@container (min-width: 520px) { .rc-two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rc-col + .rc-col { border-top: 0; padding-top: 0; border-left: 1px solid var(--line); padding-left: 16px; } }

/* Resources, nothing shared yet: the kinds that will show, read only (Umar, 18 Nov). */
.res-kinds .act { cursor: default; } .res-kinds .act:hover { background: none; }
.res-kinds .act-i { opacity: .75; }

/* Hifdh journal as a spreadsheet (Umar, 18 Nov): a heading over each part's two columns (amount, mistakes), then the
   mistakes on other pages. The date column stays put while a phone scrolls the table sideways. */
.hh-x { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font: 400 .86rem/1.4 var(--body); }
.hh-x.with-lesson { min-width: 820px; }
.hh-x.no-slips { min-width: 480px; }
.hh-x th, .hh-x td { padding: 7px 9px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); background: var(--card); }
.hh-x thead th { font: 700 .72rem/1.2 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--tx-2); border-bottom-color: var(--line-strong); }
.hh-x thead th.hh-g { text-align: center; border-left: 1px solid var(--line); }
.hh-x thead tr.hh-subrow th { font-size: .66rem; color: var(--tx-3); letter-spacing: .05em; }
.hh-x .hh-sub { display: block; font-size: .64rem; color: var(--tx-3); margin-top: 2px; }
.hh-x th.hh-d { width: 108px; position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--line); }
.hh-x .hh-l { width: 22%; }
.hh-x .hh-m { width: 74px; text-align: center; }
.hh-x td.hh-m, .hh-x th.hh-s.hh-m { border-right: 0; }
.hh-x td.hh-a, .hh-x th.hh-s:not(.hh-m), .hh-x td.other { border-left: 1px solid var(--line); }
.hh-x td.hh-a { overflow-wrap: anywhere; }
.hh-x td.other, .hh-x th.slips { width: 84px; text-align: center; }
.hh-x tbody th b { font: 700 .86rem/1.3 var(--body); color: var(--tx); white-space: nowrap; }
.hh-x tbody th.quiet b { font-weight: 500; color: var(--tx-3); }
.hh-x tr.none td { background: var(--card); }
.hh-x tr.none .mute { opacity: .5; }
.hh-x .hh-mn { display: inline-block; min-width: 24px; padding: 1px 7px; border-radius: 99px; background: var(--bad-bg); color: var(--bad-tx); font: 800 .8rem/1.4 var(--body); }
.hh-x tbody tr:hover td, .hh-x tbody tr:hover th { background: color-mix(in srgb, var(--key) 5%, var(--card)); }
.hh-x .hh-today { display: inline-block; margin: 3px 0 0; }
.hh-x tbody tr:last-child td, .hh-x tbody tr:last-child th { border-bottom: 0; }
@media (max-width: 560px) { .hh-x th.hh-d { width: 84px; } .hh-x th, .hh-x td { padding: 6px 7px; } }
@media (max-width: 560px) { .hh-x th.hh-d { width: 70px; } .hh-x .hh-mo { display: none; } .hh-x { min-width: 600px; } }
/* Memory map (Umar, 18 Nov): the week's revision is a link to the Revision plan, not a repeat of it. */
.mm-toplan { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mm-toplan .ico { width: 16px; height: 16px; color: var(--plan-tx); }
/* Today on a phone (Umar, 18 Nov: a long scroll): the mark cards of "Before your lesson" and "Mistakes to fix" swipe
   sideways in one row instead of stacking, each card nearly the screen's width, so every card is still there. */
@media (max-width: 600px) {
  .prep .mc-grid, .tgrid .mc-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding-bottom: 6px; margin-right: -16px; padding-right: 16px; }
  .prep .mc-grid > *, .tgrid .mc-grid > * { flex: 0 0 86%; scroll-snap-align: start; min-width: 0; }
}

/* Build 13: targets, trophies and streaks (public/trophies.js). Counted, never ranked. */
.tr-big { font-size: 1.05rem; color: var(--tx-2); margin: 0; }
.tr-big b { font-size: 2.6rem; line-height: 1; color: var(--ok-tx); font-weight: 800; margin-right: 4px; }
.tr-weeks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.tr-wk { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.tr-sq { width: 100%; max-width: 54px; aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; background: var(--tone-bg); border: 2px solid var(--tone); color: var(--tone-tx); }
.tr-sq .ico { width: 18px; height: 18px; }
.tr-wk.m-done .tr-sq { background: var(--tone); color: #fff; border-color: var(--tone-2); }
.tr-wk.m-before .tr-sq { border-style: dashed; opacity: .55; }
.tr-wk.m-now .tr-sq { border-style: dashed; }
.tr-wd { font-size: .74rem; font-weight: 700; color: var(--tx-3); text-align: center; line-height: 1.2; max-width: 100%; }
.panel .list.tr-targets { border: 0; box-shadow: none; background: none; border-radius: 0; overflow: visible; }
.list.tr-targets > * { padding: 12px 0; }
.list.tr-targets > *:first-child { padding-top: 0; }
.list.tr-targets > *:last-child { padding-bottom: 0; }
.tr-targets .item { align-items: flex-start; min-height: 0; }
.tr-targets .hint { font-size: .84rem; color: var(--tx-3); }
.tr-targets .bar { margin-top: 4px; max-width: 420px; }
.tr-cups { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tr-cup { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "i w" "g g"; gap: 8px 12px; padding: 14px; border-radius: var(--r-card, 14px); border: 1px solid var(--line); background: var(--card); }
.tr-cup .words { grid-area: w; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tr-cup .meta { font-size: .84rem; color: var(--tx-2); }
.tr-icon { grid-area: i; width: 64px; height: 64px; display: grid; place-items: center; }
.tr-cup.won { border-color: #e3b26d; background: linear-gradient(180deg, #fbf4e4, var(--card) 70%); }
.tr-svg { display: block; overflow: visible; }
.tr-svg.won { filter: drop-shadow(0 3px 5px rgba(18, 26, 44, .16)); }
.tr-track { stroke: var(--mute-bg); }
.tr-ghost { color: var(--tx-3); opacity: .7; }
.tr-cup.won.t-bronze { border-color: #e2b98f; background: linear-gradient(180deg, #fbf1e6, var(--card) 70%); }
.tr-cup.won.t-silver { border-color: #cfd5de; background: linear-gradient(180deg, #f3f5f8, var(--card) 70%); }
.tr-cup.won.t-platinum { border-color: #a9cfd6; background: linear-gradient(180deg, #ecf6f7, var(--card) 70%); }
.tr-cup.won.t-emerald { border-color: #8fd3ae; background: linear-gradient(180deg, #e8f7ef, var(--card) 70%); }
.tr-tier { margin-left: auto; letter-spacing: .08em; color: var(--tx-3); }
.tr-cup.won .tr-tier { color: var(--gold-tx); }
.tr-shelf { display: flex; flex-direction: column; gap: 4px; padding: 6px 14px; border-radius: 14px; background: linear-gradient(180deg, var(--well), var(--card)); border: 1px solid var(--line); }
.tr-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.tr-row:first-child { border-top: 0; }
.tr-rowname { flex: 0 0 190px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; color: var(--tx); }
.tr-rowname .ico { width: 16px; height: 16px; color: var(--tx-3); }
.tr-rown { font-size: .74rem; font-weight: 700; color: var(--tx-3); margin-left: 2px; }
.tr-mini { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tr-minicup { position: relative; display: inline-flex; }
.tr-cup.locked .strong { color: var(--tx-2); }
.tr-when { font-size: .8rem; font-weight: 700; color: var(--gold-tx); }
.tr-left { font-size: .8rem; font-weight: 700; color: var(--tx-2); }
.tr-group { grid-area: g; display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); border-top: 1px solid var(--line); padding-top: 8px; }
.tr-group .ico { width: 14px; height: 14px; }
.tr-label { margin: 6px 0 0; }
:root[data-theme="night"] .tr-cup.won { background: var(--card); }
:root[data-theme="night"] .tr-halo { opacity: .25; }
@media (max-width: 600px) {
  .tr-weeks { gap: 4px; }
  .tr-sq { border-radius: 8px; }
  .tr-wd { font-size: .64rem; }
  .tr-cups { grid-template-columns: 1fr; }
  .tr-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .tr-rowname { flex: none; }
  .tr-shelf { padding: 4px 12px; }
}

/* ---------- The accountability circle (build 14, public/circle.js) ---------- */
.cc-top { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; padding: 14px 16px; border-radius: var(--r-well);
  background: linear-gradient(135deg, var(--ok-bg), var(--card)); border: 1px solid var(--line); }
.cc-big { margin: 0; color: var(--tx-2); font-size: 1rem; white-space: nowrap; }
.cc-big b { font-size: 2.4rem; line-height: 1; font-weight: 800; color: var(--ok-tx); margin-right: 2px; }
.cc-dots { display: flex; flex-wrap: wrap; gap: 6px; justify-self: start; }
.cc-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ok); background: transparent; }
.cc-dots i.on { background: var(--ok); }
.cc-line { grid-column: 1 / -1; margin: 0; }
.cc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cc-m { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-well); background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong); color: inherit; text-decoration: none; min-width: 0; }
.cc-m .words { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cc-m .meta { font-size: .78rem; color: var(--tx-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-m.st-done { border-left-color: var(--ok); background: linear-gradient(90deg, var(--ok-bg), var(--card) 60%); }
.cc-m.st-away { border-left-color: var(--mute); }
.cc-m.you { box-shadow: 0 0 0 2px var(--ok-bg); }
a.cc-m:hover { border-color: var(--line-strong); }
.cc-you { margin-left: 8px; font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ok-tx); background: var(--ok-bg); padding: 2px 7px; border-radius: 99px; vertical-align: middle; }
.cc-st { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.cc-st .ico { width: 13px; height: 13px; }
.cc-rule { display: flex; align-items: flex-start; gap: 8px; margin: 0; }
.cc-rule .ico { width: 14px; height: 14px; flex: none; margin-top: 2px; }
@media (max-width: 600px) {
  .cc-top { grid-template-columns: 1fr; }
  .cc-grid { grid-template-columns: 1fr; }
}

/* ---------- 19 Nov feedback: one numbered circle everywhere (pathway steps and numbered mistakes), one step heading ---------- */
.steps .n, .mcard .mk-n, .mk-n { width: 28px; height: 28px; border-radius: 50%; font-size: .8rem; font-weight: 800;
  background: color-mix(in srgb, var(--key) 10%, var(--card)); color: var(--key);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--key) 40%, transparent), 0 0 0 3px color-mix(in srgb, var(--key) 7%, transparent); }
.mcard .mk-n { background: color-mix(in srgb, var(--tone) 12%, var(--card)); color: color-mix(in srgb, var(--tone) 78%, var(--tx));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tone) 45%, transparent), 0 0 0 3px color-mix(in srgb, var(--tone) 9%, transparent); }
.path-top { display: flex; flex-direction: column; gap: 2px; }
.path .path-h { display: inline-flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 800; color: var(--tx); margin: 0; }
.path-lv > summary { list-style: none; cursor: pointer; padding: 12px 18px; border-top: 1px solid var(--line); }
.path-lv > summary::-webkit-details-marker { display: none; }
.res-act .itile { flex: none; }

/* ---------- The plan full screen (19 Nov feedback, public/plan.js fullBtn) ---------- */
.planbar .plan-fullbtn { margin-left: auto; align-self: center; }
body.plan-full { overflow: hidden; }
body.plan-full .planpage { position: fixed; inset: 0; z-index: 400; background: var(--bg); padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
body.plan-full .planbar { padding: 0; justify-content: flex-end; }
body.plan-full .planbar > .back, body.plan-full .planbar > .words { display: none; }
body.plan-full .planframe { flex: 1; height: auto !important; min-height: 0; width: 100%; margin: 0; border-radius: 12px; border: 1px solid var(--line); }
body.plan-full .planpage > .subrow { display: none; }

/* ---------- 19 Nov B3: the homework card on both files, one flow (public/record.js hwFlow, hwAsk) ---------- */
.hwc .fold-b { gap: 14px; }
.hwf { list-style: none; margin: 0; padding: 12px 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 10px;
  background: var(--well); border: 1px solid var(--line); border-radius: var(--r-field); }
.hwf-s { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.hwf-s::before { content: ""; position: absolute; top: 13px; left: 28px; right: -10px; height: 2px; border-radius: 2px; background: var(--line-field); }
.hwf-s.done::before { background: var(--ok); }
.hwf-s:last-child::before { display: none; }
.hwf-dot { position: relative; z-index: 1; width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--card); color: var(--tx-3); box-shadow: inset 0 0 0 1.5px var(--line-field); }
.hwf-dot .ico { width: 14px; height: 14px; }
.hwf-s.done .hwf-dot { background: var(--ok); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 16%, transparent); }
.hwf-s.now .hwf-dot { background: var(--plan-bg); color: var(--plan-tx); box-shadow: inset 0 0 0 2px var(--plan), 0 0 0 3px color-mix(in srgb, var(--plan) 14%, transparent); }
.hwf-s.late .hwf-dot { background: var(--bad-bg); color: var(--bad-tx); box-shadow: inset 0 0 0 2px var(--bad), 0 0 0 3px color-mix(in srgb, var(--bad) 14%, transparent); }
.hwf-w { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.hwf-v { font: var(--t-meta); font-weight: 650; color: var(--tx); }
.hwf-s.todo .hwf-v { color: var(--tx-3); font-weight: 500; }
.hwf .pill { font-size: .74rem; }
.hw-ask { border-left: 3px solid var(--plan); padding: 2px 0 2px 12px; display: flex; flex-direction: column; gap: 4px; }
.hw-ask .pre { margin: 0; }
.hwc .trail { padding-top: 0; border-top: 0; }
.hwc .hw-foot > .row { margin-left: auto; }
@media (max-width: 599px) {
  .hwf { grid-template-columns: 1fr; gap: 8px; }
  .hwf-s { flex-direction: row; align-items: flex-start; gap: 12px; }
  .hwf-s { align-items: center; }
  .hwf-s::before { top: 28px; bottom: -8px; left: 13px; right: auto; width: 2px; height: auto; }
  .hwf-w { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
  .hwf-w .rc-k { min-width: 76px; }
}

/* ---------- 19 Nov B4: a file on a phone, the most important first (both files). Desktop keeps its two columns. ---------- */
@media (max-width: 760px) {
  .f-cols { display: flex; flex-direction: column; align-items: stretch; gap: 18px; }
  .f-cols > .main, .f-cols > .side { display: contents; }
  .f-cols .f-hw { order: 1; }
  .f-cols .f-les { order: 2; }
  .f-cols .f-mis { order: 3; }
  .f-cols .f-goal { order: 4; }
  .f-cols .f-con { order: 5; }
  .f-cols .f-later, .f-cols > .side > :not([class*="f-"]) { order: 6; }
  .f-cols .f-tools { order: 9; }
}

/* ---------- 19 Nov B5: the pathway, with colour (public/pathway.js). The course's tone colours the band. ---------- */
.list.path > .path-band { display: flex; align-items: center; gap: 18px; padding: 18px 20px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--tone) 16%, var(--card)), color-mix(in srgb, var(--tone) 5%, var(--card)) 70%);
  border-bottom: 1px solid color-mix(in srgb, var(--tone) 22%, var(--line)); }
.path-band-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.path-band .eyebrow { margin: 0; color: var(--tone-tx); }
.path-band .path-h { font-size: 1.15rem; }
.path-band .sub { margin: 0; }
.path-bar { display: flex; gap: 4px; margin-top: 6px; max-width: 360px; }
.path-bar > span { flex: 1; height: 7px; border-radius: 99px; background: color-mix(in srgb, var(--tx) 10%, transparent); }
.path-bar > span.on { background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 70%, #0d5c3a)); }
.path-ring { position: relative; flex: none; width: 64px; height: 64px; display: grid; place-items: center; }
.path-ring svg { position: absolute; inset: 0; }
.path-ring circle { fill: none; stroke-width: 7; }
.path-ring .bg { stroke: color-mix(in srgb, var(--tone) 18%, var(--card)); }
.path-ring .fg { stroke: var(--ok); stroke-linecap: round; }
.path-ring .num { position: relative; font-size: .82rem; color: var(--tx-2); font-weight: 700; }
.path-ring .num b { font-size: 1.25rem; color: var(--tx); }
.list.path > .path-road { list-style: none; margin: 0; display: flex; align-items: flex-start; padding: 14px 20px 12px; overflow-x: auto; }
.path-road li { position: relative; flex: 1 0 84px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.path-road li::before { content: ""; position: absolute; top: 7px; right: 50%; left: -50%; height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--tx) 12%, transparent); }
.path-road li:first-child::before { display: none; }
.path-road li.pr-past::before, .path-road li.pr-here::before { background: var(--ok); }
.path-road li.pr-goal::before { background: linear-gradient(90deg, var(--tone), color-mix(in srgb, var(--tone) 25%, transparent)); }
.pr-dot { position: relative; z-index: 1; width: 17px; height: 17px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 2px var(--line-field); }
.path-road .pr-past .pr-dot { background: var(--ok); box-shadow: none; }
.path-road .pr-here .pr-dot { background: var(--tone); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tone) 22%, transparent); }
.path-road .pr-goal .pr-dot { box-shadow: inset 0 0 0 2px var(--tone); }
.pr-n { font-size: .8rem; font-weight: 650; color: var(--tx-2); line-height: 1.25; }
.path-road .pr-here .pr-n, .path-road .pr-goal .pr-n { color: var(--tone-tx); font-weight: 800; }
.path-checks { list-style: none; margin: 0; padding: 4px 0; display: flex; flex-direction: column; }
.list.path > .path-checks { padding: 6px 20px 10px; }
.path-checks > li, .path-checks > .path-row { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.path-checks > li .t, .path-checks > .path-row .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.path-checks > :not(:last-child)::after { content: ""; position: absolute; left: 14px; top: calc(50% + 15px); height: calc(100% - 30px); width: 2px; background: var(--line-field); }
.path-checks > .done:not(:last-child)::after { background: var(--ok); }
.path-dot { position: relative; z-index: 1; flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 800;
  background: var(--card); color: var(--tx-3); box-shadow: inset 0 0 0 1.5px var(--line-field); }
.path-dot .ico { width: 15px; height: 15px; }
.path-dot.done { background: var(--ok); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 16%, transparent); }
.path-dot.now { background: var(--plan-bg); color: var(--plan-tx); box-shadow: inset 0 0 0 2px var(--plan), 0 0 0 4px color-mix(in srgb, var(--plan) 14%, transparent); }
.path-checks > .now { margin: 2px -10px; padding: 12px 10px; border-radius: 12px; background: color-mix(in srgb, var(--plan) 6%, transparent); }
.path-checks > .now:not(:last-child)::after { left: 24px; }
.path-checks > .todo .strong { color: var(--tx-2); }
.path-lv > summary { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.path-lv > summary .path-top { flex: 1; min-width: 180px; }
.path-lv > summary .path-bar { flex: 0 1 200px; margin: 0; }
.list.path > .path-lv > .path-checks { padding: 0 20px 10px; }
.list.path > .path-lv { padding: 0; }
.list.path > .path-lv > summary { border-top: 0; padding: 14px 20px; }
.list.path > .path-foot { display: flex; align-items: center; gap: 8px; background: var(--well); }
.path-foot .ico { width: 15px; height: 15px; flex: none; }
.path-panel .path-now .path-bar, .path-panel .path-top .path-bar { max-width: 100%; }
.path-panel .path-lv > summary { padding: 10px 0; border-top: 1px solid var(--line); }
@media (max-width: 599px) {
  .list.path > .path-band { padding: 16px; gap: 12px; align-items: flex-start; }
  .path-checks > li { flex-wrap: wrap; gap: 6px 12px; }
  .path-checks > li > .pill { margin-left: 44px; }
  .path-checks > :not(:last-child)::after { top: 42px; height: calc(100% - 30px); }
}
.path-panel .path-checks > .path-row { flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; padding: 10px 0; }
.path-panel .path-checks > .path-row .t { padding-top: 4px; }
.path-panel .path-checks > .path-row > .btn, .path-panel .path-checks > .path-row > .pill { margin-left: 42px; }
.path-panel .path-checks > :not(:last-child)::after { top: 40px; height: calc(100% - 30px); }
.path-panel .path-now { gap: 8px; }
.list.path > details.path-lv > summary { padding: 14px 20px; min-height: 0; }
.path-panel .path-checks > .path-row .t { flex: 1 1 calc(100% - 50px); }
.path-panel .path-checks > .path-row + .path-row { border-top: 0; }
.path-panel .path-checks > .now { margin: 2px -8px; padding: 10px 8px; }
.path-panel .path-checks > .now:not(:last-child)::after { left: 22px; }
.path-panel .path-now > .path-top { padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--tone) 16%, var(--card)), color-mix(in srgb, var(--tone) 5%, var(--card)) 70%); }

/* ---------- 19 Nov B2: the Hifdh journal with borders and colour (public/hifdh.js historyTable; both files share it) ---------- */
.x-hifdh .acc, .hh-x { --c-sabaq: var(--ok); --c-para: var(--info); --c-dhor: var(--gold); }
details.acc > summary.hh-month { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.hh-month > .strong { font-size: 1.05rem; }
.hh-tally { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-right: auto; }
.hh-t { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 8px; border-radius: 99px; font: 600 .78rem/1.3 var(--body); color: var(--tx-2);
  background: color-mix(in srgb, var(--c) 10%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent); }
.hh-t b { color: color-mix(in srgb, var(--c) 75%, var(--tx)); }
.hh-t.sabaq, .hh-x .sabaq { --c: var(--ok); }
.hh-t.para, .hh-x .para { --c: var(--info); }
/* Umar, 19 Nov (Ali demo): Sabaq Para's blue and Dhor's purple were too close. Dhor takes the gold the Revision plan
   already gives it, so the journal and the plan use the same three colours: green, blue, gold. */
.hh-t.dhor, .hh-x .dhor { --c: var(--gold); }
/* The month row: the month, the days noted and the three counts are one row of boxes of one height and size, like the
   calendar's bar (Umar, 19 Nov: no plain text beside bigger chips). */
details.acc > summary.hh-month { gap: 8px; }
.hh-month > .strong, .hh-month > .pill, .hh-t { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 12px; border-radius: 10px; font: 600 .86rem/1 var(--body); }
.hh-month > .strong { border: 1px solid var(--line-strong); background: var(--card); color: var(--tx); font-weight: 700; font-size: .95rem; }
.hh-month > .pill { border: 1px solid var(--line); background: var(--well); color: var(--tx-2); }
.hh-t { padding: 0 12px; }
.hh-t b { font-size: .95rem; }
.hh-key { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; font-size: .85rem; color: var(--tx-2); }
.hh-key span { display: inline-flex; align-items: center; gap: 6px; }
.hh-key .k-bold { font-weight: 700; color: var(--tx); }
.hh-key .k-grey { color: var(--tx-3); }
.hh-scroll { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--card); }
.hh-x thead th { background: var(--well); }
.hh-x thead th.hh-g { border-top: 3px solid var(--c); background: color-mix(in srgb, var(--c) 12%, var(--card)); color: color-mix(in srgb, var(--c) 70%, var(--tx)); padding-top: 9px; }
.hh-x thead th.hh-g::before { display: none; }
.hh-gw { letter-spacing: .08em; }
.hh-x thead tr.hh-subrow th.hh-s { background: color-mix(in srgb, var(--c) 5%, var(--card)); }
.hh-x thead th.hh-d { background: var(--well); }
.hh-x td.hh-a.has { background: color-mix(in srgb, var(--c) 8%, var(--card)); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--c) 70%, transparent); font-weight: 600; }
.hh-x tr.none th, .hh-x tr.none td { padding-top: 4px; padding-bottom: 4px; }
.hh-x tr.none th b { font-weight: 500; }
.hh-x tr.wk > th, .hh-x tr.wk > td { border-top: 2px solid var(--line-strong); }
.hh-x tr.is-today > th, .hh-x tr.is-today > td { background: color-mix(in srgb, var(--key) 7%, var(--card)); }
.hh-x tr.is-today > th { box-shadow: inset 4px 0 0 var(--key); }
.hh-x tr.is-today td.hh-a.has { background: color-mix(in srgb, var(--c) 12%, color-mix(in srgb, var(--key) 6%, var(--card))); }
.hh-x tbody tr:hover td.hh-a.has { background: color-mix(in srgb, var(--c) 14%, var(--card)); }
.hh-x td.hh-m.has { background: color-mix(in srgb, var(--c) 8%, var(--card)); }
.hh-x tr.is-today td.hh-m.has { background: color-mix(in srgb, var(--c) 12%, color-mix(in srgb, var(--key) 6%, var(--card))); }

/* ---------- 19 Nov B1: the phone's Week, seven narrow columns (public/calendar.js miniWeek) ---------- */
/* B4 (25 Nov): the phone's Week scrolls through the whole day under its pinned day buttons. */
.cal-wk { max-height: clamp(220px, calc(100dvh - 300px), 340px); overflow: auto; }
.cal-wk .cal-gh { padding: 4px 0; }
.cal-wk .cal-gh .cal-sd { padding: 4px 0; margin: 0 1px; }
.cal-wk .cal-hours span { padding-right: 4px; font-size: .66rem; }
.cal-wk .cal-col.on { background-color: color-mix(in srgb, var(--key) 7%, transparent); }
.cal-mini { position: absolute; left: 2px; right: 2px; box-sizing: border-box; z-index: 1; overflow: hidden; display: block; padding: 3px 2px 0; border-radius: 6px;
  background: var(--tone-bg); border-top: 3px solid var(--tone); font: 700 .66rem/1.1 var(--body); color: var(--tone-tx); text-align: center; text-decoration: none; letter-spacing: -.01em; }
.cal-mini.past { opacity: .7; } .cal-mini.off { opacity: .5; text-decoration: line-through; }
.cal-mini:focus-visible { outline: 2px solid var(--key); outline-offset: 1px; }
.cal-wk + .cal-list { margin-top: 14px; }
.cal-wk .cal-gh { border-radius: var(--r-card) var(--r-card) 0 0; }

/* The Sanad page (build 15, public/sanad.js): the same for the learner and the teacher. */
.sj-road { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sj-step { display: flex; gap: 12px; align-items: flex-start; }
.sj-step .n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800;
  background: color-mix(in srgb, var(--key) 10%, var(--card)); color: var(--key);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--key) 40%, transparent), 0 0 0 3px color-mix(in srgb, var(--key) 7%, transparent); }
.sj-step.done .n { background: var(--key); color: #fff; }
.sj-step.todo { opacity: .7; }
.sj-step .n .ico { width: 15px; height: 15px; }
.sj-step .words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sj-goal { margin-top: 12px; align-items: center; }
.sj-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; }
.sj-grid > li:not(.sj-cell) { display: contents; }
.sj-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding: 6px 2px; border-radius: 10px;
  border: 1.5px dashed var(--line); background: var(--card); color: var(--tx-2); font: inherit; min-width: 0; }
button.sj-cell { cursor: pointer; }
button.sj-cell:hover { border-color: var(--key); }
.sj-cell.heard { border: 1.5px solid var(--key); background: color-mix(in srgb, var(--key) 12%, var(--card)); color: var(--key); }
.sj-j { font-weight: 800; font-size: .95rem; }
.sj-d { font-size: .68rem; font-weight: 600; color: var(--tx-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sj-cell.heard .sj-d { color: inherit; }
.sj-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; }
.sj-day { min-height: 40px; }
.sj-done { margin-top: 12px; }
.sj-done .item { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sj-chain { margin: 0; padding-left: 1.4em; display: grid; gap: 4px; }
.sj-cert { border: 3px double var(--key); border-radius: 14px; padding: 28px 20px; text-align: center; background: var(--card); display: grid; gap: 10px; }
.sj-school { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; color: var(--tx-3); margin: 0; }
.sj-title { margin: 0; font-size: 1.5rem; color: var(--key); }
.sj-name { margin: 0; font-size: 1.35rem; font-weight: 800; }
.sj-cert p { margin: 0; }
.sj-cert .sj-chain { text-align: left; justify-self: center; font-size: .9rem; }
.sj-sign { display: flex; justify-content: space-around; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.sj-sign > span { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 140px; }
.sj-line { border-top: 1.5px solid var(--tx-2); padding-top: 6px; font-weight: 700; min-width: 140px; }
@media (max-width: 600px) {
  .sj-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sj-cert { padding: 20px 12px; }
}
/* Printing the certificate alone: everything but the certificate is hidden. */
@media print {
  body.print-cert #main * { visibility: hidden; }
  body.print-cert .sj-cert.printing, body.print-cert .sj-cert.printing * { visibility: visible; }
  body.print-cert .sj-cert.printing { position: fixed; inset: 10mm; border-color: #000; }
}

/* ---------- 19 Nov (Ali demo): the memory map in the portal's look, not flat. The squares are small tiles with a light top
   edge (2.5D, not loud), the Juz numbers small gold tiles like the portal's icons, the frame a soft card. ---------- */
.mm-frame { background: linear-gradient(180deg, var(--card) 0%, var(--well) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 10px 24px -18px rgba(15, 27, 51, .35); padding: 10px 8px 10px 10px; }
.mm-sq { border-radius: 3px; background: linear-gradient(180deg, color-mix(in srgb, var(--mute-bg) 70%, #fff) 0%, var(--mute-bg) 100%); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .05); }
.mm-sq.s-yes { background: linear-gradient(180deg, #4cc489 0%, #22925a 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -1px 0 rgba(0, 0, 0, .12); }
.mm-sq.s-half { background: linear-gradient(180deg, #f5c27f 0%, #e39a3e 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -1px 0 rgba(0, 0, 0, .1); }
.mm-sq.s-no { background: linear-gradient(180deg, #e7765f 0%, #c4432e 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -1px 0 rgba(0, 0, 0, .12); }
.mm-sq.prac { box-shadow: inset 0 0 0 2px var(--info-tx); }
.mm-sq.clr { box-shadow: inset 0 0 0 2px #2fa56b; }
.mm-n { border: 0; color: #fff; border-radius: 8px; background: radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, .38), transparent 55%), linear-gradient(145deg, #d3a04a 0%, #a8781f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 3px 8px -4px rgba(168, 120, 31, .7); }
.mm-key li { padding: 4px 10px 4px 6px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); }
.mm-key .mm-sq { width: 14px; height: 14px; border-radius: 4px; }
:root[data-theme="dark"] .mm-frame { box-shadow: 0 10px 24px -18px rgba(0, 0, 0, .6); }

/* ---------- 19 Nov (Ali demo): Trophies in the portal's look. Sections with Hide like Still to earn; the streak in three
   bordered boxes; targets as rows that open their page; coloured icon tiles; headings bigger than their words; a
   padlock and the tier's colour on what is still to earn. ---------- */
.tr-sec > .card { padding: 16px; }
.tr-streak { display: grid; gap: 14px; }
.tr-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tr-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 8%, var(--card)), var(--card) 75%); box-shadow: 0 6px 16px -14px rgba(15, 27, 51, .4); }
.tr-box .words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-bv { font: 800 1.35rem/1.1 var(--body); color: var(--tx); }
.tr-box.tone-ok .tr-bv { color: var(--ok-tx); }
.tr-bw { font-weight: 700; font-size: .92rem; color: var(--tx); }
.tr-bs { font-size: .8rem; color: var(--tx-2); }
.tr-note { margin: 0; font-size: .86rem; color: var(--tx-2); }
.tr-wk.m-done .tr-sq { background: radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, .35), transparent 55%), linear-gradient(145deg, #3fb57b, #1f8a55);
  border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -2px 0 rgba(0, 0, 0, .12), 0 5px 12px -7px rgba(31, 138, 85, .8); }
.tr-sq { max-width: 46px; }
.tr-targets .tr-target { align-items: center; padding: 14px 16px; text-decoration: none; color: inherit; }
.tr-targets .tr-target:hover { background: var(--well); }
.tr-target .strong { font-size: 1rem; }
.tr-tw { font-size: .92rem; color: var(--tx); }
.tr-target .end { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--tx-3); }
.tr-target .end .ico { width: 16px; height: 16px; }
.tr-sub { margin: -4px 0 10px; font-size: .88rem; font-weight: 700; color: var(--gold-tx); }
.tr-rowname { font-size: 1rem; gap: 10px; }
.tr-rown { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 99px; background: var(--well); border: 1px solid var(--line); font-size: .74rem; color: var(--tx-2); }
.tr-cup .strong { font-size: 1.02rem; }
.tr-cup .meta { color: var(--tx-2); }
.tr-icon { position: relative; }
.tr-svg.won { filter: drop-shadow(0 4px 6px rgba(18, 26, 44, .22)) drop-shadow(0 0 10px color-mix(in srgb, #e3b26d 45%, transparent)); }
.tr-cup.won .tr-icon { border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .9), transparent 60%); }
.tr-cup.locked { border-top: 3px solid var(--tier, var(--line-strong)); background: linear-gradient(180deg, color-mix(in srgb, var(--tier, #999) 7%, var(--card)), var(--card) 60%); }
.tr-cup.locked.t-bronze { --tier: #c98a52; } .tr-cup.locked.t-silver { --tier: #9aa6b6; } .tr-cup.locked.t-gold { --tier: #d0a040; }
.tr-cup.locked.t-platinum { --tier: #5fa8b5; } .tr-cup.locked.t-emerald { --tier: #3aa877; }
.tr-cup.locked .strong { color: var(--tx); }
.tr-cup.locked .tr-left { color: color-mix(in srgb, var(--tier, var(--tx-2)) 70%, var(--tx)); }
.tr-cup.locked .tr-ghost { color: color-mix(in srgb, var(--tier, var(--tx-3)) 70%, var(--tx-3)); opacity: .85; }
.tr-cup.locked .tr-tier { color: color-mix(in srgb, var(--tier, var(--tx-3)) 75%, var(--tx)); }
.tr-lock { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; color: #fff;
  background: radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, .35), transparent 55%), linear-gradient(145deg, #5b6b86, #2c3a55); box-shadow: 0 3px 8px -3px rgba(15, 27, 51, .6); }
.tr-lock .ico { width: 13px; height: 13px; }
.tr-group { color: var(--tx-2); }
@media (max-width: 600px) { .tr-boxes { grid-template-columns: 1fr; } .tr-target .end .pill { display: none; } }
.tr-rowname { flex: 0 0 230px; white-space: nowrap; }
.tr-rowname .itile .ico, .tr-group .itile .ico { color: #fff; width: 13px; height: 13px; }
.tr-targets .tr-target > .end { flex-direction: row; align-self: center; }
@media (max-width: 600px) { .tr-rowname { flex: none; } }

/* ---------- 19 Nov (Ali demo): the circle in the portal's look. The done dots and the member cards have depth; the rule
   line has its own small tile. ---------- */
.cc-top { border: 1px solid color-mix(in srgb, var(--ok) 30%, var(--line)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 8px 20px -16px rgba(15, 27, 51, .4); }
.cc-dots i, .cc-dots span { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 2px 5px -2px rgba(31, 138, 85, .6); }
.cc-m { border: 1px solid var(--line-strong); box-shadow: 0 6px 16px -14px rgba(15, 27, 51, .45); background: linear-gradient(180deg, var(--card), color-mix(in srgb, var(--well) 60%, var(--card))); }
.cc-m.st-done { background: linear-gradient(180deg, color-mix(in srgb, var(--ok) 8%, var(--card)), var(--card)); }
.cc-rule { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--well); color: var(--tx-2); }
.cc-rule .itile .ico { color: #fff; }

/* ---------- 19 Nov (Ali demo): Resources as one list, the kinds as a row of chips (one height, like the calendar's bar). ---------- */
.res-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.res-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card); color: var(--tx); font: 600 .88rem/1 var(--body); cursor: pointer; }
.res-chip i { width: 10px; height: 10px; border-radius: 3px; background: linear-gradient(145deg, var(--tone), var(--tone-2)); }
.res-chip b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--well); font-size: .76rem; color: var(--tx-2); }
.res-chip[aria-pressed="true"] { background: var(--side, #0f1b33); border-color: transparent; color: #fff; }
.res-chip[aria-pressed="true"] b { background: rgba(255, 255, 255, .16); color: #fff; }
.res-one { max-width: 860px; }
.res-kind { font-weight: 700; color: var(--tx-2); }

/* Streak key (Umar, 19 Nov, Ali demo): every kind of week shown is named, small squares in one wrapping row. */
.tr-key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--t-meta, .8rem); color: var(--tx-2); }
.tr-key .tr-wk { flex-direction: row; gap: 6px; }
.tr-key .tr-sq { width: 18px; max-width: 18px; border-radius: 5px; border-width: 1.5px; }
.tr-key .tr-sq .ico { width: 11px; height: 11px; }

/* Apply everywhere (Umar, 19 Nov): one-tap links. Your own "Not yet" in the circle opens the plan; each mistake that
   keeps coming back on the memory map opens its page. */
a.cc-m { flex-wrap: wrap; text-decoration: none; color: inherit; }
.cc-go { flex-basis: 100%; font-size: var(--t-meta, .8rem); font-weight: 700; color: var(--key); padding-left: 46px; }
.mm-back li a { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; color: inherit; text-decoration: none; }
.mm-back li a:hover b { text-decoration: underline; }
.mm-go { font-size: var(--t-meta, .8rem); font-weight: 700; color: var(--key); white-space: nowrap; }

/* Build 9: the teacher's board (public/board.js). One row per learner; each thing waiting is a small link with its tile. */
.bd-row { align-items: flex-start; padding: 12px 4px; }
.bd-row.needs { box-shadow: inset 3px 0 0 var(--warn); padding-left: 10px; }
.bd-name { color: var(--tx); text-decoration: none; font-size: var(--t-body, 1rem); }
.bd-name:hover { text-decoration: underline; }
.bd-asks { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 4px; }
.bd-ask { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--tx); text-decoration: none; font-size: var(--t-meta, .82rem); font-weight: 700; box-shadow: var(--sh-1, none); }
.bd-ask:hover { border-color: var(--tone, var(--key)); background: var(--tone-bg, var(--tint)); }
.bd-clear { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-meta, .82rem); color: var(--ok-tx); font-weight: 700; }
.bd-clear .ico { width: 14px; height: 14px; }
.bd-none { padding: 14px 4px; margin: 0; }
.bd-key { display: flex; gap: 8px; align-items: flex-start; color: var(--tx-2); }

/* ---------- Build 16: coverage of every rule and letter (public/coverage.js). The book map reuses the memory map's .mm-* ---------- */
.cv-sum { display: grid; gap: 8px; margin: 0 0 12px; }
.cv-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--mute-bg); box-shadow: inset 0 1px 2px rgba(15, 27, 51, .12); }
.cv-bar i { display: block; height: 100%; }
.cv-bar i.ok { background: linear-gradient(180deg, #4cc489 0%, #22925a 100%); }
.cv-bar i.warn { background: linear-gradient(180deg, #f5c27f 0%, #e39a3e 100%); }
.cv-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; color: var(--tx-2); }
.cv-nums b { color: var(--tx); font-size: 1rem; }
.cv-of { margin-left: auto; }
.cv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.cv-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.cv-tile { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--mute-bg); border-radius: 12px; background: var(--card); }
.cv-tile.st-secure { border-left-color: #2fa56b; }
.cv-tile.st-learning { border-left-color: #e39a3e; background: color-mix(in srgb, var(--warn-bg) 35%, var(--card)); }
.cv-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: .78rem; font-weight: 800; color: var(--mute-tx); background: var(--mute-bg); font-variant-numeric: tabular-nums; }
.cv-tile.st-secure .cv-n { color: #fff; background: linear-gradient(145deg, #4cc489, #22925a); }
.cv-tile.st-learning .cv-n { color: var(--warn-tx); background: var(--warn-bg); box-shadow: inset 0 0 0 2px #e39a3e; }
.cv-n .ico { width: 15px; height: 15px; }
.cv-w { display: grid; gap: 3px; min-width: 0; }
.cv-t { font-size: .92rem; line-height: 1.3; }
.cv-s { font-size: .8rem; color: var(--tx-2); line-height: 1.35; }
.cv-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.cv-tags .pill { padding: 4px 8px; font-size: .7rem; }
a.cv-open { text-decoration: none; }
@media (max-width: 600px) { .cv-tiles { grid-template-columns: 1fr; gap: 6px; } .cv-of { margin-left: 0; width: 100%; }
  .cv-tile { padding: 8px 10px; grid-template-columns: auto 1fr auto; align-items: center; } .cv-s { display: none; } .cv-tags { margin-top: 0; } .cv-n { width: 24px; height: 24px; } }
/* The book map: far fewer pages than the Mushaf, so each square is a fixed small size and carries its printed number. */
.cv-page .mm-cells { grid-template-columns: repeat(var(--cols), minmax(0, 46px)); }
.cv-page .mm-sq { aspect-ratio: auto; height: 34px; overflow: hidden; font-size: .7rem; font-weight: 700; color: var(--tx-2); font-variant-numeric: tabular-nums; }
.cv-page .mm-sq.s-half { color: #5c3606; } .cv-page .mm-sq.s-no { color: #fff; }
.cv-page .mm-key .mm-sq { height: 16px; font-size: 0; }
@media (max-width: 600px) { .cv-page .mm-sq { height: 28px; font-size: .62rem; } }

/* Build 17 (3d): the "Similar" chip on a Mix-up of the Mushaf page, and the ring round a sign as a tap target. */
svg .sim-chip { cursor: pointer; }
svg .sim-chip rect { fill: var(--mk-mixup); stroke: #fff; stroke-width: 1.5; opacity: .94; }
svg .sim-chip text { fill: #fff; font-family: var(--body); font-weight: 800; letter-spacing: .02em; pointer-events: none; }
svg .sim-chip:hover rect, svg .sim-chip:focus-visible rect { opacity: 1; stroke: var(--gold); stroke-width: 3; }
svg .sim-chip:focus { outline: none; }
svg .mk-hit { fill: transparent; stroke: transparent; stroke-width: 6; pointer-events: all; cursor: pointer; }
svg .mk-hit:focus-visible { stroke: var(--gold); outline: none; }

/* ===== Umar's 20 Nov feedback, Part A (docs/archive/FEEDBACK_20NOV_ROUND.md). ===== */
/* A1. The bell as a 3D gradient tile, like the icon tiles on every page (gold: the notices' colour). */
.hicon.hbell { border: 0; background: none; width: 42px; height: 42px; padding: 0; cursor: pointer; }
.hb-tile { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, .42), transparent 55%), linear-gradient(145deg, #f0c46e 0%, #b07a1c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 0 rgba(0, 0, 0, .14), 0 6px 14px -6px rgba(176, 122, 28, .8); transition: transform .15s ease; }
.hb-tile .ico { width: 20px; height: 20px; stroke-width: 2; }
.hicon.hbell:hover .hb-tile, .hicon.hbell[aria-expanded="true"] .hb-tile { transform: translateY(-2px); }
.hicon.hbell:focus-visible { outline: 2px solid var(--key); outline-offset: 2px; border-radius: 14px; }
.hbell .bell-n { top: -5px; right: -5px; }
/* A4. Clear one, Clear all (in the list's head). */
.bp-h { display: flex; align-items: center; gap: 8px; }
.bp-h > span:first-child { margin-right: 2px; }
.bp-all { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--btn-line); background: var(--card); color: var(--key);
  border-radius: 99px; padding: 5px 12px; min-height: 32px; font: 700 .8rem/1 var(--body); cursor: pointer; }
.bp-all .ico { width: 15px; height: 15px; }
.bp-all:hover { background: var(--tint); }
.bp-row { padding: 0 8px 0 0; gap: 4px; }
.bp-go { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: center; padding: 11px 8px 11px 16px; text-decoration: none; color: var(--tx); }
.bp-x { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 0; background: none; color: var(--tx-3); display: grid; place-items: center; cursor: pointer; }
.bp-x .ico { width: 16px; height: 16px; }
.bp-x:hover, .bp-x:focus-visible { background: var(--well); color: var(--tx); }
@media (max-width: 599px) { .bp-x { width: 44px; height: 44px; } }
/* A2. The school's name: the display font a little heavier, in the title's navy-to-blue finish, its last word in the
   page titles' blue (one key word, as on every page's title). A3. The role chip: a small raised pill with its icon. */
@media (min-width: 900px) {
  .hbar .logo { gap: 11px; }
  .hbar .logo svg { width: 26px; height: 26px; stroke-width: 2.4; filter: drop-shadow(0 2px 3px rgba(168, 120, 31, .35)); }
  .logo-w { font-weight: 600; font-size: 1.32rem; letter-spacing: .005em; background: linear-gradient(100deg, #0f1b33 0%, #24447e 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .logo-w em { font-style: normal; background: linear-gradient(95deg, var(--key) 10%, var(--key-2) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .04em; }
  .rolechip { gap: 5px; padding: 4px 11px 4px 8px; border: 1px solid color-mix(in srgb, var(--key) 22%, transparent);
    background: linear-gradient(180deg, #ffffff 0%, var(--tint) 100%); box-shadow: inset 0 1px 0 #fff, 0 3px 8px -4px rgba(35, 88, 184, .45); }
  .rolechip .ico { width: 14px; height: 14px; stroke-width: 2.2; }
}
:root[data-theme="night"] .logo-w { background-image: linear-gradient(100deg, #ffffff 0%, #c9d8f2 100%); }
:root[data-theme="night"] .rolechip { background: linear-gradient(180deg, #1a2c4c 0%, var(--tint) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 3px 8px -4px rgba(0, 0, 0, .6); }
.logo-w { white-space: nowrap; }
/* A30. Every box heading puts its extras at the right end, always in one order: the "All ..." link, then Hide / Show.
   (With three items, space-between had put "All reports" in the middle.) */
.sechead { justify-content: flex-start; }
.sechead > .label { margin-right: auto; }
.sechead > .foldbtn { margin-left: 0; }
.sechead .sh-link + .foldbtn { margin-left: 4px; }
/* A27, A28. Today's circle in the calendar (and the date picker's ring) takes the buttons' own paint, the one used by
   Join: navy in the light look, the light blue in Night with dark figures, so it never looks washed out. */
.cal-num.now { background: var(--btn-bg), var(--btn); color: var(--on-btn); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 3px 8px -3px color-mix(in srgb, var(--btn) 70%, transparent); }
.cal-gd.now .cal-gw, .cal-list-h.now { color: var(--btn); }
:root[data-theme="night"] .cal-col.now { background-color: color-mix(in srgb, var(--btn) 7%, transparent); }
.dp-d.now { box-shadow: inset 0 0 0 1.5px var(--btn); }
/* A29. Your goal: the key on one line (Memorised first, "1 block = 1 Juz" at its end), and every line of the box starts
   at the same left edge (the goal line no longer has an icon pushing its words right). */
.gb-key { flex-wrap: nowrap; gap: 12px; white-space: nowrap; font-size: .78rem; }
.gb-key > span { gap: 5px; }
.gb-key .gb-j { width: 12px; height: 12px; border-radius: 3px; }
.gb-key > .gb-per { margin-left: auto; font-weight: 500; color: var(--tx-3); }
.gb-goal { gap: 10px; }
@media (max-width: 359px) { .gb-key { flex-wrap: wrap; } }
/* A6. Book a lesson: a place's head is the one row of the portal (course icon, title, coloured class chip, teacher). */
.bk-place { padding: 0; border: 0; background: none; }
.bk-place .itile { width: 42px; height: 42px; }
/* A7. Memory map: one tidy block above the map: the mistakes still open (and Practise) on the left, page numbers and zoom
   on the right, the key under them as small plain items; little padding, no separate rows of big buttons. */
.mm-bar { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--r-well); background: var(--well); }
.mm-bar-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.mm-bar .mm-proof { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font: var(--t-meta); color: var(--tx); font-weight: 600; }
.mm-bar-tools { margin-left: auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mm-bar .btn.sm { min-height: 34px; }
.mm-bar .mm-zoom .btn { min-width: 34px; padding: 0 10px; font-size: 1rem; }
.mm-bar .mm-key { margin: 0; gap: 4px 14px; }
.mm-bar .mm-key li { padding: 0; border: 0; background: none; font-size: .78rem; }
.mm-bar .mm-key .mm-sq { width: 12px; height: 12px; border-radius: 3px; }
@media (max-width: 599px) { .mm-bar-tools { margin-left: 0; } }
/* A31. What the fee covers, as tiles: a 3D icon, a short key line in the display font, the longer words under it. */
.cv2 { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.cv2-i { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-well);
  background: linear-gradient(160deg, color-mix(in srgb, var(--tone) 7%, var(--card)) 0%, var(--card) 60%); box-shadow: var(--shadow); }
.cv2-w { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cv2-k { font: 700 1.38rem/1.12 var(--disp); color: var(--tx); letter-spacing: .005em; }
.cv2-s { font: var(--t-meta); color: var(--tx-2); line-height: 1.45; }
.cv2-i.pkg { border-color: color-mix(in srgb, var(--tone) 45%, var(--line)); }
.cv2-i.pkg .cv2-k { background: linear-gradient(95deg, var(--key) 10%, var(--key-2) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cv2-i.pkg .cv2-s { order: -1; font: var(--t-label); text-transform: uppercase; letter-spacing: .08em; color: var(--tx-3); }
.covers { gap: 10px; }
/* A8 to A21. Trophies and targets (public/trophies.js, the same page on both sides). */
.t2-streak { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; }
.t2-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.t2-box { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-well); background: var(--card); min-width: 0; }
.t2-box .words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.t2-bl { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 4px; font: 700 .98rem/1.25 var(--body); color: var(--tx); }
.t2-bl .pill { align-self: center; }
.t2-n { font: var(--t-num); font-size: 1.5rem; line-height: 1; color: var(--ok-tx); }
.t2-bs { font: var(--t-meta); font-size: .78rem; color: var(--tx-2); }
.t2-streak .tr-weeks { gap: 6px; }
.t2-streak .tr-sq { height: 28px; max-width: 34px; }
.t2-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.t2-foot .tr-key { margin: 0; }
.t2-foot .tr-note { margin: 0; font-size: .8rem; color: var(--tx-2); }
@media (max-width: 699px) { .t2-boxes { grid-template-columns: 1fr; gap: 8px; } .t2-box { padding: 8px 10px; } }
/* targets: the icon tile and the button sit in the middle of the row, never against its top (A12) */
.t2-targets .t2-target { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 14px var(--cpx); }
.t2-target .words { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.t2-tline { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font: var(--t-meta); color: var(--tx-2); }
.t2-tn b { font: var(--t-num); font-size: 1.05rem; color: var(--tx); }
.t2-for { display: block; min-width: 0; line-height: 1.7; } /* one line of words that wraps like a sentence on a phone (20 Nov) */
.t2-for .t2-svg { display: inline-block; vertical-align: middle; margin: -3px 4px 0; }
.t2-for b { color: var(--tx); }
.t2-target .bar { max-width: 360px; }
.t2-target .end .pill { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; padding: 6px 12px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 6px -3px rgba(18, 26, 44, .3); }
.t2-target .end .pill .ico { width: 14px; height: 14px; }
.pill.gold { color: var(--gold-tx); background: #f8efdc; }
:root[data-theme="night"] .pill.gold { background: #2a2010; }
@media (max-width: 599px) { .t2-targets .t2-target { grid-template-columns: auto minmax(0, 1fr); } .t2-target .end { grid-column: 2; justify-self: start; } }
/* the cups */
.t2-svg { display: block; flex: none; overflow: visible; }
.t2-svg.won { filter: drop-shadow(0 4px 6px rgba(18, 26, 44, .18)); }
.t2-svg.locked .t2-cup { opacity: .42; filter: saturate(.55); }
.t2-svg.locked .t2-halo { opacity: .6; }
.t2-svg .tr-track { stroke: var(--line); }
/* the summary row (A17) */
.t2-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: 16px 20px; }
.t2-pct { display: flex; align-items: center; gap: 14px; }
.t2-ringbox { position: relative; display: grid; place-items: center; }
.t2-ringfill { stroke: var(--gold); }
.t2-pn { position: absolute; font: var(--t-num); font-size: 1.15rem; color: var(--tx); }
.t2-pct .words { display: flex; flex-direction: column; }
.t2-big { font: 700 1.6rem/1.1 var(--disp); color: var(--tx); }
.t2-grades { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.t2-grade-i { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border: 1px solid var(--line); border-radius: 99px; background: var(--well); }
.t2-grade-i .words { display: flex; flex-direction: column; line-height: 1.1; }
.t2-grade-i b { font: var(--t-num); font-size: 1.1rem; color: var(--tx); }
.t2-of { font: var(--t-meta); font-size: .78rem; color: var(--tx-3); font-weight: 600; }
.t2-gw { font: var(--t-label); font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tx-2); }
.t2-grade-i.none .t2-svg { opacity: .5; filter: saturate(.4); }
@media (max-width: 699px) { .t2-grades { margin-left: 0; } .t2-grade-i { padding: 6px 10px 6px 6px; } }
/* the shelf and the earned list side by side (A20, A21) */
.t2-two { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 12px; }
@media (max-width: 999px) { .t2-two { grid-template-columns: 1fr; } }
.t2-shelf { padding: 6px 16px; }
.t2-row { display: flex; align-items: center; gap: 10px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.t2-row:last-child { border-bottom: 0; }
.t2-rowname { flex: 0 0 190px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.t2-gname { font: var(--t-title); font-size: .95rem; }
.t2-rown { margin-left: auto; font: var(--t-meta); font-size: .76rem; color: var(--tx-2); white-space: nowrap; }
.t2-mini { display: flex; flex-wrap: wrap; gap: 6px; }
.t2-minicup { position: relative; }
.t2-minilock, .t2-lock { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 99px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line-strong); color: var(--tx-2); }
.t2-minilock .ico, .t2-lock .ico { width: 11px; height: 11px; }
@media (max-width: 599px) { .t2-row { flex-direction: column; align-items: flex-start; gap: 8px; } .t2-rowname { flex: none; width: 100%; } }
.t2-earned { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.t2-eh { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.t2-eh b { font: var(--t-title); }
.t2-elist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.t2-elist li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-well); background: var(--well); border: 1px solid var(--line); }
.t2-elist .words { display: flex; flex-direction: column; min-width: 0; }
/* still to earn: cards with a glimpse of each cup (A18) */
.t2-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.t2-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow); }
.t2-ic { position: relative; flex: none; }
.t2-card .words { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.t2-card .strong { font: var(--t-title); }
.t2-card .meta { font-size: .8rem; }
.t2-left { font: 700 .8rem/1.3 var(--body); color: var(--key); }
.t2-when { font: 700 .8rem/1.3 var(--body); color: var(--ok-tx); }
.t2-tag { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font: var(--t-label); font-size: .64rem; text-transform: uppercase; letter-spacing: .07em; color: var(--tx-2); }
.t2-tag .itile.xs { width: 18px; height: 18px; border-radius: 6px; }
.t2-tag .itile.xs .ico { width: 11px; height: 11px; }
.t2-grade { padding: 2px 7px; border-radius: 99px; font-size: .62rem; }
.t2-grade.g-bronze { background: #f8e6da; color: #7a3f1d; } .t2-grade.g-silver { background: #eceff4; color: #4f5a6a; }
.t2-grade.g-gold { background: #fbf1c8; color: #7d5300; } .t2-grade.g-platinum { background: #eceffc; color: #4d5694; }
.t2-grade.g-hafidh { background: #1b1d23; color: #f0c46e; }
:root[data-theme="night"] .t2-grade.g-bronze { background: #3a2316; color: #f0b083; } :root[data-theme="night"] .t2-grade.g-silver { background: #252b35; color: #d5dbe4; }
:root[data-theme="night"] .t2-grade.g-gold { background: #3a2f0c; color: #f7d45a; } :root[data-theme="night"] .t2-grade.g-platinum { background: #23264a; color: #c9cff5; }
:root[data-theme="night"] .t2-grade.g-hafidh { background: #000; color: #f0c46e; box-shadow: inset 0 0 0 1px #5a4a22; }
:root[data-theme="night"] .t2-svg .t2-halo { opacity: .14; }
.list.tr-targets.t2-targets > .t2-target { padding: 14px var(--cpx); align-items: center; min-height: 0; }
.tr-sec > .card.t2-sum { flex-direction: row; padding: 16px 20px; }
.tr-sec > .card.t2-streak { padding: 14px 16px; }
.tr-sec > .card.t2-shelf { padding: 6px 16px; } .tr-sec > .card.t2-earned { padding: 14px 16px; }
@media (max-width: 600px) { .t2-target .end .pill { display: inline-flex; } }
.t2-targets .t2-target > .end { align-self: center; flex-direction: row; align-items: center; margin: 0; }
.t2-targets .t2-target:has(> .end) > .itile { grid-row: 1 / span 4; align-self: center; }
.t2-targets .t2-target:has(> .end) > .end > :first-child { grid-row: 1 / span 4; align-self: center; margin-top: 0; }
.t2-targets a.t2-target:has(> .end)::after { grid-row: 1 / span 4; }
@media (max-width: 599px) { .t2-targets .t2-target:has(> .end) > .end > :first-child { grid-row: auto; grid-column: 2; justify-self: start; margin: 6px 0 0; } }
/* A23. The way a homework is handed in, on its row on Today ("Hand in a recording"). */
.hw-how { display: inline-flex; align-items: center; gap: 4px; }
.hw-how .ico { width: 13px; height: 13px; }

/* ===== 20 Nov 2026, Part B (docs/archive/FEEDBACK_20NOV_ROUND.md B31, B32): the Hifdh journal's head and table. =====
   B31: the month is the head; the days noted and the parts' tally sit beside it, smaller and quieter.
   B32: the table's column and row titles in the portal's own type, as the month is written: no small capitals. */
.hh-month > .strong { font-size: 1.15rem; min-height: 38px; padding: 0 14px; }
.hh-month > .pill, .hh-t { min-height: 26px; padding: 0 9px; border-radius: 8px; font: 600 .76rem/1 var(--body); }
.hh-t b { font-size: .8rem; }
.hh-tally { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.hh-x thead th { font: 700 .86rem/1.25 var(--body); text-transform: none; letter-spacing: 0; color: var(--tx); }
.hh-x thead th.hh-g { color: color-mix(in srgb, var(--c) 70%, var(--tx)); }
.hh-x thead tr.hh-subrow th { font: 600 .78rem/1.25 var(--body); text-transform: none; letter-spacing: 0; color: var(--tx-2); }
.hh-x .hh-sub { font-size: .74rem; }

/* 8b (20 Nov): the admin's Recording links (public/reclinks.js). Each lesson is a row; its form opens in place under it. */
.list.rl-list > .rl-row { padding: 0; }
.rl-row > .item { padding: 14px 18px; border: 0; box-shadow: none; background: transparent; border-radius: 0; }
.rl-row > .item .end { display: flex; flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.rl-row > .rl-slot:not(:empty) { margin: 0 18px 16px; padding: var(--cpad); border: 1px solid var(--line); border-radius: var(--r-well); background: var(--well); }
.rl-row > [role="status"]:not(:empty) { padding: 0 18px 14px; }
.rl-slot .note-box { margin: 0; }
@media (max-width: 599px) {
  .rl-row > .item { display: grid; grid-template-columns: auto 1fr; align-items: start; }
  .rl-row > .item .end { grid-column: 2; justify-content: flex-start; }
}
.rl-row > .rl-slot:has(> .note-box) { padding: 0; border: 0; background: none; }

/* Umar, 20 Nov evening. D1: "1 block = 1 Juz" its own grey line under the goal box's key. D3: each notification's Clear
   has its word, not an x alone. D4: the school's name the same at every width (Hāfidh upright and blue, not italic). */
.gb-per { margin: 6px 0 0; font: var(--t-meta); font-size: .78rem; color: var(--tx-3); }
.bp-x { width: auto; height: 32px; padding: 0 10px 0 8px; gap: 4px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 99px; font: 700 .76rem/1 var(--body); color: var(--tx-2); }
.bp-x .ico { width: 13px; height: 13px; }
@media (max-width: 599px) { .bp-x { width: auto; height: 36px; margin-right: 4px; } }
.logo-w { font-weight: 600; background: linear-gradient(100deg, #0f1b33 0%, #24447e 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-w em { font-style: normal; background: linear-gradient(95deg, var(--key) 10%, var(--key-2) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .04em; }
:root[data-theme="night"] .logo-w { background-image: linear-gradient(100deg, #ffffff 0%, #c9d8f2 100%); }
:root[data-theme="night"] .logo-w em { background-image: linear-gradient(95deg, var(--key) 10%, var(--key-2) 90%); }

/* D2 (Umar, 20 Nov evening): "Before your lesson" is ONE white card; each part a block with its own coloured tile, name
   and count, divided by a hairline. No rail. The same blocks in the teacher's "Before this lesson" card (prep.js). */
.card.bcard, .bcard { padding: 0; gap: 0; display: flex; flex-direction: column; overflow: hidden; }
.bpart { display: flex; flex-direction: column; gap: 10px; padding: var(--cpad); }
.bpart + .bpart { border-top: 1px solid var(--line); }
.bk-h { display: flex; align-items: center; gap: 10px; margin: 0; font: var(--t-title); color: var(--tx); }
.bk-h .itile.xs { width: 26px; height: 26px; min-width: 26px; border-radius: 8px; }
.bk-h .itile.xs .ico { width: 14px; height: 14px; }
.bpart > .list { box-shadow: none; border-radius: var(--r-well); }
.bpart > .prep-q, .bpart > .prep-log { margin: 0; }
.bpart > a.small { align-self: flex-start; }
.panel.prep .bcard { border: 0; }
.t-b2 > .sh-sub, .sh-sub { margin: -2px 0 2px; font: var(--t-meta); color: var(--tx-2); }

/* D6 (Umar, 20 Nov evening): Book a lesson. Steps 1 2 3 in numbered circles; each day a calendar leaf (weekday, a big
   date, the month, how many times); each time a card (clock, the time large, when it ends, its length). Picked = solid. */
.bk-pick { gap: 12px; }
.bk-step { display: flex; align-items: center; gap: 8px; margin: 0; font: 700 .9rem/1.3 var(--body); color: var(--tx); }
.bk-sn { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--info-bg); color: var(--key); font: 800 .74rem/1 var(--body); }
.bk-days { gap: 10px; padding: 4px 4px 16px; margin: -4px -4px -8px; }
.bk-days button { min-width: 78px; min-height: 0; padding: 10px 10px 9px; gap: 1px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.bk-days button:hover { transform: translateY(-2px); border-color: var(--key); }
.bk-days .bk-wd { font: 700 .68rem/1.2 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--tx-3); }
.bk-days .bk-dn { font: 800 1.5rem/1.1 var(--body); color: var(--tx); font-variant-numeric: lining-nums; }
.bk-days .bk-mo { font: 600 .78rem/1.2 var(--body); color: var(--tx-2); }
.bk-days .bk-n { margin-top: 5px; padding: 2px 8px; border-radius: 99px; background: var(--ok-bg, var(--well)); color: var(--ok-tx, var(--tx-2)); font: 700 .66rem/1.4 var(--body); white-space: nowrap; }
.bk-days button[aria-pressed="true"] { background: var(--btn); border-color: var(--btn); box-shadow: 0 6px 16px color-mix(in srgb, var(--btn) 30%, transparent); }
.bk-days button[aria-pressed="true"] .bk-wd, .bk-days button[aria-pressed="true"] .bk-mo { color: color-mix(in srgb, var(--on-btn) 75%, transparent); }
.bk-days button[aria-pressed="true"] .bk-dn { color: var(--on-btn); }
.bk-days button[aria-pressed="true"] .bk-n { background: color-mix(in srgb, var(--on-btn) 18%, transparent); color: var(--on-btn); }
.bk-times { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bk-slot { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "ic t" "ic to" "ic len"; justify-items: start; align-items: center; column-gap: 12px; row-gap: 1px;
  min-height: 0; padding: 12px 14px; text-align: left; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.bk-slot:hover { transform: translateY(-2px); }
.bk-slot > .ico { grid-area: ic; width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--info-bg); color: var(--key); box-sizing: border-box; }
.bk-slot .bk-t { grid-area: t; font: 800 1.2rem/1.15 var(--body); color: var(--tx); font-variant-numeric: lining-nums; }
.bk-slot .bk-to { grid-area: to; font: 500 .78rem/1.3 var(--body); color: var(--tx-2); }
.bk-slot .bk-len { grid-area: len; margin-top: 3px; padding: 1px 8px; border-radius: 99px; background: var(--well); border: 1px solid var(--line); font: 700 .66rem/1.5 var(--body); color: var(--tx-2); }
.bk-slot[aria-pressed="true"] { background: var(--btn); border-color: var(--btn); box-shadow: 0 6px 16px color-mix(in srgb, var(--btn) 30%, transparent); }
.bk-slot[aria-pressed="true"] .bk-t { color: var(--on-btn); }
.bk-slot[aria-pressed="true"] .bk-to { color: color-mix(in srgb, var(--on-btn) 75%, transparent); }
.bk-slot[aria-pressed="true"] > .ico { background: color-mix(in srgb, var(--on-btn) 16%, transparent); color: var(--on-btn); }
.bk-slot[aria-pressed="true"] .bk-len { background: transparent; border-color: color-mix(in srgb, var(--on-btn) 35%, transparent); color: var(--on-btn); }
.bk-confirm { padding: var(--cpad); border-color: color-mix(in srgb, var(--key) 30%, var(--line)); background: color-mix(in srgb, var(--info-bg) 55%, var(--card)); }
.bk-confirm .bk-what { font-size: 1.05rem; }
@media (prefers-reduced-motion: reduce) { .bk-days button, .bk-slot { transition: none; } .bk-days button:hover, .bk-slot:hover { transform: none; } }
@media (max-width: 599px) { .bk-times { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bk-days button { min-width: 70px; } }

/* D8 to D10 (Umar, 20 Nov evening), My Qur'an, both sides (the teacher's marking page is the same code).
   D8: on a phone the zoom steps show on their own centred line, named "Zoom". D9: the key under the page is centred at
   every width. D10: the kinds on the page are pills with the key's dot, beside the count, not loose words. */
.mstrip .mk-zoom .zq.zq-l { display: none !important; }
@media (max-width: 599px) {
  .mstrip .mnav-g:nth-child(3), .mstrip .mk-zoom { display: contents; }
  .mstrip .mnav-g:first-child { order: 0; } .mstrip .mnav-g:nth-child(2) { order: 1; }
  .mstrip .mk-zoom > .btn:not(.zq) { order: 2; margin-left: 4px; padding: 0 8px; font-size: .76rem; }
  .mk-viewer > .mnav.mstrip::after { content: ""; order: 3; flex: 1 1 100%; height: 0; }
  .mstrip .mk-zoom .zq { display: inline-flex !important; align-items: center; order: 4; }
  .mstrip .mk-zoom .zq.zq-l { display: inline-flex !important; gap: 5px; margin-left: auto; padding-right: 4px; font: 700 .76rem/1 var(--body); color: var(--tx-2); }
  .mstrip .mk-zoom > .zq + .zq + .zq + .btn.zq { margin-right: auto; }
  .mstrip .mk-zoom .zq .small { margin-left: 3px; }
  .mstrip .mk-zoom > .btn.zq { min-width: 40px; justify-content: center; font-size: 1rem; }
  .mstrip .mk-zoom .zq .mk-zoomin { flex: none; width: 58px; max-width: 58px; }
}
.mk-viewer .mk-filter, .mk-filter { justify-content: center; }
.mk-onkinds { display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 0 0 0 4px; }
.mk-onkinds:empty { display: none; }
.mk-kp { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); font: 700 .74rem/1.3 var(--body); color: var(--tx-2); text-transform: none; letter-spacing: 0; white-space: nowrap; }
.mk-kp .mk-dot { width: 8px; height: 8px; }

/* D16 (Umar, 20 Nov evening): the Hifdh journal's today, both sides (the teacher opens the same table). The date cell is
   solid navy with TODAY over the date; the row keeps its part colours and is framed in navy, not tinted blue. */
.hh-x tr.is-today > th, .hh-x tr.is-today > td { background: var(--card); }
.hh-x tr.is-today td.hh-a.has, .hh-x tr.is-today td.hh-m.has { background: color-mix(in srgb, var(--c) 12%, var(--card)); }
.hh-x tr.is-today > th.hh-d { background: var(--btn); color: var(--on-btn); box-shadow: none; }
.hh-x tr.is-today > th.hh-d b, .hh-x tr.is-today > th.hh-d .hh-mo { color: var(--on-btn); }
.hh-x tr.is-today .hh-today { display: block; margin: 0 0 3px; padding: 0; border: 0; background: none; font: 800 .62rem/1.2 var(--body); letter-spacing: .1em; text-transform: uppercase; color: color-mix(in srgb, var(--on-btn) 72%, transparent); }
.hh-x tr.is-today > td { box-shadow: inset 0 2px 0 var(--btn), inset 0 -2px 0 var(--btn); }
.hh-x tr.is-today > td:last-child { box-shadow: inset 0 2px 0 var(--btn), inset 0 -2px 0 var(--btn), inset -2px 0 0 var(--btn); }
.hh-x tr.is-today > td.hh-a.has { box-shadow: inset 3px 0 0 var(--c), inset 0 2px 0 var(--btn), inset 0 -2px 0 var(--btn); }

/* ===== P1, the finishing look (20 Nov, docs/archive/BUILD_FINISH_LOOK.md): the banner's and the memory map's care, once, on every
   page and both sides. One rule set, nothing per page: (a) every box a soft gradient with a light top edge and a far soft
   shadow; (b) what opens a page lifts a little under a mouse (never on a touch screen); (c) the page's first boxes rise in
   one after another; (d) none of the movement when the device asks for less. ===== */
:root {
  --card-bg: linear-gradient(180deg, #ffffff 0%, #ffffff 38%, #faf8f3 100%);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 1px 2px rgba(18, 26, 44, .05), 0 4px 10px -6px rgba(18, 26, 44, .10), 0 16px 32px -20px rgba(18, 26, 44, .20);
  --shadow-up: inset 0 1px 0 rgba(255, 255, 255, 1), 0 2px 4px rgba(18, 26, 44, .06), 0 10px 20px -10px rgba(18, 26, 44, .16), 0 26px 48px -22px rgba(18, 26, 44, .32);
}
:root[data-theme="night"] {
  --card-bg: linear-gradient(180deg, #14213a 0%, #111c31 40%, #0e1728 100%);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 2px rgba(0, 0, 0, .35), 0 14px 30px -18px rgba(0, 0, 0, .75);
  --shadow-up: inset 0 1px 0 rgba(255, 255, 255, .08), 0 2px 4px rgba(0, 0, 0, .4), 0 24px 46px -20px rgba(0, 0, 0, .85);
}
/* (a) A box heading's icon tile and a count tile's number sit on the same light: the count tiles get the memory map's soft
   corner glow in their own tone (already on .stat) and a crisp edge. */
.stat { border-color: color-mix(in srgb, var(--line) 80%, var(--tone-bg)); }
/* (b) Lift: whole boxes that open a page rise 2px with the deeper shadow; rows inside a list stay put (a row that jumped
   out of its list looked loose) and their icon tile and arrow move instead. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  a.card, a.stat, a.classcard, a.panel, .cv2 > li > a, a.mm-n { transition: transform .18s ease, box-shadow .2s ease, border-color .15s; }
  a.card:hover, a.stat:hover, a.classcard:hover, a.panel:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); border-color: var(--line-strong); }
  a.item .itile, a.item .avatar, .act .act-i, .gitem .itile, a.gitem .avatar { transition: transform .18s ease, box-shadow .2s ease; }
  a.item:hover .itile, a.item:hover .avatar, .act:hover .act-i, a.gitem:hover .itile, a.gitem:hover .avatar { transform: translateY(-2px); }
  .act .act-go, a.gitem > .ico { transition: transform .18s ease; }
  .act:hover .act-go, a.gitem:hover > .ico { transform: translateX(3px); }
}
/* (c) Rise-in, one after another: the page's own boxes (the head, then each section), 40ms apart, the sixth and later
   together, all within a third of a second. A page redrawn in place (.still, after a save) does not rise again. */
@media (prefers-reduced-motion: no-preference) {
  .page > * > * { animation: rise .32s ease-out backwards; }
  .page > * > :nth-child(2) { animation-delay: 40ms; }
  .page > * > :nth-child(3) { animation-delay: 80ms; }
  .page > * > :nth-child(4) { animation-delay: 120ms; }
  .page > * > :nth-child(5) { animation-delay: 160ms; }
  .page > * > :nth-child(n+6) { animation-delay: 200ms; }
  .page.still > *, .page.still > * > * { animation: none; }
}
/* (d) Reduced motion: nothing moves, nothing waits. */
@media (prefers-reduced-motion: reduce) {
  .page > *, .page > * > * { animation: none !important; }
  a.card, a.stat, a.classcard, a.panel, .act-i, .act-go, .itile, .avatar { transition: none !important; transform: none !important; }
}

/* ===== Umar, 21 Nov (docs/archive/FEEDBACK_21NOV_ROUND.md). ===== */
/* J1. The Hifdh journal on a phone: like the calendar's grid, the month's table scrolls inside its own box and its head
   (Date, Sabaq, Sabaq Para / Sabaqi, Dhor / Manzil, and the Lines / Mistakes row) stays pinned at the top. The date
   column stays pinned at the left as before; the corner cell sits over both. */
@media (max-width: 700px) {
  .hh-scroll { max-height: calc(100dvh - 170px); overflow: auto; overscroll-behavior: contain; }
  .hh-x thead { position: sticky; top: 0; z-index: 3; box-shadow: 0 4px 10px -8px rgba(18, 26, 44, .3); }
  .hh-x thead th.hh-d { z-index: 4; }
}
/* E3. Resources: the chosen kind was a flat near-black; it takes the buttons' navy gradient, the same paint as today's
   circle in the calendar and every main button. */
.res-chip[aria-pressed="true"] { background: var(--btn-bg), var(--btn); color: var(--on-btn); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 14px -8px rgba(20, 39, 74, .55); }
/* H1. The recorder everywhere (a hand-in, the teacher's spoken feedback, a voice note, a spot test): the red button is no
   bigger than the portal's other icon tiles, the strip is one slim row, the words at body size. */
.rec { padding: 9px 12px; gap: 8px; }
.rec .row { gap: 10px; align-items: center; }
.rec-btn { width: 40px; height: 40px; }
.rec-btn .ico { width: 18px; height: 18px; }
.rec .status { font-weight: 600; font-size: .88rem; line-height: 1.4; margin: 0; }
.hin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.hin-file > summary { list-style: none; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; color: var(--key); font-weight: 700; font-size: .88rem; }
.hin-file > summary::-webkit-details-marker { display: none; }
.hin-file > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.hin-file[open] { flex-basis: 100%; }
.hin-file[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
/* B2. The rule about changing a lesson, said once above the booked lessons: a clock, two short lines, one grey line. */
.bk-rules { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; margin: 0 0 10px; border-radius: var(--r-well); background: var(--info-bg, var(--tint)); border: 1px solid var(--line); font-size: .9rem; line-height: 1.5; }
.bk-rules > .ico { flex: none; width: 20px; height: 20px; color: var(--key); margin-top: 2px; }
.bk-rules p { margin: 0; }
/* P1 (Umar, 21 Nov, version C): Before your lesson is the teacher's words as one line, then small tiles, each opening
   its page. The same on the teacher's lesson page ("Before this lesson"). */
.before { display: flex; flex-direction: column; gap: 12px; }
.bt-line { display: block; background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--r-well); padding: 10px 16px; font-size: .9rem; line-height: 1.5; color: var(--tx-2); text-decoration: none; }
.bt-line b { color: var(--tx); }
.prep .bt-line { background: var(--well); }
.btiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.btile { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--r-well); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; color: var(--tx); text-decoration: none; min-width: 0; }
.btile .bt-n { font-weight: 800; font-size: 1.35rem; line-height: 1.2; color: var(--key); }
.btile .bt-t { font-weight: 700; font-size: .98rem; }
.btile .bt-s { font-size: .84rem; color: var(--tx-2); overflow-wrap: anywhere; }
.btile .bt-go { margin-top: auto; padding-top: 4px; font-weight: 700; font-size: .86rem; color: var(--key); }
.bwrap { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 700px) {
  .btiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .btiles:has(> :nth-child(2):last-child) { grid-template-columns: 1fr 1fr; }
  .btiles:has(> :only-child) { grid-template-columns: 1fr; }
  .btile { padding: 10px; }
  .btile .bt-n { font-size: 1.1rem; }
  .btile .bt-s { font-size: .78rem; }
}
/* P5 (Umar, 21 Nov): To do in the Marked layout, what to do on the left, the hand-in on the right. */
@container (min-width: 560px) { .mc-parts.hw-parts.hw-todo { grid-template-columns: 1fr 1fr; } }
.hw-todo .hin { gap: 8px; }
/* P8 (Umar, 21 Nov, All lessons B): past lessons as short rows in the same list as the ones coming up. On a computer
   Attended, Read the report and Watch the recording sit on one line at the right; on a phone a past row copies an
   upcoming row: Attended and a short Watch at the top right, "50 min · Read the report ›" under the chip. */
.lrow .len { font-size: .82rem; color: var(--tx-2); white-space: nowrap; }
.lrow .rd, .rpt-h .rd { font-weight: 700; font-size: .86rem; color: var(--key); white-space: nowrap; text-decoration: none; position: relative; z-index: 1; }
.lrow .rd-ph { display: none; }
.btn.watch { position: relative; z-index: 1; white-space: nowrap; display: inline-flex; flex-direction: row; align-items: center; gap: 6px; }
.btn.watch .w-long { margin-left: -6px; }
.rpt-h > .end-row { margin-left: auto; }
@media (max-width: 700px) {
  .lrow .rd-desk { display: none; }
  .lrow .rd-ph { display: inline; }
  .btn.watch .w-long { display: none; }
}
.prep .btiles { grid-template-columns: 1fr 1fr; gap: 8px; }
.prep .btile { padding: 10px 12px; box-shadow: none; }
/* P4 (Umar, 21 Nov): My Qur'an's controls, version E, on a phone and a computer. Each control has its small name above it
   (Page · of 848, Surah, Juz, Zoom, View). The page arrows and the zoom steps are each one joined box; the % stays.
   A computer: one line of five. A phone: Page, Surah, Juz on the first line; Zoom and View on the second. */
.mstrip .mlab { display: none; }
.mk-viewer > .mnav.mstrip.mstrip-e { display: grid !important; grid-auto-flow: column; grid-template-rows: auto auto; justify-content: center; align-items: end; gap: 4px 12px; padding: 10px 14px; flex-wrap: nowrap; overflow: visible; }
.mk-viewer > .mnav.mstrip.mstrip-e::after { content: none !important; }
.mstrip-e .mnav-g, .mstrip-e .mk-zoom, .mstrip-e .mk-zoom .zq.zq-l { display: contents !important; }
.mstrip-e .mk-zoom .zq.zq-l { display: none !important; }
.mstrip-e .mlab { display: block; grid-row: 1; font: 800 .62rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); white-space: nowrap; padding: 0 2px 2px; }
.mstrip-e .mseg, .mstrip-e .ms-s, .mstrip-e .ms-j, .mstrip-e .ms-v { grid-row: 2; }
.mstrip-e .ml-p, .mstrip-e .mseg-p { grid-column: 1; } .mstrip-e .ml-s, .mstrip-e .ms-s { grid-column: 2; } .mstrip-e .ml-j, .mstrip-e .ms-j { grid-column: 3; }
.mstrip-e .ml-z, .mstrip-e .zseg { grid-column: 4; } .mstrip-e .ml-v, .mstrip-e .ms-v { grid-column: 5; }
.mstrip-e.is-book .ml-z, .mstrip-e.is-book .zseg { grid-column: 2; } .mstrip-e.is-book .ml-v, .mstrip-e.is-book .ms-v { grid-column: 3; }
.mstrip-e .mseg { display: inline-flex !important; align-items: stretch; height: 34px; box-sizing: border-box; border: 1px solid var(--line-field); border-radius: 10px; background: var(--card); overflow: hidden; order: 0 !important; margin: 0 !important; }
.mstrip-e .mseg > .btn, .mstrip-e .mseg .btn.zq { display: inline-flex !important; align-items: center; justify-content: center; height: 100% !important; min-height: 0 !important; min-width: 34px; padding: 0 10px !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: none; margin: 0 !important; order: 0 !important; font-size: .95rem !important; }
.mstrip-e .mseg > .mnav-num, .mstrip-e .mseg > .zq.row { display: inline-flex !important; align-items: center; gap: 2px; padding: 0 6px !important; border-left: 1px solid var(--line); border-right: 1px solid var(--line); margin: 0 !important; order: 0 !important; }
.mstrip-e .mseg input, .mstrip-e .mseg .mk-zoomin { height: 100% !important; min-height: 0 !important; border: 0 !important; border-radius: 0 !important; background: none; box-shadow: none; width: 3.2em !important; max-width: none !important; padding: 0 2px !important; text-align: center; }
.mstrip-e .mseg-p .mnav-num .small { display: none; }
.mstrip-e .zseg .zq .small { margin: 0 !important; font-weight: 700; color: var(--tx); }
.mstrip-e .ms-s, .mstrip-e .ms-j { max-width: none !important; width: auto; }
.mstrip-e .ms-v { order: 0 !important; margin: 0 !important; padding: 0 14px !important; font-size: .82rem !important; }
@media (max-width: 599px) {
  .mk-viewer > .mnav.mstrip.mstrip-e { grid-auto-flow: row; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto auto auto auto; justify-content: stretch; gap: 3px 8px; padding: 10px; }
  .mstrip-e .ml-p, .mstrip-e .mseg-p { grid-column: 1 / 5; } .mstrip-e .ml-s, .mstrip-e .ms-s { grid-column: 5 / 10; } .mstrip-e .ml-j, .mstrip-e .ms-j { grid-column: 10 / 13; }
  .mstrip-e .ml-z, .mstrip-e .zseg { grid-column: 1 / 7; } .mstrip-e .ml-v, .mstrip-e .ms-v { grid-column: 7 / 13; }
  .mstrip-e .ml-z, .mstrip-e .ml-v { grid-row: 3; padding-top: 10px; } .mstrip-e .zseg, .mstrip-e .ms-v { grid-row: 4; }
  .mstrip-e.is-book .ml-p, .mstrip-e.is-book .mseg-p { grid-column: 1 / 13; }
  .mstrip-e .mseg, .mstrip-e .ms-s, .mstrip-e .ms-j, .mstrip-e .ms-v { width: 100% !important; min-width: 0; }
  .mstrip-e .mseg { justify-content: space-between; }
  .mstrip-e .mseg > .mnav-num, .mstrip-e .mseg > .zq.row { flex: 1; justify-content: center; }
  .mstrip-e .ms-v { justify-content: center; }
}
.mstrip-e .zseg .mk-zoomin { width: 2.4em !important; text-align: right; -moz-appearance: textfield; }
.mstrip-e .zseg .mk-zoomin::-webkit-inner-spin-button, .mstrip-e .zseg .mk-zoomin::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.mstrip-e .ms-v { height: 34px !important; min-height: 34px !important; box-sizing: border-box; }
/* Umar, 22 Nov (TD1): "Your teacher asked" opens the report; it now looks like it (the words, then "Read the report ›"
   in the link colour; a hover like the tiles). The teacher's "You asked" on the lesson page is the same element. */
.bt-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; transition: border-color .15s, background .15s; }
.bt-line .bt-lw { flex: 1 1 280px; min-width: 0; }
.bt-line .bt-lgo { flex: none; margin-left: auto; font-weight: 700; font-size: .86rem; color: var(--key); white-space: nowrap; }
.bt-line:hover { border-color: var(--btn-line); }
.bt-line:hover .bt-lgo { text-decoration: underline; }
/* Umar, 22 Nov (P4, strip version 4): the controls at the left with a line between each, the Mushaf choice at the far
   right (both sides: "Mushaf you hold" for the family, the teacher's switch on the marking page). On a phone the choice
   is its own row under the others, and no lines. */
.mk-viewer > .mnav.mstrip.mstrip-e:has(.ml-m) { grid-template-columns: repeat(5, auto) 1fr auto; justify-content: stretch; }
.mstrip-e { --sg: 28px; }
@media (min-width: 600px) { .mk-viewer > .mnav.mstrip.mstrip-e { column-gap: var(--sg); } }
.mstrip-e .mlab { position: relative; }
.mstrip-e .ml-s::before, .mstrip-e .ml-j::before, .mstrip-e .ml-z::before, .mstrip-e .ml-v::before { content: ""; position: absolute; left: calc(var(--sg, 28px) / -2); top: -2px; height: 58px; border-left: 1px solid var(--line-strong); }
.mstrip-e.is-book .ml-z::before { content: none; }
.mstrip-e .ml-m, .mstrip-e .mz { grid-column: 7; }
.mstrip-e .ml-m { grid-row: 1; } .mstrip-e .mz { grid-row: 2; }
.mstrip-e .seg.mz { display: inline-flex; align-items: stretch; height: 34px; box-sizing: border-box; padding: 0; gap: 0; border: 1px solid var(--line-field); border-radius: 10px; background: var(--card); overflow: hidden; }
.mstrip-e .seg.mz button { min-height: 0; height: 100%; padding: 0 14px; border: 0; border-radius: 0; box-shadow: none; background: none; font-weight: 700; font-size: .86rem; color: var(--key); white-space: nowrap; }
.mstrip-e .seg.mz button + button { border-left: 1px solid var(--line); }
.mstrip-e .seg.mz button[aria-pressed="true"] { background: var(--btn-bg), var(--btn); color: #fff; }
.mstrip-e .seg.mz button:disabled { opacity: .5; }
.mz-why { margin: 4px 0 0; text-align: center; color: var(--tx-2); }
.mk-top:has(> :only-child) { grid-template-columns: 1fr; }
@media (max-width: 599px) {
  .mstrip-e .mlab::before { content: none !important; }
  .mk-viewer > .mnav.mstrip.mstrip-e:has(.ml-m) { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto auto auto auto auto auto; }
  .mstrip-e .ml-m, .mstrip-e .mz { grid-column: 1 / 13; }
  .mstrip-e .ml-m { grid-row: 5; padding-top: 10px; } .mstrip-e .mz { grid-row: 6; width: 100%; }
  .mstrip-e .seg.mz button { flex: 1; }
}
/* Umar, 22 Nov (TD2, version A): the three tiles as steps, a navy number in the corner; the count in the title. */
.btile.bt-stepped { position: relative; padding-top: 44px; }
.btile .bt-step { position: absolute; top: 12px; left: 14px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 800 .78rem/1 var(--body); color: #fff; background: var(--btn-bg), var(--btn); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.prep .btile.bt-stepped { padding-top: 40px; } .prep .btile .bt-step { top: 10px; left: 12px; }
@media (max-width: 599px) { .btile.bt-stepped { padding-top: 40px; } .btile .bt-step { top: 10px; left: 10px; } }
/* Umar, 22 Nov (TR1, version B): the streak's weeks as round coins, painted like the icon in the box above; the key the same. */
.t2-streak .tr-weeks .tr-sq { height: auto !important; width: 32px; max-width: 32px; aspect-ratio: 1; border-radius: 50%; }
.t2-streak .tr-key .tr-sq { width: 16px; max-width: 16px; height: 16px !important; border-radius: 50%; }
.t2-streak .tr-wk.m-before .tr-sq { border: 1.5px dashed var(--line-strong); background: transparent; opacity: .8; }
.t2-streak .tr-wk.m-done .tr-sq { border: 0; }
/* Umar, 22 Nov: on a narrower computer (about 1300 wide and less) the one-line strip ran out of room (the zoom + and
   "Madani / Saudi" cut off). When the viewer is narrower than the strip needs, it takes two lines: Page, Surah, Juz;
   then Zoom, View and the Mushaf choice at the right. The phone keeps its own layout (under 600). */
.mk-viewer { container: mkv / inline-size; }
@media (min-width: 600px) {
  @container mkv (max-width: 700px) {
    .mk-viewer > .mnav.mstrip.mstrip-e, .mk-viewer > .mnav.mstrip.mstrip-e:has(.ml-m) { grid-auto-flow: row; grid-template-columns: auto auto auto 1fr auto; grid-template-rows: auto auto auto auto; justify-content: stretch; }
    .mstrip-e .ml-p, .mstrip-e .mseg-p { grid-column: 1; } .mstrip-e .ml-s, .mstrip-e .ms-s { grid-column: 2; } .mstrip-e .ml-j, .mstrip-e .ms-j { grid-column: 3; }
    .mstrip-e .ml-z, .mstrip-e .zseg { grid-column: 1; } .mstrip-e .ml-v, .mstrip-e .ms-v { grid-column: 2; }
    .mstrip-e .ml-m, .mstrip-e .mz { grid-column: 3 / 6; justify-self: end; }
    .mstrip-e .ml-z, .mstrip-e .ml-v, .mstrip-e .ml-m { grid-row: 3; padding-top: 12px; }
    .mstrip-e .zseg, .mstrip-e .ms-v, .mstrip-e .mz { grid-row: 4; }
    .mstrip-e .ml-z::before { content: none; }
    .mstrip-e .ml-v::before { top: 10px; }
    .mstrip-e.is-book .ml-z, .mstrip-e.is-book .zseg { grid-column: 2; } .mstrip-e.is-book .ml-v, .mstrip-e.is-book .ms-v { grid-column: 3; }
    .mstrip-e.is-book .ml-z, .mstrip-e.is-book .ml-v { grid-row: 1; padding-top: 0; } .mstrip-e.is-book .zseg, .mstrip-e.is-book .ms-v { grid-row: 2; }
  }
  /* Narrower still (a small laptop with the side menu open): the Mushaf choice takes its own line under the others. */
  @container mkv (max-width: 560px) {
    .mk-viewer > .mnav.mstrip.mstrip-e:has(.ml-m) { grid-template-rows: auto auto auto auto auto auto; }
    .mstrip-e .ml-m, .mstrip-e .mz { grid-column: 1 / -1; justify-self: start; }
    .mstrip-e .ml-m { grid-row: 5; } .mstrip-e .mz { grid-row: 6; }
  }
}
/* Umar, 22 Nov (MM2, version B): the Juz numbers on the memory map are plain bold grey, no pill. Green for Memorised stays.
   Only the Juz rows of the memory map (the book coverage map keeps its own row numbers). */
.mm-n.mm-nj { background: transparent; box-shadow: none; border: 0; color: var(--tx-2); font-weight: 800; border-radius: 0; }
/* Umar, 22 Nov (K8, his combined pick): the top row of version E (a big ring, five grade tiles of one size), the group rows of
   version B (the count in a box at the right), Earned so far as version C's numbered line. Both sides: the teacher's page is the same code. */
.tr-sec > .card.t2-sum { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 20px 32px; padding: 22px 26px; }
.t2-sum .t2-pct { gap: 22px; }
.t2-sum .t2-ringbox svg { width: 150px; height: 150px; }
.t2-sum .t2-pn { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.15; }
.t2-sum .t2-pn1 { font-size: 1.55rem; }
.t2-sum .t2-pn2 { font: 700 .86rem/1.2 var(--body); color: var(--tx-2); }
.t2-sum .t2-grades { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; width: 100%; margin: 0; }
.t2-sum .t2-grade-i { flex-direction: column; justify-content: center; text-align: center; padding: 14px 6px; border-radius: 16px; gap: 6px; }
.t2-sum .t2-grade-i .words { align-items: center; }
.t2-sum .t2-grade-i b { font-size: 1.5rem; }
.t2-shelf .t2-row { display: grid; grid-template-columns: 11em minmax(0, 1fr) 8em; align-items: center; gap: 12px; }
.t2-shelf .t2-rowname { flex: none; width: auto; }
.t2-shelf .t2-gname { white-space: nowrap; }
.t2-count { justify-self: end; width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--card); font: 700 .8rem/1.2 var(--body); color: var(--tx-2); white-space: nowrap; }
.t2-elist { counter-reset: e; position: relative; gap: 6px; }
.t2-elist::before { content: ''; position: absolute; left: 21px; top: 16px; bottom: 16px; width: 2px; background: var(--line-strong); }
.t2-elist li { counter-increment: e; position: relative; padding: 8px 8px 8px 44px; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.t2-elist li::before { content: counter(e); position: absolute; left: 10px; top: 50%; transform: translateY(-50%); z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 800 .78rem/1 var(--body); color: #fff; background: linear-gradient(145deg, #d49a5c, #a8642c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
@media (max-width: 699px) {
  .tr-sec > .card.t2-sum { grid-template-columns: 1fr; justify-items: center; gap: 16px; padding: 18px 14px; }
  .t2-sum .t2-ringbox svg { width: 120px; height: 120px; }
  .t2-sum .t2-pn1 { font-size: 1.25rem; }
  .t2-sum .t2-grades { gap: 6px; }
  .t2-sum .t2-grade-i { padding: 10px 2px; }
  .t2-sum .t2-grade-i svg { width: 40px; height: 40px; }
  .t2-sum .t2-grade-i b { font-size: 1.15rem; }
  .t2-sum .t2-gw { font-size: .58rem; }
}
@media (max-width: 599px) {
  .t2-shelf .t2-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; }
  .t2-shelf .t2-rowname { grid-column: 1; grid-row: 1; width: auto; }
  .t2-shelf .t2-count { grid-column: 2; grid-row: 1; width: auto; }
  .t2-shelf .t2-mini { grid-column: 1 / -1; grid-row: 2; }
}
.mm-scroll.fixed .mm-n.mm-nj { background: var(--well); } /* zoomed or page numbers on: the squares slide under the sticky number */
/* Umar, 22 Nov (strip, again): version 4 is ONE strip. As the viewer gets narrower the gaps between the controls tighten, the strip
   stays on one line, and only a really narrow viewer (under about 800) takes two lines. Same look at every width. */
@media (min-width: 600px) {
  @container mkv (max-width: 1010px) {
    .mstrip-e { --sg: 24px; }
    /* Umar, 23 Nov: roomy gaps kept after every divider on a narrower computer by shortening the boxes, the Surah box long enough for the whole name. */
    .mstrip-e .ms-s { max-width: 11.6em !important; }
    .mstrip-e .mseg-p input { width: 2.4em !important; }
    .mstrip-e .mseg > .btn { padding: 0 8px !important; min-width: 30px !important; }
    .mstrip-e .zseg .mk-zoomin { width: 1.9em !important; }
    .mstrip-e .zseg, .mstrip-e .mseg-p, .mstrip-e .seg.mz { min-width: max-content; } /* never squeezed: the % and the two Mushaf names always show */
    .mk-viewer > .mnav.mstrip.mstrip-e { padding-left: 12px; padding-right: 12px; }
  }
  @container mkv (max-width: 930px) {
    .mstrip-e { --sg: 20px; }
    .mstrip-e .ml-m { width: 0; min-width: 100%; overflow: hidden; text-overflow: ellipsis; }
    .mstrip-e .seg.mz button { padding: 0 10px; }
    .mstrip-e .ms-v { padding: 0 10px !important; }
  }
  @container mkv (max-width: 860px) {
    .mstrip-e { --sg: 14px; }
    .mk-viewer > .mnav.mstrip.mstrip-e { padding-left: 8px; padding-right: 8px; }
    .mstrip-e .mseg > .btn, .mstrip-e .mseg .btn.zq { padding: 0 8px !important; min-width: 30px; }
    .mstrip-e .seg.mz button { padding: 0 8px; font-size: .8rem; }
  }
  @container mkv (max-width: 800px) {
    .mstrip-e { --sg: 5px; }
    .mk-viewer > .mnav.mstrip.mstrip-e { padding-left: 6px; padding-right: 6px; }
    .mstrip-e .ms-s { font-size: .78rem !important; padding: 0 4px !important; max-width: 10.4em !important; }
    .mstrip-e .mseg > .btn, .mstrip-e .mseg .btn.zq { padding: 0 6px !important; min-width: 26px; }
    .mstrip-e .seg.mz button { padding: 0 6px; font-size: .76rem; }
    .mstrip-e .ms-v { padding: 0 6px !important; }
  }
}
/* Umar, 22 Nov (trophies, again): the cups of a group are ALWAYS one row, as in his picture. The shelf keeps the width the row needs;
   when the page is too narrow for the shelf and Earned so far side by side, Earned so far goes under it (not the cups onto a second row). */
.tr-page { container: trp / inline-size; }
.t2-two { grid-template-columns: minmax(590px, 1.5fr) minmax(0, 1fr); }
.t2-shelf .t2-mini { flex-wrap: nowrap; }
@container trp (max-width: 700px) { .t2-two { grid-template-columns: 1fr; } }
@media (max-width: 599px) { .t2-two { grid-template-columns: 1fr; } }
@media (min-width: 600px) { @container trp (max-width: 1000px) { .t2-shelf .t2-row { grid-template-columns: 9.6em minmax(0, 1fr) 7.6em; gap: 10px; } .t2-count { padding: 11px 10px; font-size: .78rem; } } }
/* Umar, 22 Nov (L4): Earned so far stays BESIDE the group rows on every computer width, as in his picture. The shelf shrinks (smaller cups, narrower
   name and count columns) instead of Earned so far dropping underneath; they stack only on a really narrow viewer (under 700), as on a phone. */
@media (min-width: 600px) {
  @container trp (max-width: 860px) {
    .t2-two { grid-template-columns: minmax(510px, 1.5fr) minmax(0, 1fr); }
    .t2-shelf .t2-row { grid-template-columns: 8.6em minmax(0, 1fr) 7em; gap: 8px; }
    .t2-shelf .t2-mini { gap: 4px; }
    .t2-shelf .t2-minicup .t2-svg { width: 38px; height: 38px; }
  }
  @container trp (max-width: 760px) {
    .t2-two { grid-template-columns: minmax(470px, 1.5fr) minmax(0, 1fr); }
    .t2-shelf { padding: 6px 12px; }
    .t2-shelf .t2-row { grid-template-columns: 8.2em minmax(0, 1fr) 6.6em; gap: 6px; }
    .t2-shelf .t2-minicup .t2-svg { width: 34px; height: 34px; }
    .t2-count { padding: 9px 6px; font-size: .74rem; }
    .t2-gname { font-size: .88rem; }
    .t2-sum .t2-grades { gap: 8px; }
    .t2-sum .t2-grade-i { padding: 12px 2px; }
    .t2-sum .t2-grade-i svg { width: 50px; height: 50px; }
    .t2-sum .t2-grade-i b { font-size: 1.25rem; }
    .t2-sum .t2-gw { font-size: .6rem; letter-spacing: .05em; }
  }
}
/* Umar, 22 Nov (M2, phone strip version A): two lines on a phone. Line 1 Page, Surah, Juz; line 2 Zoom, View and the Mushaf as a small dropdown. */
.mstrip-e .mz-sel, .mstrip-e .ml-sh { display: none; }
@media (max-width: 599px) {
  .mk-viewer > .mnav.mstrip.mstrip-e { grid-template-rows: auto auto auto auto; }
  .mstrip-e .ml-z, .mstrip-e .zseg { grid-column: 1 / 6; } .mstrip-e .ml-v, .mstrip-e .ms-v { grid-column: 6 / 9; }
  .mstrip-e .ml-m, .mstrip-e .mz { grid-column: 9 / 13; justify-self: stretch; }
  .mstrip-e .ml-m { grid-row: 3; padding-top: 10px; } .mstrip-e .mz { grid-row: 4; width: 100%; }
  .mstrip-e .ml-lg { display: none; } .mstrip-e .ml-sh { display: inline; }
  .mstrip-e .seg.mz { display: block; border: 0; background: none; padding: 0; height: auto; overflow: visible; }
  .mstrip-e .seg.mz > button { display: none; }
  .mstrip-e .seg.mz > .mz-sel { display: block; width: 100%; height: 34px; box-sizing: border-box; padding: 0 8px; border: 1px solid var(--line-field); border-radius: 10px; background: var(--card); font: 700 .8rem/1 var(--body); color: var(--tx); }
  .mstrip-e .zseg .mk-zoomin { width: 1.9em !important; }
  .mstrip-e .zseg > .btn, .mstrip-e .zseg .btn.zq { min-width: 26px; padding: 0 6px !important; }
  .mstrip-e .zseg > .zq.row { padding: 0 3px !important; }
  .mstrip-e .ms-v { padding: 0 4px !important; font-size: .74rem !important; }
}
/* Umar, 22 Nov (M11): the 30 Juz key says that every coloured Juz is memorised and the colour is how well. */
.legend .lg-lead { font-weight: 800; color: var(--tx); margin-right: 2px; }
/* Umar, 22 Nov (M13): on a phone the number sits at the top of its row (not in the middle of a two-line step), so the line runs from dot to dot. */
@media (max-width: 599px) {
  .path-checks > li { align-items: flex-start; }
  .path-checks > li .t { padding-top: 4px; }
}
/* Umar, 22 Nov (M1): the homework dates as a timeline (version B). */
.hwtl { list-style: none; margin: 2px 16px 12px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; }
.hwtl::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 7px; height: 2px; background: var(--line-strong); }
.hwtl li { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; position: relative; min-width: 0; }
.hwtl i { width: 16px; height: 16px; border-radius: 50%; background: var(--ok-tx, #1f8a55); box-shadow: 0 0 0 4px var(--card); }
.hwtl li.off i { background: var(--card); border: 2px solid var(--line-strong); box-sizing: border-box; }
.hwtl li.off { opacity: .65; }
.hwtl li.late i { background: #c4432e; border: 0; }
.hwtl b { font: 800 .64rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); }
.hwtl span { font: 700 .84rem/1.2 var(--body); color: var(--tx); }
.hwtl em { font-style: normal; font-weight: 600; color: var(--tx-2); }
.hwtl li.late span, .hwtl li.late em { color: #b3261e; }
@media (max-width: 599px) { .hwtl { margin: 2px 12px 10px; } .hwtl span { font-size: .78rem; } .hwtl b { font-size: .58rem; letter-spacing: .05em; } }
/* Umar, 22 Nov (M3, lessons filter version C): long dated lists folded by month; the first month open, the others shut with their count. */
.mfolds { display: flex; flex-direction: column; gap: 8px; }
.mfold { border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.mfold > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer; }
.mfold > summary::-webkit-details-marker { display: none; }
.mfold > summary b { font: 800 .95rem/1 var(--body); color: var(--tx); }
.mfold > summary .small { margin-left: auto; color: var(--tx-2); }
.mfold .mfold-x { width: 8px; height: 8px; border-right: 2px solid var(--tx-3); border-bottom: 2px solid var(--tx-3); transform: rotate(45deg); margin: -3px 2px 0 6px; transition: transform .15s; }
.mfold[open] > summary .mfold-x { transform: rotate(-135deg); margin-top: 3px; }
.mfold:not([open]) { background: var(--well); }
.mfold-b { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; border-top: 1px solid var(--line) !important; }
/* Umar, 22 Nov (M8): Resources kinds. A computer: ONE centred line, tighter chips, no coloured square (version A; a narrow computer wraps, still centred).
   A phone: one dropdown "Show: All (8)" instead of the chips (version C). */
.res-selw { display: none; }
@media (min-width: 600px) {
  .res-chips { justify-content: center; gap: 6px; }
  .res-chip { min-height: 34px; padding: 0 10px; font-size: .8rem; white-space: nowrap; gap: 6px; }
  .res-chip i { display: none; }
}
@media (max-width: 599px) {
  .res-chips { display: none; }
  .res-selw { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 12px; }
  .res-selw span { font: 800 .62rem/1 var(--body); letter-spacing: .09em; text-transform: uppercase; color: var(--tx-3); }
  .res-sel { min-width: 240px; height: 42px; box-sizing: border-box; padding: 0 14px; border: 1px solid var(--line-field, var(--line-strong)); border-radius: 12px; background: var(--card); font: 700 .9rem/1 var(--body); color: var(--tx); }
}
/* Umar, 22 Nov (M7, version C): the general Back button, floating at the bottom left; beside the side menu on a computer. */
.gb-fab { position: fixed; left: 14px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 60; display: inline-flex; align-items: center; gap: 6px; height: 46px; padding: 0 18px; border: 0; border-radius: 99px;
  background: var(--btn-bg), var(--btn); color: var(--on-btn, #fff); font: 800 .9rem/1 var(--body); cursor: pointer; box-shadow: 0 10px 24px -8px rgba(18, 26, 44, .5); }
.gb-fab span { font-size: 1.3rem; line-height: 1; margin-top: -2px; }
.gb-fab[hidden] { display: none; }
@media (min-width: 900px) { .gb-fab { left: 272px; } }
@media print { .gb-fab { display: none; } }
/* Umar, 22 Nov: Reports must keep their OLD width (the four parts on one line). A month there is only a heading row, no box round the cards. */
/* MH1 (Umar, 23 Nov): cards inside a month (Reports, Homework, the learner's file) sit in the same bordered box as the
   All lessons months, with a little room around them. */
.mfold.plain > .mfold-b { padding: 14px; gap: 14px; background: var(--well); }
/* Umar, 22 Nov (M6, version A): the marks and "More about the marks" on ONE line, spread evenly across the whole line; the words open centred underneath. */
.mk-legend .mk-key { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; width: 100%; }
.mk-legend .mk-more > summary { display: none; }
.mk-legend .mk-more { width: 100%; text-align: center; }
.mk-legend .mk-more > p { margin: 8px auto 0; max-width: 70ch; }
.mk-pillmore { display: inline-flex; align-items: center; gap: 6px; font: 800 .8rem/1 var(--body); padding: 7px 12px; border-radius: 99px; border: 1px solid var(--key); color: var(--key); background: var(--card); cursor: pointer; }
.mk-top .mk-legend, .mk-legend { justify-items: stretch; text-align: center; }
@media (max-width: 599px) { .mk-legend .mk-key { justify-content: center; } }
#main .mk-legend .mk-key { justify-content: space-evenly !important; width: 100%; }
@media (max-width: 599px) { #main .mk-legend .mk-key { justify-content: center !important; } }
.gb-fab { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* Umar, 23 Nov: reports on a phone as a 2 by 2 grid, everywhere (the one report grid `.rpt-g`: Reports, a lesson's report, Today's last report, the teacher's views). */
@media (max-width: 640px) {
  .rpt-g, .rpt-g.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rpt-g > .rpt-c, .rpt-g.two > .rpt-c:nth-child(n+2) { border-left: 1px solid var(--line); border-top: 0; padding: 12px; }
  .rpt-g > .rpt-c:nth-child(odd) { border-left: 0; }
  .rpt-g > .rpt-c:nth-child(n+3) { border-top: 1px solid var(--line); }
  .rpt-g > .rpt-c:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.wk-delta { display: block; margin-top: 4px; font: 700 .78rem/1.2 var(--body); color: var(--tx-2); } .wk-delta.up { color: #1b6b43; } .wk-delta.dn { color: #b3261e; }

/* Umar, 23 Nov: Week in a minute, the small line under each day (Lesson, Homework in, Revision), and the teacher's "On last week" line. */
.wk-day .wk-dl { display: block; font-size: .74rem; line-height: 1.25; text-align: center; }
.wk-vs .wk-delta { display: inline; margin: 0; font-size: inherit; white-space: nowrap; }

/* Umar, 23 Nov (F2): a file on a phone must never scroll sideways. The lesson and homework cards could not shrink below
   their content (flex min-width: auto), so "Lessons and reports" was 445px wide on a 390 screen. Both files (same classes). */
@media (max-width: 760px) {
  .f-cols > .main > *, .f-cols > .side > *, .f-cols .tools, .f-cols .acts, .f-cols .section, .f-cols .section > .stack, .f-cols .section > .mfolds, .f-cols .mfold-b, .f-cols details.fold, .f-cols .fold-s, .f-cols .fold-s .rc-w { min-width: 0; max-width: 100%; }
  .f-cols .fold-s .end { min-width: 0; flex-wrap: wrap; }
  /* Each part takes the full width, so its height is measured at the width it is drawn (Goals had 120px of empty space). */
  .f-cols > .main > *, .f-cols > .side > * { width: 100%; box-sizing: border-box; }
}
/* H3 (Umar, 23 Nov): Homework's Sort sits in the first month's heading row, beside Hide, at the Hide button's height.
   `.sh-sort`: Homework and Recordings (R2, Umar 23 Nov); To review keeps its own bar (it has no month bars). */
.bk-first { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.bk-first .row { align-items: center; gap: 12px; }
.sechead .sh-sort { display: inline-flex; flex: none; }
.sechead .sh-sort .fixsort { height: 28px; border-radius: 99px; padding-left: 10px; }
.sechead .sh-sort .fixsort select { height: 26px; line-height: 26px; font-size: .76rem; }
.sechead .sh-sort .fixsort > .small { font-size: .66rem; }
@media (max-width: 600px) { .sechead:has(.sh-sort) { gap: 6px; }
  .sechead .sh-sort .fixsort > .small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sechead .sh-sort .fixsort { padding-left: 8px; } .sechead .sh-sort .fixsort select { padding-right: 22px; } }
/* F1, F3 (Umar, 23 Nov): the file's folding boxes and sections (My file and the teacher's learner file) open and close
   with the Hide / Show button, as on Today: no arrow, the header itself is not a button. On a phone the parts sit 22px
   apart, Today's spacing. */
.panel.collapsible.hs > .phead { cursor: auto; padding-right: revert-layer; }
.panel.collapsible.hs > .phead::after, .collapsible-sec.hs > :first-child::after { display: none; }
.collapsible-sec.hs > :first-child { cursor: auto; padding-right: 0; }
.panel.collapsible.hs > .phead > .foldbtn { margin-left: auto; }
@media (max-width: 760px) { .f-cols { gap: 22px; } }
/* T1 (Umar, 23 Nov): the teacher's marking toolbar uses the same oval keys as the learner's "What the marks mean"
   (.mk-pill): kinds, portion kinds and the tools row. Only the teacher's marking tools use these classes. */
.mk-kinds button, .mk-tools button, .mk-pk { border-radius: 99px; font-weight: 800; font-size: .8rem; padding: 0 12px 0 9px; }
.mk-kinds button .mk-sw, .mk-pk .mk-sw { width: 30px; height: 14px; }

/* K1 / K2 (Umar, 23 Nov, version D): the teacher marks memorised pages on the memory map. While marking, a page marked
   here carries a small white tick; the hint sits under the key. Teacher only (the button comes only with can_mark). */
.mm-markhint { margin: 4px 0 0; font-size: .84rem; color: var(--tx-2); text-align: left; }
.mm-scroll.marking .mm-sq { cursor: copy; }
.mm-scroll.marking .mm-sq.mine { position: relative; }
.mm-scroll.marking .mm-sq.mine::after { content: ""; position: absolute; left: 30%; top: 18%; width: 28%; height: 46%; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(40deg); }
.mm-markbtn[aria-pressed="true"] { background: var(--key); color: #fff; border-color: var(--key); }

/* RS1 (Umar, 23 Nov, version C): Resources kinds. One line where it fits; where it does not (public/resources.js measures
   it and sets .res-narrow), the drop-down, as on a phone, so "Printables" never drops onto a line of its own. Resources page only. */
@media (min-width: 600px) {
  .res-chips { flex-wrap: nowrap; }
  .res-narrow .res-chips { display: none; }
  .res-narrow .res-selw { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin: 4px 0 12px; }
  .res-narrow .res-selw span { font: 800 .62rem/1 var(--body); letter-spacing: .09em; text-transform: uppercase; color: var(--tx-3); }
  .res-narrow .res-sel { min-width: 260px; height: 42px; box-sizing: border-box; padding: 0 14px; border: 1px solid var(--line-field, var(--line-strong)); border-radius: 12px; background: var(--card); font: 700 .9rem/1 var(--body); color: var(--tx); }
}
/* TJ1 (Umar, 23 Nov): Today's upcoming rows: the "in 3 days" pill and Join sit on one centre line (the shared row rule's
   2px / 3px top margins pushed Join down). */
.tgrid .item:has(> .end) > .end > * { margin-top: 0; margin-bottom: 0; align-self: center; }

/* J3 (Umar, 23 Nov): the Hifdh journal's months in the All lessons box, and its table headings in the portal's own
   lettering (no spaced capitals). Journal, My file and the teacher's learner file share it. */
.hh-fold > .hh-body { padding: 12px 14px 14px; }
.hh-fold > .hh-body > .hh-tally { display: flex; margin: 0 0 12px; }
.hh-fold .hh-t { min-height: 30px; }
.hh-x thead th, .hh-x thead tr.hh-subrow th, .hh-x thead th .hh-gw { font: 700 .86rem/1.3 var(--body) !important; letter-spacing: 0 !important; text-transform: none !important; }
.hh-x thead tr.hh-subrow th { font-weight: 600 !important; color: var(--tx-2); }
/* MM5 (Umar, 23 Nov): the page numbers button and the zoom never part on a phone. */
.mm-nums { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 6px; white-space: nowrap; }
@media (max-width: 380px) { .mm-nums .btn.sm { padding: 0 9px; } .mm-nums .mm-zoom .btn { min-width: 32px; padding: 0 8px; } }
/* HI1 (Umar, 23 Nov): a heading with a course chip beside it (Fees: "Hifdh one-to-one · Ali" + "Hifdh and revision")
   sits on the icon's centre line, not on the chip's baseline. Only headings that carry a chip. */
.panel:not(.hwcard) > .phead > .stack:has(> .cchip) { align-items: center; }
/* BK3b (Umar, 23 Nov): Book a lesson, "Change or cancel a lesson": each booking a card, the pill and the buttons at the
   bottom, lined up. An EVEN number is always 2 by 2 (1440 too, the cards stretched); an ODD number is 3 across on a wide
   screen, 2 on a smaller one; one under another on a phone. Book a lesson only (.bk-grid). */
.bk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 1300px) { .bk-grid.bk-odd:not(:has(> :only-child)) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 599px) { .bk-grid { grid-template-columns: 1fr; } }
.bk-grid > .bk-row { display: flex; flex-direction: column; margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05)); }
.bk-grid > .bk-row > .bk-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bk-grid > .bk-row > .bk-foot > .row { margin: 0; gap: 6px; }
/* SH1b (Umar, 23 Nov, version B): Reports' Hide on the first month bar, the "Lesson reports" heading kept. Shut, only that
   bar shows (with Show on it). Reports only (.fold-inbar, hideOnMonthBar in public/study.js). */
.fold-inbar .mfolds > .mfold:first-child > summary > .small { margin-left: auto; }
.fold-inbar .mfolds > .mfold:first-child > summary > .foldbtn { margin-left: 10px; }
.section.folded.fold-inbar > .mfolds { display: flex; }
.section.folded.fold-inbar > .mfolds > .mfold:not(:first-child), .section.folded.fold-inbar > .mfolds > .mfold:first-child > :not(summary) { display: none; }
/* R1100 (Umar, 23 Nov, "after"): a report's four parts never leave one alone. Four across where four fit (about 840 wide),
   otherwise 2 by 2, as on a phone. Shared report look (recap in public/app.js): Reports, All lessons, a lesson's report, the
   week page, My file, the teacher's learner file and lesson page. Only a report with exactly four parts. */
.rpt-g:not(.two):has(> .rpt-c:nth-child(4):last-child) { container: rptg / inline-size; grid-template-columns: repeat(auto-fit, minmax(clamp(24.9%, (840px - 100%) * 999, 49.9%), 1fr)); }
@container rptg (max-width: 839px) {
  .rpt-g > .rpt-c { border-left: 1px solid var(--line); border-top: 0; }
  .rpt-g > .rpt-c:nth-child(odd) { border-left: 0; }
  .rpt-g > .rpt-c:nth-child(n+3) { border-top: 1px solid var(--line); }
}
/* FL1 / LS1 (Umar, 23 Nov): My file and the teacher's learner file list lessons the All lessons way: inside the month's box
   each lesson is a row under its day bar, not a card of its own (it still opens to its report). Those two files only. */
.fl-box > details.hw { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; margin: 0 !important; background: none !important; }
.fl-box > details.hw > summary { padding-left: 14px; padding-right: 14px; }
/* K1-phone (Umar, 23 Nov): the marks key on 2 lines on a phone: "More about the marks" says "More" there. */
.mk-more-short { display: none; }
@media (max-width: 599px) { .mk-more-long { display: none; } .mk-more-short { display: inline; } }
@media (max-width: 380px) { .mk-legend .mk-key { gap: 5px; } .mk-legend .mk-pill { padding: 4px 8px 4px 5px; gap: 4px; } .mk-legend .mk-pill .mk-sw { width: 20px; } }
/* FS1 (Umar, 23 Nov): Fees, "What £120 a month covers": 3 a row at every computer width (it was 3 and 3 in a window, 4 and 2
   on a full screen), the tiles growing to fill a wider screen. FS2: the package tile reads like the others (black name,
   the words under it), no grey label first. Fees only (.cv2). */
@media (min-width: 900px) { .cv2 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cv2-i.pkg { border-color: var(--line); }
.cv2-i.pkg .cv2-k { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--tx); }
.cv2-i.pkg .cv2-s { order: 0; font: var(--t-meta); text-transform: none; letter-spacing: 0; color: var(--tx-2); }
/* J4 (Umar, 23 Nov): the journal's part counts on the month line, between the month and the count (Journal, My file,
   the teacher's learner file: historyTable in public/hifdh.js). On a phone they take the line under the month. */
.hh-fold > summary > .hh-tally { display: inline-flex; margin: 0 0 0 auto; }
.hh-fold > summary > .small { margin-left: 4px; white-space: nowrap; }
@media (max-width: 760px) { .hh-fold > summary { flex-wrap: wrap; } .hh-fold > summary > .hh-tally { order: 5; flex-basis: 100%; margin: 2px 0 0; } .hh-fold > summary > .small { margin-left: auto; } }
/* MM6 (Umar, 23 Nov): memory map on a phone: Practise, then (pushed to the right) "Show page numbers" and the minus / plus,
   all on one line under the mistakes line. Memory map only (.mm-bar). */
@media (max-width: 600px) {
  .mm-bar-top { flex-wrap: wrap; gap: 8px 6px; }
  .mm-bar-top > .mm-proof { display: contents; }
  .mm-bar-top > .mm-proof > span { flex-basis: 100%; font: var(--t-meta); font-weight: 600; color: var(--tx); }
  .mm-bar-top > .mm-proof > .btn { padding: 0 12px; }
  .mm-bar-top > .mm-bar-tools:not(:has(.mm-markbtn)) { margin-left: auto; flex-wrap: nowrap; }
  .mm-bar-top .mm-nums { gap: 4px; }
  .mm-bar-top .mm-nums .btn.sm { padding: 0 10px; }
  .mm-bar .mm-zoom .btn { min-width: 32px; padding: 0 8px; }
}
@media (max-width: 600px) {
  .mm-bar .mm-bar-top > .mm-proof > .btn.sm { padding: 0 11px; }
  .mm-bar .mm-bar-top .mm-nums > .btn.sm .ico { display: none; }
  .mm-bar .mm-bar-top .mm-nums > .btn.sm { padding: 0 10px; }
}
/* J4: where the counts do not fit beside the month (1100, or a narrow column), they take the next line whole; the month never breaks. */
.hh-fold > summary { flex-wrap: wrap; row-gap: 8px; }
.hh-fold > summary > b { white-space: nowrap; }
@media (min-width: 761px) { .hh-fold > summary > .hh-tally { flex: none; flex-wrap: nowrap; } }
.hh-fold { container: hhf / inline-size; }
@container hhf (max-width: 820px) { .hh-fold > summary > .hh-tally { order: 5; flex: 1 1 100%; flex-wrap: wrap; margin: 0; } .hh-fold > summary > .small { margin-left: auto; } }

/* MQ3b, then MQ3d to MQ3f (Umar, 24 Nov, version B, Qur'an and book lessons alike): the teacher's lesson page. One learner:
   their button and "Open the meeting" one under the other in the top card; on a phone the button goes under the card, the
   whole width. Two or more: the top card keeps the meeting only; "Students in the lesson" under it, one short button each, on
   one line or one row that scrolls across (never a lone button on a second line). On a phone the meeting is a short "Join"
   beside the time chip (public/teach.js, public/mushaf.js lessonOpeners). */
.hero-btns { display: flex; flex-direction: column; gap: 8px; align-items: stretch; flex: none; }
.hero-btns .btn { justify-content: center; }
.hero-meet-s { display: none; }
.lesson-open { margin: 0; padding: 14px 16px; border-radius: var(--r-card); background: var(--card-bg); border: 1px solid var(--line); box-shadow: var(--shadow); }
.lesson-open.one { display: none; }
.lesson-open .lo-h { margin: 0 0 10px; font: 800 .7rem/1.2 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--tx-3); }
.hero-when { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.lesson-open .lo-row { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding: 4px 3px 8px; margin: -4px -3px -8px; -webkit-overflow-scrolling: touch; }
.lesson-open .lo-row .btn { flex: 0 0 auto; justify-content: center; white-space: nowrap; padding-inline: 14px; }
@media (min-width: 601px) and (max-width: 1199px) { .lesson-open .lo-row { gap: 6px; } .lesson-open .lo-row .btn { padding-inline: 10px; gap: 6px; } }
@media (max-width: 600px) {
  .card.hero .hero-meet-s { display: inline-flex; }
  .card.hero .hero-meet, .card.hero .hero-btns { display: none; }
  .lesson-open.one { display: block; padding: 0; background: none; border: 0; box-shadow: none; }
  .lesson-open .lo-row .btn { flex: 1 0 auto; }
}

/* RV13b (Umar, 24 Nov, version A): the memory map's one line pointing to the revision plan's Plan tab. */
.mm-toplan { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; padding: 14px 18px; border-radius: var(--r-card); background: var(--card-bg); border: 1px solid var(--line); box-shadow: var(--shadow); }

/* MQ1b (Umar, 24 Nov): the teacher's toolbar on two lines, each with its name on the left ("Kind of mark", "How to mark"),
   the four ways to mark joined in one strip, Undo / Redo after it. 1320 wide and up (1366, 1440): version E, the note box on
   the right of both lines, its words centred. 600 to 1319 (1280, 1100): the same two lines, the note under them. A phone
   keeps its rows that scroll across, as before (no names, nothing joined). */
.mk-bar > .mk-lab, .mk-lab-in { display: none; }
/* MQ1b phone B (Umar, 24 Nov): on a phone the rows still scroll across at the same height; each row starts with its name
   ("Kind of mark", "How to mark") and a divider, and slides away with it; the four ways joined in one strip, Undo / Redo after a line. */
@media (max-width: 599px) {
  .mk-bar .mk-lab-in { display: flex; align-items: center; align-self: stretch; flex: none; white-space: nowrap; padding-right: 10px; margin-right: 2px;
    border-right: 1px solid var(--line); font: 800 .6rem/1.15 var(--body); letter-spacing: .09em; text-transform: uppercase; color: var(--tx-3); }
  .mk-bar .mk-seg { display: inline-flex; flex: none; border: 1.5px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: var(--card); }
  .mk-bar .mk-seg > button { border: 0; border-radius: 0; box-shadow: none; padding-inline: 12px; white-space: nowrap; }
  .mk-bar .mk-seg > button + button { border-left: 1px solid var(--line); }
  .mk-bar .mk-seg > button[aria-pressed="true"] { background: var(--key); color: #fff; box-shadow: none; }
  .mk-bar .mk-undo { display: inline-flex; flex: none; gap: 5px; padding-left: 8px; margin-left: 2px; border-left: 1px solid var(--line); }
  .mk-bar .mk-undo .hist.first { margin-left: 0; }
}
@media (min-width: 600px) {
  .mk-bar:has(> .mk-lab) { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 18px; align-items: center; padding: 14px 16px;
    border: 1px solid var(--line-strong); border-radius: 18px; background: linear-gradient(180deg, var(--card) 0%, color-mix(in srgb, var(--key) 5%, var(--card)) 100%);
    box-shadow: 0 6px 18px -12px rgba(20, 39, 74, .35); }
  .mk-bar > .mk-lab { display: flex; align-items: center; align-self: stretch; padding-right: 16px; border-right: 1px solid var(--line);
    font: 800 .66rem/1.2 var(--body); letter-spacing: .11em; text-transform: uppercase; color: var(--tx-3); white-space: nowrap; }
  .mk-bar:has(> .mk-lab) > .mk-kinds { gap: 8px; }
  .mk-bar:has(> .mk-lab) > .mk-tools { padding-top: 0; border-top: 0; align-items: center; gap: 10px; }
  .mk-bar:has(> .mk-lab) > .mk-portion, .mk-bar:has(> .mk-lab) > .mk-fields { grid-column: 1 / -1; }
  .mk-seg { display: inline-flex; border: 1.5px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: var(--card); }
  .mk-tools .mk-seg > button { border: 0; border-radius: 0; box-shadow: none; padding-inline: 16px; }
  .mk-tools .mk-seg > button + button { border-left: 1px solid var(--line); }
  .mk-tools .mk-seg > button[aria-pressed="true"] { background: var(--key); color: #fff; box-shadow: none; }
  .mk-undo { display: inline-flex; gap: 6px; padding-left: 10px; border-left: 1px solid var(--line); }
  .mk-undo .hist.first { margin-left: 0; }
}
@media (min-width: 1320px) {
  .mk-bar:has(> .mk-lab) { grid-template-columns: auto auto minmax(220px, 1fr); }
  .mk-bar:has(> .mk-lab) > .mk-fields { grid-column: 3; grid-row: 1 / 3; align-self: stretch; }
  .mk-bar:has(> .mk-lab) > .mk-fields > .mk-notewide { flex: 1 1 100%; display: flex; }
  .mk-bar:has(> .mk-lab) > .mk-fields > .mk-notewide input { height: 100%; min-height: 84px; text-align: center; font-size: .74rem; }
  .mk-bar:has(> .mk-lab) > .mk-portion { grid-column: 1 / -1; }
}
/* MQ1b-1280 (Umar, 24 Nov): at 1280 the note box goes at the end of the "How to mark" line, so the toolbar is on 2 lines (the Qur'an toolbar only: on the Qaida book pages "Whole pages" and "Kind of mistake" leave no room, so they keep the note under); its
   words whole and centred, a little smaller, the four ways a little narrower to make room. Measured: the five kinds need about
   595px and at 1100 their line has 597, so at 1100 nothing more fits beside them and the note stays under the two lines. */
@media (min-width: 1276px) and (max-width: 1319px) {
  .mk-bar:has(> .mk-lab):has(> .mk-kinds > :nth-child(6)) { grid-template-columns: auto auto minmax(0, 1fr); }
  .mk-bar:has(> .mk-lab):has(> .mk-kinds > :nth-child(6)) > .mk-kinds { grid-column: 2 / -1; }
  .mk-bar:has(> .mk-lab):has(> .mk-kinds > :nth-child(6)) > .mk-fields { grid-column: 3; grid-row: 2; }
  .mk-bar:has(> .mk-lab):has(> .mk-kinds > :nth-child(6)) > .mk-fields > .mk-notewide { flex: 1 1 100%; display: flex; }
  .mk-bar:has(> .mk-lab):has(> .mk-kinds > :nth-child(6)) > .mk-fields > .mk-notewide input { text-align: center; font-size: .7rem; padding-inline: 8px; }
  .mk-bar:has(> .mk-kinds > :nth-child(6)) .mk-tools .mk-seg > button { padding-inline: 13px; }
}

/* FX1 (Umar, 24 Nov): the fixed class lesson words (public/classrule.js). Only .fx1 boxes use these. */
.fx1 { display: grid; gap: 6px; padding: 10px 14px; border-radius: 12px; background: var(--info-bg); color: var(--tx); font-size: .85rem; }
.fx1-t, .fx1 > summary { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; color: var(--info-tx); }
.fx1 > summary { cursor: pointer; list-style: none; }
.fx1 > summary::-webkit-details-marker { display: none; }
.fx1 > summary::after { content: "›"; margin-left: auto; transition: transform .15s; }
.fx1[open] > summary::after { transform: rotate(90deg); }
.fx1 .ico { width: 16px; height: 16px; flex: none; }
.fx1-list { margin: 0; padding-left: 22px; display: grid; gap: 3px; color: var(--tx-2); }
/* M-4 (Umar, 24 Nov): the full box as 2 cards side by side when there is room (Lessons, Book a lesson); one under the
   other when narrow (a phone, the class page's side column). Only .fx2 boxes use these. */
.fx1.fx2 { container-type: inline-size; padding: 0; background: none; }
.fx2-in { display: grid; gap: 8px; }
@container (min-width: 520px) { .fx2-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); } }
.fx2-c { display: grid; gap: 5px; align-content: start; padding: 10px 14px; border-radius: 12px; background: var(--info-bg); }
.fx2-p { margin: 0; color: var(--tx-2); }
.fx2-miss > summary { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--info-tx); list-style: none; cursor: pointer; }
.fx2-miss > summary::-webkit-details-marker { display: none; }
@media (max-width: 599px) {
  .fx2-miss > summary::after { content: "›"; margin-left: auto; transition: transform .15s; }
  .fx2-miss[open] > summary::after { transform: rotate(90deg); }
}
@media (min-width: 600px) { .fx2-miss > summary { cursor: default; } }
/* L-Q8d (Umar, 24 Nov): the line on Marks to fix saying how it differs from My Qur'an (public/proof.js). */
.mf-diff { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--tx-2); }
.mf-diff .ico { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--info-tx); }

/* L-Q16 (Umar, 24 Nov): the Bin (public/family2.js). Only .bin-row and .bin-txt use these. */
.bin-row { align-items: flex-start; }
.bin-row .words { gap: 4px; }
.bin-txt { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--tx); }

/* R-4 / T2a (Umar, 24 Nov): on the teacher's lesson page and Ali's Qur'an, the heading stands on its own line, as Ali's
   headings do, and its explanation goes underneath it (it sat on the same line). Only panels given "sub-under". */
.panel.sub-under > .phead { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 8px; row-gap: 3px; }
.panel.sub-under > .phead > .stack { display: contents; }
.panel.sub-under > .phead > .itile { grid-column: 1; grid-row: 1; }
.panel.sub-under > .phead h2 { grid-column: 2; grid-row: 1; }
.panel.sub-under > .phead > :not(.itile):not(.stack) { grid-column: 3; grid-row: 1; }
.panel.sub-under > .phead .sub { grid-column: 1 / -1; grid-row: 2; }

/* R-2 (Umar, 24 Nov): the mark's picture shows its whole line with a line before and after; its own height, not a fixed strip. */
.pf-snapbox.wide { height: auto; display: block; }
.pf-snapbox.wide .pf-snap { width: 100%; height: auto; max-height: 230px; }
/* R-1 (Umar, 24 Nov, version C): the picture on the left; the note above "Practise it on the page" on its right. On a phone the
   picture is the whole width and the note and a shorter button share one line under it. */
.pf-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; align-items: start; }
.pf-side { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.pf-side > .mc-parts { align-self: stretch; }
.pf-go .pf-go-s { display: none; }
@media (max-width: 599px) {
  .pf-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pf-side { flex-direction: row; align-items: center; }
  .pf-side > .mc-parts { flex: 1 1 auto; min-width: 0; }
  .pf-side > .pf-go { flex: none; margin-left: auto; }
  .pf-go .pf-go-l { display: none; } .pf-go .pf-go-s { display: inline; }
}
/* The mark a "Practise it on the page" button opened, lit on the page (R-1). */
.mpage .mk-lit { fill: none; stroke: #d4a017; pointer-events: none; animation: mk-lit 1.2s ease-in-out 3; }
@keyframes mk-lit { 50% { stroke-opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .mpage .mk-lit { animation: none; } }
/* R-5 (Umar, 24 Nov, bug): in a chat on a phone or tablet the floating Back button sat over the attach icon of the message
   bar. A chat already has its own back arrow at the top left (Messages and the teacher's Inbox), so the floating one is
   not shown while a chat is open there. Every other page keeps it. */
@media (max-width: 899px) { body:has(#main .chatview) .gb-fab { display: none; } }

/* R-3 (Umar, 24 Nov, look C): "Test yourself" on Marks to fix, and the page with the marked line as a navy band. */
.rh { display: grid; gap: 12px; }
.rh-strip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card-bg); box-shadow: var(--shadow); }
.rh-strip .rh-w { flex: 1; min-width: 0; } .rh-strip .rh-w p { margin: 2px 0 0; }
.rh-box { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card-bg); box-shadow: var(--shadow); }
.rh-box[hidden] { display: none; }
.rh-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rh-box p { margin: 0; }
.rh-frame { background: #fff; border: 1px solid var(--line); border-radius: var(--r-well); padding: 6px; max-width: 760px; }
.rh-page { display: block; width: 100%; height: auto; }
.rh-band { fill: #14274a; }
.rh-dot { fill: rgba(255, 255, 255, .55); } .rh-dot.hit { fill: #f2c14e; }
.rh-n { fill: rgba(255, 255, 255, .8); font-family: var(--body); font-weight: 700; }
.rh-gold { fill: none; stroke: #d4a017; }
.rh-btns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 599px) { .rh-strip { flex-wrap: wrap; } .rh-strip > .btn { margin-left: auto; } .rh-box { padding: 12px; } }
/* Umar, 25 Nov part T, picks on the phone (both sides share these rows).
   H1 version A: "1 day overdue" on the same line as the date, at the right, not under it.
   G1 version A: on a pathway check the pill (or the tick button) goes under the words, so the words have the whole width. */
@media (max-width: 599px) {
  .hwf-w { flex: 1; width: 100%; flex-wrap: nowrap; }
  .hwf-v { white-space: nowrap; }
  .hwf-w > .pill { margin-left: auto; }
  .path-checks > li, .path-checks > .path-row { flex-wrap: wrap; row-gap: 6px; }
  .path-checks > li .t, .path-checks > .path-row .t { flex-basis: calc(100% - 44px); }
  .path-checks > li > .pill, .path-checks > .path-row > .pill, .path-checks > .path-row > .btn { margin-left: 44px; }
}
/* I1 version A (Umar, 25 Nov): a recording row is the date in bold, the rest in grey, Watch at the right, at every width. */
.recrow.rec-d { display: flex; align-items: center; gap: 12px; }
.recrow.rec-d .rec-w { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.recrow.rec-d .rec-w .sub { color: var(--tx-3); }
.recrow.rec-d > .btn { flex: none; }
/* P-C1 (Umar's pick A, 25 Nov): Book a lesson's 48-hour box, two short lines with a dot. */
.bk-rules.c1 { display: grid; gap: 8px; }
.c1r { display: grid; grid-template-columns: 10px max-content 1fr; gap: 4px 10px; align-items: baseline; }
.c1r span { color: var(--tx-2, var(--tx-3)); }
.c1d { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.c1d.ok { background: #2e8b57; } .c1d.warn { background: #d08a12; }
@media (max-width: 600px) { .c1r { grid-template-columns: 10px 1fr; } .c1r span { grid-column: 2; } }
/* P-B23 (Umar's pick B, 25 Nov): the phone's bar, the date between the arrows on its own line, then Today, Day / Week / Month, Book. */
.cal-hint { display: none; margin: -4px 0 0; }
@media (max-width: 699px) {
  .cal-bar.b23 { display: grid; gap: 8px; }
  .cal-bar.b23 .cal-nav { display: grid; grid-template-columns: 34px 1fr 34px; gap: 8px; }
  .cal-bar.b23 .cal-range { margin: 0; justify-content: center; font-weight: 700; }
  .cal-bar.b23 .cal-right { display: flex; gap: 8px; justify-content: flex-start; }
  .cal-bar.b23 .cal-seg { flex: 1; display: flex; } .cal-bar.b23 .cal-seg button { flex: 1; }
  .cal-hint { display: block; }
}
/* P-B1 (Umar's pick B, 25 Nov): the phone's Day, every hour in a box that scrolls. */
.cal-dh { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); position: relative; }
.cal-dh-r { display: grid; grid-template-columns: 52px minmax(0, 1fr); min-height: 46px; border-top: 1px solid var(--line); }
.cal-dh-r:first-child { border-top: 0; }
.cal-dh-t { font: 700 .72rem/1 var(--body); color: var(--tx-3); padding: 8px; }
.cal-dh-c { display: grid; gap: 6px; padding: 4px 8px 4px 0; }
/* P-D3 (Umar's pick B, 25 Nov): on a phone the kinds of "On Page N" sit in one line under the heading that slides across. */
.mk-onkinds.d3row { display: none; }
@media (max-width: 699px) {
  .mk-onpage > summary .mk-onkinds { display: none; }
  .mk-onpage > .mk-onkinds.d3row:not(:empty) { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; margin: 0; padding: 0 0 10px; scrollbar-width: none; }
  .mk-onpage:not([open]) > .mk-onkinds.d3row { display: none; }
}
/* P-D4 (Umar's pick B, 25 Nov): the kind pill top right; the Note narrower, where the mark stands and "Similar āyāt" at its right. */
.mcard.d4 > .mc-head { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: start; }
.mcard.d4 > .mc-head::before { margin-top: 6px; }
.mcard.d4 .mc-title { min-width: 0; overflow-wrap: anywhere; }
.mcard.d4 .mc-badges { justify-content: flex-end; }
.d4row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.d4side { grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 220px; }
.d4side > .row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.d4side .sim-open { white-space: normal; text-align: center; }
.mcard.d4 > .pf:not(:has(> :not([hidden]))) { display: none; }
/* P-E1 (Umar's pick A, 25 Nov): Kind and Juz drop-downs, Sort at the right; on a phone the drop-downs share one line. */
.fixbar.e1 { display: block; }
.fixbar.e1 > .row { display: flex; flex-wrap: nowrap; gap: 8px; width: 100%; }
.fixbar.e1 .e1s { margin-left: auto; }
@media (max-width: 599px) {
  .fixbar.e1 .fixsort { flex: 1 1 0; min-width: 0; padding-left: 8px; }
  .fixbar.e1 .fixsort > .small { display: none; }
  .fixbar.e1 .fixsort select { width: 100%; min-width: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; font-size: .78rem; padding-right: 22px; }
  .fixbar.e1 .e1s { margin-left: 0; }
}
/* P-E3 (Umar's pick A, 25 Nov): sent and waiting, one blue line; the two buttons side by side. */
.e3s { margin: 0; color: var(--key); font-weight: 700; }
.mcard.e3 .pf-side > .mc-parts { width: 100%; }
.e3f { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.e3f .btn { width: 100%; justify-content: center; }
.e3f .pf-go .pf-go-l { display: none; } .e3f .pf-go .pf-go-s { display: inline; }
.e3f:has(> :only-child) { grid-template-columns: 1fr; }
/* P-F3 (Umar's pick B, 25 Nov): Note a day, one part at a time on a phone; the day at the top right; Save at the bottom right. */
.sechead.f3h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.f3top { display: flex; justify-content: flex-end; }
.f3day { margin: 0 !important; } .f3day input { height: 34px; padding: 4px 8px; font-size: .85rem; width: 150px; }
.f3tabs { display: flex; gap: 4px; background: var(--well); border-radius: 12px; padding: 4px; }
.f3t { flex: 1; border: 0; background: none; border-radius: 9px; padding: 7px 4px; font: 700 .85rem/1.2 var(--body); color: var(--tx-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.f3t[aria-selected="true"] { background: var(--card); color: var(--tx); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.f3dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; } .f3t.has .f3dot { background: var(--key); }
@media (max-width: 699px) { .f3 .hj-f.f3off { display: none; } }
.f3save { display: flex; justify-content: flex-end; }
@media (min-width: 700px) {
  .f3tabs { display: none; }
}
@media (min-width: 900px) { .f3 .hj-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1.3fr); } }
@media (max-width: 699px) { .f3 .hj-l { display: none; } }
/* P-H5 (Umar's pick B, 25 Nov): the 30 Juz on My file as 30 small squares. */
.h5p { border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; background: var(--card); box-shadow: var(--shadow); display: grid; gap: 10px; }
.h5top { display: flex; gap: 10px; align-items: baseline; } .h5top a { margin-left: auto; }
.h5g { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 3px; }
.h5g i { font-style: normal; font-size: .6rem; text-align: center; padding: 3px 0; border-radius: 4px; background: var(--well); color: var(--tx-3); }
.h5g i.m { background: #2e8b57; color: #fff; font-weight: 800; }
/* P-J1 (Umar's pick A, 25 Nov): everything sent in a chat as a full view over the chat, tabs, big squares by month. */
.chatview.j1on > :not(.chat-head):not(.c-info) { display: none !important; }
.chatview.j1on > .c-info { max-height: none; flex: 1; padding: 0 0 14px; gap: 0; }
.j1h { padding: 10px 14px; border-bottom: 1px solid var(--line); justify-content: flex-start !important; }
.j1h .j1x { width: 36px; height: 36px; min-height: 36px; border-radius: 50%; }
.j1tabs { display: flex; border-bottom: 1px solid var(--line); }
.j1tabs button { flex: 1; border: 0; background: none; padding: 11px 4px; font: 700 .85rem/1.2 var(--body); color: var(--tx-3); cursor: pointer; }
.j1tabs button[aria-selected="true"] { color: var(--key); box-shadow: inset 0 -3px 0 var(--key); }
.j1m { margin: 0; padding: 12px 14px 6px; font: 800 .75rem/1.2 var(--body); text-transform: uppercase; letter-spacing: .05em; color: var(--tx-3); }
.j1g { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
@media (min-width: 900px) { .j1g { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.j1g .j1t { margin: 0; aspect-ratio: 1; overflow: hidden; position: relative; }
.j1g .j1t .c-thumb { all: unset; display: block; width: 100%; height: 100%; cursor: pointer; }
.j1g .j1t img { width: 100%; height: 100%; object-fit: cover; display: block; }
.j1g .j1t figcaption { display: none; }
.j1g .j1t.big { grid-column: 1 / -1; aspect-ratio: auto; }
.j1g .j1t.big img { height: auto; max-height: 70vh; object-fit: contain; background: #000; }
.j1g .j1t.big figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; }
.j1l { padding: 0 14px; } .j1none { padding: 14px; margin: 0; }
.chatview.j1on > .c-info > .c-grp { padding: 14px 14px 0; }
/* P-J2 (Umar's pick B, 25 Nov): a slim chat head on a phone, the next lesson one thin line with Join, the messages down by the
   message box, and the round buttons true circles. */
.chat-head .c-tools .btn.round, .c-srow .btn.round, .composer .btn.round { aspect-ratio: 1; flex: none; padding: 0; border-radius: 50%; }
@media (max-width: 899px) {
  .chat-head { padding: 6px 10px; gap: 8px; }
  .chat-head .av { width: 32px; height: 32px; font-size: .72rem; border-width: 1.5px; }
  .chat-head .chat-title { font-size: 1rem; margin: 0; }
  .chat-head .seen { font-size: .75rem; }
  .chat-head .c-tools .btn.round { width: 36px; height: 36px; min-height: 36px; }
  .chat-head .c-tools .ico { width: 20px; height: 20px; }
  .stack:has(> .chatview) .chat-head { padding-left: 40px; }
  .stack:has(> .chatview) > .back { top: 7px; }
  .chat-nextrow { padding: 4px 10px; margin: 4px 0; gap: 8px; justify-content: space-between; min-height: 0; border-radius: 12px; }
  .chat-nextrow .btn { height: 28px; min-height: 28px; padding: 2px 12px; }
  .chatview > .chat { justify-content: flex-end; }
}
/* D15 (Umar, 25 Nov): the plan's goal and graph on the memory map, in a frame drawn by the plan itself. */
.mm-goalframe { display: block; width: 100%; height: 520px; border: 0; background: transparent; }

/* Umar, 25 Nov (L1): the floating Back button slides away while the page is scrolled down; on a phone the page ends with room for it, so it
   never sits on the last line. */
.gb-fab { transition: transform .22s ease, opacity .22s ease; }
.gb-fab.away { transform: translateY(96px); opacity: 0; pointer-events: none; }
@media (max-width: 899px) { body:has(.gb-fab:not([hidden])):not(:has(#main .chatview)):not(:has(#main .planframe)):not(:has(.savebar)) .page { padding-bottom: 84px; } }
@media (prefers-reduced-motion: reduce) { .gb-fab { transition: none; } }
/* Full check, 25 Nov: a file in a chat keeps its icon, name and size apart; the Back button never sits on a chat's own buttons (the paperclip on
   a computer; a phone had this already, R-5), the conversation has its own way back at the top. */
.bubble .b-file { display: flex; }
body:has(#main .chatview) .gb-fab { display: none; }
/* MM3 (Umar, 25 Nov, version B): the places that keep coming back, small links in the memory map's bar. */
.mm-cb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: .9rem; }
.mm-cb a { text-decoration: none; }
/* Full check, 25 Nov (X5): on a phone the book pages (Qaida, Tajweed) keep Zoom and View side by side, as the Mushaf does; the computer's
   columns for a book were squashing them on top of each other. */
@media (max-width: 599px) {
  .mstrip-e.is-book .ml-z, .mstrip-e.is-book .zseg { grid-column: 1 / 7; }
  .mstrip-e.is-book .ml-v, .mstrip-e.is-book .ms-v { grid-column: 7 / 13; }
}
/* W5 (Umar, 25 Nov, version B): the homework card's label on a phone. */
@media (max-width: 599px) { .hw-asked { display: none; } }
/* Z12 (Umar, 25 Nov): a Coaching learner's own goal on Today: its Juz in a row. */
.gb-cj { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; }
.gb-cjr { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--tx-2); }
.gb-cjr .gb-j { width: 14px; height: 22px; flex: none; }
/* Z3 (Umar, 25 Nov, pick 3 B): a group class's weekly time, on the teacher's class page. */
.cw { display: flex; flex-direction: column; gap: 4px; }
.cw .cw-t, .cw .cw-p { margin: 0; }
.cw .cw-b { margin-top: 8px; gap: 8px; }
.cw .cw-form { margin-top: 12px; gap: 12px; }
.cw .cw-f { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cw .cw-f > .field:first-child { grid-column: 1 / -1; }
/* Z4 (Umar, 25 Nov, pick 4 A): Change details, Pause the place, End the place in a learner's row on School. */
.pl-b { gap: 8px; }
.pl-s:empty { display: none; }
@media (max-width: 599px) { .grid2.pl-2 { grid-template-columns: minmax(0, 1fr); } .grid2.pl-2 input { width: 100%; min-width: 0; } }
/* Full check, 25 Nov: Print this file prints the file only, not the tabs and the way back. */
@media print { nav.subrow, #main .back { display: none !important; } }

/* Two-month goals (Y12, 25 Nov; version B of pick-G8): Today, and the learner's file. */
.tm a { text-decoration: none; color: inherit; }
.tm-main { display: flex; gap: 16px; align-items: center; }
.tm-ring { width: 92px; height: 92px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--ok) var(--p), var(--mute-bg) var(--p)); }
.tm-ring > span { width: 68px; height: 68px; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.tm-ring b { font: 800 1.25rem/1.05 var(--body); color: var(--tx); } .tm-ring small { font: 600 .7rem/1.2 var(--body); color: var(--tx-2); max-width: 58px; }
.tm-ring .ico { width: 20px; height: 20px; color: var(--tx-3); }
.tm-w { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.tm-t { font: var(--t-title); color: var(--tx); }
.tm-weeks { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; margin-top: 14px; }
.tm-k { height: 26px; border-radius: 7px; display: grid; place-items: center; font: 700 .74rem/1 var(--body); background: var(--mute-bg); color: var(--mute-tx); box-sizing: border-box; }
.tm-k.met { background: var(--ok); color: #fff; } .tm-k .ico { width: 14px; height: 14px; }
.tm-k.now { background: var(--card); border: 2px solid var(--ok); color: var(--ok-tx); }
.tm-k.past { border: 1px solid var(--line); } .tm-k.break { border: 1px dashed var(--mute); }
.tm-when { margin: 6px 0 10px; }
.tm-row { display: flex; justify-content: space-between; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.tm-row > b { font: var(--t-title); min-width: 0; } .tm-n { white-space: nowrap; flex: none; color: var(--tx-2); } .tm-n b { color: var(--tx); }
.tm-n.small { white-space: normal; text-align: right; max-width: 46%; flex: 0 1 auto; }
.tm-why { margin: 8px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.tm-form { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--plan-bg); color: var(--plan-tx); font-weight: 600; }
.tm-wk { display: flex; align-items: flex-end; gap: 10px; } .tm-wk .field { flex: 1; min-width: 0; }
.card.gb.tm, .tm { gap: 0; }
