/* Lecture mélodieuse — feuille de style
   Palette douce (ivoire, rose poudré, prune, or) + thème « nuit ».
   Mise en page fluide ; disposition dédiée mobile en PAYSAGE. */

@font-face {
  font-family: "IndoPak";
  src: url("/fonts/indopak.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #fbf6f2;
  --bg2: #f6ebe8;
  --surface: #ffffff;
  --surface2: #fdf3f5;
  --line: #efdde3;
  --text: #3d2a35;
  --muted: #8e7482;
  --rose: #d46f93;
  --rose-deep: #b4517a;
  --rose-soft: #f9e1ea;
  --plum: #5d2c4c;
  --gold: #c39a52;
  --gold-soft: #f6ead2;
  --ok: #4f9e7c;
  --warn: #d58a2c;
  --danger: #c4485a;
  --shadow: 0 10px 30px -14px rgba(93, 44, 76, .28);
  --shadow-sm: 0 4px 14px -8px rgba(93, 44, 76, .3);
  --radius: 18px;
  --ar-size: 2rem;
  --pattern-op: .55;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1320; --bg2: #24182a; --surface: #2a1d30; --surface2: #33233a;
    --line: #463249; --text: #f6e9f0; --muted: #c0a3b5; --rose: #f09bbb;
    --rose-deep: #f6b3cb; --rose-soft: #4a2a40; --plum: #f7d3e3;
    --gold: #e4c27f; --gold-soft: #3f3123;
    --shadow: 0 12px 30px -14px rgba(0, 0, 0, .7);
    --shadow-sm: 0 4px 14px -8px rgba(0, 0, 0, .7);
    --pattern-op: .18; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1320; --bg2: #24182a; --surface: #2a1d30; --surface2: #33233a;
  --line: #463249; --text: #f6e9f0; --muted: #c0a3b5; --rose: #f09bbb;
  --rose-deep: #f6b3cb; --rose-soft: #4a2a40; --plum: #f7d3e3;
  --gold: #e4c27f; --gold-soft: #3f3123;
  --shadow: 0 12px 30px -14px rgba(0, 0, 0, .7);
  --shadow-sm: 0 4px 14px -8px rgba(0, 0, 0, .7);
  --pattern-op: .18; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5; overflow-x: hidden;
}
body::before {               /* motif géométrique (étoiles à 8 branches) */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: var(--pattern-op);
  background-image: url("../img/pattern.svg");
  background-size: 84px 84px;
  mask-image: linear-gradient(to bottom, #000 0, transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 70%);
}
a { color: var(--rose-deep); }
button, input, select { font: inherit; color: inherit; }
.ar { font-family: "IndoPak", "Amiri", "Scheherazade New", serif;
      direction: rtl; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ───────────── barre du haut ───────────── */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center;
  gap: 12px; padding: 10px 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none;
         color: var(--plum); min-width: 0; }
.brand img { width: 34px; height: 34px; flex: none; }
.brand b { font-family: "Playfair Display", Georgia, serif; font-size: 1.2rem;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar nav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; transition: .15s; color: var(--plum); flex: none;
}
.icon-btn:hover { border-color: var(--rose); color: var(--rose-deep); }
.icon-btn svg { width: 20px; height: 20px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; text-decoration: none; color: var(--plum); font-weight: 700;
  font-size: .9rem; transition: .15s; white-space: nowrap;
}
.pill:hover { border-color: var(--rose); }
.pill.on { background: var(--rose); border-color: var(--rose); color: #fff; }
.pill svg { width: 16px; height: 16px; }

main { padding: 0 16px 40px; padding-left: max(16px, env(safe-area-inset-left));
       padding-right: max(16px, env(safe-area-inset-right)); }
.wrap { max-width: 1180px; margin: 0 auto; }

/* ───────────── accueil / index ───────────── */
.hero { text-align: center; padding: 34px 0 18px; }
.hero .kicker { letter-spacing: .32em; text-transform: uppercase;
                color: var(--rose-deep); font-weight: 800; font-size: .75rem; }
.hero h1 { font-family: "Playfair Display", Georgia, serif; color: var(--plum);
           font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.08;
           margin: 8px 0 6px; }
.hero p { color: var(--muted); margin: 0 auto; max-width: 560px; }
.hero .bismillah { font-size: 1.9rem; color: var(--gold); margin: 6px 0 0; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
           margin: 14px 0 18px; }
.search {
  flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 6px 4px 14px;
}
.search input { border: 0; outline: 0; background: none; flex: 1; padding: 8px 0;
                min-width: 0; }
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
}
.card {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius); text-decoration: none;
  color: inherit; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s,
  border-color .18s; overflow: hidden;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow);
              border-color: var(--rose); }
.card.soon { opacity: .62; }
.card .info { min-width: 0; flex: 1; }
.card .tr { font-weight: 800; color: var(--plum); white-space: nowrap;
            overflow: hidden; text-overflow: ellipsis; }
.card .fr { color: var(--muted); font-size: .86rem; white-space: nowrap;
            overflow: hidden; text-overflow: ellipsis; }
.card .name-ar { font-size: 1.7rem; color: var(--rose-deep); line-height: 1.2;
                 flex: none; }
.card .tag { position: absolute; top: 8px; right: 10px; font-size: .68rem;
             font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
             color: var(--muted); }
.card .tag.play { color: var(--ok); }
.star {                         /* médaillon numéro (étoile à 8 branches) */
  position: relative; width: 46px; height: 46px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: .9rem;
  color: var(--rose-deep);
}
.star::before, .star::after {
  content: ""; position: absolute; inset: 7px; border-radius: 6px;
  border: 2px solid var(--rose); background: var(--rose-soft);
}
.star::after { transform: rotate(45deg); background: transparent; }
.star span { position: relative; z-index: 1; }

