:root {
  --bg: #F3F5F4; --surface: #FFFFFF; --surface-2: #E9EEEC; --ink: #14201D; --muted: #5A6A65; --line: #D3DCD8;
  --accent: #0E5A4F; --accent-ink: #FFFFFF; --accent-soft: #DCEBE6; --gold: #9C7A33;
  --ok: #2F7D4E; --ok-soft: #DDEFE3; --warn: #A86B12; --warn-soft: #F6EAD5; --err: #C23B2A; --err-soft: #F8E1DD; --mask: #D7E0DC;
  --shadow: 0 1px 2px rgba(20, 32, 29, .06), 0 6px 20px rgba(20, 32, 29, .06);
  --r: 12px; --ui: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --quran: "Amiri Quran", "Amiri", "Scheherazade New", "Traditional Arabic", "Geeza Pro", serif;
  --arabic: "Amiri", "Geeza Pro", "Traditional Arabic", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E1412; --surface: #151D1B; --surface-2: #1C2623; --ink: #E3EBE8; --muted: #93A39E; --line: #29352F;
    --accent: #58B4A3; --accent-ink: #062019; --accent-soft: #17332D; --gold: #D2B067;
    --ok: #62BD88; --ok-soft: #173024; --warn: #E0A14A; --warn-soft: #33260F; --err: #EC6E5F; --err-soft: #3B1E1A; --mask: #28332F;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1412; --surface: #151D1B; --surface-2: #1C2623; --ink: #E3EBE8; --muted: #93A39E; --line: #29352F;
  --accent: #58B4A3; --accent-ink: #062019; --accent-soft: #17332D; --gold: #D2B067;
  --ok: #62BD88; --ok-soft: #173024; --warn: #E0A14A; --warn-soft: #33260F; --err: #EC6E5F; --err-soft: #3B1E1A; --mask: #28332F;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--ui); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: 1.6rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Barre du haut ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 8px; font-weight: 700; letter-spacing: -.01em; font-size: 1.1rem; cursor: pointer; background: none; border: 0; padding: 0; }
.brand .ar { font-family: var(--arabic); color: var(--accent); font-size: 1.35rem; font-weight: 700; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; flex-wrap: wrap; }
.nav button { background: none; border: 0; padding: 6px 10px; border-radius: 8px; color: var(--muted); cursor: pointer; }
.nav button[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.nav button:hover { color: var(--ink); }
.who { font-size: .85rem; color: var(--muted); }

main { max-width: 1080px; margin: 0 auto; padding: 20px 16px 64px; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Éléments ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 550; line-height: 1.2; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--err); }
.btn.ghost { background: none; border-color: transparent; }
.btn.small { padding: 5px 10px; font-size: .85rem; border-radius: 8px; }
.btn.big { padding: 14px 22px; font-size: 1.05rem; border-radius: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.panel.lift { box-shadow: var(--shadow); border-color: transparent; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.eyebrow { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); font-size: .9rem; }
.notice.info { background: var(--accent-soft); }
.notice.err { background: var(--err-soft); }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }

label.field { display: flex; flex-direction: column; gap: 5px; font-size: .88rem; font-weight: 550; }
label.field .hint { order: 2; font-weight: 400; color: var(--muted); font-size: .8rem; }
input[type="text"], input[type="number"], input[type="date"], input[type="password"], select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; width: 100%; min-width: 0; }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: center; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 550; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { display: inline-flex; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span { min-width: 38px; text-align: center; padding: 6px 6px; border-radius: 8px; border: 1px solid var(--line); font-size: .82rem; cursor: pointer; }
.days input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.days input:focus-visible + span { outline: 2px solid var(--accent); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
.strip { display: inline-flex; gap: 3px; }
.strip i { width: 9px; height: 9px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); }
.strip i.full { background: var(--ok); border-color: var(--ok); }
.strip i.part { background: var(--warn); border-color: var(--warn); }

/* ---------- Tuiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi b { display: block; font-size: 1.7rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi span { font-size: .82rem; color: var(--muted); }
.tile { text-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.tile:hover { border-color: var(--accent); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 1.05rem; }

.task { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.task.done { opacity: .75; }
.task .ar { font-family: var(--arabic); font-size: 1.15rem; }

/* ---------- Pavé PIN ---------- */
.pinpad { display: grid; grid-template-columns: repeat(3, 64px); gap: 10px; justify-content: center; }
.pinpad button { height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 1.3rem; cursor: pointer; }
.pindots { display: flex; gap: 10px; justify-content: center; margin: 8px 0 16px; }
.pindots i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--muted); }
.pindots i.on { background: var(--accent); border-color: var(--accent); }

