/* Hassanates : lecteur du Coran, correcteur de récitation, mémorisation, progrès.
   S'appuie sur identite.css (jetons) et app.css (coquille). Préfixes : qr- lecteur, qa- audio,
   rc- réciter, mz- mémorisation, pg- progrès. */
:root {
  --qr-size: 2rem;
  --ink-quran: var(--c-text);
  --st-correct: var(--c-ok);
  --st-wrong: var(--c-mistake);
  --st-skipped: var(--c-skip);
  --st-corrected: var(--c-fixed);
  --paper: var(--c-surface);
  --paper-edge: var(--c-line);
  --qr-ink: #0e1210; --qr-night: #06080a; /* constants : ne suivent pas le thème */
}

.qr-loading { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 48px 0; color: var(--c-muted); }
.qr-spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--c-border); border-top-color: var(--c-text); animation: qr-spin .9s linear infinite; }
@keyframes qr-spin { to { transform: rotate(360deg); } }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; min-height: 44px; padding: 8px 0; cursor: pointer; }
.check input { margin-top: 3px; flex: none; }
.lbl { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.empty { text-align: center; color: var(--c-muted); padding: 24px 12px; }

/* Segments à boutons radio (en plus des .seg à boutons d'app.css) */
.seg label { display: grid; place-items: center; min-height: 40px; margin: 0; border-radius: var(--r-pill); font-weight: 600; font-size: .88rem; cursor: pointer; position: relative; text-align: center; padding: 0 8px; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--c-solid); color: var(--c-on-solid); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--c-text); }
.seg label:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.seg button[aria-selected="true"] { background: var(--c-solid); color: var(--c-on-solid); }