/* ───────────── lecteur ───────────── */
.reader {
  display: grid; grid-template-columns: 1fr; gap: 14px;
  max-width: 980px; margin: 0 auto; padding-top: 16px;
}
.surah-head {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm); display: flex; gap: 14px; align-items: center;
  flex-wrap: wrap;
}
.surah-head .titles { flex: 1; min-width: 160px; }
.surah-head h1 { font-family: "Playfair Display", Georgia, serif; margin: 0;
                 color: var(--plum); font-size: clamp(1.4rem, 4vw, 2rem);
                 line-height: 1.15; }
.surah-head .sub { color: var(--muted); font-size: .92rem; }
.surah-head .name-ar { font-size: 2.6rem; color: var(--rose-deep);
                       line-height: 1.1; }
.about { margin-top: 6px; }
.about summary { cursor: pointer; color: var(--rose-deep); font-weight: 700;
                 font-size: .9rem; }
.about p { color: var(--text); font-size: .93rem; margin: 8px 0; }

.verses { display: flex; flex-direction: column; gap: 10px;
          scroll-padding: 30vh; }
.bismillah-line { text-align: center; font-size: calc(var(--ar-size) * .95);
                  color: var(--gold); padding: 4px 0; }
.verse {
  --p: 0; position: relative; border-radius: 16px; padding: 12px 16px 10px;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer;
  transition: background .25s, border-color .25s, transform .25s,
              box-shadow .25s, opacity .25s;
  overflow: hidden; -webkit-tap-highlight-color: transparent;
}
.verse:hover { border-color: var(--rose); }
.verse.nosound { cursor: default; }
.verse .ar-text {
  font-family: "IndoPak", "Amiri", serif; direction: rtl; text-align: right;
  font-size: var(--ar-size); line-height: 2.05; color: var(--text);
  word-spacing: .06em;
}
.verse .num {
  display: inline-grid; place-items: center; min-width: 1.9em; height: 1.9em;
  margin: 0 .25em; padding: 0 .2em; font-family: "Nunito", sans-serif;
  font-size: .42em; font-weight: 800; color: var(--gold); vertical-align: middle;
  border: 2px solid var(--gold); border-radius: 50%; direction: ltr;
}
.verse .tr-text { color: var(--muted); font-size: .95rem; margin-top: 4px; }
.verse .ph-text { color: var(--rose-deep); font-size: .92rem; margin-top: 2px;
                  font-style: italic; }
.verse .tr-text b { color: var(--gold); margin-right: 4px; }
.verse::after {                    /* jauge de progression du verset */
  content: ""; position: absolute; left: 0; bottom: 0; height: 4px;
  width: calc(var(--p) * 100%); background: linear-gradient(90deg,
  var(--rose), var(--gold)); border-radius: 0 4px 4px 0; opacity: 0;
  transition: opacity .2s;
}
.verse.live {
  background: linear-gradient(120deg, var(--rose-soft), var(--gold-soft));
  border-color: var(--rose); box-shadow: var(--shadow); transform: scale(1.01);
}
.verse.live::after { opacity: 1; }
.verse.live .ar-text { color: var(--plum); }
.verse.done .ar-text { opacity: .82; }
.verse.intro .ar-text { text-align: center; color: var(--gold); }
.hide-tr .tr-text, .hide-ph .ph-text { display: none; }

/* mode prompteur : un verset à la fois, très grand */
.prompter .verse:not(.live):not(.next) { display: none; }
.prompter .verse.live { --ar-size: calc(var(--ar-size-base, 2rem) * 1.5); }
.prompter .verse.next { opacity: .45; transform: scale(.97); }
.prompter .verse.live .ar-text { font-size: calc(var(--ar-size) * 1.45); }
.prompter .bismillah-line { display: none; }

/* barre de lecture */
.player {
  position: sticky; bottom: 0; z-index: 20; margin: 0 -16px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -20px rgba(93,44,76,.4);
}
.player .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
               justify-content: center; }
.player .main-ctl { display: flex; align-items: center; gap: 8px; }
.play-btn {
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 20px -8px var(--rose-deep); transition: transform .15s;
}
.play-btn:active { transform: scale(.94); }
.play-btn svg { width: 26px; height: 26px; }
.timeline { position: relative; height: 26px; flex: 1 1 100%; cursor: pointer;
            touch-action: none; margin-bottom: 4px; }
.timeline .track { position: absolute; left: 0; right: 0; top: 11px; height: 5px;
                   border-radius: 4px; background: var(--line); }
.timeline .fill { position: absolute; left: 0; top: 11px; height: 5px;
                  border-radius: 4px; background: linear-gradient(90deg,
                  var(--rose), var(--gold)); width: 0; }
.timeline .tick { position: absolute; top: 7px; width: 2px; height: 13px;
                  background: var(--surface); border-radius: 2px; opacity: .9; }
.timeline .knob { position: absolute; top: 5px; width: 17px; height: 17px;
                  margin-left: -8px; border-radius: 50%; background: var(--surface);
                  border: 3px solid var(--rose); left: 0; }
.time { font-variant-numeric: tabular-nums; color: var(--muted);
        font-size: .82rem; min-width: 92px; text-align: center; }
.opts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.opts .pill { padding: 6px 11px; font-size: .8rem; }

.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.notice { background: var(--gold-soft); border: 1px solid var(--line);
          border-radius: 14px; padding: 10px 14px; font-size: .92rem; }

