/* Homework-link pages: one bright, friendly style for the home page, the builder, the dashboard and the student. */
@font-face { font-family: 'WajibHafs'; src: url('fonts/UthmanicHafs1Ver18.woff2') format('woff2'); font-display: swap; }
/* Cairo kept next to the page (SIL Open Font License), not fetched from Google: no outside request on a children's page */
@font-face { font-family: 'Cairo'; src: url('fonts/cairo-ar.woff2') format('woff2'); font-weight: 200 1000; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Cairo'; src: url('fonts/cairo-latext.woff2') format('woff2'); font-weight: 200 1000; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Cairo'; src: url('fonts/cairo-lat.woff2') format('woff2'); font-weight: 200 1000; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --blue: #2f6fde; --blue-2: #4f8cf7; --green: #22b07d; --amber: #ffb627; --pink: #ff5d8f; --purple: #8b5cf6; --teal: #14b8a6; --red: #e5484d;
  --bg: #f4f7fb; --card: #ffffff; --ink: #1b2437; --muted: #6b7690; --line: #e3e8f1; --soft: #eef3fb;
  --focus: #ffe58a; --playing: #fff6d6; --playing-line: #ffb627; --wa: #1fa855;
  --note: #e0457b; --note-bg: #ffe2ed; --note-ink: #8a1840;
  --shadow: 0 2px 4px rgba(27, 36, 55, .04), 0 8px 24px rgba(27, 36, 55, .07);
  --radius: 20px;
  --k-new: #22b07d; --k-near: #2f6fde; --k-far: #8b5cf6; --k-tilawa: #14b8a6; --k-listen: #64748b; --k-tajweed: #f97316; --k-custom: #6b7280;
  --hero-a: #2f6fde; --hero-b: #6a5cf0; --hero-c: #a855f7; --bar: #2f6fde; --bar-deep: #1e3a8a;
  --page-bg: #fffdf6; --page-line: #eadfc3;
  color-scheme: light;
}
/* The theme dots in the top bar. "joy" (purple and pink) is the default; "dark" is the night theme. */
:root[data-theme="joy"] {
  --bg: #fbf7ff; --line: #ecdffb; --soft: #f4ebff; --blue: #7c3aed; --blue-2: #c13df0; --radius: 22px;
  --hero-a: #8b3dff; --hero-b: #d63fd0; --hero-c: #ff4fa3; --bar: #7c3aed; --bar-deep: #4c1d95;
}
:root[data-theme="sunset"] {
  --bg: #fff8f1; --line: #fbe3cc; --soft: #ffefdf; --blue: #c2410c; --blue-2: #ea7a1a; --radius: 22px;
  --hero-a: #f97316; --hero-b: #f43f5e; --hero-c: #eab308; --bar: #c2410c; --bar-deep: #7c2d12;
}
:root[data-theme="green"] {
  --bg: #eef7f1; --ink: #16301f; --muted: #5d7a68; --line: #d6e9dc; --soft: #e3f2e8; --blue: #1f8a5b; --blue-2: #2fae74;
  --hero-a: #1f8a5b; --hero-b: #25a06a; --hero-c: #14b8a6; --bar: #1f8a5b; --bar-deep: #145c3c;
}
:root[data-theme="ocean"] {
  --bg: #eef8fd; --line: #d3e9f5; --soft: #e0f2fb; --blue: #0e8ac2; --blue-2: #19a7e0;
  --hero-a: #0e8ac2; --hero-b: #2f6fde; --hero-c: #14b8a6; --bar: #0e8ac2; --bar-deep: #0b4f73;
}
:root[data-theme="dark"] {
  --bg: #0d1424; --card: #151f33; --ink: #e9eef8; --muted: #9aa8c2; --line: #263552; --soft: #1b2842;
  --focus: #6b5410; --playing: #2a3420; --shadow: none; --blue: #5b8ff5; --page-bg: #161f31; --page-line: #2c3b5a; --bar: #1e3a8a;
  --note: #ff6f9f; --note-bg: rgba(255, 111, 159, .2); --note-ink: #ffc2d6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Cairo', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.6;
  background-image: radial-gradient(circle at 10% 0, color-mix(in srgb, var(--hero-a) 11%, transparent), transparent 40%), radial-gradient(circle at 95% 20%, color-mix(in srgb, var(--hero-c) 10%, transparent), transparent 35%);
  background-attachment: fixed;
}
body.sheet-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.center-msg { min-height: 50vh; display: grid; place-content: center; justify-items: center; text-align: center; padding: 24px 16px; color: var(--muted); gap: 6px; }
.center-msg.small-msg { min-height: 120px; }
.big-emoji { font-size: 3.4rem; line-height: 1.2; }
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; flex-wrap: wrap; }
.spinner { display: inline-block; width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--blue); animation: spin .8s linear infinite; }
.spinner.small { width: 22px; height: 22px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink) !important; text-decoration: none; font-weight: 800; font-size: 1.08rem; white-space: nowrap; min-width: 0; }
.brand svg { flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text small { font-size: .7rem; font-weight: 700; color: var(--muted); }
.brand svg { border-radius: 10px; box-shadow: 0 2px 8px rgba(47, 111, 222, .25); }
.topbar-end { display: flex; align-items: center; gap: 10px; flex: none; }
.theme-dots { display: flex; align-items: center; gap: 6px; }
.theme-dot {
  width: 22px; height: 22px; padding: 0; border-radius: 50%; cursor: pointer; flex: none;
  border: 2px solid var(--card); background: linear-gradient(135deg, var(--d1) 50%, var(--d2) 50%);
  box-shadow: 0 0 0 1px var(--line); transition: transform .15s, box-shadow .15s;
}
.theme-dot:hover { transform: scale(1.12); }
.theme-dot.on { box-shadow: 0 0 0 2px var(--ink); transform: scale(1.12); }
.flag-btn { display: flex; align-items: center; gap: 3px; height: 38px; padding: 0 8px; border: 0; border-radius: 12px; background: var(--soft); cursor: pointer; }
.flag-btn .caret { font-size: .7rem; color: var(--muted); }
.flag { display: block; width: 26px; height: 19px; object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); background: var(--line); }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.lang-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 700; cursor: pointer; text-align: start;
}
.lang-item:hover { border-color: var(--blue); }
.lang-item.on { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--card)); }
/* "More details" for teachers: a button that floats at the bottom corner of the page */
.fab-details {
  position: fixed; z-index: 30; bottom: calc(16px + env(safe-area-inset-bottom)); inset-inline-end: 16px;
  display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 10px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--hero-a), var(--hero-c)); color: #fff; font-weight: 800; font-size: .95rem;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--hero-a) 40%, transparent); transition: transform .15s;
}
.fab-details:hover { transform: translateY(-2px); }
/* while the teacher types in the form, the floating button steps aside (on a phone it sat over «إلى آية») */
main.builder:focus-within ~ .fab-details { opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .15s, transform .15s; }
.wrap.builder { padding-bottom: 96px; }
.editing-note { margin: 0 2px 12px; font-weight: 800; color: var(--blue); }
.tool.static { cursor: default; }