/* ---------- Séance ---------- */
.session { display: flex; flex-direction: column; gap: 10px; max-width: 640px; width: 100%; margin: 0 auto; }
@media (max-width: 820px) { .session { grid-template-columns: minmax(0, 1fr); } }
.mushaf { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px 20px; position: relative; }
.mushaf.flash { animation: flash .6s; }
@keyframes flash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 4px var(--err); } }
.mushaf.okflash { animation: okflash .5s; }
@keyframes okflash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 4px var(--ok); } }
.ayat { direction: rtl; font-family: var(--quran); font-size: clamp(1.6rem, 4.2vw, 2.3rem); line-height: 2.25; text-align: justify; text-align-last: center; }
.ayat.review { max-height: 60vh; overflow-y: auto; text-align-last: auto; padding-inline: 4px; scroll-behavior: smooth; }
.ayah { padding: 2px 6px; border-radius: 10px; transition: background .2s; }
.ayat:not(.review) .ayah { display: block; margin-bottom: 6px; }
.ayah.cur { background: var(--accent-soft); }
.ayah.errv { background: var(--err-soft); }
/* révision (texte continu) : pas de fond, qui recouvrirait les lignes voisines ; les autres versets sont atténués */
.ayat.review .ayah { padding: 0; border-radius: 0; background: none; transition: opacity .2s; }
.ayat.review .ayah:not(.cur):not(.errv) { opacity: .45; }
.w { transition: color .15s; color: var(--ink); }
.w.pending { color: color-mix(in srgb, var(--ink) 58%, transparent); }
.w.read { color: var(--accent); }
.w.tent { color: color-mix(in srgb, var(--accent) 60%, var(--ink)); }
.w.next { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 12px; text-decoration-thickness: 2px; }
.w.mask { color: transparent; background: var(--mask); border-radius: 8px; }
.w.bad { color: var(--err) !important; opacity: 1; background: color-mix(in srgb, var(--err) 30%, transparent); border-radius: 6px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 30%, transparent); text-decoration: underline wavy var(--err); text-underline-offset: 12px; }
.w.bad.mask { color: transparent !important; }
.marker { font-family: var(--quran); color: var(--gold); font-size: .9em; margin-inline: 4px; }
.surah-head { text-align: center; font-family: var(--arabic); color: var(--gold); font-size: 1.3rem; margin: 6px 0; direction: rtl; }
.side { display: flex; flex-direction: column; gap: 12px; }
.counter { text-align: center; }
.counter b { font-size: 3rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1; }
.counter b small { font-size: 1.3rem; color: var(--muted); font-weight: 500; }
.dots { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); }
.dots i.on { background: var(--accent); border-color: var(--accent); }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.steps { display: flex; flex-wrap: wrap; gap: 4px; }
.steps span { font-size: .75rem; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.steps span.done { background: var(--ok-soft); color: var(--ok); }
.steps span.cur { background: var(--accent); color: var(--accent-ink); }
.mic { width: 100%; }
.mic.on { background: var(--err); border-color: var(--err); color: #fff; }
.live { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); min-height: 22px; }
.live .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.live .dot.on { background: var(--err); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.heard { direction: rtl; font-family: var(--arabic); color: var(--muted); font-size: 1.05rem; min-height: 1.6em; text-align: right; overflow-wrap: anywhere; }
.msg { padding: 12px 14px; border-radius: 10px; font-weight: 550; }
.msg.err { background: var(--err-soft); color: var(--err); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.info { background: var(--accent-soft); color: var(--accent); }
.demo { border-top: 1px dashed var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.demo textarea { direction: rtl; font-family: var(--arabic); min-height: 60px; }

.modal-bg { position: fixed; inset: 0; background: rgba(8, 14, 12, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 16px; padding: 20px; max-width: 440px; width: 100%; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.toast { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; z-index: 60; max-width: calc(100% - 32px); }

.hero { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; }
@media (max-width: 760px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.hero .ar-big { font-family: var(--quran); direction: rtl; font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 2; color: var(--accent); text-align: center; }
.seq { font-variant-numeric: tabular-nums; font-size: .88rem; line-height: 1.7; color: var(--ink); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; }
details summary { cursor: pointer; }
audio { width: 100%; max-width: 360px; height: 36px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.code-big { font-size: 2rem; font-weight: 700; letter-spacing: .12em; padding: 8px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }

/* ---------- Séance sur téléphone : texte réduit, commandes toujours visibles ---------- */
.enroll-intro { margin-top: 6px; }
@media (max-width: 820px) {
  main:has(.session) { gap: 10px; padding-block: 12px 24px; }
  .session { gap: 10px; }
  .mushaf { padding: 12px 10px; border-radius: 12px; }
  .ayat { font-size: clamp(1.35rem, 5.4vw, 1.8rem); line-height: 2; max-height: 34vh; overflow-y: auto; }
  .ayat.review { max-height: 34vh; }
  .side { gap: 8px; }
  .side .panel { padding: 12px; }
  .counter { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: start; }
  .counter b { font-size: 1.8rem; }
  .counter b small { font-size: 1rem; }
  .counter .dots { margin-top: 0; justify-content: flex-end; }
  .enroll-head h1 { font-size: 1.3rem; }
  .enroll-intro { font-size: .85rem; }
  .demo textarea { min-height: 44px; }
}
@media (max-width: 520px) {
  .topbar-in { padding: 6px 12px; gap: 6px; }
  .nav { gap: 0; }
  .nav button { padding: 4px 8px; font-size: .88rem; }
  .who { display: none; }
}

/* ---------- Barre de commandes en haut de la séance ---------- */
.ctlbar { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; box-shadow: 0 6px 16px rgba(0, 0, 0, .12); }
.ctlrow { display: flex; align-items: center; gap: 12px; }
.ctlrow .mic { width: auto; flex: 0 0 auto; padding: 6px 14px; font-size: .95rem; min-height: 0; line-height: 1.2; }
.ctlrow .live { flex: 1; min-width: 0; }
.ctlbar .heard { width: 100%; box-sizing: border-box; background: var(--surface-2); border-radius: 8px; padding: 2px 10px; min-height: 1.9em; line-height: 1.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--quran); color: var(--ink); }
.ctlbar .heard:empty::before { content: "…"; color: var(--muted); }
.ctlbar #msg:empty { display: none; }
.ctlbar .msg { padding: 5px 10px; font-size: .88rem; font-weight: 600; border-radius: 8px; }

/* ---------- Page du Mushaf de Médine ---------- */
.mushaf:has(.ayat.mp) { padding: 0; background: none; border: 0; }
.ayat.mp { max-height: none !important; overflow: visible !important; font-size: 20px; line-height: normal; text-align: initial; text-align-last: auto; padding: 0; }
.mp-page { direction: rtl; background: #eef6ee; color: #111; border-radius: 10px; padding: 8px 10px 10px; max-width: 580px; margin: 0 auto; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.mp-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 6px; font-family: "Amiri", var(--quran); font-size: .98rem; color: #14532d; padding: 2px 4px 6px; }
.mp-top span { text-decoration: underline; text-decoration-color: #7fb08f; text-underline-offset: 5px; white-space: nowrap; }
.mp-sura { justify-self: start; } .mp-pno { justify-self: center; } .mp-juz { justify-self: end; }
.mp-lines { direction: rtl; padding-inline: 7px; }
.mp-line { display: flex; justify-content: space-between; align-items: center; height: 1.95em; white-space: nowrap; }
.mp-first .mp-line { justify-content: center; gap: .3em; }
.mp-hdr, .mp-bsm { justify-content: center; font-family: var(--quran); }
.mp-bsm { font-size: 1em; gap: 0; }
.mp-hdr { justify-content: center; height: auto; margin: .15em 0; }
.mp-hdrbox { position: relative; width: 100%; aspect-ratio: 8 / 1; container-type: inline-size; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 75' preserveAspectRatio='none'%3E%3Crect x='1.5' y='1.5' width='597' height='72' fill='%23f7fbf6' stroke='%231f6b3c' stroke-width='3'/%3E%3Crect x='6' y='6' width='588' height='63' fill='none' stroke='%236aae80' stroke-width='1'/%3E%3Crect x='9' y='9' width='582' height='57' fill='none' stroke='%232e7d4f' stroke-width='.6'/%3E%3Cpolygon points='30.0,22.5 34.1,27.5 40.6,26.9 40.0,33.4 45.0,37.5 40.0,41.6 40.6,48.1 34.1,47.5 30.0,52.5 25.9,47.5 19.4,48.1 20.0,41.6 15.0,37.5 20.0,33.4 19.4,26.9 25.9,27.5' fill='%23e6f3e7' stroke='%232e7d4f' stroke-width='1.4'/%3E%3Ccircle cx='30' cy='37.5' r='5.0' fill='none' stroke='%232e7d4f' stroke-width='1.1'/%3E%3Cpolygon points='570.0,22.5 574.1,27.5 580.6,26.9 580.0,33.4 585.0,37.5 580.0,41.6 580.6,48.1 574.1,47.5 570.0,52.5 565.9,47.5 559.4,48.1 560.0,41.6 555.0,37.5 560.0,33.4 559.4,26.9 565.9,27.5' fill='%23e6f3e7' stroke='%232e7d4f' stroke-width='1.4'/%3E%3Ccircle cx='570' cy='37.5' r='5.0' fill='none' stroke='%232e7d4f' stroke-width='1.1'/%3E%3Cpath d='M50.0,37.5 Q59.8,20.5 69.7,37.5 Q79.5,54.5 89.3,37.5 Q99.2,20.5 109.0,37.5 Q118.8,54.5 128.7,37.5 Q138.5,20.5 148.3,37.5 Q158.2,54.5 168.0,37.5' fill='none' stroke='%232e7d4f' stroke-width='1.8'/%3E%3Cpath d='M50.0,37.5 Q59.8,54.5 69.7,37.5 Q79.5,20.5 89.3,37.5 Q99.2,54.5 109.0,37.5 Q118.8,20.5 128.7,37.5 Q138.5,54.5 148.3,37.5 Q158.2,20.5 168.0,37.5' fill='none' stroke='%236aae80' stroke-width='1.8'/%3E%3Cpath d='M50.0,34.3 L53.2,37.5 L50.0,40.7 L46.8,37.5 Z' fill='%232e7d4f'/%3E%3Cpath d='M69.7,34.3 L72.9,37.5 L69.7,40.7 L66.5,37.5 Z' fill='%232e7d4f'/%3E%3Cpath d='M89.3,34.3 L92.5,37.5 L89.3,40.7 L86.1,37.5 Z' fill='%232e7d4f'/%3E%3Cpath d='M109.0,34.3 L112.2,37.5 L109.0,40.7 L105.8,37.5 Z' fill='%232e7d4f'/%3E%3Cpath d='M128.7,34.3 L131.9,37.5 L128.7,40.7 L125.5,37.5 Z' fill='%232e7d4f'/%3E%3Cpath d='M148.3,34.3 L151.5,37.5 L148.3,40.7 L145.1,37.5 Z' fill='%232e7d4f'/%3E%3Cpath d='M168.0,34.3 L171.2,37.5 L168.0,40.7 L164.8,37.5 Z' fill='%232e7d4f'/%3E%3Ccircle cx='59.8' cy='29.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='59.8' cy='45.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='79.5' cy='29.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='79.5' cy='45.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='99.2' cy='29.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='99.2' cy='45.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='118.8' cy='29.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='118.8' cy='45.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='138.5' cy='29.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='138.5' cy='45.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='158.2' cy='29.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='158.2' cy='45.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Cpath d='M432.0,37.5 Q441.8,20.5 451.7,37.5 Q461.5,54.5 471.3,37.5 Q481.2,20.5 491.0,37.5 Q500.8,54.5 510.7,37.5 Q520.5,20.5 530.3,37.5 Q540.2,54.5 550.0,37.5' fill='none' stroke='%232e7d4f' stroke-width='1.8'/%3E%3Cpath d='M432.0,37.5 Q441.8,54.5 451.7,37.5 Q461.5,20.5 471.3,37.5 Q481.2,54.5 491.0,37.5 Q500.8,20.5 510.7,37.5 Q520.5,54.5 530.3,37.5 Q540.2,20.5 550.0,37.5' fill='none' stroke='%236aae80' stroke-width='1.8'/%3E%3Cpath d='M432.0,34.3 L435.2,37.5 L432.0,40.7 L428.8,37.5 Z' fill='%232e7d4f'/%3E%3Cpath d='M451.7,34.3 L454.9,37.5 L451.7,40.7 L448.5,37.5 Z' fill='%232e7d4f'/%3E%3Cpath d='M471.3,34.3 L474.5,37.5 L471.3,40.7 L468.1,37.5 Z' fill='%232e7d4f'/%3E%3Cpath d='M491.0,34.3 L494.2,37.5 L491.0,40.7 L487.8,37.5 Z' fill='%232e7d4f'/%3E%3Cpath d='M510.7,34.3 L513.9,37.5 L510.7,40.7 L507.5,37.5 Z' fill='%232e7d4f'/%3E%3Cpath d='M530.3,34.3 L533.5,37.5 L530.3,40.7 L527.1,37.5 Z' fill='%232e7d4f'/%3E%3Cpath d='M550.0,34.3 L553.2,37.5 L550.0,40.7 L546.8,37.5 Z' fill='%232e7d4f'/%3E%3Ccircle cx='441.8' cy='29.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='441.8' cy='45.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='461.5' cy='29.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='461.5' cy='45.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='481.2' cy='29.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='481.2' cy='45.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='500.8' cy='29.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='500.8' cy='45.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='520.5' cy='29.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='520.5' cy='45.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='540.2' cy='29.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Ccircle cx='540.2' cy='45.5' r='2.1' fill='none' stroke='%232e7d4f' stroke-width='1'/%3E%3Cpath d='M168,37.5 L194,9 H406 L432,37.5 L406,66 H194 Z' fill='%23e3f2e3' stroke='%231f6b3c' stroke-width='3.2'/%3E%3Cpath d='M177,37.5 L198,14 H402 L423,37.5 L402,61 H198 Z' fill='none' stroke='%236aae80' stroke-width='1.1'/%3E%3C/svg%3E") center / 100% 100% no-repeat; display: flex; align-items: center; justify-content: center; }
.mp-sn { display: flex; flex-direction: row; direction: rtl; gap: .12em; align-items: center; font-family: tksn, var(--quran); color: #174a2c; font-size: 9.5cqw; line-height: 1; transform: translateX(-.12em); white-space: nowrap; }
.mp-sn.txt { font-family: var(--quran); font-size: 5.2cqw; }
.mp-bsm .bw { margin-inline: .12em; }
.mw { color: #1b1b1b; border-radius: 5px; transition: color .15s, background .15s, opacity .2s; }
.mw.me { color: #1f8a5b; }
.mw.read { color: #0b9a5c; }
.mw.tent { color: #5bb88a; }
.mw.next { box-shadow: inset 0 -2px 0 #c9a227; }
.mw.bad { color: #c62828; background: rgba(229, 57, 53, .22); box-shadow: 0 0 0 2px rgba(229, 57, 53, .5); }
.mw.mask { color: transparent; background: #ece3c6; }
.mw.bad.mask { color: transparent; background: rgba(229, 57, 53, .35); }
.mw.out { opacity: .32; }

.brand .ver { font-size: .62rem; color: var(--muted); font-weight: 500; margin-inline-start: 4px; align-self: flex-end; }
.update-banner { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 70; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

/* ---------- En-tête de séance compact + progression ---------- */
.sess-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 640px; width: 100%; margin: 0 auto; }
.sess-head .eyebrow { margin: 0; font-size: .82rem; line-height: 1.35; }
.sess-head .btn { flex: 0 0 auto; padding: 5px 10px; font-size: .85rem; }
main:has(.session) { gap: 8px; }
.progstrip { display: flex; flex-direction: column; gap: 6px; padding: 0 2px; }
.ps-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ps-lbl { font-size: .85rem; color: var(--muted); font-weight: 600; }
.ps-num { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.ps-num small { font-size: .85rem; color: var(--muted); font-weight: 500; }
.ps-row .dots { margin: 0; justify-content: flex-start; }
.ps-bar { display: flex; align-items: center; gap: 8px; }
.ps-bar .bar { flex: 1; height: 7px; }
.progstrip.review .ps-row { display: none; }
@media (max-width: 820px) {
  .mushaf:has(.ayat.mp) { margin-inline: -12px; }
  .mp-page { border-radius: 0; padding: 6px 5px 8px; box-shadow: none; }
}

/* ---------- Numéros de verset en rosace verte et rose, en-tête avec quart de hizb ---------- */
.mw.me { position: relative; color: transparent !important; }
.mw.me::before { content: attr(data-n); position: absolute; inset: 0; margin: auto; width: 2.5em; height: 2.5em; font-size: .5em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cellipse cx='20' cy='4.2' rx='4.2' ry='3' fill='%23e07ab0'/%3E%3Cellipse cx='20' cy='35.8' rx='4.2' ry='3' fill='%23e07ab0'/%3E%3Ccircle cx='20' cy='4.2' r='1.2' fill='%23f7d774'/%3E%3Ccircle cx='20' cy='35.8' r='1.2' fill='%23f7d774'/%3E%3Cellipse cx='4.6' cy='20' rx='2.6' ry='4' fill='%233f9b5f'/%3E%3Cellipse cx='35.4' cy='20' rx='2.6' ry='4' fill='%233f9b5f'/%3E%3Ccircle cx='20' cy='20' r='14.5' fill='%23f3faf1' stroke='%232e8b57' stroke-width='2.4'/%3E%3Ccircle cx='20' cy='20' r='11.3' fill='none' stroke='%238fcfa5' stroke-width='1.1'/%3E%3C/svg%3E") center / contain no-repeat;
  display: flex; align-items: center; justify-content: center; font-family: "Amiri", serif; line-height: 1; color: #14532d; }
.mw.me.n3::before { font-size: .4em; width: 3.1em; height: 3.1em; }
.mw.me.out::before { opacity: 1; }
.mp-hz { display: inline-block; margin-inline-start: 6px; padding: 0 5px; min-width: 1.4em; text-align: center; border: 1.5px solid #2e8b57; border-radius: 3px; background: #dff1de; color: #14532d; font-weight: 700; font-size: .85em; line-height: 1.35; text-decoration: none; }

/* ---------- v0.6.7 : lisibilité ---------- */
.ctlbar .msg.err { background: #b42318; color: #fff; }
/* numéros de verset : la rosace a sa propre place, elle ne recouvre plus le mot suivant */
.mw.me { display: inline-flex; justify-content: center; align-items: center; min-width: 1.3em; }
/* mot en erreur : surlignage qui couvre tout le mot sans décaler la ligne */
.mw.bad { padding: 0 .14em; margin: 0 -.14em; border-radius: .28em; background: rgba(229, 57, 53, .2); box-shadow: 0 0 0 1.5px rgba(229, 57, 53, .65); color: #c62828; position: relative; z-index: 1; }
.mw.next { box-shadow: inset 0 -.1em 0 #c9a227; }

/* ---------- v0.7 ---------- */
html { touch-action: manipulation; }
.pinpad button { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.pinpad button.hit, .pinpad button:active { background: var(--accent-soft); border-color: var(--accent); transform: scale(.96); }
/* séance : pas de barre du haut, partie haute figée et repliable */
body.in-session .topbar { display: none; }
body.in-session main { padding-top: 0; }
.sess-top { position: sticky; top: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column; gap: 6px; padding: 6px 0 6px; margin: 0 -2px; box-shadow: 0 6px 10px -8px rgba(0, 0, 0, .5); }
.sess-top .ctlbar { box-shadow: none; }
.ctlrow .fold { margin-inline-start: auto; flex: 0 0 auto; padding: 4px 10px; font-size: 1rem; line-height: 1; }
.sess-top.folded .progstrip, .sess-top.folded .heard, .sess-top.folded #hint, .sess-top.folded .demo { display: none !important; }
.sess-top.folded .ctlbar { padding: 6px 8px; }
.sess-top.folded .live { font-size: .8rem; }
/* chargement de la page du Mushaf */
.mp-wait .mp-page { min-height: 70vh; }
.mp-skel { height: 70vh; background: repeating-linear-gradient(#eef6ee 0 1.2em, #e2eee3 1.2em 1.35em, #eef6ee 1.35em 2.4em); opacity: .7; animation: mpblink 1.2s ease-in-out infinite alternate; }
@keyframes mpblink { to { opacity: .35; } }
/* console : erreurs lisibles, écoute + téléchargement */
.errlist { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.errlist li { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.arw { font-family: var(--quran); font-size: 1.35rem; line-height: 1.6; color: var(--err); direction: rtl; unicode-bidi: isolate; }
.audiobox { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.audiobox audio { width: 260px; max-width: 100%; }
/* accueil élève compact */
.shome { display: flex; flex-direction: column; gap: 12px; max-width: 640px; width: 100%; margin: 0 auto; }
.shead h1 { font-size: 1.3rem; }
.shead p { margin: 2px 0 0; }
.stack.tight { gap: 8px; }
.stack.tight h2 { font-size: .95rem; color: var(--muted); font-weight: 600; }
.stask { padding: 10px 12px; gap: 10px; flex-wrap: nowrap; }
.stask-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.stask h3 { font-size: 1rem; }
.stask .ar { margin: 2px 0 0; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stask .btn { flex: 0 0 auto; }
.sstats { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); padding: 8px 2px; border-top: 1px solid var(--line); }
.sstats b { color: var(--ink); font-size: 1rem; }
.sstrip { margin-inline-start: auto; }

/* ---------- v0.7.1 : consigne d'apprentissage, logo en séance ---------- */
.ctlbar .msg.guide { background: #1f7a4d; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .95rem; }
.ctlbar .msg.guide b { font-size: 1.05rem; background: rgba(255, 255, 255, .18); padding: 1px 8px; border-radius: 6px; }
.ctlbar #guide:empty, .ctlbar #errBox:empty { display: none; }
.sess-head { justify-content: flex-start; }
.sess-head .eyebrow { flex: 1; min-width: 0; }
.brand-mini { font-family: var(--arabic); color: var(--accent); font-size: 1.3rem; font-weight: 700; line-height: 1; flex: 0 0 auto; }

/* ---------- v0.7.2 : logo (Mushaf + boucle de répétition) et nom en El Messiri ---------- */
.brand { align-items: center; gap: 8px; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto; }
.brand .ar { font-family: "El Messiri", var(--arabic); font-weight: 700; font-size: 1.45rem; color: var(--gold); line-height: 1; }
.brand .la { font-family: "El Messiri", var(--sans, system-ui); font-weight: 700; font-size: 1.1rem; letter-spacing: .01em; color: var(--ink); }
.sess-head { justify-content: space-between; }
.sess-head .brand { cursor: default; }
.crumb { margin: 0; font-size: .78rem; line-height: 1.35; }
.sess-top.folded .crumb { display: none; }

/* ---------- v0.8 : langues ---------- */
.langpick { margin-inline-start: auto; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 3px 6px; font-size: .8rem; max-width: 5em; }
.topbar-in .nav + .langpick { margin-inline-start: 6px; }
[dir="rtl"] body { font-family: "El Messiri", var(--arabic), system-ui, sans-serif; }
[dir="rtl"] .seq, [dir="rtl"] .num, [dir="rtl"] input[type=email], [dir="rtl"] input[type=password] { direction: ltr; unicode-bidi: isolate; }