/* ================= Sommaire ================= */
.qr-index { display: grid; grid-template-columns: minmax(0, 1fr); }
.qr-index [hidden] { display: none; }
.qr-resume { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; width: calc(100% + 2 * var(--gutter)); margin-inline: calc(-1 * var(--gutter)); min-height: 152px; padding: 22px var(--gutter) 26px; border: 0; overflow: hidden; background: var(--qr-ink); color: #ecf0ec; font: inherit; text-align: left; cursor: pointer; transition: transform .3s var(--spring); }
.qr-resume:active { transform: scale(.985); }
.qr-resume-text { display: grid; gap: 2px; flex: 1 1 11ch; min-width: 0; }
.qr-resume-verb { color: var(--brand); font: 700 1rem/1.2 var(--f-title); }
.qr-resume b { font: 800 clamp(2rem, 9vw, 2.6rem)/1.05 var(--f-title); letter-spacing: -.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-resume small { color: #a8b2ab; font-size: .92rem; }
.qr-resume-ar { flex: none; max-width: 100%; margin-inline-start: auto; font-size: clamp(2.2rem, 11vw, 3rem); line-height: 1.5; white-space: nowrap; }
.qr-resume-bar { position: absolute; inset: auto 0 0; height: 3px; background: rgb(236 240 236 / .14); }
.qr-resume-bar i, .qr-plan-bar i { display: block; height: 100%; background: var(--brand); }
@media (min-width: 712px) { .qr-resume { width: 100%; margin-inline: 0; border-radius: var(--r-lg); padding-inline: 24px; } }
.qr-plan { position: relative; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 0; color: inherit; text-decoration: none; border-bottom: 1px solid var(--c-line); }
.qr-plan .grow { flex: 1; min-width: 0; }
.qr-plan b { display: block; font: 700 1.05rem/1.25 var(--f-title); }
.qr-plan small { display: block; color: var(--c-muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-plan .ico { color: var(--c-muted); }
.qr-plan-bar { position: absolute; inset: auto 0 -1px; height: 2px; }
.qr-plan-bar i { background: var(--mark); }
.qr-bar { display: flex; align-items: center; gap: 2px; margin-top: var(--sp-bloc); border-bottom: 1px solid var(--c-line); }
.qr-tabs { flex: 1; min-width: 0; display: flex; gap: 16px; }
.qr-tabs button { position: relative; min-height: 46px; padding: 0; border: 0; background: none; color: var(--c-muted); font: 600 .95rem/1 var(--f-title); cursor: pointer; }
.qr-tabs button[aria-selected="true"] { color: var(--c-text); box-shadow: inset 0 -3px 0 var(--mark); }
.qr-icon { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-md); background: none; color: var(--c-text); cursor: pointer; }
.qr-icon:active { background: var(--c-surface-2); }
.qr-find { display: flex; align-items: center; gap: 4px; margin-top: var(--sp-bloc); }
.qr-find input { flex: 1; min-width: 0; }
.qr-item { width: 100%; min-height: 60px; padding: 8px 0; background: none; border: 0; border-bottom: 1px solid var(--c-border); font: inherit; color: inherit; text-align: left; cursor: pointer; gap: 10px; }
.list li:last-child .qr-item { border-bottom: 0; }
.qr-item .grow small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .84rem; }
.qr-num { width: 30px; flex: none; display: grid; place-items: center; font: 600 .95rem var(--f-moment); color: var(--c-muted); font-variant-numeric: tabular-nums; }
.qr-item:hover .qr-num { color: var(--c-text); }
.qr-item-ar { font-size: 1.35rem; line-height: 1.6; color: var(--c-text); white-space: nowrap; }

/* ================= Lecture immersive =================
   Rien ne s'anime sur le texte du Coran : surlignages francs, sans transition. */
.app-body.qr-reading, .app-body.rc-focus { --tabbar-h: 0px; --rail-w: 0px; padding-top: var(--safe-t); padding-bottom: 0; }
.qr-reading .app-top, .qr-reading .app-tabs, .qr-reading .app-head, .rc-focus .app-top, .rc-focus .app-tabs, .rc-focus .app-head { display: none; }
.qr-reading .app-main { width: min(100% - 2 * var(--gutter), 1100px); }
.app-main > .qr-reader, .app-main > .rc-session { animation: none; }
.qr-reader { --qr-line: 2.35; display: grid; padding-top: 52px; }
.qr-progress { position: fixed; z-index: 21; inset: var(--safe-t) 0 auto; height: 2px; pointer-events: none; }
.qr-progress i { display: block; height: 100%; background: var(--mark); transform: scaleX(0); transform-origin: right; }
.qr-top { position: fixed; z-index: 20; inset: var(--safe-t) 0 auto; height: 52px; display: flex; align-items: center; gap: 4px; padding: 0 6px; background: var(--c-bg); transition: transform .28s var(--ease), visibility .28s; }
.qr-top-title { flex: 1; min-width: 0; text-align: center; font: 700 1rem/1 var(--f-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-immersed .qr-top { transform: translateY(-110%); visibility: hidden; }
.qr-tool { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 10px; border: 0; border-radius: var(--r-md); background: none; color: var(--c-text); font: 700 .95rem var(--f-body); cursor: pointer; }
.qr-tool[aria-pressed="true"] { background: var(--c-solid); color: var(--c-on-solid); }
.qr-seg { min-width: 0; }
.qr-seg button { padding: 0 6px; }
.qr-display .qr-sheet-body { display: grid; gap: var(--sp-voisin); }
.qr-display-row { display: flex; gap: 6px; }
.qr-display-row .qr-tool { background: var(--c-surface-2); }
.qr-display-row [data-tr] { flex: 1; }
.qr-display-row [data-tr][aria-pressed="true"] { background: var(--c-solid); }
.qr-content { cursor: default; }
.qr-reader[data-view="surah"] .qr-content { width: min(100%, 46rem); margin-inline: auto; }
.qr-content:focus:not(:focus-visible) { outline: none; }
.qr-content .quran { font-size: var(--qr-size); line-height: var(--qr-line); color: var(--ink-quran); text-align: justify; text-align-last: center; margin: 0; }
.qr-flow { padding: 0 2px; }
.qr-surah-head { text-align: center; margin: 2px 0 0; }
.qr-surah-frame { margin: 0 auto; }
.qr-surah-ar { font-family: var(--f-quran); font-size: 1.3rem; line-height: 1.8; color: var(--c-muted); }
.qr-basmala { text-align: center !important; text-align-last: center !important; margin: 0 !important; font-size: calc(var(--qr-size) * .86) !important; }
.qr-ayah { border-radius: 6px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.qr-ayah.is-playing { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.qr-ayah.is-target { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.qr-ayah.is-bookmarked .qr-mark { color: var(--accent-fg); }
.qw { border-radius: 6px; }
.qw.is-on { background: var(--accent); color: var(--on-accent); }
.qr-mark { font: inherit; font-family: var(--f-quran); color: var(--c-muted); background: none; border: 0; padding: 0 2px; cursor: pointer; min-width: 32px; line-height: 1; border-radius: 50%; }
.qr-mark:hover { color: var(--c-text); }
.qr-block { padding: 10px 0 14px; border-bottom: 1px solid var(--c-line); }
.qr-block-ar { text-align: right !important; text-align-last: auto !important; }
.qr-tr { margin: 6px 0 0; font-size: 1rem; line-height: 1.6; }
.qr-spread { display: grid; gap: 16px; }
.qr-spread.is-double { grid-template-columns: 1fr 1fr; direction: rtl; }
.qr-spread.is-double > * { direction: ltr; }
.qr-page { background: var(--paper); border-radius: var(--r-lg); padding: 14px clamp(10px, 3vw, 26px) 10px; }
.qr-page-top { display: flex; justify-content: space-between; font-size: .8125rem; color: var(--c-muted); padding: 4px 6px 8px; border-bottom: 1px solid var(--c-line); }
.qr-page-num { text-align: center; font-family: var(--f-ar); color: var(--c-muted); padding-top: 6px; border-top: 1px solid var(--c-line); margin-top: 8px; }
.qr-pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qr-pager-label { font-size: .85rem; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.qr-reader[data-view="page"] .qr-pager { padding: 12px 0 96px; }
.qr-sheet { border: 0; padding: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; width: min(100%, 560px); max-height: 85dvh; margin: auto auto 0; background: var(--c-surface); color: var(--c-text); }

.qr-sheet[open] { animation: sheet-up .3s var(--ease); }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.qr-sheet-body { padding: 30px 18px calc(16px + var(--safe-b, 0px)); }
.qr-sheet-body h2 { font-size: 1.2rem; }
.qr-sheet-ar { font-size: 1.6rem; line-height: 2.1; max-height: 30dvh; overflow: auto; }
.qr-sheet-actions { display: grid; gap: 8px; }

.qr-sheet-actions .btn { width: 100%; }
/* Fin de sourate : après le texte, jamais dessus ; le bas de la page tombe dans la nuit. */
.qr-end { width: 100vw; margin: 28px 0 0 calc(50% - 50vw); color: #ecf0ec; }
.qr-end-fall { height: 34vh; background: linear-gradient(180deg, var(--c-bg), var(--qr-night)); }
.qr-end-body { min-height: 66dvh; display: grid; justify-items: center; align-content: start; gap: 4px; padding: 0 var(--gutter) calc(96px + var(--safe-b)); background: var(--qr-night); text-align: center; }
.qr-end-ar { margin: 0; font: 700 clamp(3.2rem, 17vw, 5rem)/1.3 var(--f-kufi); }
.app-main .qr-end-name { margin: 0; font: var(--t-normal); color: inherit; }
.qr-end-time { margin: 6px 0 0; min-height: 1.5em; color: #a8b2ab; }
.qr-end .btn-gold { width: min(100%, 340px); margin-top: var(--sp-partie); }
.qr-end-prev { min-height: 44px; margin-top: 6px; border: 0; background: none; color: #a8b2ab; font: 600 .92rem var(--f-body); cursor: pointer; display: inline-flex; align-items: center; }
.qr-end :focus-visible { outline-color: #ecf0ec; }
.is-khatm .qr-end-ar { font-size: clamp(2.6rem, 13vw, 4rem); }

/* Barre audio : sombre, neutre, posée en bas ; elle s'efface avec le reste */
.qr-audio { position: fixed; z-index: 20; inset: auto var(--gutter) calc(var(--safe-b) + 10px); max-width: 560px; margin-inline: auto; transition: transform .28s var(--ease), visibility .28s; }
.is-immersed .qr-audio { transform: translateY(calc(100% + 20px)); visibility: hidden; }
.qa-bar { background: var(--qr-ink); color: #ecf0ec; border-radius: var(--r-lg); padding: 4px 6px; box-shadow: 0 0 0 1px rgb(236 240 236 / .1);
  --c-text: #ecf0ec; --c-muted: #a8b2ab; --c-field: #1c211e; --c-surface: #131715; --c-surface-2: #1c211e; --c-line: rgb(236 240 236 / .14); --c-border: rgb(236 240 236 / .14); --c-line-strong: rgb(236 240 236 / .46);
  --c-solid: #ecf0ec; --c-on-solid: #0e1210; --accent-fg: var(--brand); --brand-fg: var(--brand); color-scheme: dark; }
.qa-main { display: flex; align-items: center; gap: 2px; }
.qa-btn, .qa-play { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: var(--r-md); border: 0; background: transparent; color: var(--c-text); font-size: 1.3rem; cursor: pointer; }
.qa-play { background: var(--accent); color: var(--on-accent); font-size: 1rem; transition: transform .15s; }
.qa-play:active { transform: scale(.94); }
.qa-now { flex: 1; min-width: 0; padding-left: 6px; font-size: .85rem; color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-opts { padding: 8px 6px 4px; border-top: 1px solid var(--c-border); margin-top: 6px; max-height: 60dvh; overflow: auto; }
.qa-row { flex-wrap: nowrap; align-items: flex-end; }
.qa-row .field { flex: 1; min-width: 0; margin-bottom: 8px; }
.qa-range { border: 1px solid var(--c-border); border-radius: var(--r-md); padding: 8px 10px 10px; margin: 6px 0; }
.qa-range legend { font-weight: 600; font-size: .9rem; padding: 0 4px; }

/* ================= Réciter ================= */
.rc-results, .rc-search { display: grid; gap: 16px; }
.rc-setup { display: grid; gap: var(--sp-bloc); padding-top: var(--sp-voisin); }
.rc-next { text-align: center; min-height: 236px; align-content: center; display: grid; }
.rc-next-ar { margin: 0; font-size: clamp(3rem, 15vw, 4.4rem); line-height: 1.5; text-align: center; }
.rc-next-line { margin: 0; font-size: 1.3rem; line-height: 2; color: var(--c-muted); text-align: center; text-wrap: balance; }
.rc-next-place { margin: 10px 0 0; font-weight: 600; }
.rc-go { width: 100%; min-height: 64px; font-size: 1.15rem; }
.rc-more { display: grid; justify-items: center; }
.rc-more .link-btn { color: var(--c-text); text-decoration: none; }
.rc-fallback { margin: 0; padding-left: 12px; font-size: .92rem; box-shadow: inset 3px 0 0 var(--c-warn); }
.rc-sheet { width: min(100%, 640px); max-height: 92dvh; }
.rc-fs { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.rc-fs legend { font-family: var(--f-title); font-size: 1.15rem; margin-bottom: 8px; padding: 0; }
.rc-range { flex-wrap: nowrap; }
.rc-range .field { flex: 1; min-width: 0; }
.rc-modes { display: grid; gap: 8px; }
.rc-mode { display: flex; gap: 12px; align-items: flex-start; padding: 14px; margin: 0; border: 2px solid transparent; background: var(--c-surface-2); border-radius: var(--r-md); cursor: pointer; font-weight: 400; transition: border-color .2s, background .2s; }
.rc-mode input { margin-top: 4px; }
.rc-mode b { margin-right: 6px; }
.rc-mode small { display: block; color: var(--c-muted); font-size: .85rem; }
.rc-mode:has(input:checked) { border-color: var(--c-text); background: var(--c-surface); }
.rc-paywall:not(:empty) { margin-top: 12px; }
.rc-settings { margin: 0 0 18px; background: var(--c-surface-2); border-radius: var(--r-md); padding: 0 14px; }
.rc-settings summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.rc-settings[open] { padding-bottom: 10px; }
.rc-settings input[type="range"] { accent-color: var(--c-solid); padding: 0; }
.seg-3 { grid-auto-columns: 1fr; }
.rc-privacy { font-size: .82rem; line-height: 1.5; margin: 14px 0 0; }

/* Session : toujours sombre, le texte s'allume mot à mot. Changement franc, sans animation sur le texte. */
.app-body.rc-focus { color-scheme: dark; background: #090b0a; color: #ecf0ec;
  --c-bg: #090b0a; --c-surface: #131715; --c-surface-2: #1c211e; --c-surface-3: #282e2a; --c-line: rgb(236 240 236 / .1); --c-border: rgb(236 240 236 / .1); --c-line-strong: rgb(236 240 236 / .46);
  --c-text: #ecf0ec; --c-muted: #a8b2ab; --c-solid: #ecf0ec; --c-on-solid: #0e1210; --c-field: #1c211e; --c-err: #ff7b70; --c-warn: #f2a65a; --on-err: #2c0704;
  --brand-fg: var(--brand); --mark: var(--brand); --accent-fg: var(--brand); --paper: transparent; --ink-quran: #ecf0ec;
  --st-correct: #4fd08a; --st-wrong: #ff7b70; --st-skipped: #f2a65a; --st-corrected: #7db2ff; --w-wait: #7f8a83; }
.rc-focus .app-main { width: min(100% - 2 * var(--gutter), 760px); }
.rc-session { display: flex; flex-direction: column; gap: 6px; height: calc(100dvh - var(--safe-t)); padding-bottom: var(--safe-b); }
.rc-head { display: flex; gap: 6px; align-items: center; min-height: 52px; }
.rc-head-main { flex: 1; min-width: 0; }
.rc-sub { margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-kicker { margin: 0; font: 500 .84rem/1.3 var(--f-moment); color: var(--c-muted); font-variant-numeric: tabular-nums; }
.rc-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; font-size: .8125rem; color: var(--c-muted); }
.rc-legend li { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-correct { background: var(--st-correct); } .lg-wrong { background: var(--st-wrong); } .lg-skipped { background: var(--st-skipped); } .lg-corrected { background: var(--st-corrected); }
.rc-scroll { position: relative; flex: 1; overflow-y: auto; min-height: 0; padding: 4px 2px; scroll-behavior: smooth; overscroll-behavior: contain; }
.rc-text { font-size: clamp(1.7rem, 6.4vw, 2.5rem); line-height: 2.3; text-align: justify; text-align-last: center; }
.rc-surah-head { text-align: center; font-family: var(--f-quran); color: var(--c-muted); font-size: .62em; margin: 0; }
.rc-basmala { text-align: center; font-size: .85em; margin: 0; }
.rc-mark { font-family: var(--f-quran); color: var(--c-muted); padding: 0 2px; }
.rc-mark.is-hidden { opacity: .5; }
.w { font: inherit; color: inherit; background: none; border: 0; padding: 0 .06em; margin: 0; cursor: default; border-radius: 6px; line-height: inherit; }
.w-pending { color: var(--w-wait, var(--c-muted)); }
.w-recited, .w-preview-done { color: var(--c-text); }
.w-correct { color: var(--st-correct); }
.w-wrong { color: var(--st-wrong); background: color-mix(in srgb, var(--st-wrong) 14%, transparent); cursor: pointer; text-decoration: underline solid 2px; text-underline-offset: .3em; } /* faux sans se fier à la couleur */
.w-skipped { color: var(--st-skipped); background: color-mix(in srgb, var(--st-skipped) 14%, transparent); cursor: pointer; text-decoration: underline wavy color-mix(in srgb, var(--st-skipped) 70%, transparent); text-underline-offset: .35em; }
.w-corrected { color: var(--st-corrected); cursor: pointer; }
.w-current { color: var(--c-text); box-shadow: inset 0 -3px 0 var(--brand); }
.w-hidden { color: transparent !important; background: color-mix(in srgb, var(--c-text) 10%, transparent); text-shadow: none; }
.w-hidden.w-current { box-shadow: inset 0 -3px 0 var(--brand); }
.w-peeked:not(.w-hidden) { outline: 2px dashed var(--accent-fg); outline-offset: 2px; }
.w:focus-visible { outline: 3px solid var(--c-text); }
.rc-manual { display: grid; gap: 6px; width: 100%; }
.rc-manual label { font-size: .8rem; }
.rc-manual .row { flex-wrap: nowrap; }
.rc-manual input { font-size: 1.2rem; }
.rc-dock { display: grid; gap: 6px; padding: 6px 0 12px; }
.rc-status { margin: 0; min-height: 1.4em; font-size: .88rem; text-align: center; color: var(--c-muted); }
.rc-status[data-kind="error"] { color: var(--c-err); font-weight: 600; }
.rc-status[data-kind="warn"] { color: var(--c-warn); }
.rc-controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
.rc-wave { width: 100%; height: 52px; color: var(--brand); }
.rc-side { min-width: 0; padding-inline: .8em; font-size: .88rem; }
.rc-mic { display: grid; place-items: center; min-width: 52px; min-height: 52px; padding: 0; border: 0; border-radius: var(--r-md); background: var(--c-surface-2); color: var(--c-text); cursor: pointer; transition: transform .25s var(--spring), background-color .2s; }
.rc-mic:active { transform: scale(.96); }
.rc-mic svg { fill: none; stroke: currentColor; stroke-width: 2; }
.rc-mic-play { display: none; align-items: center; gap: 8px; font: 700 1.02rem var(--f-body); }
.rc-mic-pause { display: grid; }
[data-phase="ready"] .rc-mic, [data-phase="paused"] .rc-mic { grid-column: 1 / 3; background: var(--brand); color: var(--on-brand); }
[data-phase="ready"] .rc-mic-play, [data-phase="paused"] .rc-mic-play { display: inline-flex; }
[data-phase="ready"] .rc-mic-pause, [data-phase="paused"] .rc-mic-pause { display: none; }
[data-phase="ready"] .rc-wave, [data-phase="paused"] .rc-wave, [data-engine="manuel"] .rc-wave { display: none; }
/* Recherche vocale : même micro, sans rond */
.rc-mic-sm { min-width: 72px; margin: 4px auto 10px; background: var(--c-solid); color: var(--c-on-solid); }
.rc-mic-sm svg { width: 24px; height: 24px; }
.rc-mic-sm.is-on { background: var(--brand); color: var(--on-brand); }
.rc-mic-ring { display: none; }
.rc-word-dlg { border: 0; border-radius: var(--r-xl); padding: 0; width: min(92vw, 420px); background: var(--c-surface); color: var(--c-text); }
.rc-dlg { padding: 20px; display: grid; gap: 4px; }
.rc-dlg h3 { margin-bottom: 6px; }
.rc-dlg-label { margin: 6px 0 0; font-size: .875rem; color: var(--c-muted); }
.rc-dlg-word { font-size: 2.2rem; margin: 0; text-align: center; color: var(--st-correct); }
.rc-dlg-heard { font-size: 1.6rem; margin: 0; text-align: center; color: var(--st-wrong); }
.rc-dlg .row { margin-top: 12px; }

/* Résultats */
.rc-score { display: flex; gap: 18px; align-items: center; }
.rc-ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: var(--c-surface-2); }
.ring-fg { stroke: var(--c-text); stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); }
.rc-ring-val { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.rc-ring-val b { font: 800 1.5rem var(--f-moment); font-variant-numeric: tabular-nums; }
.rc-ring-val small { color: var(--c-muted); font-size: .8125rem; }
.rc-counts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rc-counts li { background: var(--c-surface); border-radius: var(--r-md); text-align: center; padding: 8px 2px; font-size: .8125rem; color: var(--c-muted); }
.rc-counts b { display: block; font-size: 1.3rem; color: var(--c-text); font-variant-numeric: tabular-nums; }
.c-correct b { color: var(--st-correct); } .c-wrong b { color: var(--st-wrong); } .c-skipped b { color: var(--st-skipped); } .c-corrected b { color: var(--st-corrected); }
.rc-mistakes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rc-mistakes li { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--c-line); }
.rc-mistakes li:last-child { border-bottom: 0; }
.rc-m-word { font-size: 1.7rem; line-height: 1.8; }
.st-wrong { color: var(--st-wrong); text-decoration: underline solid 2px; text-underline-offset: .3em; } .st-skipped { color: var(--st-skipped); } .st-corrected, .st-peeked { color: var(--st-corrected); }
.rc-m-info { font-size: .85rem; }
.rc-m-actions { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.rc-audio audio { width: 100%; }
.rc-actions .btn { flex: 1 1 auto; }

/* Recherche vocale */
.rc-search-card { text-align: center; }
.rc-search-form .row { flex-wrap: nowrap; }
.rc-found { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rc-hit .quran { font-size: 1.6rem; line-height: 2.1; margin: 0 0 6px; }
.rc-hit-meta { margin: 0 0 8px; font-size: .9rem; }
.rc-hist-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.rc-hist-list a { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 44px; padding: 6px 12px; border-radius: var(--r-md); background: var(--c-surface); border: 1px solid var(--c-border); text-decoration: none; color: inherit; }

/* ================= Mémorisation & progrès ================= */
.mz, .pg { display: grid; gap: 16px; }
.mz-due { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mz-due li { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--c-line); }
.mz-due li:last-child { border-bottom: 0; }
.mz-due .row { grid-column: 1 / -1; }
.mz-strength { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.mz-strength.fragile { background: var(--st-wrong); } .mz-strength.en-cours { background: var(--st-skipped); } .mz-strength.solide { background: var(--st-correct); }
.mz-plan-days { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 340px; overflow: auto; }
.mz-plan-days li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-md); background: var(--c-surface-2); font-size: .9rem; }
.mz-plan-days li.is-done { opacity: .55; text-decoration: line-through; }
.mz-plan-days li.is-today { background: var(--accent); color: var(--on-accent); }
.mz-bar { height: 10px; border-radius: 99px; background: var(--c-surface-2); overflow: hidden; }
.mz-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .8s var(--ease); }
.mz-card-q { text-align: center; }
.mz-prompt { font-size: clamp(1.8rem, 7vw, 2.6rem); line-height: 2.2; margin: 6px 0; }
.mz-prompt .mz-hole { color: transparent; background: color-mix(in srgb, var(--c-text) 9%, transparent); border-radius: 8px; }
.mz-prompt .mz-shown { color: var(--c-muted); }
.mz-dots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.mz-dots li { width: 12px; height: 12px; border-radius: 50%; background: var(--c-surface-2); }
.mz-dots li.ok { background: var(--st-correct); } .mz-dots li.ko { background: var(--st-wrong); } .mz-dots li.now { outline: 2px solid var(--c-text); outline-offset: 2px; }
.mz-grades { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mz-grades .btn { flex-direction: column; gap: 0; line-height: 1.2; min-height: 56px; }
.mz-grades small { font-weight: 400; font-size: .8125rem; opacity: .8; }
.mz-surah-pick { max-height: 240px; overflow: auto; border: 1px solid var(--c-border); border-radius: var(--r-md); padding: 4px 10px; }
.mz-surah-pick .check { min-height: 40px; padding: 4px 0; }

.pg-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pg-stat { background: var(--c-surface); border-radius: var(--r-md); padding: 12px 8px; text-align: center; }
.pg-stat b { display: block; font: 800 1.6rem/1.1 var(--f-moment); letter-spacing: -.03em; color: var(--c-text); font-variant-numeric: tabular-nums; }
.pg-stat small { color: var(--c-muted); font-size: .8125rem; }
.cs { margin: 0; }
.cs-sky { display: block; width: 100%; height: auto; border-radius: var(--r-lg); }
.cs-cap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; padding: 8px 2px 0; font-size: .92rem; color: var(--c-muted); }
.cs-cap a { flex: none; font-weight: 600; }
.pg-goals { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pg-goal { text-align: center; position: relative; }
.pg-goal .rc-ring { width: 90px; height: 90px; margin: 0 auto 6px; }
.pg-goal .ring-fg { stroke: var(--c-text); }
.pg-goal.is-done .ring-fg { stroke: var(--c-ok); }
.pg-goal .pg-del { position: absolute; top: 6px; right: 6px; }
.pg-chart { width: 100%; height: auto; overflow: visible; }
.pg-chart .axis { stroke: var(--c-border); }
.pg-chart text { fill: var(--c-muted); font: 11px var(--f-body); }
.pg-chart .line { fill: none; stroke: var(--c-text); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.pg-chart .area { fill: color-mix(in srgb, var(--accent) 30%, transparent); }
.pg-chart .bar { fill: var(--accent); }
.pg-chart .dot { fill: var(--c-surface); stroke: var(--c-text); stroke-width: 2; }
.pg-heat { display: grid; gap: 12px; }
.pg-heat-row h4 { margin: 0 0 6px; font: 600 .9rem var(--f-body); display: flex; justify-content: space-between; }
.pg-heat-cells { display: flex; flex-wrap: wrap; gap: 4px; }
.pg-heat-cells a { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; font-size: .8125rem; font-weight: 700; text-decoration: none; color: #1d1606; }
.pg-heat-cells a[data-l="rouge"] { background: #e2574c; color: #fff; } .pg-heat-cells a[data-l="orange"] { background: #ef9a3c; }
.pg-heat-cells a[data-l="jaune"] { background: #f3d36b; } .pg-heat-cells a[data-l="vert"] { background: #7fcf98; }
.pg-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.pg-badge { text-align: center; padding: 12px 6px; border-radius: var(--r-md); background: var(--c-surface); }
.pg-badge .ico-b { font-size: 1.8rem; display: block; }
.pg-badge b { display: block; font-size: .8rem; line-height: 1.25; }
.pg-badge small { font-size: .8125rem; color: var(--c-muted); line-height: 1.25; display: block; margin-top: 2px; }
.pg-badge:not(.is-earned) .ico-b { filter: grayscale(1); opacity: .35; }
.pg-badge.is-earned { background: var(--accent); color: var(--on-accent); }
.pg-badge.is-earned small { color: inherit; opacity: .75; }
.pg-hist { list-style: none; margin: 0; padding: 0; }
.pg-hist li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--c-line); }
.pg-hist li:last-child { border-bottom: 0; }
.pg-hist .is-locked { filter: blur(3px); opacity: .5; user-select: none; }
.pg-acc { font-weight: 700; font-variant-numeric: tabular-nums; }
.legend-heat { display: flex; gap: 10px; flex-wrap: wrap; font-size: .8125rem; color: var(--c-muted); margin: 0 0 8px; }
.legend-heat i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 4px; vertical-align: -1px; }
@media (max-width: 360px) { .rc-counts { grid-template-columns: repeat(3, 1fr); } .pg-hero { grid-template-columns: 1fr 1fr; } }
.mz-ring { margin: 0 auto; }
.mz-center { justify-content: center; }
.btn-danger-text { color: var(--c-err); }
.mz [hidden], .pg [hidden], .rc-session [hidden]:not(.rc-side), .rc-setup [hidden], .qr-reader [hidden] { display: none !important; }


@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --qr-ink: #1c211e; --qr-night: #040506; } }
:root[data-theme="dark"] { --qr-ink: #1c211e; --qr-night: #040506; }

/* Encart « écoute coranique à installer » (micro sans modèle) et verset trouvé par la recherche */
.asr-gate { display: grid; gap: 8px; text-align: start; padding: 14px 16px; border-radius: var(--r-lg); background: var(--c-surface-2); box-shadow: inset 3px 0 0 var(--brand); margin: 0 0 10px; }
.asr-gate h3 { margin: 0; font-size: 1.05rem; }
.asr-gate p { margin: 0; }
.asr-gate .row { flex-wrap: wrap; gap: 8px; }
.asr-gate-net { font-size: .92rem; color: var(--c-muted); }
.asr-gate-net.is-warn { color: var(--c-warn); font-weight: 600; }
.asr-gate-err { color: var(--c-err); font-size: .92rem; }
.asr-gate .off-meter { height: 10px; border-radius: 99px; background: var(--c-surface-3); overflow: hidden; }
.asr-gate .off-meter span { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.rc-sq-label { display: block; margin: 10px 0 6px; font-size: .92rem; color: var(--c-muted); }
.rc-hit-main { box-shadow: inset 0 0 0 2px var(--brand); }
.rc-hit-surah { margin: 0; font-size: 1.3rem; color: var(--c-muted); }
