/* أهل القرآن — app styles. Same family as the Sufyan app (emerald / gold / Amiri), its own identity. */
@font-face { font-family: 'Amiri Quran'; src: url('/hifz/fonts/AmiriQuran-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
:root {
  --bg: #0b1611; --bg2: #0f1d16; --panel: #13251c; --panel2: #1a3226; --line: rgba(212,175,55,.2); --line2: rgba(255,255,255,.08);
  --gold: #d4af37; --gold2: #e8c84a; --text: #f0ece2; --mut: #9db3a5; --ok: #3fb27f; --weak: #e0714f; --strong: #e8c84a; --on-gold: #1a1405;
  --shadow: 0 6px 20px rgba(0,0,0,.35);
  --font: 'Amiri', 'Traditional Arabic', 'Segoe UI', Tahoma, serif; --arfont: 'Amiri', 'Traditional Arabic', 'Segoe UI', Tahoma, serif; --quran: 'Amiri Quran', 'Amiri', serif;
}
:root[data-theme="light"] {
  --bg: #f6f2e7; --bg2: #efe9d8; --panel: #ffffff; --panel2: #f1ecdc; --line: rgba(122,94,10,.28); --line2: rgba(0,0,0,.09);
  --gold: #8f6f0e; --gold2: #7a5e0a; --text: #1d2a22; --mut: #5d6e63; --ok: #1f8a5b; --weak: #c4532f; --strong: #a8820a; --on-gold: #fff;
  --shadow: 0 6px 18px rgba(0,0,0,.12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 18px; line-height: 1.6; min-height: 100vh; overflow-x: hidden; }
a { color: var(--gold2); }
button, select, input { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font); color: var(--gold2); margin: 0 0 .4em; line-height: 1.3; }
h2 { font-size: 1.45rem; } h3 { font-size: 1.2rem; } h4 { font-size: 1rem; margin-top: 1em; color: var(--mut); }
.mut { color: var(--mut); font-size: .92rem; margin: .2em 0 .8em; }
.ico { flex: none; }
:focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; }

#app { max-width: 680px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
#app.full { padding-bottom: 0; }
#app.full #tabs { display: none; }
#view { outline: none; }
.page { padding: 16px 16px 24px; padding-top: calc(16px + env(safe-area-inset-top)); }
#tabs { position: fixed; inset-inline: 0; bottom: 0; z-index: 20; display: flex; max-width: 680px; margin: 0 auto; background: var(--bg2); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px 7px; color: var(--mut); text-decoration: none; font-size: .82rem; min-height: 56px; }
#tabs a.on { color: var(--gold2); }
#tabs a.on svg { filter: drop-shadow(0 0 6px rgba(232,200,74,.45)); }
.boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg); z-index: 50; gap: 8px; }
.spin { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--gold2); border-radius: 50%; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* buttons, chips, fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px 20px; border: 1px solid var(--gold); border-radius: 12px; background: linear-gradient(180deg, var(--gold2), var(--gold)); color: var(--on-gold); font-weight: 700; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--gold2); }
.btn.danger { background: transparent; color: var(--weak); border-color: var(--weak); }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.sm { min-height: 38px; padding: 4px 12px; font-size: .95rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.4rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.wrap.scroll { max-height: 38vh; overflow-y: auto; padding: 2px; }
.chip { min-height: 40px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.chip.sm { min-height: 34px; padding: 2px 11px; font-size: .95rem; }
.chip.on { background: var(--gold); border-color: var(--gold2); color: var(--on-gold); font-weight: 700; }
.field { margin: 14px 0; }
.field > label { display: block; color: var(--mut); margin-bottom: 6px; font-size: .95rem; }
select, input[type=date] { width: 100%; min-height: 46px; padding: 6px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.row2 { display: flex; gap: 10px; } .row2 > * { flex: 1; min-width: 0; }
.row3 { display: flex; gap: 10px; } .row3 > * { flex: 1; min-width: 0; }
.gate-q { font-size: 1.25rem; text-align: center; margin: 10px 0 14px; }
.gate-opts { margin-bottom: 10px; } .gate-ans { font-size: 1.3rem; min-height: 52px; }
a.btn { text-decoration: none; text-align: center; }
.summary { margin: 16px 0 6px; padding: 12px 14px; border: 1px solid var(--line); background: linear-gradient(135deg, var(--panel), var(--panel2)); border-radius: 14px; }
.summary b { color: var(--gold2); }
.stepper { display: flex; align-items: center; gap: 16px; } .stepper output { min-width: 2em; text-align: center; font-size: 1.4rem; color: var(--gold2); }
.soon { font-style: normal; font-size: .72rem; background: var(--panel2); color: var(--gold2); padding: 0 8px; border-radius: 99px; border: 1px solid var(--line); }
.box { background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; padding: 14px 16px 16px; margin-bottom: 14px; }
.ph { margin-bottom: 14px; }

/* onboarding */
.onb { padding: 24px 16px 32px; padding-top: calc(24px + env(safe-area-inset-top)); position: relative; }
.onb h1 { font-size: 2.3rem; text-align: center; margin-bottom: 4px; }
.onb .lead { text-align: center; color: var(--mut); margin: 0 0 18px; }
.logo-mark { width: 84px; height: 84px; margin: 12px auto 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--gold2); border: 2px solid var(--gold); background: radial-gradient(circle, var(--panel2), var(--bg2)); }
.mode { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; padding: 14px 16px; margin-bottom: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.mode b { font-size: 1.25rem; color: var(--gold2); } .mode span { color: var(--mut); flex: 1; font-size: .95rem; }
.mode.on { border-color: var(--gold2); box-shadow: inset 0 0 0 1px var(--gold2); } .mode.off { opacity: .6; cursor: not-allowed; }
.onb .back { position: absolute; top: 20px; inset-inline-start: 12px; background: none; border: 0; color: var(--gold2); }

/* sheets, toast */
.sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .18s; }
.sheet-back.in { opacity: 1; }
.sheet { width: 100%; max-width: 680px; max-height: 88vh; overflow-y: auto; background: var(--bg2); border-top: 1px solid var(--gold); border-radius: 22px 22px 0 0; padding: 8px 18px calc(18px + env(safe-area-inset-bottom)); transform: translateY(24px); transition: transform .18s; }
.sheet-back.in .sheet { transform: none; }
.sheet.tall { max-height: 92vh; }
.grab { width: 44px; height: 4px; background: var(--line); border-radius: 4px; margin: 4px auto 12px; }
.toast { position: fixed; bottom: calc(90px + env(safe-area-inset-bottom)); inset-inline: 16px; margin: 0 auto; width: fit-content; max-width: 90vw; background: var(--panel2); border: 1px solid var(--gold); color: var(--text); padding: 10px 18px; border-radius: 12px; z-index: 80; opacity: 0; transform: translateY(10px); transition: all .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }
.cred { padding-inline-start: 18px; } .cred li { margin-bottom: 10px; }

/* today */
.hero { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line); background: radial-gradient(circle at 85% 0, var(--panel2), var(--panel) 60%); margin-bottom: 12px; }
.date-h { font-size: 1.55rem; color: var(--gold2); line-height: 1.3; } .date-g { color: var(--mut); font-size: .95rem; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding-block: 3px; padding-inline: 10px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg2); font-size: .92rem; }
.pill b { color: var(--gold2); font-size: 1.1rem; } .pill .ico { color: #f0a040; }
.ring .rt { fill: none; stroke: var(--line2); stroke-width: 3; } .ring .rp { fill: none; stroke: var(--gold2); stroke-width: 3; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 18px 18px; }
.dayline { color: var(--mut); margin: 6px 2px 10px; } .dayline b { color: var(--text); } .okc { color: var(--ok); font-weight: 700; }
.note { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); margin: 10px 0; }
.note.ok { border-color: var(--ok); } .note.rest { background: var(--panel2); }
.cards { display: flex; flex-direction: column; gap: 10px; }
.card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--text); position: relative; overflow: hidden; }
.card::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px; background: var(--gold); }
.card.c-connect::before { background: #5fa8d3; } .card.c-review::before { background: var(--ok); }
.card .badge { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--panel2); color: var(--gold2); flex: none; }
.card.done .badge { background: var(--ok); color: #fff; }
.card .ct { flex: 1; min-width: 0; display: flex; flex-direction: column; } .card .ct b { font-size: 1.25rem; color: var(--gold2); }
.card .rg { font-size: 1.1rem; overflow-wrap: anywhere; } .card small { color: var(--mut); }
.card .go { color: var(--gold2); } .card.empty { opacity: .55; } .card.done { border-color: var(--ok); }

/* session */
.sess { min-height: 100vh; padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.sbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: var(--bg); border-bottom: 1px solid var(--line2); }
.sbar .stt { min-width: 0; display: flex; flex-direction: column; } .sbar b { color: var(--gold2); font-size: 1.2rem; line-height: 1.2; } .sbar small { color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tools, .testbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 0; }
.pagebox { margin: 12px 12px 0; padding: 16px 14px 24px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); box-shadow: inset 0 0 0 4px var(--panel), inset 0 0 0 5px var(--line); }
.pagebox.small { margin: 8px 0; box-shadow: none; max-height: 40vh; overflow-y: auto; }
.mushaf { font-family: var(--quran); font-size: calc(1.75rem * var(--qs, 1)); line-height: 2.5; text-align: justify; margin: 0 0 6px; word-spacing: .05em; }
.v { border-radius: 8px; cursor: pointer; transition: background .2s; padding: 0 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.v.playing, .bsm.playing { background: rgba(232,200,74,.22); box-shadow: 0 0 0 2px rgba(232,200,74,.35); }
.vend { color: var(--gold2); font-size: .8em; white-space: nowrap; }
.sura-head { margin: 10px 0; text-align: center; font-family: var(--font); font-size: 1.5rem; color: var(--gold2); border: 1px solid var(--gold); border-radius: 10px; padding: 2px 8px; background: linear-gradient(90deg, transparent, rgba(212,175,55,.14), transparent); }
.sura-tag { text-align: center; color: var(--mut); font-size: .95rem; margin: 6px 0 0; }
.bsm { font-family: var(--quran); font-size: calc(1.6rem * var(--qs, 1)); text-align: center; color: var(--gold2); margin: 4px 0 6px; border-radius: 8px; line-height: 2.2; }
.pgmark { display: flex; align-items: center; gap: 10px; margin: 8px 0; color: var(--mut); font-size: .85rem; }
.pgmark::before, .pgmark::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.mushaf.withtaf { display: block; text-align: right; }
.taf { margin: 2px 0 14px; padding: 8px 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line2); font-family: var(--font); font-size: calc(1.05rem * var(--qs, 1)); line-height: 1.8; }
.taf summary { color: var(--gold2); cursor: pointer; } .taf .tb { color: var(--text); }
.credit { margin: 10px 14px 0; font-size: .82rem; color: var(--mut); text-align: center; }
.w { display: inline-block; cursor: pointer; border-bottom: 2px dotted var(--gold); margin: 0 1px; min-width: 1.1em; }
.w .f, .w .r { color: transparent; }
.pagebox.hint .w .f { color: inherit; }
.w.shown { border-bottom-color: transparent; } .w.shown .f, .w.shown .r { color: inherit; }
/* «سمّع»: words appear as they are recited */
.w.ok { border-bottom-color: transparent; transition: color .25s; } .w.ok .f, .w.ok .r { color: #8fe3a8; }
.w.miss { border-bottom-color: transparent; background: rgba(232,170,60,.16); border-radius: 6px; } .w.miss .f, .w.miss .r { color: #f0b45a; }
.w.next { border-bottom: 2px solid var(--gold2); }
.lsn { margin: 10px 14px 0; padding: 12px 14px; border-radius: 16px; background: var(--bg2); border: 1px solid var(--gold);
       display: flex; align-items: center; gap: 12px; font-family: var(--font); }
.lsn .dot { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #c0392b; color: #fff; }
.lsn.on .dot { animation: lsnpulse 1.4s ease-out infinite; }
@keyframes lsnpulse { 0% { box-shadow: 0 0 0 0 rgba(192,57,43,.6); } 100% { box-shadow: 0 0 0 16px rgba(192,57,43,0); } }
.lsn .tx { flex: 1; min-width: 0; line-height: 1.7; } .lsn .tx b { display: block; color: var(--gold2); } .lsn .tx small { color: var(--mut); }
.lsn .bar { height: 5px; border-radius: 5px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: 6px; } .lsn .bar i { display: block; height: 100%; background: #8fe3a8; width: 0; transition: width .4s; }
#listen.on { background: #c0392b; color: #fff; border-color: transparent; }
.mk { color: var(--mut); }
.pbar { position: fixed; bottom: 0; inset-inline: 0; max-width: 680px; margin: 0 auto; z-index: 15; background: var(--bg2); border-top: 1px solid var(--gold); padding: 8px 14px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(0,0,0,.35); }
.pstat { text-align: center; font-size: .92rem; color: var(--mut); min-height: 1.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 4px; }
.prow.acts { margin-top: 8px; gap: 10px; } .prow.acts .btn { flex: 1; }
.play { width: 62px; height: 62px; border-radius: 50%; border: 0; background: linear-gradient(180deg, var(--gold2), var(--gold)); color: var(--on-gold); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 14px rgba(212,175,55,.35); }
.rate { display: flex; gap: 8px; margin: 12px 0 4px; } .rate .btn { flex: 1; padding: 8px 4px; }
.r-ex { background: linear-gradient(180deg, #4cc690, #2c9a68); border-color: #2c9a68; color: #fff; } .r-gd { background: linear-gradient(180deg, var(--gold2), var(--gold)); }
.r-wk { background: linear-gradient(180deg, #ea8a68, #cf5f3c); border-color: #cf5f3c; color: #fff; }

/* week table (looks like the printed table of the halaqah) */
.page.wide { max-width: 1000px; margin: 0 auto; }
.tbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; } .tbar .wk { color: var(--gold2); font-size: 1.15rem; }
.tscroll { overflow-x: auto; display: flex; gap: 0; align-items: stretch; -webkit-overflow-scrolling: touch; border-radius: 6px; }
.wtable { border-collapse: collapse; background: #fff; color: #111; font-size: 15px; text-align: center; min-width: 560px; flex: 1; font-family: var(--font); }
.wtable th, .wtable td { border: 1.5px solid #222; padding: 4px 6px; }
.wtable .ttl { background: #2b5a1f; color: #fff; font-size: 1.35em; padding: 10px; }
.wtable th { background: #c5ddbd; font-weight: 700; } .wtable .g1 th { background: #d9ead3; } .wtable .gh { color: #b3201a; background: #d9ead3; }
.wtable td { background: #fde5d0; font-weight: 700; } .wtable td.dn { background: #fff; } .wtable td.dt { background: #fff; font-weight: 400; font-size: .85em; white-space: nowrap; }
.wtable td.sura { background: #d9ead3; color: #b3201a; white-space: nowrap; } .wtable td.nw { background: #fff1e0; } .wtable td.rv.sura { background: #fbe0c7; }
.wtable tr.rest td:not(.dn):not(.dt), .wtable tr.off td:not(.dn):not(.dt) { background: #f6b073; font-size: 1.1em; }
.wtable tr.off td:not(.dn):not(.dt) { background: #e4e4e4; color: #666; }
.wtable tr.today td.dn { background: #ffe58a; } .wtable tr.isdone td.dn { background: #dff3dc; }
.wtable td > div { line-height: 1.5; }
.weekno { background: #d9ead3; border: 1.5px solid #222; border-inline-end: 0; writing-mode: vertical-rl; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 8px; color: #b3201a; font-weight: 700; color: #b3201a; flex: none; }
.weekno b { writing-mode: horizontal-tb; color: #b3201a; font-size: 1.4em; }
.okc { color: var(--ok); }

/* progress */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.st { background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; padding: 10px; text-align: center; display: flex; flex-direction: column; }
.st b { font-size: 1.5rem; color: var(--gold2); line-height: 1.3; } .st span { color: var(--mut); font-size: .85rem; }
.st.big { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: center; gap: 16px; } .st.big > div { display: flex; flex-direction: column; text-align: start; }
.st.big b { font-size: 2rem; } .st.wide2 { grid-column: 1 / -1; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--mut); font-size: .85rem; margin: 6px 0 12px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-inline-end: 4px; border: 1px solid var(--line); }
.c-none { background: var(--bg2); } .c-part { background: rgba(63,178,127,.3); } .c-mem { background: #2c9a68; color: #fff; } .c-strong { background: var(--strong); color: #1a1405; } .c-weak { background: var(--weak); color: #fff; }
.juz { margin-bottom: 14px; } .juz h3 { font-size: 1.05rem; margin-bottom: 6px; } .juz h3 small { color: var(--mut); font-weight: 400; }
.jb { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; padding: 0 10px; border-radius: 99px; background: var(--gold); color: var(--on-gold); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 4px; }
.pc { height: 34px; border-radius: 7px; border: 1px solid var(--line2); font-size: .78rem; padding: 0; cursor: pointer; font-family: var(--font); color: var(--mut); }
.pc.c-none { color: var(--mut); }

/* celebration */
.celebrate { position: fixed; inset: 0; z-index: 90; background: rgba(5,12,8,.82); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.celebrate i { position: absolute; top: -10px; inset-inline-start: var(--x); width: 9px; height: 14px; background: var(--c); border-radius: 2px; animation: fall 2.6s var(--d) ease-in infinite; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); } }
.cbox { position: relative; background: var(--bg2); border: 1px solid var(--gold); border-radius: 22px; padding: 22px 28px; text-align: center; max-width: 320px; }
.cbox .big { width: 76px; height: 76px; margin: 0 auto 8px; border-radius: 50%; background: var(--ok); color: #fff; display: flex; align-items: center; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .celebrate i, .spin { animation: none; } * { transition: none !important; } }

/* print: the weekly table on A4 landscape */
@page { size: A4 landscape; margin: 10mm; }
@media print {
  html, body { background: #fff !important; }
  #tabs, .noprint, .toast, .sheet-back, .boot { display: none !important; }
  #app { max-width: none; padding: 0; }
  .page { padding: 0; max-width: none; }
  .tscroll { overflow: visible; }
  .wtable { min-width: 0; width: 100%; font-size: 13pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .wtable th, .wtable td, .weekno { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (min-width: 700px) { body { font-size: 19px; } .mushaf { font-size: calc(2.1rem * var(--qs, 1)); } }
@media (max-width: 380px) { .stats { grid-template-columns: repeat(2, 1fr); } .wtable { font-size: 13px; } }

[hidden] { display: none !important; }
#app.full ~ .toast { bottom: calc(185px + env(safe-area-inset-bottom)); }
@media (max-width: 520px) { .wtable { font-size: 13px; min-width: 500px; } .wtable th, .wtable td { padding: 3px 4px; } }

/* ---- English interface: LTR, Inter for the UI; the Quran text, sura calligraphy and tafsir text stay Arabic ---- */
html[lang="en"] { --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; }
html[lang="en"] body { font-size: 16px; line-height: 1.55; }
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3, html[lang="en"] h4 { font-weight: 650; letter-spacing: -.005em; }
html[lang="en"] h2 { font-size: 1.3rem; } html[lang="en"] h3 { font-size: 1.1rem; }
html[lang="en"] .onb h1 { font-size: 2rem; }
html[lang="en"] .date-h { font-size: 1.3rem; }
html[lang="en"] .hero { background: radial-gradient(circle at 15% 0, var(--panel2), var(--panel) 60%); }
html[lang="en"] .card .ct b { font-size: 1.1rem; }
html[lang="en"] .card .rg { font-size: 1rem; }
html[lang="en"] .mode b { font-size: 1.1rem; }
html[lang="en"] .tscroll { direction: ltr; }
@media (min-width: 700px) { html[lang="en"] body { font-size: 17px; } }
.term, .arname, .sura-head > span, .sura-tag span, .taf .tb, .bsm { font-family: var(--arfont); }
.term { font-weight: 400; font-size: .85em; color: var(--mut); margin-inline-start: 4px; }
.arname { font-size: 1.5rem; text-align: center; color: var(--gold2); margin: -4px 0 6px; line-height: 1.3; }
.mode.lg { justify-content: center; margin-bottom: 0; } .mode.lg b { font-size: 1.35rem; color: var(--text); }
.mode.lg.on b { color: var(--gold2); }
.langpick { display: flex; gap: 10px; margin-bottom: 14px; } .langpick .mode { flex: 1; width: auto; }
.sura-head { display: flex; flex-direction: column; align-items: center; }
.sura-head .sub { font-family: var(--font); font-size: .8rem; color: var(--mut); line-height: 1.3; padding-bottom: 3px; }
.taf .tb { text-align: start; }
html[lang="en"] .taf summary { font-size: .9rem; }
.tbar .btn .ico { vertical-align: middle; }
/* ---- halaqah (teacher dashboard, join flow) ---- */
.inp, textarea.inp { width: 100%; min-height: 46px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
textarea.inp { resize: vertical; font-family: inherit; }
.inp.code { font-size: 1.5rem; letter-spacing: .25em; text-align: center; text-transform: uppercase; font-family: 'Inter', ui-monospace, monospace; }
.ctr { text-align: center; }
.ferr { color: var(--weak); margin: 8px 0 0; font-size: .95rem; }
.btn.busy { opacity: .6; pointer-events: none; }
.note.warn { border-color: var(--weak); }
.note.warn .row2 { margin-top: 8px; }
.bigcode { margin: 14px auto; padding: 14px 10px; text-align: center; font-size: 2.6rem; letter-spacing: .3em; font-weight: 700; color: var(--gold2); font-family: 'Inter', ui-monospace, monospace; border: 2px dashed var(--gold); border-radius: 16px; background: var(--panel); user-select: all; }
.hcreated .logo-mark { color: var(--ok); border-color: var(--ok); }
.hchip { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; color: var(--gold2); font-size: .95rem; }
.hchip .mut { margin: 0; }
.hnote { border-color: var(--gold); background: linear-gradient(135deg, var(--panel), var(--panel2)); }
.hn-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hn-h b { color: var(--gold2); } .hn-h small { color: var(--mut); }
.hn-t { margin: 6px 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.hdash .hh { margin-bottom: 0; overflow-wrap: anywhere; } .hh-n { margin-top: 0; }
.hcode { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.codebox small { display: block; color: var(--mut); font-size: .85rem; line-height: 1.2; }
.codebox b { font-size: 1.7rem; letter-spacing: .2em; color: var(--gold2); font-family: 'Inter', ui-monospace, monospace; }
.hcb { display: flex; gap: 8px; }
.hnet { margin: 4px 0 8px; } .hnet .note { margin: 0; }
.hscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hgrid { border-collapse: collapse; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font-size: .9rem; text-align: center; }
.hgrid th, .hgrid td { border: 1px solid var(--line2); padding: 4px 3px; vertical-align: middle; }
.hgrid thead th { background: var(--panel2); color: var(--gold2); font-weight: 700; white-space: nowrap; font-size: .85rem; }
.hgrid thead th small { display: block; color: var(--mut); font-weight: 400; font-size: .75rem; }
.hgrid .hn { text-align: start; min-width: 124px; max-width: 170px; padding: 6px 8px; font-weight: 400; background: var(--panel); position: sticky; inset-inline-start: 0; z-index: 1; }
.hgrid .hn small { display: block; color: var(--mut); font-size: .76rem; line-height: 1.3; }
.hname { background: none; border: 0; padding: 0; color: var(--text); font-weight: 700; font-size: 1rem; text-align: start; cursor: pointer; text-decoration: underline dotted var(--gold); text-underline-offset: 4px; overflow-wrap: anywhere; min-height: 32px; }
.ovb { font-style: normal; color: var(--gold2); vertical-align: middle; }
.hc { min-width: 46px; } .hc > span:first-child { display: block; font-size: 1.15rem; font-weight: 700; line-height: 1.1; } .hc small { display: block; font-size: .68rem; line-height: 1.2; }
.hc.done { background: rgba(63,178,127,.22); color: var(--ok); }
.hc.part { background: rgba(232,200,74,.18); color: var(--gold2); }
.hc.miss { background: rgba(224,113,79,.2); color: var(--weak); }
.hc.future, .hc.none { color: var(--mut); }
.hlegend { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 10px 0 14px; font-size: .85rem; }
.hlegend .hc { min-width: 0; display: inline-flex; gap: 4px; align-items: center; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line2); }
.hlegend .hc > span:first-child { display: inline; font-size: 1rem; }
.hnl { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line2); overflow-wrap: anywhere; }
.hacts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .hacts .btn { padding: 8px 10px; font-size: .95rem; }
.hst { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.hs { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 8px 4px; text-align: center; }
.hs b { display: block; font-size: 1.4rem; color: var(--gold2); } .hs span { font-size: .8rem; color: var(--mut); }
.weakl { margin: 4px 0 8px; padding-inline-start: 20px; } .weakl li { margin: 2px 0; }
.hrow { align-items: center; } .hrow .btn { flex: none; } .hrow2 { margin-top: 12px; }
.printonly { display: none; }
body:not(.is-teacher) #tabs [data-r="teacher"] { display: none; }
body.is-teacher:not(.teacher-solo) #tabs [data-r="today"], body.is-teacher:not(.teacher-solo) #tabs [data-r="table"], body.is-teacher:not(.teacher-solo) #tabs [data-r="progress"] { display: none; }
@media print {
  .printonly { display: block; font-size: 16pt; font-weight: 700; margin: 0 0 6px; color: #111; }
  .hdash .hh, .hh-n { color: #111; }
  .hgrid { background: #fff; color: #111; font-size: 11pt; border: 1.5px solid #222; }
  .hgrid th, .hgrid td { border: 1.5px solid #222; background: #fff; color: #111; position: static; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .hgrid thead th, .hgrid thead th small, .hgrid .hn small { color: #111; }
  .hname { color: #111; text-decoration: none; }
  .hc.done { background: #d9f0e2 !important; } .hc.part { background: #fff3c4 !important; } .hc.miss { background: #f9d6cb !important; }
  .hscroll { overflow: visible; }
}
html[lang="en"] .inp.code { letter-spacing: .2em; }
.hdash .tbar { flex-wrap: wrap; } .hdash .tbar .wk { text-align: center; font-size: 1.05rem; } .hdash .tbar .wk small { display: block; font-size: .8rem; color: var(--mut); font-weight: 400; }
@media (max-width: 480px) { .hdash .tbar .wk { flex: 1 1 100%; order: -1; } }
.hsl span { white-space: nowrap; } .hsl span:not(:last-child)::after { content: ' ·'; margin-inline-end: .35em; }

/* C2: review amount, text size, reminder, certificate */
.stepper.sm { gap: 10px; } .stepper.sm output { font-size: 1.15rem; min-width: 2em; }
.revcus { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.stline { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cyc { margin: 8px 4px 0; font-size: .85rem; color: var(--mut); }
.fsz { margin-inline-start: auto; display: flex; gap: 6px; flex: none; } .fsz .icon { min-width: 44px; font-size: .95rem; font-family: var(--font); }
.fsz .icon:disabled { opacity: .35; }
.qprev { text-align: center; margin: 10px 0 0; }
.remrow { display: flex; align-items: center; gap: 14px; } .remrow input[type=time] { flex: 1; min-height: 46px; padding: 6px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.sw { position: relative; flex: none; width: 56px; height: 32px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; padding: 0; }
.sw i { position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--mut); transition: inset-inline-start .15s, background .15s; }
.sw.on { background: var(--ok); border-color: var(--ok); } .sw.on i { inset-inline-start: 27px; background: #fff; }
button.jb.cert { border: 0; cursor: pointer; font: inherit; font-size: .8rem; margin-inline-start: 4px; background: linear-gradient(135deg, var(--gold2), var(--gold)); }
.certbox { margin: 10px 0 12px; } .certcv { display: block; width: 100%; height: auto; max-width: 440px; margin: 0 auto; border-radius: 10px; box-shadow: var(--shadow); }#pf-revtxt { margin-bottom: 1rem; }
/* offline downloads (Android app only; the markup is only produced when window.HifzNative.downloads exists) */
.dlrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; } .dlused { flex: 1; min-width: 0; }
.dlind { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; padding: 8px 12px; border: 1px solid var(--line2); border-radius: 12px; background: var(--panel); font-size: .9rem; color: var(--mut); }
.dlind[hidden] { display: none; } .dlind.run { border-color: var(--line); }
.dlbar { flex: 1 1 120px; min-width: 90px; height: 8px; border-radius: 99px; background: var(--bg2); overflow: hidden; } .dlbar i { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .2s; }
.dlprog { margin: 0 0 12px; }
.dpchk { display: flex; align-items: center; gap: 10px; margin: 8px 0; } .dpchk input { width: 20px; height: 20px; accent-color: var(--gold); }
select.inp { appearance: auto; }