/* PAYSAGE sur téléphone : panneau de contrôle à gauche, versets à droite */
@media (orientation: landscape) and (max-height: 560px) {
  .topbar { padding-top: 6px; padding-bottom: 6px; }
  .topbar .brand b { font-size: 1rem; }
  .icon-btn { width: 34px; height: 34px; }
  .hero { padding: 14px 0 4px; }
  .hero h1 { font-size: 1.8rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
  .card { padding: 10px 12px; }
  main.reading { padding-bottom: 0; }
  .reader {
    max-width: none; padding-top: 8px;
    grid-template-columns: minmax(250px, 34%) 1fr;
    grid-template-rows: auto 1fr; gap: 10px 14px;
    height: calc(100dvh - 54px);
  }
  .reader .surah-head { grid-column: 1; grid-row: 1; padding: 10px 12px; }
  .reader .surah-head .name-ar { font-size: 1.8rem; }
  .reader .about { display: none; }
  .reader .player {
    grid-column: 1; grid-row: 2; position: static; margin: 0; align-self: start;
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 10px; box-shadow: var(--shadow-sm);
  }
  .reader .verses-pane { grid-column: 2; grid-row: 1 / span 2; overflow-y: auto;
                         padding: 4px 4px 40vh; overscroll-behavior: contain; }
  .play-btn { width: 50px; height: 50px; }
}
@media (min-width: 1100px) {
  .reader { grid-template-columns: 320px 1fr; max-width: 1240px;
            align-items: start; }
  .reader .side { position: sticky; top: 76px; display: flex;
                  flex-direction: column; gap: 14px; }
  .reader .player { position: static; margin: 0; border: 1px solid var(--line);
                    border-radius: var(--radius); box-shadow: var(--shadow-sm); }
}
.reader .side { display: contents; }
@media (min-width: 1100px) { .reader .side { display: flex; } }

/* ───────────── studio ───────────── */
.studio { max-width: 1280px; margin: 0 auto; padding-top: 18px; }
.studio h1 { font-family: "Playfair Display", Georgia, serif; color: var(--plum);
             margin: 0 0 4px; }
.panel { background: var(--surface); border: 1px solid var(--line);
         border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm);
         margin-bottom: 14px; }
.panel h2 { font-size: 1rem; margin: 0 0 10px; color: var(--plum); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); padding: 9px 14px;
  cursor: pointer; font-weight: 700; color: var(--plum); text-decoration: none;
  transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--rose); }
.btn.primary { background: linear-gradient(135deg, var(--rose), var(--rose-deep));
               color: #fff; border: 0; }
.btn.gold { background: var(--gold); color: #fff; border: 0; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 17px; height: 17px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px;
        font-size: .74rem; font-weight: 800; background: var(--bg2); color: var(--muted); }
.chip.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.chip.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.chip.rose { background: var(--rose-soft); color: var(--rose-deep); }
.stable { width: 100%; border-collapse: collapse; font-size: .92rem; }
.stable th, .stable td { padding: 8px 6px; border-bottom: 1px solid var(--line);
                         text-align: left; vertical-align: middle; }
.stable th { color: var(--muted); font-weight: 700; font-size: .78rem;
             text-transform: uppercase; letter-spacing: .05em; }
.stable tr.clickable { cursor: pointer; }
.stable tr.clickable:hover { background: var(--surface2); }
.switch { position: relative; width: 40px; height: 24px; flex: none;
          display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line);
               transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px;
                      left: 3px; top: 3px; border-radius: 50%; background: #fff;
                      transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--rose); }
.switch input:checked + span::after { transform: translateX(16px); }
.scroll-x { overflow-x: auto; }

.wave-wrap { position: relative; overflow-x: auto; overflow-y: hidden;
             border-radius: 14px; background: var(--bg2); border: 1px solid var(--line);
             touch-action: pan-x; -webkit-overflow-scrolling: touch; }
.wave-wrap canvas { display: block; }
.transport { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
             margin-top: 10px; }
.transport .time { min-width: 120px; }
.zoom { display: flex; align-items: center; gap: 6px; margin-left: auto;
        color: var(--muted); font-size: .85rem; }
.tap-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
           background: var(--rose-soft); border-radius: 14px; padding: 10px 12px;
           margin-top: 10px; }
.tap-big { font-size: 1.05rem; padding: 14px 22px; }
.vrow td { padding: 6px 4px; }
.vrow.sel { background: var(--rose-soft); }
.vrow.bad td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
.vrow .ar { font-size: 1.15rem; max-width: 280px; white-space: nowrap;
            overflow: hidden; text-overflow: ellipsis; }
.tin { width: 78px; padding: 5px 6px; border-radius: 8px; border: 1px solid var(--line);
       background: var(--surface); font-variant-numeric: tabular-nums; }
.mini { border: 1px solid var(--line); background: var(--surface); border-radius: 8px;
        padding: 3px 7px; cursor: pointer; font-size: .8rem; color: var(--plum); }
.mini:hover { border-color: var(--rose); }
.progress { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; transition: width .3s;
                   background: linear-gradient(90deg, var(--rose), var(--gold)); }
.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 16px;
        text-align: center; color: var(--muted); cursor: pointer; transition: .15s; }
.drop.over { border-color: var(--rose); background: var(--rose-soft); }
.login { max-width: 380px; margin: 40px auto; text-align: center; }
.login input { width: 100%; padding: 12px 14px; border-radius: 12px;
               border: 1px solid var(--line); background: var(--surface); margin: 12px 0; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .85rem;
         color: var(--muted); }
.field input, .field select { padding: 8px 10px; border-radius: 10px;
         border: 1px solid var(--line); background: var(--surface); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
         z-index: 100; background: var(--plum); color: var(--bg); padding: 10px 18px;
         border-radius: 12px; box-shadow: var(--shadow); font-weight: 700;
         max-width: calc(100vw - 32px); animation: toast .25s ease-out; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } }

footer.foot { text-align: center; color: var(--muted); font-size: .8rem;
              padding: 20px 16px 30px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* portrait : la barre de lecture reste collée en bas, sous les versets */
.reader .surah-head { order: 1; }
.reader .verses-pane { order: 2; }
.reader .player { order: 3; }

/* ═════════════════ ANIMATIONS & AMBIANCE ═════════════════ */
.aura { position: fixed; inset: -20vmax; z-index: -2; pointer-events: none;
        filter: blur(60px); opacity: .55; }
.aura i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%;
          animation: drift 28s ease-in-out infinite alternate; }