.wrap { max-width: 760px; margin: 0 auto; padding: 16px; }
.wrap.student { padding-bottom: 150px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin-bottom: 14px; box-shadow: var(--shadow); animation: rise .35s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
h1 { font-size: 1.5rem; margin: 0 0 4px; line-height: 1.35; font-weight: 800; }
h2 { font-size: 1.12rem; margin: 0 0 12px; font-weight: 800; }

/* fields */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; margin: 0 0 12px; min-width: 0; }
.grid .field { margin: 0; }
.field > span:first-child { font-size: .9rem; color: var(--muted); font-weight: 700; }
.field input, .field select, .field textarea, .search {
  width: 100%; min-width: 0; padding: 11px 13px; border: 2px solid var(--line); border-radius: 14px; background: var(--bg); transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, .search:focus { outline: none; border-color: var(--blue); background: var(--card); }
/* a clear ring on the field (or button) in use, for keyboard users above all */
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .search:focus-visible, .ai-box textarea:focus-visible,
button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 60%, transparent); outline-offset: 2px; }
.field .row select { flex: 1; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--blue); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 8px 16px;
  border-radius: 14px; border: 2px solid var(--line); background: var(--card); cursor: pointer; text-decoration: none; color: var(--ink); font-weight: 700;
  transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:hover { border-color: var(--blue); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: linear-gradient(135deg, var(--blue), var(--blue-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(47, 111, 222, .3); }
.btn.big { width: 100%; min-height: 58px; font-size: 1.15rem; border-radius: 18px; }
.btn.small { min-height: 38px; padding: 4px 12px; font-size: .92rem; }
.btn.soft { background: var(--soft); border-color: transparent; }
.btn.wa { background: linear-gradient(135deg, #1fa855, #28c76f); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(31, 168, 85, .28); }
.btn.danger { color: var(--red); }
.btn.done { background: var(--green); border-color: var(--green); color: #fff; }
.btn.start { background: linear-gradient(135deg, var(--green), #2fd39b); border: 0; color: #fff; box-shadow: 0 8px 20px rgba(34, 176, 125, .32); margin: 6px 0 12px; }
.btn.start svg { width: 26px; height: 26px; }
.btn.shine { position: relative; overflow: hidden; }
.btn.shine::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-120%); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 60%, 100% { transform: translateX(120%); } }
.ghost-btn { min-height: 46px; padding: 0 12px; }
.link { background: none; border: 0; padding: 6px 4px; color: var(--blue); cursor: pointer; font-weight: 700; text-decoration: none; }
.link:disabled { color: var(--muted); opacity: .45; cursor: default; }
.link.danger { color: var(--red); }
.link.strong { color: var(--green); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn.small { width: 46px; height: 46px; background: var(--blue); color: #fff; flex: none; border-radius: 14px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; cursor: pointer;
  font-size: .92rem; font-weight: 700; color: var(--ink); transition: transform .12s, background .15s;
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
[class*="kind-"] { --k: var(--k-custom); }
.kind-new { --k: var(--k-new); } .kind-near { --k: var(--k-near); } .kind-far { --k: var(--k-far); }
.kind-tilawa { --k: var(--k-tilawa); } .kind-listen { --k: var(--k-listen); } .kind-tajweed { --k: var(--k-tajweed); }
.chip[class*="kind-"] { color: var(--k); border-color: color-mix(in srgb, var(--k) 35%, transparent); }
.chip[class*="kind-"].on { background: var(--k); border-color: var(--k); color: #fff; }
.small-chips .chip { font-size: .82rem; padding: 2px 10px; cursor: default; }
.pill { display: inline-block; background: rgba(255, 255, 255, .22); border-radius: 999px; padding: 3px 12px; font-weight: 700; font-size: .9rem; }

/* home */
.hero { text-align: center; padding: 18px 8px 8px; }
.hero h1 { font-size: 1.75rem; }
.hero p { color: var(--muted); max-width: 520px; margin: 4px auto 0; }
.hero-art { display: flex; justify-content: center; gap: 14px; font-size: 2.3rem; margin-bottom: 6px; }
.hero-art span { animation: bob 2.6s ease-in-out infinite; }
.hero-art span:nth-child(2) { animation-delay: .3s; } .hero-art span:nth-child(3) { animation-delay: .6s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; margin: 18px 0; }
.choice {
  display: flex; align-items: center; gap: 14px; padding: 20px 18px; border-radius: 24px; text-decoration: none; color: #fff;
  box-shadow: var(--shadow); transition: transform .15s; animation: rise .4s ease-out both;
}
.choice:hover { transform: translateY(-3px); }
.choice.teacher { background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); }
.choice.student { background: linear-gradient(135deg, #22b07d, #14b8a6); animation-delay: .08s; }
.choice-icon { font-size: 2.6rem; background: rgba(255, 255, 255, .2); width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; flex: none; }
.choice b { display: block; font-size: 1.25rem; }
.choice small { display: block; opacity: .92; font-size: .95rem; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 10px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; font-weight: 700; font-size: .92rem; display: flex; align-items: center; gap: 8px; }
.feature span { font-size: 1.4rem; }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.mini-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--soft); text-decoration: none; color: var(--ink); }
.mini-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* progress ring */
.ring { --pct: 0; width: 74px; height: 74px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--amber) calc(var(--pct) * 1%), rgba(255, 255, 255, .25) 0); }
.ring span { width: 58px; height: 58px; border-radius: 50%; background: rgba(0, 0, 0, .12); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: .95rem; white-space: nowrap; direction: ltr; }
.ring.small { width: 46px; height: 46px; background: conic-gradient(var(--green) calc(var(--pct) * 1%), var(--line) 0); }
.ring.small span { width: 36px; height: 36px; background: var(--card); color: var(--ink); font-size: .78rem; }
.stars-count { font-weight: 800; background: rgba(255, 255, 255, .22); border-radius: 999px; padding: 2px 12px; }
.stars-count.small { background: var(--card); font-size: .9rem; }

/* dashboard */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { border-radius: 18px; padding: 12px; color: #fff; display: flex; flex-direction: column; align-items: center; text-align: center; }
.tile b { font-size: 1.8rem; line-height: 1.2; }
.tile span { font-size: .85rem; font-weight: 700; opacity: .95; }
.tile.blue { background: linear-gradient(135deg, #2f6fde, #4f8cf7); }
.tile.amber { background: linear-gradient(135deg, #f59e0b, #ffb627); }
.tile.green { background: linear-gradient(135deg, #22b07d, #2fd39b); }
.sent-list { display: grid; gap: 0; }
.sent-card .chips { margin: 8px 0; }
.status { border-radius: 999px; padding: 3px 12px; font-weight: 800; font-size: .85rem; white-space: nowrap; }
.status.done { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.status.listen { background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); }
.status.open { background: color-mix(in srgb, var(--amber) 22%, transparent); color: #b7791f; }
.status.wait, .status.na { background: var(--soft); color: var(--muted); }
.students { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.students li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; background: var(--soft); border-radius: 12px; padding: 8px 12px; }
.card-acts { display: flex; flex-wrap: wrap; gap: 0 8px; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 6px; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }

/* builder */
.page-head { display: flex; align-items: flex-start; gap: 12px; margin: 6px 0 16px; }
.page-head > div { flex: 1; }
.page-head p { margin: 0; }
.back { flex: none; width: 42px; height: 42px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; text-decoration: none; font-size: 1.3rem; color: var(--ink); }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.step-head h2 { margin: 0; }
.step-n { width: 32px; height: 32px; border-radius: 11px; background: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
section.step:not(.card) .step-head { margin: 22px 4px 12px; }
.profile-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; background: var(--soft); border-radius: 14px; padding: 10px 14px; }
.part-edit { border-top: 5px solid var(--k); }
.pe-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.pe-num { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--k); color: #fff; display: grid; place-items: center; font-weight: 800; }
.range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.surah-btn {
  flex: 1 1 230px; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--bg); cursor: pointer; text-align: start; margin-bottom: 12px;
}
.surah-btn:hover { border-color: var(--blue); }
.surah-btn span[lang="ar"] { font-weight: 800; font-size: 1.1rem; }
.surah-btn small { color: var(--muted); }
.surah-btn .caret { margin-inline-start: auto; color: var(--muted); }
.surah-no { min-width: 30px; height: 30px; padding: 0 4px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--blue); }
.range-nums { display: flex; gap: 10px; }
.range-nums .ayah-num { width: 92px; }
.range-end { flex: 1 1 100%; display: flex; flex-direction: column; }
.range-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin: -4px 0 10px; font-size: .92rem; }
.presets, .method { margin: 8px 0; }
.lbl { display: block; font-size: .9rem; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.chip.preset { font-size: .98rem; padding: 7px 14px; }
.method { background: var(--soft); border-radius: 16px; padding: 12px; }
.method p { margin: 6px 0 0; }
.steppers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 8px; margin-top: 10px; }
.stepper { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.stepper > span { font-size: .85rem; color: var(--muted); font-weight: 700; }
.stepper-ctl { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stepper-ctl button { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--soft); font-size: 1.35rem; font-weight: 800; cursor: pointer; color: var(--blue); }
.stepper-ctl output { font-weight: 800; font-size: 1.2rem; min-width: 2.4em; text-align: center; }
.pe-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 10px 0; }
.pe-sum .plan-sum { margin: 0; }
.pe-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.pe-tools .btn { flex: 1 1 auto; }
.custom { margin: 10px 0; padding: 10px; background: var(--soft); border-radius: 16px; }
.custom .mushaf.edit .ayah { background: var(--card); margin-bottom: 6px; border: 1px solid var(--line); }
.mini-editor { border: 2px solid var(--amber); border-radius: 14px; padding: 10px; margin: 6px 0; background: var(--card); animation: rise .2s ease-out; }
.mini-editor .row { gap: 8px; }
.pe-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; border-top: 1px solid var(--line); padding-top: 8px; }
.add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 18px; }
.add-row > span { font-weight: 800; }
.mode-switch { display: flex; background: var(--soft); border-radius: 14px; padding: 4px; gap: 4px; margin: 4px 0 10px; }
.mode-switch button { flex: 1; min-width: 0; border: 0; background: transparent; border-radius: 11px; padding: 8px 4px; font-weight: 700; cursor: pointer; color: var(--muted); font-size: .86rem; line-height: 1.3; }
.mode-switch button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.make .est { margin: 0 0 10px; font-weight: 700; color: var(--muted); text-align: center; }
/* "Listen now" and "Make the link" side by side (one under the other on phones) */
.make-hint { margin: 0 0 10px; font-weight: 700; color: var(--ink); text-align: center; }
.make-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.make-btns .btn.start { margin: 0; }
.result { margin-top: 14px; display: grid; gap: 10px; }
.result .ok { color: var(--green); font-weight: 800; font-size: 1.2rem; text-align: center; }
.link-box { display: flex; gap: 8px; }
.link-box input { flex: 1; min-width: 0; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; background: var(--bg); font-size: .9rem; }
.result .btns, .rec .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.result .btns .btn { flex: 1 1 140px; }
.pop-in { animation: popin .35s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes popin { from { opacity: 0; transform: scale(.92); } }
.qr { display: flex; justify-content: center; }
.qr img, .qr canvas { background: #fff; padding: 10px; border-radius: 14px; }

/* student */
.hero-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 18px; border-radius: 24px; margin-bottom: 14px;
  color: #fff; background: linear-gradient(135deg, var(--hero-a) 0%, var(--hero-b) 55%, var(--hero-c) 100%); box-shadow: 0 10px 28px rgba(79, 70, 229, .3); animation: rise .35s ease-out both;
}
.hero-card h1 { color: #fff; font-size: 1.45rem; }
.hero-card .from { margin: 0 0 6px; opacity: .95; font-weight: 600; }
.hero-text { min-width: 0; }
.hero-stats { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; }
.bubble { background: #fff7e0; border: 2px solid #ffe2a1; color: #5b4300; border-radius: 18px; padding: 12px 14px; margin: 0 0 14px; white-space: pre-line; position: relative; }
:root[data-theme="dark"] .bubble { background: #2b2614; border-color: #4d3f12; color: #f5e3b0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .bubble { background: #2b2614; border-color: #4d3f12; color: #f5e3b0; } }
.small-bubble { margin: 6px 0 8px; padding: 8px 12px; }
.name-ask label { font-weight: 800; display: block; margin-bottom: 8px; }
.name-ask input { flex: 1; min-width: 0; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; background: var(--bg); }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: thin; }
.tab { flex: none; display: flex; flex-direction: column; align-items: flex-start; padding: 8px 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); cursor: pointer; text-align: start; transition: transform .12s; }
.tab .tab-kind { font-weight: 800; color: var(--k); }
.tab .tab-range { font-size: .85rem; color: var(--muted); }
.tab.on { border-color: var(--k); background: color-mix(in srgb, var(--k) 10%, var(--card)); transform: translateY(-2px); }
.tab.done .tab-kind::after { content: ''; }
.part { border-top: 6px solid var(--k); }
.part-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.kind-badge { background: color-mix(in srgb, var(--k) 14%, transparent); color: var(--k); border-radius: 999px; padding: 4px 12px; font-weight: 800; }
.part h2 { font-size: 1.45rem; margin: 10px 0 0; }
.sub-ar { font-family: 'WajibHafs', serif; color: var(--muted); font-size: 1.1rem; }
.plan-sum { list-style: none; padding: 0; margin: 10px 0 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.plan-sum li { background: var(--soft); border-radius: 12px; padding: 3px 10px; font-size: .9rem; font-weight: 700; }
.reciter-pill { margin-bottom: 10px; }
/* the chosen reciter (opens the list) and the list itself: a coloured initial, the name, its style */
.rc-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 7px 12px; border-radius: 16px; cursor: pointer;
  border: 2px solid var(--line); background: var(--soft); color: var(--ink); text-align: start; transition: border-color .15s;
}
.rc-btn:hover { border-color: var(--blue); }
.rc-btn .caret { margin-inline-start: auto; color: var(--muted); }
.rc-av {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 1.05rem;
  background: linear-gradient(135deg, hsl(var(--h) 62% 52%), hsl(calc(var(--h) + 35) 62% 42%));
}
.rc-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.rc-text b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-text small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.rc-top { position: sticky; top: -8px; z-index: 2; background: var(--card); padding: 8px 0 6px; margin-top: -8px; }
.rc-top .search { position: static; margin-bottom: 8px; }
.rc-cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.rc-cats::-webkit-scrollbar { display: none; }
.rc-cats .chip { flex: none; white-space: nowrap; }
.rc-list { display: grid; gap: 2px; padding-top: 4px; }
.rc-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 14px 4px 4px; color: var(--ink); }
.rc-head b { font-size: 1rem; }
.rc-head small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.rc-head .rc-n { margin-inline-start: auto; color: var(--muted); font-size: .8rem; font-weight: 700; }
.rc-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 14px; background: transparent; cursor: pointer; text-align: start; color: var(--ink); }
.rc-row:hover { background: var(--soft); }
.rc-row.on { background: color-mix(in srgb, var(--blue) 12%, var(--card)); }
.rc-check { margin-inline-start: auto; color: var(--blue); font-weight: 900; font-size: 1.1rem; }
.rc-none { text-align: center; color: var(--muted); padding: 24px 8px; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.tool { border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 6px 10px; cursor: pointer; font-size: .9rem; font-weight: 700; color: var(--ink); }
.tool.on { background: #fff4d1; border-color: var(--amber); color: #5b4300; }
.tool-group { display: inline-flex; gap: 4px; }
.legend { background: var(--soft); border-radius: 14px; padding: 8px 12px; margin-bottom: 8px; }
.legend summary { cursor: pointer; font-weight: 700; }
.legend ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; font-size: .88rem; }
.legend .dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-inline-end: 6px; vertical-align: -2px; }
.part-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-top: 12px; }

/* Quran text */
.mushaf { --qfont: 32px; }
.surah-head { text-align: center; margin: 16px 0 4px; }
.surah-head span {
  display: inline-block; font-family: 'WajibHafs', serif; font-size: calc(var(--qfont) * .78); padding: 2px 28px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(47, 111, 222, .1), rgba(34, 176, 125, .12)); border: 2px solid rgba(47, 111, 222, .25);
}
.basmala { text-align: center; font-size: calc(var(--qfont) * .88); margin: 4px 0 8px; font-family: 'WajibHafs', serif; }
.basmala.indopak { font-family: 'wq-indopak', 'WajibHafs', serif; }
.ayah { padding: 6px 10px; border-radius: 16px; border: 2px solid transparent; transition: background .25s, border-color .25s; scroll-margin: 90px; }
.ayah + .ayah { margin-top: 2px; }
.ayah.extra { background: color-mix(in srgb, var(--amber) 9%, transparent); }
.ayah.playing { background: var(--playing); border-color: var(--playing-line); box-shadow: 0 4px 14px rgba(255, 182, 39, .25); }
.ar { font-size: var(--qfont); line-height: 2.1; margin: 0; text-align: right; color: var(--ink); }
.ar.hafs { font-family: 'WajibHafs', 'Amiri Quran', serif; }
.ar.indopak { font-family: 'wq-indopak', 'WajibHafs', serif; line-height: 2.4; }
.ar.glyph { line-height: 2.05; word-spacing: -.04em; }
.w { border-radius: 10px; padding: 0 1px; cursor: pointer; transition: background .15s; }
.w:hover { background: color-mix(in srgb, var(--amber) 22%, transparent); }
.w.focus { background: var(--focus); box-shadow: inset 0 -3px 0 var(--amber); }
.num { font-size: inherit; color: var(--blue); background: none; border: 0; padding: 0 2px; cursor: pointer; border-radius: 10px; font-family: inherit; line-height: 1; }
.ar.hafs .num, .ar.indopak .num { font-size: calc(var(--qfont) * .9); }
.num:hover { background: var(--soft); }
.ayah-note { font-size: .92rem; margin: 2px 0 4px; }
.badge { display: inline-block; background: var(--amber); color: #3b2d00; border-radius: 999px; padding: 0 9px; font-size: .85rem; font-weight: 800; font-family: 'Cairo', sans-serif; vertical-align: middle; }
.tr { color: var(--ink); opacity: .88; font-size: 1rem; line-height: 1.75; margin: 2px 0 6px; }
.tl { color: var(--muted); font-size: .95rem; font-style: italic; margin: 0 0 6px; text-align: left; }
.tl u { text-decoration-color: var(--amber); }
/* At night the tajweed page font (black letters, coloured rules) is turned light by a filter on its glyphs: the
   lightness is inverted and the hue turned back, so the rule colours keep their family (as in the teacher's mushaf).
   Never a CSS font palette on these colour fonts: it crashed Chrome (2026-11-01). The ayah-end medallion keeps its
   own colours (it is not inside .w). */
:root[data-theme="dark"] .mushaf .w .g[style*="wq-tajweed-"] { filter: invert(.88) hue-rotate(180deg) brightness(1.1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .mushaf .w .g[style*="wq-tajweed-"] { filter: invert(.88) hue-rotate(180deg) brightness(1.1); }
}
/* self-test: words hidden until tapped (the colour layers of the tajweed font are hidden too) */
.mushaf.test-hide .w:not(.shown) .g, .mushaf.test-first .w:not(.first):not(.shown) .g { opacity: 0; }
.mushaf.test-hide .w:not(.shown), .mushaf.test-first .w:not(.first):not(.shown) {
  background: linear-gradient(to bottom, transparent 64%, color-mix(in srgb, var(--muted) 45%, transparent) 64%, color-mix(in srgb, var(--muted) 45%, transparent) 70%, transparent 70%);
  box-shadow: none; border-radius: 0;
}
.w.shown { animation: popin .25s ease-out; }

/* finish + recording */
.finish { display: grid; gap: 12px; }
.rec { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rec.on { color: var(--red); font-weight: 800; }
.rec .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
.rec audio { width: 100%; }
.rec-btn { background: var(--soft); border-color: transparent; }
@keyframes blink { 50% { opacity: .2; } }
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; padding: 18px 8px; color: var(--muted); font-size: .92rem; text-align: center; }

/* the player at the bottom */
.player {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30; color: #fff;
  background: linear-gradient(135deg, var(--bar-deep), var(--bar)); padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0; box-shadow: 0 -8px 26px rgba(30, 58, 138, .3);
}
.pl-top { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 8px; }
.pl-info { flex: 1; min-width: 0; }
.pl-label { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-sub { font-size: .82rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Media buttons keep the usual order in every language: back on the left, next (▶|) on the right. */
.pl-ctrl { display: flex; align-items: center; gap: 2px; flex: none; direction: ltr; }
.pl-ctrl .icon-btn.main { width: 58px; height: 58px; background: var(--amber); color: #1b2437; box-shadow: 0 4px 14px rgba(255, 182, 39, .45); }
.pl-ctrl .icon-btn.main svg { width: 30px; height: 30px; }
.pl-ctrl .icon-btn.main.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(255, 182, 39, 0); transform: scale(1.04); } 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 182, 39, .5); } }
.pl-bar { max-width: 760px; margin: 6px auto 0; height: 5px; background: rgba(255, 255, 255, .22); border-radius: 5px; overflow: hidden; }
#pl-fill { height: 100%; width: 0; background: var(--amber); transition: width .3s; border-radius: 5px; }
[dir="rtl"] .pl-bar { transform: scaleX(-1); }
.turn { max-width: 760px; margin: 0 auto 8px; background: var(--amber); color: #1b2437; border-radius: 14px; padding: 8px 12px; font-weight: 800; text-align: center; font-size: 1.08rem; animation: popin .25s ease-out; }

/* bottom sheet */
#sheet-back { position: fixed; inset: 0; z-index: 40; background: rgba(10, 16, 30, .45); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
#sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 41; max-height: 86vh; overflow: auto; background: var(--card);
  border-radius: 24px 24px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .25); animation: up .22s ease-out;
}
#sheet.tall { height: 86vh; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-inner { max-width: 640px; margin: 0 auto; padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet-grip { width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: 4px auto 12px; }
.sheet-title { font-weight: 800; font-size: 1.15rem; margin-bottom: 10px; }
.sheet-label { font-weight: 700; color: var(--muted); margin: 10px 0 6px; font-size: .9rem; }
.sheet-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.sheet-btns .btn { flex: 1; }
#sheet .chips { margin-bottom: 8px; }
.word-big { font-size: 46px; text-align: center; line-height: 2; }
.word-big.hafs { font-family: 'WajibHafs', serif; }
.focus-note { background: #fff4d1; color: #5b4300; border-radius: 12px; padding: 8px 12px; margin: 6px 0; font-weight: 700; }
.word-info { text-align: center; min-height: 1.6em; }
.wi-tl { font-style: italic; color: var(--muted); }
.wi-tr { font-size: 1.2rem; font-weight: 800; }
.search { margin-bottom: 10px; position: sticky; top: 0; z-index: 1; }
.surah-list { display: grid; gap: 4px; }
.surah-row { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: start; }
.surah-row:hover, .surah-row.on { background: var(--soft); }
.surah-row .surah-ar { font-weight: 800; font-size: 1.1rem; }
.surah-row .surah-en { color: var(--muted); font-size: .9rem; }
.surah-row .surah-n { color: var(--muted); font-size: .8rem; }

/* celebration */
.celebrate { position: fixed; inset: 0; z-index: 80; background: rgba(10, 16, 30, .5); display: grid; place-items: center; animation: fade .2s; }
.celebrate canvas { position: absolute; inset: 0; pointer-events: none; }
.celebrate-card { position: relative; background: var(--card); border-radius: 28px; padding: 26px 24px; text-align: center; width: min(88vw, 360px); animation: popin .45s cubic-bezier(.2, 1.5, .4, 1); box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.celebrate-big { font-size: 4.2rem; line-height: 1.2; animation: bob 1.6s ease-in-out infinite; }
.celebrate-text { font-weight: 800; font-size: 1.2rem; margin: 6px 0 16px; }

#toast {
  position: fixed; inset-inline: 16px; bottom: 140px; z-index: 90; max-width: 520px; margin: 0 auto; text-align: center;
  background: #1b2437; color: #fff; padding: 12px 16px; border-radius: 16px; font-weight: 700;
  opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s; pointer-events: none;
}
#toast.show { opacity: 1; transform: none; }

@media (max-width: 400px) {
  .hero-card { padding: 16px 14px; }
  .hero-card h1 { font-size: 1.22rem; }
  .brand span { font-size: .98rem; }
  .theme-dots { gap: 4px; }
  .theme-dot { width: 19px; height: 19px; }
  .topbar { padding-inline: 12px; }
}
@media (max-width: 340px) {
  .brand span { display: none; }
}
@media (min-width: 700px) {
  h1 { font-size: 1.75rem; }
  .wrap { padding: 22px 20px; }
  .hero h1 { font-size: 2.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* the printed mushaf page (15 lines, fitted to the width) */
.mushaf.pages { padding: 2px 0; }
.mpage { background: var(--page-bg); border: 2px solid var(--page-line); border-radius: 16px; padding: 12px 12px 6px; margin: 10px auto; max-width: 600px; box-shadow: var(--shadow); }
.mpage-lines { --pf: 26px; direction: rtl; }
.mpage .ln { display: flex; justify-content: space-between; align-items: center; white-space: nowrap; font-size: var(--pf); line-height: 1.95; min-height: calc(var(--pf) * 1.95); }
.mpage .ln.center { justify-content: center; gap: .18em; }
.mpage .ln.head, .mpage .ln.bsm { justify-content: center; font-family: 'WajibHafs', serif; }
.mpage .ln.head span { font-size: .72em; padding: 0 1.6em; border-radius: 12px; border: 2px solid color-mix(in srgb, var(--blue) 35%, transparent); background: color-mix(in srgb, var(--blue) 8%, transparent); }
.mpage .ln.bsm { font-size: calc(var(--pf) * .82); }
.mpage-lines.measure .ln { width: max-content; justify-content: flex-start; }
.mpage .w, .mpage .num { padding: 0; border-radius: 6px; font-size: inherit; line-height: inherit; }
/* the drawn ayah-end medallion (readers whose digits are not Arabic): about the size of the printed one */
.medal {
  display: inline-grid; place-items: center; inline-size: 1.1em; block-size: 1.1em; vertical-align: middle; border-radius: 50%;
  background: #fffaf0; border: .06em solid #b08d2e; box-shadow: inset 0 0 0 .05em #fffaf0, inset 0 0 0 .09em #d9bd6a;
}
.medal b { font: 700 .4em/1 'Cairo', system-ui, sans-serif; color: #3b2f1e; letter-spacing: -.02em; }
.mpage .num .medal { margin: 0 .03em; }
.mpage .playing { background: var(--playing); box-shadow: inset 0 -3px 0 var(--playing-line); }
.mushaf.focus-dim .mpage .out { opacity: .28; }
.mushaf.focus-only .mpage .out { visibility: hidden; }
.mpage-no { text-align: center; font-size: .85rem; color: var(--muted); font-weight: 700; padding-top: 2px; }

/* The teacher's notes. A noted word has its own soft pink (never the yellow of the ayah being read, and both show at
   once: yellow behind, the pink line and number stay), a pink line under it and the note's small number above it. */
.nd {
  display: inline-grid; place-items: center; min-inline-size: 1.5em; block-size: 1.5em; padding: 0 .3em; border-radius: 999px;
  background: var(--note); color: #fff; font: 800 .78rem/1 'Cairo', system-ui, sans-serif; flex: none;
}
.w.note, .num.note { position: relative; -webkit-tap-highlight-color: transparent; }
.w.note { background: var(--note-bg); }
.w.note::after, .num.note::after {
  content: ''; position: absolute; inset-inline: 6%; bottom: .2em; block-size: max(2px, .085em); border-radius: 2px; background: var(--note); pointer-events: none;
}
.ar .w.note::after, .ar .num.note::after { bottom: -.05em; }
.w.note > .nd, .num.note > .nd {
  position: absolute; inset-block-start: .02em; inset-inline-start: -.12em; font-size: clamp(9px, .3em, 13px); pointer-events: none;
  box-shadow: 0 0 0 1.5px var(--page-bg);
}
.ar .w.note > .nd, .ar .num.note > .nd { inset-block-start: -.25em; }
.mpage .w.note.playing, .ayah .w.note.playing { background: var(--playing); }
.mpage .w.note.playing::after, .num.note.playing::after { block-size: max(3px, .11em); }
.note-flash { animation: noteflash 1.2s ease-in-out 2; }
@keyframes noteflash { 50% { background: color-mix(in srgb, var(--note) 38%, transparent); } }

.notes-card { border: 2px solid color-mix(in srgb, var(--note) 35%, transparent); background: color-mix(in srgb, var(--note-bg) 55%, var(--card)); border-radius: 16px; padding: 8px 10px; margin: 6px 0 10px; }
.notes-title { font-weight: 800; color: var(--note-ink); margin: 0 2px 4px; }
.notes-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.notes-list li { display: flex; align-items: center; gap: 6px; }
.note-row {
  flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 8px; text-align: start; cursor: pointer;
  border: 0; border-radius: 12px; background: var(--card); padding: 4px 10px; color: var(--ink); font-weight: 700;
}
.note-row:hover { background: color-mix(in srgb, var(--note-bg) 70%, var(--card)); }
.note-row .nw { font-family: 'WajibHafs', serif; font-size: 1.45rem; line-height: 1.5; font-weight: 400; flex: none; }
.note-row .na { color: var(--muted); font-size: .85rem; flex: none; }
.note-row .ntx { min-width: 0; overflow-wrap: anywhere; }
.note-play {
  flex: none; inline-size: 44px; block-size: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--card); color: var(--green);
}
.note-play svg { inline-size: 20px; block-size: 20px; }

.note-pop {
  position: absolute; z-index: 35; max-inline-size: min(320px, calc(100vw - 16px)); padding: 8px 12px; border-radius: 14px;
  background: var(--card); color: var(--ink); border: 2px solid var(--note); box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  font: 700 1rem/1.5 'Cairo', system-ui, sans-serif; animation: popin .22s ease-out; cursor: pointer;
}
.note-pop.auto { pointer-events: none; }
.np-row { display: flex; align-items: center; gap: 8px; }
.np-row + .np-row { margin-top: 4px; }
.np-arrow {
  position: absolute; left: calc(var(--ax, 50%) - 7px); bottom: -8px; inline-size: 12px; block-size: 12px;
  background: var(--card); border: 2px solid var(--note); border-top: 0; border-left: 0; transform: rotate(45deg);
}
.note-pop.below .np-arrow { bottom: auto; top: -8px; transform: rotate(225deg); }

/* the teacher's side: the same pages to tap, the ready-made notes in the sheet */
.notes-btn { inline-size: 100%; justify-content: center; margin-top: 4px; }
.notes-btn.on { border-color: var(--note); }
.custom.marks .mushaf.pages { padding: 0; }
.custom.marks .mpage { margin: 6px auto; }
.custom.marks .mpage .w.in, .custom.marks .mpage .num.in { cursor: pointer; }
.custom.marks .mpage .out { cursor: default; }
.custom.marks .notes-box:empty { display: none; }
.note-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.note-chips .chip { min-height: 40px; }
.note-chips .chip.on { background: var(--note); border-color: var(--note); color: #fff; }
.ayah-no { display: inline-block; font-size: .78rem; font-weight: 800; color: var(--blue); background: var(--soft); border-radius: 999px; padding: 0 10px; }
.views { margin-top: -4px; }

/* AI helper */
.ai-box { border-style: dashed; background: linear-gradient(135deg, color-mix(in srgb, var(--purple) 9%, var(--card)), var(--card)); }
.ai-box .row { align-items: stretch; margin-top: 8px; }
.ai-box textarea { flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: 14px; padding: 10px; background: var(--bg); resize: vertical; }
/* the short teacher form ("simple") and the switch to every option */
.builder-mode { margin: 0 0 14px; }
.builder-mode button { font-size: .98rem; padding: 10px 6px; }
.or-line { display: flex; align-items: center; gap: 10px; margin: -2px 4px 12px; color: var(--muted); font-weight: 700; font-size: .9rem; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.kind-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kind-pick button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 8px 4px;
  border-radius: 16px; border: 2px solid color-mix(in srgb, var(--k) 35%, var(--line)); background: var(--card); color: var(--k);
  font-weight: 800; font-size: .92rem; line-height: 1.25; text-align: center; cursor: pointer; overflow-wrap: anywhere; transition: transform .12s, background .15s;
}
.kind-pick button span { font-size: 1.35rem; line-height: 1; }
.kind-pick button:active { transform: scale(.96); }
.kind-pick button.on { background: var(--k); border-color: var(--k); color: #fff; }
.surah-field .range { gap: 10px; }
.surah-field .surah-btn { margin-bottom: 0; }
.surah-field .range-nums { flex: 1 1 200px; }
.surah-field .range-nums .ayah-num { flex: 1; width: auto; margin: 0; }
.simple-part .range-quick { margin: 0 0 12px; }
.more-hint { display: block; width: 100%; text-align: start; padding: 10px 2px 2px; border-top: 1px solid var(--line); margin-top: 4px; line-height: 1.5; }
.more-hint .muted { font-weight: 600; font-size: .88rem; }
.simple-note { background: color-mix(in srgb, var(--amber) 14%, var(--card)); border: 2px solid color-mix(in srgb, var(--amber) 45%, transparent); border-radius: 14px; padding: 10px 12px; }
.simple-note p { margin: 0 0 8px; font-weight: 700; }
.row.wrap { flex-wrap: wrap; }
@media (max-width: 560px) {
  .ai-main .row { flex-direction: column; }
  .ai-main .row .btn { width: 100%; }
}

/* the sheet after "I finished" */
.finish-sheet { text-align: center; }
.finish-sheet .field { text-align: start; margin-top: 10px; }
.finish-sheet .field input { flex: 1; min-width: 0; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; background: var(--bg); }
.rate-row { margin-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rate-row .lbl { font-weight: 700; color: var(--muted); font-size: .9rem; }
.rate-row .chips { justify-content: center; }
.invite { display: block; margin-top: 14px; font-size: .82rem; color: var(--muted); text-decoration: none; }

/* trying from memory, daily portions, the quiet privacy link */
.recall-btn { display: block; margin: 12px auto 0; font-size: 1rem; }
.mushaf .recall { background: var(--focus); box-shadow: inset 0 -3px 0 var(--amber); border-radius: 6px; }
.day-pill { background: var(--soft); color: inherit; margin-top: 6px; }
.steppers.days { grid-template-columns: minmax(0, 260px); }
.foot .fine { flex-basis: 100%; font-size: .72rem; color: var(--muted); opacity: .7; text-decoration: none; }

/* «رموز التجويد للأطفال» (js/kids.js): a small picture above a word's coloured letter, never on the letters. It sits
   in the word's box but outside the glyph (.g), so the night filter on the glyph does not turn its colour. */
.w.kt-w { position: relative; }
.kt { position: absolute; top: .06em; width: max(8px, .32em); height: max(8px, .32em); transform: translateX(50%); background: no-repeat center / contain; cursor: pointer; font-style: normal; }
.ayah .kt { top: -.05em; }
.kt::before { content: ''; position: absolute; inset: -6px; }
.kt.more::after { content: ''; position: absolute; top: -.05em; left: -.12em; width: 3px; height: 3px; border-radius: 50%; background: var(--ink); opacity: .55; }
.mushaf.test-hide .w:not(.shown) .kt, .mushaf.test-first .w:not(.first):not(.shown) .kt { visibility: hidden; }
:root[data-theme="dark"] .kt { filter: brightness(1.18) drop-shadow(0 0 .6px rgba(255, 255, 255, .9)); }
.kt-ic { display: inline-block; width: 22px; height: 22px; vertical-align: middle; background: no-repeat center / contain; font-style: normal; flex: none; }
#kt-pop { position: fixed; z-index: 90; width: min(300px, calc(100vw - 12px)); padding: 14px 14px 12px; border-radius: 20px; text-align: center;
  background: var(--card); color: var(--ink); border: 2px solid color-mix(in srgb, var(--blue) 35%, transparent); box-shadow: 0 10px 32px rgba(0, 0, 0, .3); }
#kt-pop[hidden] { display: none; }
#kt-pop .kt-big { width: 76px; height: 76px; margin: 0 auto 4px; padding: 8px; border-radius: 50%; background: color-mix(in srgb, var(--c) 12%, var(--card)); }
#kt-pop .kt-big .kt-ic { width: 60px; height: 60px; }
#kt-pop h3 { margin: 2px 0; font-size: 1.35rem; }
#kt-pop .kt-say { margin: 0; font-size: 1.12rem; font-weight: 700; line-height: 1.6; }
#kt-pop .kt-say2 { margin: 2px 0 0; font-size: .9rem; color: var(--muted); }
#kt-pop .kt-letters { margin: 6px 0 0; font-family: 'WajibHafs', serif; font-size: 1.3rem; letter-spacing: .08em; opacity: .85; }
#kt-pop .kt-others { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; margin-top: 8px; font-size: .8rem; }
#kt-pop .kt-others button { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 12px; border: 1px solid var(--line); background: none; color: inherit; font: inherit; cursor: pointer; }
#kt-pop .kt-others .kt-ic { width: 18px; height: 18px; }
#kt-pop .kt-row { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.kt-card { background: var(--soft); border-radius: 16px; padding: 10px 12px; margin-bottom: 8px; }
.kt-card-title { font-weight: 800; font-size: 1.05rem; }
.kt-card-row { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; padding: 8px 10px; border-radius: 14px; background: var(--card); }
.kt-card-sym .kt-ic { width: 40px; height: 40px; }
.kt-card-row .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kt-card-row b { font-size: 1.1rem; }
.kt-card-row small { color: var(--muted); }
.kt-play { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--blue); color: #fff; font-size: 1rem; cursor: pointer; }
.kt-choose .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kt-rule .kt-ic { width: 18px; height: 18px; margin-inline-end: 2px; }
.chip.kt-rule.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--card)); color: var(--ink); font-weight: 800; }
.kt-busy { color: #b35c00; }