.aura i:nth-child(1) { background: radial-gradient(circle, #f6c4d6 0, transparent 65%);
                       left: 5%; top: 0; }
.aura i:nth-child(2) { background: radial-gradient(circle, #e6d3f3 0, transparent 65%);
                       right: 0; top: 20%; animation-duration: 34s; animation-delay: -8s; }
.aura i:nth-child(3) { background: radial-gradient(circle, #fbe3c4 0, transparent 65%);
                       left: 30%; bottom: 0; animation-duration: 40s; animation-delay: -16s; }
:root[data-theme="dark"] .aura { opacity: .22; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .aura { opacity: .22; } }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vmax, -4vmax) scale(1.12); }
  100% { transform: translate(-5vmax, 5vmax) scale(.94); }
}
#view.enter > * { animation: viewIn .55s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } }
.rise { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both;
        animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.shine {
  background: linear-gradient(100deg, var(--plum) 20%, var(--rose-deep) 40%,
              var(--gold) 50%, var(--rose-deep) 60%, var(--plum) 80%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text;
  color: transparent; animation: shine 7s linear infinite;
}
@keyframes shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.verse.live { animation: glow 2.6s ease-in-out infinite; }
@keyframes glow {
  0%, 100% { box-shadow: 0 10px 30px -14px rgba(212, 111, 147, .45), 0 0 0 0 rgba(212, 111, 147, .0); }
  50% { box-shadow: 0 14px 36px -12px rgba(212, 111, 147, .6), 0 0 0 6px rgba(212, 111, 147, .10); }
}
.play-btn.playing { animation: pulse 1.8s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 8px 20px -8px var(--rose-deep), 0 0 0 0 rgba(212, 111, 147, .45); }
  100% { box-shadow: 0 8px 20px -8px var(--rose-deep), 0 0 0 16px rgba(212, 111, 147, 0); }
}

/* ═════════════════ COUVERTURE (comme le Genially) ═════════════════ */
.cover { position: relative; min-height: calc(100dvh - 60px); display: grid;
         place-items: center; text-align: center; padding: 20px 0 30px; overflow: hidden; }
.cover .medal { width: clamp(120px, 26vmin, 210px); aspect-ratio: 1; position: relative;
                margin: 0 auto 6px; }
.cover .medal img { width: 100%; height: 100%; animation: spin 60s linear infinite;
                    filter: drop-shadow(0 12px 30px rgba(180, 81, 122, .35)); }
.cover .medal::after { content: ""; position: absolute; inset: -14%; border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--gold) 70%, transparent);
  animation: spin 90s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.cover h1 { font-family: "Playfair Display", Georgia, serif; font-weight: 700;
            font-size: clamp(2.4rem, 8.5vmin, 5.2rem); line-height: 1.02; margin: 8px 0; }
.cover .teacher { letter-spacing: .34em; text-transform: uppercase; font-weight: 800;
                  color: var(--rose-deep); font-size: clamp(.72rem, 2vmin, .95rem); }
.cover .ar-big { font-size: clamp(1.6rem, 5vmin, 2.6rem); color: var(--gold); margin-top: 4px; }
.cta {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 22px;
  padding: 14px 34px; border-radius: 999px; text-decoration: none; font-weight: 800;
  letter-spacing: .3em; text-transform: uppercase; color: #fff; font-size: .95rem;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  box-shadow: 0 14px 30px -12px var(--rose-deep); position: relative; overflow: hidden;
  transition: transform .2s;
}
.cta:hover { transform: translateY(-2px) scale(1.02); }
.cta::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg,
  transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); transform: translateX(-100%);
  animation: sweep 3.2s ease-in-out infinite; }
@keyframes sweep { 60%, 100% { transform: translateX(100%); } }
.sparkles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sparkles i { position: absolute; bottom: -10px; width: var(--s, 6px); height: var(--s, 6px);
  border-radius: 50%; background: radial-gradient(circle, #fff 0, var(--gold) 40%, transparent 70%);
  opacity: 0; animation: floatUp var(--d, 12s) linear infinite; animation-delay: var(--delay, 0s);
  left: var(--x, 50%); filter: blur(.3px); }
@keyframes floatUp {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  12% { opacity: .9; }
  100% { transform: translateY(-105vh) translateX(var(--dx, 20px)); opacity: 0; }
}
.cover-stats { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.cover-stats span { background: color-mix(in srgb, var(--surface) 75%, transparent);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  font-size: .85rem; color: var(--muted); backdrop-filter: blur(6px); }
@media (orientation: landscape) and (max-height: 560px) {
  .cover { min-height: calc(100dvh - 50px); padding: 6px 0; }
  .cover .inner { display: grid; grid-template-columns: auto 1fr; gap: 6px 28px;
                  align-items: center; text-align: left; }
  .cover .medal { grid-row: span 5; width: 34vmin; margin: 0; }
  .cover h1 { font-size: 11vmin; }
  .cover .cta { margin-top: 10px; justify-self: start; }
  .cover-stats { justify-content: flex-start; margin-top: 8px; }
}

/* ═════════════════ ONGLETS DU LECTEUR ═════════════════ */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; overflow-x: auto;
        background: color-mix(in srgb, var(--surface) 80%, transparent);
        border: 1px solid var(--line); scrollbar-width: none; flex-basis: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: 1; text-align: center; padding: 8px 12px; border-radius: 999px; white-space: nowrap;
          text-decoration: none; color: var(--muted); font-weight: 800; font-size: .86rem;
          transition: background .25s, color .25s; }
.tabs a.on { background: linear-gradient(135deg, var(--rose), var(--rose-deep)); color: #fff;
             box-shadow: 0 6px 16px -8px var(--rose-deep); }
.about-pane { display: none; }
.tab-apropos .about-pane { display: block; }
.tab-apropos .verses, .tab-apropos .notice-audio { display: none; }
.about-pane article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm); line-height: 1.75; }
.about-pane article p { margin: 0 0 12px; white-space: pre-line; }
.about-pane h2 { font-family: "Playfair Display", serif; color: var(--plum); margin: 0 0 10px; }
.tab-phonetique .ph-text { font-size: 1.15rem; color: var(--plum); font-style: normal;
                           font-weight: 700; margin-top: 6px; }
.tab-phonetique .verse .ar-text { font-size: calc(var(--ar-size) * .8); }
.tab-ecouter .verses { min-height: 60vh; justify-content: center; }
.tab-ecouter .verse:not(.live):not(.next) { display: none; }
.tab-ecouter .verse.live .ar-text { font-size: calc(var(--ar-size) * 1.4); line-height: 2.2;
                                    text-align: center; }
.tab-ecouter .verse.live .tr-text, .tab-ecouter .verse.live .ph-text { text-align: center; font-size: 1.05rem; }
.tab-ecouter .verse.next { opacity: .5; transform: scale(.96); }
.tab-ecouter .verse.next .ar-text { text-align: center; }
.tab-ecouter .verse.live { animation: glow 2.6s ease-in-out infinite, verseIn .5s cubic-bezier(.2,.8,.2,1); }
@keyframes verseIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.tab-ecouter .bismillah-line { display: none; }
.surah-nav { display: flex; justify-content: space-between; gap: 10px; margin: 18px 0 8px; flex-wrap: wrap; }
.idx-head { text-align: center; padding: 26px 0 6px; }
.idx-head h1 { font-family: "Playfair Display", Georgia, serif; font-size: clamp(1.8rem, 5vw, 2.8rem);
               margin: 0; }
@media (orientation: landscape) and (max-height: 560px) {
  .idx-head { padding: 10px 0 0; } .idx-head h1 { font-size: 1.6rem; }
  .tab-ecouter .verses { min-height: 0; }
  .tabs a { padding: 6px 8px; font-size: .78rem; }
}
.cover .medal .iqra { position: absolute; inset: 0; display: grid; place-items: center;
  font-size: clamp(1.5rem, 5.4vmin, 2.9rem); color: var(--rose-deep); padding-top: .2em;
  text-shadow: 0 1px 0 #fff; pointer-events: none; }
:root[data-theme="dark"] .cover .medal .iqra { color: #b4517a; }

/* correctifs de mise en page */
.search svg, .toolbar svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.reader { grid-template-columns: minmax(0, 1fr); }
.reader > *, .reader .side > *, .verses-pane { min-width: 0; }
.surah-head .titles { min-width: 0; }
.verse .ar-text { overflow-wrap: anywhere; }
@media (orientation: landscape) and (max-height: 560px) {
  .reader { grid-template-columns: minmax(240px, 34%) minmax(0, 1fr);
            grid-template-rows: auto minmax(0, 1fr); }
  .reader .player { max-height: 100%; overflow-y: auto; align-self: stretch; }
  .reader .surah-head .sub { display: none; }
  .reader .surah-head { gap: 8px 10px; }
  .reader .surah-head h1 { font-size: 1.3rem; }
  .reader .surah-head .star { width: 38px; height: 38px; }
  .surah-nav { margin-bottom: 0; }
}
@media (min-width: 1100px) {
  .reader { grid-template-columns: 340px minmax(0, 1fr); }
}
.tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
        border-radius: 18px; overflow: visible; }
.tabs a { padding: 8px 10px; }
.surah-head h1 { white-space: nowrap; }
.surah-head .name-ar { margin-left: auto; }
:where(main) svg { width: 1.1em; height: 1.1em; flex: none; }
.drop svg { vertical-align: -3px; margin-right: 4px; }
input[type="range"], input[type="checkbox"] { accent-color: var(--rose); }
.surah-head h1 { overflow: hidden; text-overflow: ellipsis; }
.surah-head .name-ar { flex: none; }
.star { font-size: .8rem; letter-spacing: -.02em; }
/* paysage : place au nom de la sourate (le n° est déjà dans le titre de page) */
@media (orientation: landscape) and (max-height: 560px) {
  .reader .surah-head .star { display: none; }
  .reader .surah-head .name-ar { font-size: 1.5rem; }
}

/* ═════════ MOBILE PAYSAGE : tout tient sur un écran (jusqu'à ~260 px de haut) ═════════ */
@media (orientation: landscape) and (max-height: 560px) {
  /* en lecture, la barre du haut disparaît (le bouton retour reste) */
  body:has(main.reading) .topbar { display: none; }
  main.reading { padding: 0 10px; padding-left: max(10px, env(safe-area-inset-left));
                 padding-right: max(10px, env(safe-area-inset-right)); }
  .reader { height: 100dvh; padding: 6px 0; gap: 6px 10px;
            grid-template-columns: minmax(220px, 31%) minmax(0, 1fr);
            grid-template-rows: auto minmax(0, 1fr); }
  .reader .surah-head { padding: 6px 8px; gap: 6px 8px; border-radius: 14px; flex-wrap: wrap; }
  .reader .surah-head .icon-btn { width: 30px; height: 30px; }
  .reader .surah-head .titles { flex: 1; min-width: 0; }
  .reader .surah-head h1 { font-size: 1.05rem; }
  .reader .surah-head .name-ar { font-size: 1.25rem; }
  /* onglets : grille 2 × 2 compacte */
  .reader .tabs { grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 12px; }
  .reader .tabs a { padding: 4px 6px; font-size: .72rem; border-radius: 9px; }
  /* lecteur compact */
  .reader .player { padding: 6px 8px; border-radius: 14px; overflow-y: auto; }
  .reader .player .row { gap: 6px; flex-wrap: nowrap; }
  .reader .timeline { margin-bottom: 0; height: 22px; }
  .reader .play-btn { width: 42px; height: 42px; }
  .reader .play-btn svg { width: 20px; height: 20px; }
  .reader .player .icon-btn { width: 32px; height: 32px; }
  .reader .time { min-width: 0; font-size: .72rem; }
  .reader .opts { flex-wrap: wrap; overflow-x: auto; justify-content: flex-start;
                  margin-top: 4px !important; scrollbar-width: none; padding-bottom: 2px; }
  .reader .opts::-webkit-scrollbar { display: none; }
  .reader .opts .pill { padding: 4px 9px; font-size: .7rem; flex: none; }
  .reader .opts .pill svg { width: 12px; height: 12px; }
  /* texte arabe proportionné à la HAUTEUR de l'écran */
  .reader { --ar-size: clamp(1.15rem, 7.5vh, 2rem) !important; }
  .reader .verses-pane { padding: 2px 2px 30vh; }
  .reader .verse { padding: 6px 12px 6px; border-radius: 14px; }
  .reader .verse .ar-text { line-height: 1.9; }
  .reader .verse .tr-text, .reader .verse .ph-text { font-size: .8rem; margin-top: 0; }
  .verses { gap: 6px; }
  /* onglet Écouter : verset courant grand mais borné par la hauteur */
  .tab-ecouter .verses { min-height: 0; justify-content: flex-start; }
  .tab-ecouter .verse.live .ar-text { font-size: clamp(1.4rem, 11vh, 2.6rem); line-height: 1.85; }
  .tab-ecouter .verse.live .tr-text { font-size: .85rem; }
  .tab-ecouter .verse.next .ar-text { font-size: clamp(1rem, 7vh, 1.6rem); }
  .verse .num { white-space: nowrap; }
  .surah-nav { margin: 8px 0 0; }
  .surah-nav .pill { padding: 5px 10px; font-size: .75rem; }
}
/* très peu de hauteur (barre d'adresse visible) : on resserre encore */
@media (orientation: landscape) and (max-height: 330px) {
  .reader .surah-head .sub, .reader .surah-head .name-ar { display: none; }
  .reader .tabs a { padding: 3px 4px; font-size: .68rem; }
  .reader .timeline { height: 18px; }
  .reader .timeline .track, .reader .timeline .fill { top: 8px; }
  .reader .timeline .knob { top: 2px; width: 14px; height: 14px; margin-left: -7px; }
  .reader .timeline .tick { top: 5px; height: 11px; }
  .reader .play-btn { width: 38px; height: 38px; }
  .reader .verse .tr-text { font-size: .76rem; }
  .reader .opts { flex-wrap: nowrap; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .reader .player .row.opts { flex-wrap: wrap; }
}
@media (orientation: landscape) and (max-height: 330px) {
  .reader .player .row.opts { flex-wrap: nowrap; }
}
/* bureau : panneau latéral étroit → nom complet (n° déjà dans le sous-titre) */
@media (min-width: 1100px) {
  .reader .surah-head .star { display: none; }
  .reader .surah-head h1 { font-size: 1.6rem; }
}

/* ═════════ TÉLÉPHONE (portrait ou paysage) : lecture plein écran ═════════
   en-tête = nom + infos de la sourate · milieu = versets (seule zone qui
   défile) · bas = barre de contrôle sur toute la largeur. La barre du site
   est masquée pendant la lecture (le bouton retour reste dans l'en-tête). */
@media (max-width: 760px), (orientation: landscape) and (max-height: 560px) {
  body:has(main.reading) .topbar { display: none; }
  body:has(main.reading) { overflow: hidden; }
  main.reading { padding: 0; }
  .reader { display: flex; flex-direction: column; height: 100dvh; max-width: none;
            margin: 0; padding: 0; gap: 0; }
  /* en-tête : grille retour | nom | nom arabe, infos dessous, onglets */
  .reader .surah-head {
    flex: none; display: grid; align-items: center; border-radius: 0;
    border-width: 0 0 1px; box-shadow: none; gap: 2px 10px;
    padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "back title ar" "back sub ar" "tabs tabs tabs";
  }
  .reader .surah-head > .icon-btn { grid-area: back; width: 40px; height: 40px; }
  .reader .surah-head .star { display: none; }
  .reader .surah-head .titles { display: contents; }
  .reader .surah-head h1 { grid-area: title; white-space: normal; overflow: visible;
    text-overflow: clip; overflow-wrap: anywhere; font-size: clamp(1.15rem, 5.4vw, 1.6rem);
    line-height: 1.15; }
  .reader .surah-head .sub { grid-area: sub; display: block; font-size: .8rem;
                             line-height: 1.3; }
  .reader .surah-head .name-ar { grid-area: ar; margin: 0; font-size: clamp(1.6rem, 8vw, 2.2rem); }
  .reader .surah-head .tabs { grid-area: tabs; margin-top: 6px; gap: 3px; padding: 3px;
    border-radius: 12px; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .reader .surah-head .tabs a { padding: 7px 4px; font-size: .78rem; border-radius: 9px;
    white-space: normal; line-height: 1.15; display: grid; place-items: center; }
  /* versets : seule zone qui défile */
  .reader .verses-pane { flex: 1 1 auto; min-height: 0; overflow-y: auto;
    overscroll-behavior: contain; padding: 10px 12px 20vh;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right)); }
  .tab-ecouter .verses { min-height: 0; justify-content: flex-start; }
  /* barre de contrôle sur tout le bas, opaque */
  .reader .player { flex: none; position: static; margin: 0; max-height: none;
    overflow: visible; border: 0; border-top: 1px solid var(--line); border-radius: 0;
    background: var(--surface); box-shadow: 0 -10px 30px -20px rgba(93,44,76,.4);
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right)); }
  .reader .timeline { height: 24px; margin-bottom: 0; }
  .reader .player .icon-btn { width: 44px; height: 44px; }
  .reader .play-btn { width: 52px; height: 52px; }
  .reader .time { min-width: 0; font-size: .8rem; }
  .reader .player .row.opts { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start;
    scrollbar-width: none; margin-top: 6px !important; padding-bottom: 2px; }
  .reader .player .row.opts::-webkit-scrollbar { display: none; }
  .reader .opts .pill { flex: none; min-height: 38px; padding: 7px 12px; font-size: .82rem; }
  .reader .surah-nav { margin: 14px 0 0; }
}
/* portrait étroit : les options passent à la ligne plutôt que de défiler */
@media (max-width: 760px) and (orientation: portrait) {
  .reader .player .row.opts { flex-wrap: wrap; justify-content: center; }
}
/* paysage : en-tête sur une ligne (onglets à droite), contrôles sur une ligne */
@media (orientation: landscape) and (max-height: 560px) {
  .reader .surah-head { grid-template-columns: auto minmax(0, auto) auto minmax(0, 1fr);
    grid-template-areas: "back title ar tabs" "back sub ar tabs"; padding-top: 4px;
    padding-bottom: 4px; gap: 0 12px; }
  .reader .surah-head h1 { font-size: 1.15rem; }
  .reader .surah-head .sub { font-size: .72rem; }
  .reader .surah-head .name-ar { font-size: 1.6rem; }
  .reader .surah-head .tabs { margin-top: 0; }
  .reader .surah-head .tabs a { padding: 5px 4px; font-size: .74rem; }
  .reader .player { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px;
                    padding-top: 2px; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .reader .player .row:first-child { flex: 1 1 100%; }
  .reader .player .row { flex: none; flex-wrap: nowrap; }
  .reader .player .row.opts { flex: 1 1 0; min-width: 0; margin-top: 0 !important; }
  .reader .player .icon-btn { width: 38px; height: 38px; }
  .reader .play-btn { width: 44px; height: 44px; }
  .reader .opts .pill { min-height: 34px; padding: 5px 10px; font-size: .76rem; }
  .reader .verses-pane { padding-bottom: 30vh; }
}
@media (orientation: landscape) and (max-height: 330px) {
  .reader .surah-head .sub, .reader .surah-head .name-ar { display: none; }
  .reader .surah-head { grid-template-areas: "back title ar tabs"; }
}

/* ═════════ INDEX : noms de sourates entiers (pas de « … ») ═════════ */
.grid { grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); }
.card { padding-top: 22px; align-items: center; }
.card .tr, .card .fr { white-space: normal; overflow: visible; text-overflow: clip;
                       overflow-wrap: anywhere; line-height: 1.25; }
.card .name-ar { font-size: 1.55rem; max-width: 42%; text-align: right; }
.card .tag { top: 6px; font-size: .64rem; }
@media (orientation: landscape) and (max-height: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
  .card { padding: 20px 12px 10px; }
}

/* ═════════ JAUGE DU VERSET DE DROITE À GAUCHE (sens de la lecture arabe) ═════════
   (la frise du lecteur, elle, reste de gauche à droite) */
.verse::after { left: auto; right: 0; border-radius: 4px 0 0 4px;
  background: linear-gradient(270deg, var(--rose), var(--gold)); }
/* titre du site : se réduit avec la largeur (police système agrandie) au lieu d'être coupé */
@media (max-width: 600px) {
  .brand b { font-size: min(1.2rem, 5vw); }
  .topbar { gap: 8px; }
  .topbar nav .pill { padding: 8px 12px; }
}
.about-pane .about-src { margin: 14px 0 0; font-size: .82rem; color: var(--muted); }
.about-pane .about-src a { color: var(--rose-deep); }

/* ═════════ SURLIGNAGE MOT À MOT (verset en cours) ═════════ */
.verse .w { border-radius: .35em; padding: 0 .06em; transition: background .18s, color .18s; }
.reader:not(.no-words) .verse.live .w.said { color: var(--rose-deep); }
.reader:not(.no-words) .verse.live .w.on { color: var(--plum);
  background: color-mix(in srgb, var(--gold) 34%, transparent);
  box-shadow: 0 0 0 .08em color-mix(in srgb, var(--gold) 34%, transparent); }

/* ═════════ MODE MUSHAF : fond blanc, texte noir (thème clair comme sombre) ═════════ */
.reader.mushaf .verses-pane { background: #fdfbf5; color-scheme: light; }
.reader.mushaf .verse, .reader.mushaf .verse.intro {
  background: #fff; border-color: #e4dccb; box-shadow: none; animation: none; }
.reader.mushaf .verse .ar-text, .reader.mushaf .verse.live .ar-text,
.reader.mushaf .verse.intro .ar-text, .reader.mushaf .bismillah-line { color: #111; }
.reader.mushaf .verse.done .ar-text { opacity: 1; }
.reader.mushaf .verse .num { color: #6b5a2e; border-color: #b8a46a; }
.reader.mushaf .verse .tr-text, .reader.mushaf .verse .ph-text { color: #4a4a4a; }
.reader.mushaf .verse .tr-text b { color: #6b5a2e; }
.reader.mushaf .verse.live { background: #fffaf0; border-color: #c39a52; transform: none;
  box-shadow: 0 0 0 2px rgba(195, 154, 82, .25); }
.reader.mushaf .verse.next { opacity: .7; }
.reader:not(.no-words).mushaf .verse.live .w.said { color: #111; }
.reader:not(.no-words).mushaf .verse.live .w.on { color: #111; background: rgba(195, 154, 82, .32);
  box-shadow: 0 0 0 .08em rgba(195, 154, 82, .32); }
.reader.mushaf .surah-nav .pill { background: #fff; color: #333; border-color: #e4dccb; }

/* ═════════ TAJWÎD EN COULEURS (palette de quran.com) ═════════ */
:root, .reader.mushaf {
  --tj-madd-n: #537fff; --tj-madd-p: #4050ff; --tj-madd-o: #2144c1; --tj-madd-l: #000ebc;
  --tj-ghunna: #ff7e1e; --tj-qalqala: #dd0008; --tj-ikhfa: #9400a8; --tj-ikhfa-s: #d500b7;
  --tj-idgham-g: #169777; --tj-idgham-n: #169200; --tj-idgham-s: #58b800; --tj-iqlab: #26bffd;
  --tj-silent: #aaaaaa; }
:root[data-theme="dark"] .reader:not(.mushaf) {
  --tj-madd-n: #8ea9ff; --tj-madd-p: #8b95ff; --tj-madd-o: #6f8be8; --tj-madd-l: #6d78ff;
  --tj-ghunna: #ffa04d; --tj-qalqala: #ff5c63; --tj-ikhfa: #c76cd6; --tj-ikhfa-s: #f06ae0;
  --tj-idgham-g: #3ccfa6; --tj-idgham-n: #4cc94c; --tj-idgham-s: #8bdc3b; --tj-iqlab: #5fd3ff;
  --tj-silent: #8a8a8a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .reader:not(.mushaf) {
  --tj-madd-n: #8ea9ff; --tj-madd-p: #8b95ff; --tj-madd-o: #6f8be8; --tj-madd-l: #6d78ff;
  --tj-ghunna: #ffa04d; --tj-qalqala: #ff5c63; --tj-ikhfa: #c76cd6; --tj-ikhfa-s: #f06ae0;
  --tj-idgham-g: #3ccfa6; --tj-idgham-n: #4cc94c; --tj-idgham-s: #8bdc3b; --tj-iqlab: #5fd3ff;
  --tj-silent: #8a8a8a; } }
.reader.tajweed .tj-madd-n { color: var(--tj-madd-n); }
.reader.tajweed .tj-madd-p { color: var(--tj-madd-p); }
.reader.tajweed .tj-madd-o { color: var(--tj-madd-o); }
.reader.tajweed .tj-madd-l { color: var(--tj-madd-l); }
.reader.tajweed .tj-ghunna { color: var(--tj-ghunna); }
.reader.tajweed .tj-qalqala { color: var(--tj-qalqala); }
.reader.tajweed .tj-ikhfa { color: var(--tj-ikhfa); }
.reader.tajweed .tj-ikhfa-s { color: var(--tj-ikhfa-s); }
.reader.tajweed .tj-idgham-g { color: var(--tj-idgham-g); }
.reader.tajweed .tj-idgham-n { color: var(--tj-idgham-n); }
.reader.tajweed .tj-idgham-s { color: var(--tj-idgham-s); }
.reader.tajweed .tj-iqlab { color: var(--tj-iqlab); }
.reader.tajweed .tj-silent { color: var(--tj-silent); }
.tj-legend { display: none; flex-wrap: wrap; gap: 4px 12px; font-size: .74rem; color: var(--muted);
  padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); }
.reader.tajweed .tj-legend { display: flex; }
.tab-apropos .tj-legend { display: none !important; }
.tj-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tj-legend small { flex-basis: 100%; font-size: .7rem; opacity: .85; }
.tj-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tj-dot.tj-madd-n { background: var(--tj-madd-n); }
.tj-dot.tj-madd-p { background: var(--tj-madd-p); }
.tj-dot.tj-madd-o { background: var(--tj-madd-o); }
.tj-dot.tj-madd-l { background: var(--tj-madd-l); }
.tj-dot.tj-ghunna { background: var(--tj-ghunna); }
.tj-dot.tj-qalqala { background: var(--tj-qalqala); }
.tj-dot.tj-ikhfa { background: var(--tj-ikhfa); }
.tj-dot.tj-ikhfa-s { background: var(--tj-ikhfa-s); }
.tj-dot.tj-idgham-g { background: var(--tj-idgham-g); }
.tj-dot.tj-idgham-n { background: var(--tj-idgham-n); }
.tj-dot.tj-idgham-s { background: var(--tj-idgham-s); }
.tj-dot.tj-iqlab { background: var(--tj-iqlab); }
.tj-dot.tj-silent { background: var(--tj-silent); }
.reader.mushaf .tj-legend { background: #fff; color: #444; border-color: #e4dccb; }
.view-opts { margin: 0 0 10px; }
.tab-apropos .view-opts { display: none; }

/* légende du tajwîd repliable */
.tj-legend-btn { margin-left: auto; border: 1px solid var(--line); background: var(--surface);
  color: var(--rose-deep); border-radius: 999px; padding: 3px 10px; font-size: .7rem;
  font-weight: 700; cursor: pointer; }
.reader.tj-nolegend .tj-legend > span, .reader.tj-nolegend .tj-legend > small { display: none; }
.reader.tj-nolegend .tj-legend { border: 0; background: none; padding: 0; justify-content: flex-end; }
.reader.mushaf .tj-legend-btn { background: #fff; color: #6b5a2e; border-color: #e4dccb; }
/* phonétique Tanzil */
.ph-text .ph-b, .ph-note .ph-b { opacity: .45; }
.ph-text .ph-u, .ph-note .ph-u { text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 3px; }
.ph-note { display: none; font-size: .74rem; color: var(--muted); margin: 0 0 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tab-phonetique .ph-note { display: block; }
.ph-note a { color: var(--rose-deep); }
.reader.mushaf .ph-note { background: #fff; color: #444; border-color: #e4dccb; }
.tj-legend small a { color: var(--rose-deep); }
