/* Adhkar — prototype.
   Mise en page : une fiche par écran, défilement vertical aimanté,
   compteur fixé en bas, à portée de pouce. L'arabe d'abord. */
:root {
  /* Couleurs : encre de nuit et or d'enluminure du mushaf */
  --bg: #F5F3EE;
  --surface: #FFFFFF;
  --surface-2: #EEEBE3;
  --ink: #1B1F2A;
  --muted: #687082;
  --line: #E2DED4;
  --gold: #A87B22;
  --gold-soft: #F1E5C8;
  --lapis: #22407A;
  --ok: #1D7A55;
  --dawn-a: #FCE3C6; --dawn-b: #F7F0E2; --dawn-ink: #4A2E12;
  --dusk-a: #23285A; --dusk-b: #4C3768; --dusk-ink: #F3ECFF;
  /* Compteur en verre clair (le texte reste visible dessous) */
  --dock: #FFFFFF; --dock-ink: #1B1F2A; --dock-muted: #5E6678; --ring-track: rgba(27,31,42,.12); --dock-alpha: 58%; --dock-halo: rgba(255,255,255,.9);
  /* Tajwid (convention du mushaf tajwid des lecteurs) */
  --tj-lazim: #A3157F; --tj-wajib: #E2336B; --tj-jaiz: #E8801A; --tj-tabii: #B8901A;
  --tj-ghunna: #138F48; --tj-idgham: #9A9CA3; --tj-qalqala: #1A9BD0;
  /* Typographie */
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ui-ar: "IBM Plex Sans Arabic", "Noto Naskh Arabic", system-ui, sans-serif;
  --ar: "Amiri", "Noto Naskh Arabic", serif;
  --quran-uni: "Amiri Quran", "Amiri", serif;
  --scale: 1;
  --dock-h: 76px;
  --top-h: 64px;
  --quran-palette-42: normal; --quran-palette-49: normal; --quran-palette-604: normal;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C111D; --surface: #141B2B; --surface-2: #1B2436; --ink: #ECE7DB; --muted: #97A0B4;
    --line: #26304A; --gold: #D9B468; --gold-soft: #2D2715; --lapis: #9DB6F0; --ok: #5CC79A;
    --dawn-a: #3A2A1E; --dawn-b: #1A1A22; --dawn-ink: #FBE3C2;
    --dusk-a: #1A1E46; --dusk-b: #34254F; --dusk-ink: #EDE3FF;
    --dock: #1E2740; --dock-ink: #F2EEE4; --dock-muted: #B4BCD0; --ring-track: rgba(255,255,255,.12); --dock-alpha: 55%; --dock-halo: rgba(0,0,0,.6);
    --tj-lazim: #E06BC5; --tj-wajib: #FF6F96; --tj-jaiz: #FFA24D; --tj-tabii: #E2C25A;
    --tj-ghunna: #4FCB83; --tj-idgham: #8D93A3; --tj-qalqala: #5CC6F0;
    --quran-palette-42: --qv4-night-42; --quran-palette-49: --qv4-night-49; --quran-palette-604: --qv4-night-604;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C111D; --surface: #141B2B; --surface-2: #1B2436; --ink: #ECE7DB; --muted: #97A0B4;
  --line: #26304A; --gold: #D9B468; --gold-soft: #2D2715; --lapis: #9DB6F0; --ok: #5CC79A;
  --dawn-a: #3A2A1E; --dawn-b: #1A1A22; --dawn-ink: #FBE3C2;
  --dusk-a: #1A1E46; --dusk-b: #34254F; --dusk-ink: #EDE3FF;
  --dock: #1E2740; --dock-ink: #F2EEE4; --dock-muted: #B4BCD0; --ring-track: rgba(255,255,255,.12); --dock-alpha: 55%; --dock-halo: rgba(0,0,0,.6);
  --tj-lazim: #E06BC5; --tj-wajib: #FF6F96; --tj-jaiz: #FFA24D; --tj-tabii: #E2C25A;
  --tj-ghunna: #4FCB83; --tj-idgham: #8D93A3; --tj-qalqala: #5CC6F0;
  --quran-palette-42: --qv4-night-42; --quran-palette-49: --qv4-night-49; --quran-palette-604: --qv4-night-604;
  color-scheme: dark;
}
:root[data-font="scheherazade"] { --ar: "Scheherazade New", "Amiri", serif; }
:root[data-font="noto"] { --ar: "Noto Naskh Arabic", "Amiri", serif; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg); color: var(--ink); font-family: var(--ui); font-size: 15px;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow: hidden; overscroll-behavior: none;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
[lang="ar"] { font-family: var(--ar); }
.ui-ar { font-family: var(--ui-ar); }
.app { height: 100%; position: relative; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; }
.view-enter { animation: viewIn .32s cubic-bezier(.2,.8,.2,1) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- Choix de la langue ---------- */
.onboard { justify-content: center; gap: 28px; padding-block: 32px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); max-width: 520px; margin: 0 auto; }
.onboard .bism { font-family: var(--quran-uni); font-size: 30px; text-align: center; color: var(--gold); line-height: 1.6; }
.onboard h1 { margin: 0; text-align: center; font-family: var(--ui-ar); font-weight: 600; font-size: 24px; line-height: 1.5; }
.onboard p { margin: 0; text-align: center; color: var(--muted); line-height: 1.5; }
.lang-list { display: grid; gap: 10px; }
.lang-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 0 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 18px; font-weight: 500; transition: transform .15s, border-color .15s; }
.lang-btn:active { transform: scale(.98); }
.lang-btn .hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.lang-btn[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }

/* ---------- Accueil ---------- */
.home { overflow-y: auto; padding-top: 12px; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.home-inner { max-width: 560px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.home-top { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.hijri { font-family: var(--ui-ar); color: var(--muted); font-size: 14px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--ink); }
.icon-btn:active { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; }
.moments { display: grid; gap: 12px; }
.moment { position: relative; overflow: hidden; border-radius: 26px; min-height: 148px; display: grid; transition: transform .2s; }
.moment-open { width: 100%; height: 100%; min-height: inherit; border-radius: inherit; padding: 58px 22px 20px; text-align: start; display: grid; gap: 6px; align-content: end; }
.moment-open:focus-visible { outline-offset: -4px; border-radius: inherit; }
.moment-resume { z-index: 1; min-height: 36px; }
.moment-resume:active { background: color-mix(in srgb, currentColor 22%, transparent); }
.moment:active { transform: scale(.985); }
.moment.dawn { background: linear-gradient(160deg, var(--dawn-a), var(--dawn-b)); color: var(--dawn-ink); }
.moment.dusk { background: linear-gradient(160deg, var(--dusk-a), var(--dusk-b)); color: var(--dusk-ink); }
.moment .ar-title { font-family: var(--ar); font-size: 34px; line-height: 1.3; font-weight: 700; }
.moment .tr-title { font-size: 15px; opacity: .8; }
.moment .state { position: absolute; top: 18px; inset-inline-end: 18px; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, currentColor 12%, transparent); }
.moment .now { position: absolute; top: 18px; inset-inline-start: 22px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.moment .bar { height: 4px; border-radius: 4px; background: color-mix(in srgb, currentColor 18%, transparent); margin-top: 10px; overflow: hidden; }
.moment .bar i { display: block; height: 100%; background: currentColor; border-radius: 4px; }
.moment.primary { min-height: 200px; }
.moment.primary .ar-title { font-size: 42px; }
.intro-band { min-height: 40px; display: flex; align-items: center; gap: 10px; margin-top: -16px; padding: 0 12px; border-block: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: start; }
.intro-band svg { width: 16px; height: 16px; color: var(--gold); flex: none; }
.intro-band span:last-child { margin-inline-start: auto; }
.intro-band:active { background: var(--surface-2); }
[dir="rtl"] .intro-band span:last-child { transform: rotate(180deg); }
.sun { position: absolute; width: 140px; height: 140px; border-radius: 50%; inset-inline-end: -30px; top: -34px; opacity: .55; }
.dawn .sun { background: radial-gradient(circle, #FFC98A 0%, rgba(255,201,138,0) 70%); }
.dusk .sun { background: radial-gradient(circle, #B9A8FF 0%, rgba(185,168,255,0) 70%); }
.sec-title { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin: 6px 4px 0; }
.sections { display: grid; gap: 8px; }
.section-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-align: start; min-height: 64px; }
.section-row:active { background: var(--surface-2); }
.section-row .txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.section-row .ar { font-family: var(--ar); font-size: 21px; line-height: 1.4; }
.section-row .tr { color: var(--muted); font-size: 13px; }
.section-row .soon { font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 4px 10px; }
.glyph { width: 40px; height: 40px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; flex: none; }
.glyph svg { width: 22px; height: 22px; }
.foot-note { color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; padding: 8px 12px 0; }

/* Coucher : deux boutons voisins, afin de garder « Reprendre » indépendant. */
.sleep-home { display: grid; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }
.sleep-home.primary { border-color: var(--gold); }
.sleep-home .section-row { width: 100%; border: 0; border-radius: 0; }
.sleep-resume { min-height: 44px; padding: 10px 16px; border-top: 1px solid var(--line); text-align: end; font-size: 14px; color: var(--gold); }
.sleep-state { max-width: 38%; font-size: 13px; color: var(--gold); }
.sleep-panel .card-inner { gap: 22px; }
.sleep-panel .card-head .name { font-size: 21px; color: var(--ink); margin: 0; }
.sleep-prep { display: grid; gap: 20px; padding-inline-start: 24px; margin: 0; font-size: calc(18px * var(--scale)); line-height: 1.6; }
.sleep-prep p { margin: 0 0 8px; }
.sleep-prep .chip { height: auto; min-height: 36px; padding-block: 6px; text-align: start; }
.sleep-group { display: grid; gap: 12px; }
.sleep-group h3 { margin: 0; font-size: 18px; }
.sleep-links { display: grid; gap: 8px; }
.sleep-link { display: grid; gap: 7px; min-height: 48px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: start; line-height: 1.5; }
.sleep-link b { font-size: 16px; font-weight: 600; }
.sleep-link:active { background: var(--surface-2); }
.sleep-reason, .sleep-dispute p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }
.disputed { display: block; color: var(--gold); font-size: 14px; font-weight: 600; }
.sleep-gesture { padding: 12px 14px; border-inline-start: 2px solid var(--gold); background: var(--gold-soft); border-radius: 8px; font-size: calc(16px * var(--scale)); line-height: 1.65; text-align: start; }
.sleep-gesture p { margin: 0; }
.sleep-report { margin-bottom: 18px; }
.sleep-report h4 { font-size: 14px; color: var(--muted); }
.flow-quran { font-family: var(--quran-uni); font-size: calc(30px * var(--scale)); line-height: 2.1; text-align: start; color: var(--ink); overflow-wrap: break-word; }
.flow-quran p { margin: 12px 0 24px; white-space: normal; }
.flow-basmala { text-align: center; }
.flow-quran .end { font-family: var(--quran-uni); color: var(--gold); white-space: nowrap; }
.source-content, .sleep-sheet { display: grid; gap: 18px; }
.sleep-sheet [hidden] { display: none; }
.sleep-source { justify-self: start; height: auto; min-height: 44px; }
.sleep-dispute { display: grid; gap: 8px; }
.tasbih-counter .c-label span[lang="ar"] { font-family: var(--ar); font-size: 16px; color: var(--dock-ink, var(--ink)); }
[dir="rtl"] .sleep-prep, [dir="rtl"] .sleep-gesture, [dir="rtl"] .sleep-link { font-family: var(--ui-ar); }

@media (orientation: landscape) and (max-height: 520px) {
  .tasbih-counter .c-label span[lang="ar"] { display: block; font-size: 14px; }
}

/* ---------- Lecteur ---------- */
.reader { --reader-bottom: calc(var(--dock-h) + 12px + env(safe-area-inset-bottom, 0px)); --reader-side: 0px; background: var(--bg); }
.r-top { flex: none; display: grid; grid-template-columns: 112px minmax(0, 1fr) 112px; align-items: center; gap: 4px; height: var(--top-h); padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
.r-side { display: flex; align-items: center; gap: 2px; }
.r-side.end { justify-content: flex-end; }
/* Interrupteur du compteur, visible en haut du lecteur */
.ctr-toggle { height: 34px; display: inline-flex; align-items: center; gap: 5px; padding: 0 4px; border-radius: 999px; color: var(--muted); }
.ctr-toggle .mini-ring { position: relative; width: 26px; height: 26px; flex: none; }
.mini-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mini-ring .mini-track { opacity: .2; }
.mini-ring .mini-prog { transition: stroke-dashoffset .25s; }
.mini-ring.reached { color: var(--gold); }
.mini-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }
.ctr-toggle[hidden] { display: none; }
.ctr-toggle .mini-sw { position: relative; width: 26px; height: 16px; border-radius: 999px; background: var(--line); transition: background .2s; }
.ctr-toggle .mini-sw i { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.ctr-toggle[aria-checked="true"] { color: var(--ink); }
.ctr-toggle[aria-checked="true"] .mini-sw { background: var(--gold); }
.ctr-toggle[aria-checked="true"] .mini-sw i { transform: translateX(10px); }
[dir="rtl"] .ctr-toggle[aria-checked="true"] .mini-sw i { transform: translateX(-10px); }
[dir="rtl"] .ctr-toggle .mini-sw i { left: auto; right: 2px; }
/* Compteur masqué : on compte sur ses doigts, le nombre reste affiché */
.reader.no-counter .dock { display: none; }
.reader.no-counter { --reader-bottom: env(safe-area-inset-bottom, 0px); --reader-side: 0px; }
.reader.no-counter .badge { font-size: 15px; padding: 6px 14px; }
.r-title { text-align: center; display: grid; gap: 1px; min-width: 0; }
.r-title .ar { font-family: var(--ar); font-size: 19px; font-weight: 700; line-height: 1.3; }
.r-title .sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-nav { position: relative; flex: none; height: 11px; margin: 0 16px; direction: ltr; z-index: 5; }
/* Les traits gardent leur place ; la prise tactile déborde sans agrandir l'en-tête. */
.segs { position: absolute; top: -10px; left: 0; right: 0; height: 32px; display: flex; align-items: center; gap: 3px; padding-bottom: 9px; direction: ltr; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: ew-resize; }
.segs i { flex: 1; min-width: 0; height: 3px; border-radius: 3px; background: var(--line); transition: background .2s, height .15s; pointer-events: none; }
.segs i.done { background: var(--gold); }
.segs i.cur { background: var(--ink); }
.segs.scrubbing i { height: 8px; }
.segs i.preview { background: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.seg-preview { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(290px, 100%); padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 6px 22px rgba(10,14,28,.14); text-align: center; pointer-events: none; }
.seg-preview b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.seg-preview span { display: block; margin-top: 4px; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.pager { position: relative; flex: 1; min-height: 0; margin-bottom: var(--reader-bottom); margin-inline-end: var(--reader-side); overflow-y: auto; scroll-snap-type: y mandatory; overflow-anchor: none; overscroll-behavior: contain; scrollbar-width: none; }
.pager::-webkit-scrollbar { display: none; }
.card { min-height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; flex-direction: column; padding-top: 6px; padding-bottom: 18px; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
.card-inner { max-width: 620px; width: 100%; margin: auto; display: flex; flex-direction: column; gap: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.card-head .name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--muted); line-height: 1.35; }
.badge { flex: none; font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-variant-numeric: tabular-nums; }
.swap { flex: none; height: 36px; min-width: 52px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.swap .ar-l { font-family: var(--ar); font-size: 17px; line-height: 1; }
.swap[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
/* Arabe ⇄ traduction : fondu sur place (appui long sur le texte ou bouton ع ⇄). */
.faces { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .45s ease, opacity .45s ease; }
.card.pressing .faces { transform: scale(.985); opacity: .82; }
.face { display: flow-root; transition: opacity .3s ease, transform .3s cubic-bezier(.2,.8,.2,1), visibility .3s; }
/* Seule la face visible donne sa hauteur ; l'autre continue son fondu en surimpression. */
.faces .tr-face, .faces.show-tr .ar-face { position: absolute; inset-inline: 0; top: 0; visibility: hidden; opacity: 0; transform: scale(.98); pointer-events: none; }
.faces.show-tr .tr-face { position: relative; visibility: visible; opacity: 1; transform: none; pointer-events: auto; }
/* Demande de refuge avant les versets (hors mushaf) */
.isti { font-family: var(--ar); font-size: calc(21px * var(--scale)); line-height: 1.8; text-align: center; color: var(--muted); margin-bottom: 4px; }
.isti-tr { color: var(--muted); font-size: .88em; }
.ar-text { font-family: var(--ar); font-size: calc(30px * var(--scale)); line-height: 2.05; text-align: center; margin: 0; word-spacing: .04em; }
.ar-text.short { font-size: calc(44px * var(--scale)); line-height: 1.8; }
.ar-text.long { font-size: calc(27px * var(--scale)); }
.ar-text p { margin: 0 0 .35em; }
.tr-text { font-size: calc(19px * var(--scale)); line-height: 1.6; margin: 0; text-align: center; text-wrap: pretty; }
.tr-text p { margin: 0 0 .6em; }
.tr-note { display: block; margin-top: 12px; font-size: 12px; color: var(--muted); }
.card-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--ink); }
.chip svg { width: 15px; height: 15px; color: var(--gold); }
.chip:active { background: var(--surface-2); }
.done-mark { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-size: 13px; font-weight: 600; opacity: 0; transform: translateY(4px); transition: .3s; }
.card.is-done .done-mark { opacity: 1; transform: none; }

/* Mushaf */
/* CPAL des trois v4c : palette 0, 16 entrées. 0/13 = noir, 14 = #040000.
   On conserve les couleurs du tajwid ; rouge sombre (3) et bleu sombre (7) éclaircis. */



.mushaf[data-fam="qv4-42"] { font-palette: var(--quran-palette-42); }
.mushaf[data-fam="qv4-49"] { font-palette: var(--quran-palette-49); }
.mushaf[data-fam="qv4-604"] { font-palette: var(--quran-palette-604); }
.mushaf { direction: rtl; user-select: none; -webkit-user-select: none; margin-inline: -10px; }
.mushaf .ml { display: flex; justify-content: space-between; align-items: baseline; white-space: nowrap; line-height: 1.85; }
.mushaf .ml.center { justify-content: center; gap: .3em; }
.mushaf .w.off { visibility: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mushaf.uni { font-family: var(--quran-uni); }
.mushaf-page + .mushaf-page { margin-top: 1.5rem; }
.mushaf-page { min-width: 0; }
.favorite-star { flex: none; width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--muted); touch-action: manipulation; }
.favorite-star svg { width: 21px; height: 21px; }
.favorite-star[aria-pressed="true"] { color: var(--gold); background: var(--gold-soft); }
.favorite-star[aria-pressed="true"] svg { fill: currentColor; }
.favorite-star:active { background: var(--gold-soft); }
.favorite-total { color: var(--muted); font-variant-numeric: tabular-nums; }
.favorites-view { overflow-y: auto; }
.favorites-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.favorites-head h1 { font-size: 1.5rem; }
.favorite-group { margin-block: 24px; }
.favorite-group h2 { font-size: 1rem; color: var(--muted); }
.favorite-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding-block: 8px; }
.favorite-row > button:first-child { flex: 1; min-height: 48px; text-align: start; font-size: 1rem; line-height: 1.5; }
.favorite-empty { color: var(--muted); font-size: 1rem; line-height: 1.6; }
.card-head, .intro-head { flex-wrap: wrap; }
.mushaf .end { font-family: var(--quran-uni); color: var(--gold); }
.mushaf .sura-head, .flow-quran .sura-head { display: flex; justify-content: center; align-items: center; margin: .25em 0; padding: .1em 0; border-block: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: linear-gradient(90deg, transparent, var(--gold-soft), transparent); font-family: var(--quran-uni); color: var(--ink); font-size: .9em; }
.mushaf .basmala { text-align: center; font-family: var(--quran-uni); }
.mushaf-cap { text-align: center; color: var(--muted); font-size: 12px; margin-top: 6px; font-family: var(--ui-ar); }
.tj-madda_necessary { color: var(--tj-lazim); }
.tj-madda_obligatory { color: var(--tj-wajib); }
.tj-madda_permissible { color: var(--tj-jaiz); }
.tj-madda_normal { color: var(--tj-tabii); }
.tj-ghunnah, .tj-ikhafa, .tj-ikhafa_shafawi, .tj-idgham_ghunnah, .tj-iqlab, .tj-idgham_shafawi { color: var(--tj-ghunna); }
.tj-idgham_wo_ghunnah, .tj-idgham_mutajanisayn, .tj-idgham_mutaqaribayn, .tj-ham_wasl, .tj-laam_shamsiyah, .tj-slnt { color: var(--tj-idgham); }
.tj-qalaqah { color: var(--tj-qalqala); }

/* Compteur */
.dock { position: absolute; left: 0; right: 0; bottom: 0; padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px)); padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); pointer-events: none; }
.dock-inner { max-width: 620px; height: var(--dock-h); margin: 0 auto; position: relative; display: flex; align-items: center; border-radius: 22px; background: color-mix(in srgb, var(--dock) var(--dock-alpha), transparent); color: var(--dock-ink); border: 1px solid color-mix(in srgb, var(--dock-ink) 12%, transparent); box-shadow: 0 8px 24px rgba(10,14,28,.10); -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px); pointer-events: auto; }
/* Compteur translucide : on voit le texte qui passe dessous. */
.counter { flex: 1; min-width: 0; height: 100%; border-radius: inherit; color: var(--dock-ink); display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 0 10px; touch-action: manipulation; user-select: none; -webkit-user-select: none; text-shadow: 0 0 6px var(--dock-halo), 0 0 2px var(--dock-halo); transition: transform .12s ease, background .3s; text-align: start; }
.counter:active { background: color-mix(in srgb, var(--dock) 72%, transparent); }
.counter:active { transform: scale(.975); }
.ring { position: relative; width: 58px; height: 58px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--ring-track); }
.ring .prog { stroke: var(--gold); transition: stroke-dashoffset .35s cubic-bezier(.2,.8,.2,1), stroke .3s; }
.counter.reached .ring .prog { stroke: var(--ok); }
.ring .num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; direction: ltr; }
.ring .num small { font-size: 10px; font-weight: 500; color: var(--dock-muted); margin-inline-start: 1px; margin-top: 6px; }
.ring .num.compact { font-size: 15px; }
.ring .num.compact small { font-size: 9px; }
.pop { animation: pop .22s ease; }
@keyframes pop { 40% { transform: scale(1.14); } }
.c-label { display: grid; gap: 3px; min-width: 0; }
.c-label b { font-size: 14px; font-weight: 600; line-height: 1.25; }
.c-label span { font-size: 11px; color: var(--dock-muted); line-height: 1.3; }
.dock-actions { flex: none; display: flex; align-items: center; gap: 6px; padding-inline-end: 8px; }
.undo, .next-hint { flex: none; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; touch-action: manipulation; }
.undo { background: var(--surface); color: var(--ink); border: 1px solid var(--line); transition: opacity .2s; }
.undo[disabled] { opacity: .3; }
.next-hint { background: var(--ok); color: #fff; }
.next-hint[hidden] { display: none; }
.next-hint svg { width: 16px; height: 16px; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(-3px); } }

/* Indices posés sur le bas du texte : aucune bande ne réduit le lecteur. */
.reader-cues { position: absolute; bottom: var(--reader-bottom); inset-inline-start: 12px; inset-inline-end: calc(var(--reader-side) + 12px); height: 48px; pointer-events: none; }
.scroll-cue, .swipe-cue { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.scroll-cue { background: linear-gradient(to top, var(--bg), transparent); }
.scroll-cue svg { width: 22px; height: 22px; animation: nudge 1.8s ease-in-out infinite; }
.swipe-cue { gap: 8px; max-width: 350px; margin: 0 auto; padding: 4px 18px; font-size: 13px; line-height: 1.4; text-align: start; background: linear-gradient(to top, var(--bg), color-mix(in srgb, var(--bg) 85%, transparent), transparent); }
.swipe-finger { flex: none; width: 34px; height: 44px; color: var(--gold); animation: swipeUp 1.6s ease-in-out 2; }
.reader-cues.showing-swipe .scroll-cue { visibility: hidden; }
.scroll-cue[hidden], .swipe-cue[hidden], .seg-preview[hidden] { display: none; }
[dir="rtl"] .swipe-cue, .seg-preview[dir="rtl"] { font-family: var(--ui-ar); }
@keyframes swipeUp { 0%, 15% { transform: translateY(8px); } 70%, 100% { transform: translateY(-7px); } }

/* Fin de parcours */
.finish { text-align: center; display: grid; gap: 16px; justify-items: center; }
.finish .seal { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }
.finish .seal svg { width: 44px; height: 44px; }
.finish h2 { margin: 0; font-family: var(--ar); font-size: 34px; font-weight: 700; line-height: 1.5; }
.finish p { margin: 0; color: var(--muted); line-height: 1.5; max-width: 34ch; }
.btn { height: 52px; padding: 0 24px; border-radius: 16px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 16px; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }

/* Feuille du bas (sources, réglages) */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(8,10,18,.42); animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 86%; display: flex; flex-direction: column; background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.18); animation: up .3s cubic-bezier(.2,.8,.2,1) both; max-width: 680px; margin: 0 auto; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-grip { height: 26px; flex: none; display: grid; place-items: center; cursor: grab; }
.sheet-grip::after { content: ""; width: 40px; height: 5px; border-radius: 5px; background: var(--line); }
.sheet-body { overflow-y: auto; padding: 0 20px calc(24px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 18px; }
.sheet-body h3 { margin: 0; font-size: 20px; line-height: 1.35; text-wrap: balance; }
.sheet-body h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.intro-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.intro-head h3 { flex: 1; }
.intro-head .swap { flex: none; }
.intro-text { padding-block: 4px; }
.intro-text [hidden] { display: none; }
.intro-source p { margin: 0; font-size: 13px; line-height: 1.55; }
.src-item { display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.src-item b { font-size: 15px; }
.src-item span { font-size: 13px; color: var(--muted); line-height: 1.45; }
.src-list { display: grid; gap: 8px; }
.soon-box { border: 1px dashed var(--line); border-radius: 14px; padding: 12px 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.merit { font-size: 15px; line-height: 1.6; margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-family: var(--ui-ar); font-size: 13px; direction: rtl; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.set-group { display: grid; gap: 10px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { flex: 1 1 auto; min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg.col { flex-direction: column; }
.seg.col button { text-align: start; padding: 10px 14px; line-height: 1.35; }
.seg.col button small { display: block; font-size: 12px; opacity: .7; font-weight: 400; }
.range { width: 100%; accent-color: var(--gold); height: 32px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.switch { width: 52px; height: 32px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.times { font-size: 13px; color: var(--muted); line-height: 1.55; }

.toast { position: fixed; left: 50%; bottom: calc(var(--dock-h) + 20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); animation: up .25s both; }
body:has(.reader.no-counter) .toast { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }

[dir="rtl"] .r-top, [dir="rtl"] .card-head, [dir="rtl"] .home-top { direction: rtl; }

@media (min-height: 760px) { :root { --dock-h: 84px; } }
@media (orientation: landscape) and (max-height: 520px) {
  .reader { --top-h: 44px; --reader-bottom: env(safe-area-inset-bottom, 0px); --reader-side: calc(92px + max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))); }
  .reader.no-counter { --reader-side: 0px; }
  .r-title .ar { font-size: 16px; }
  .r-title .sub { font-size: 10px; }
  .card { padding-top: 4px; padding-bottom: 8px; }
  .card-inner { max-width: none; gap: 12px; }
  .card-head { min-height: 36px; }
  .dock { left: auto; right: auto; inset-inline-start: auto; inset-inline-end: max(4px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); top: calc(var(--top-h) + 15px); bottom: calc(4px + env(safe-area-inset-bottom, 0px)); width: 80px; padding: 0; display: flex; align-items: center; }
  .dock-inner { width: 100%; height: 100%; max-height: 260px; flex-direction: column; }
  .counter { width: 100%; min-height: 64px; height: auto; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 6px 4px; text-align: center; }
  .ring { width: 56px; height: 56px; }
  .c-label b { font-size: 11px; }
  .c-label span { display: none; }
  .dock-actions { flex-direction: column; padding: 0 0 8px; }
  .reader-cues { height: 40px; }
  .toast { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-width: calc(100% - 120px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .pager { scroll-behavior: auto; }
  .swipe-finger, .scroll-cue svg, .next-hint svg { animation: none !important; }
  .segs i { transition: none; }
}

/* ---------- Écrans d'information ---------- */
.info-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -8px; }
.info-links .chip { height: 38px; }
.info-links .chip svg { color: var(--gold); }
.link-btn { display: block; margin: 2px 0 10px; color: var(--gold); font-weight: 600; font-size: 14px; text-align: start; }
.info { display: grid; gap: 6px; }
.info h4 { margin: 14px 0 4px; }
.info p { margin: 0 0 8px; line-height: 1.55; }
.info .muted { color: var(--muted); font-size: 13px; }
.info-lead { background: var(--gold-soft); border-radius: 14px; padding: 12px 14px; }
.info-lead p:last-child { margin-bottom: 0; }
.opinions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.opinions li { line-height: 1.5; }
.info q { display: block; quotes: none; font-family: var(--ar); font-size: 1.12em; line-height: 1.8; margin: 4px 0 0; color: var(--ink); }
.info cite { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }
[lang="ar"] .info, .info [lang="ar"] { font-family: var(--ar); }
:root[lang="ar"] .info { font-size: 17px; }
/* Main : un doigt replié à chaque formule */
.hand-box { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 6px 0 10px; direction: ltr; }
.hand { width: 200px; max-width: 58vw; height: auto; cursor: pointer; }
.hand .palm { fill: var(--gold-soft); stroke: var(--gold); stroke-width: 1.5; }
.hand .fg rect { fill: var(--surface); stroke: var(--gold); stroke-width: 1.5; transform-box: fill-box; transform-origin: 50% 100%; transition: transform .45s cubic-bezier(.2,.8,.2,1), fill .3s; }
.hand .fg.thumb rect { transform: rotate(32deg); }
.hand .fg.folded rect { transform: scaleY(.32); fill: var(--gold); }
.hand .fg.thumb.folded rect { transform: rotate(32deg) scaleY(.45); }
.hand .fg text { font: 600 11px var(--ui); fill: var(--muted); text-anchor: middle; }
.hand-side { display: grid; gap: 6px; justify-items: center; min-width: 92px; }
.hand-n { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.hand-l { font-size: 13px; color: var(--muted); min-height: 18px; text-align: center; }

/* Lot 17 : les trois gestes restent des illustrations, sans ordre prescrit. */
.hand-demo { display: grid; gap: 12px; }
.hand-methods { flex-wrap: wrap; }
.hand-methods button { flex: 1 1 85px; min-height: 44px; font-size: 12px; }
.hand-method-note { padding: 12px; border: 1px solid var(--line); border-radius: 14px; font-size: 14px; line-height: 1.5; }
.hand-method-note.not-retained { border: 2px solid var(--gold); background: var(--gold-soft); }
.hand-step { padding: 0; flex: 0 1 200px; border-radius: 16px; touch-action: manipulation; }
.hand-step .hand { display: block; width: 100%; max-width: 100%; }
.hand .joint-line { stroke: var(--gold); stroke-width: 1; opacity: .5; }
.hand .hand-point { fill: var(--surface); stroke: var(--gold); stroke-width: 1.5; }
.hand .hand-point.active { fill: var(--gold); stroke: var(--ink); stroke-width: 2; }
.hand .moving-thumb { fill: none; stroke: var(--gold); stroke-width: 17; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.hand .fg.folded .joint-line { visibility: hidden; }
.feedback-pencil { width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; color: var(--muted); }
.feedback-pencil svg { width: 18px; height: 18px; }
.feedback-pencil:hover, .feedback-pencil:focus-visible { color: var(--gold); background: var(--gold-soft); }
.finish > .feedback-pencil { align-self: flex-end; }
.reading-time { flex: none; align-self: center; max-width: calc(100% - 24px); min-height: 26px; padding: 1px 4px 6px; color: var(--muted); font-size: 11px; line-height: 1.3; text-align: center; }
.reading-time[hidden] { display: none; }
.reading-time:not([hidden]), .night-third:not([hidden]) {
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.reading-time > button:first-child { padding: 4px 0; text-align: inherit; }
.reading-time { padding-block: 0; }
.night-third { font-size: 12px; color: var(--muted); margin-block-end: 10px; }
.info-button {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px;
  padding: 0; color: var(--muted); border-radius: 50%;
}
.info-button > span {
  display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid currentColor;
  border-radius: 50%; font: 600 11px/1 Inter, sans-serif;
}
.info-button:hover, .info-button:focus-visible { color: var(--ink); background: var(--gold-soft); }
.card-foot .info-button + .info-button { margin-inline-start: -6px; }
.info-heading { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.info-heading h3 { flex: 1; }
.info-back { margin-block-end: 8px; }
.info-topics { display: grid; gap: 6px; }
.info-topics .section-row { justify-content: space-between; text-align: start; }
.info-related { display: flex; gap: 8px; flex-wrap: wrap; }
.info .opinions cite a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.info .hand-methods { display: flex; gap: 6px; }
.info .hand-option {
  display: flex; align-items: center; flex: 1 1 auto; border: 1px solid var(--line);
  border-radius: 12px; padding-inline: 4px;
}
.info .hand-option [data-hand-method] { flex: 1; min-height: 40px; border-radius: 9px; padding: 5px; }
.info .hand-option [aria-pressed="true"] { background: var(--gold-soft); color: var(--ink); }
.info .hand-option .info-button { flex: none; min-height: 32px; }
.day-strip {
  padding: 10px 14px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
}
.day-heading { display: flex; justify-content: space-between; align-items: center; }
.day-heading h2 { margin: 0; font-size: 15px; font-weight: 650; }
.day-place { margin: 0; font-size: 11px; color: var(--muted); }
.day-sun { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-block: 9px 10px; }
.day-clock-time { display: grid; gap: 2px; text-align: center; min-width: 0; }
.day-clock-time small { color: var(--muted); font-size: 10px; line-height: 1.2; }
.day-clock-time b, .day-status b[dir] { font-variant-numeric: tabular-nums; }
.day-sun .day-clock-time { padding-block: 7px; background: var(--gold-soft); border-radius: 11px; }
.day-sun .day-clock-time b { font-size: 23px; line-height: 1.05; }
.day-track { position: relative; height: 27px; margin-inline: 5px; }
.day-track i { position: absolute; left: var(--from); }
.day-track .day-morning, .day-track .day-evening, .day-track .day-night { width: var(--width); border-radius: 3px; }
.day-track .day-morning, .day-track .day-evening { height: 7px; top: 5px; }
.day-track .day-night { height: 5px; top: 15px; }
.day-morning { --day-color: #bd803b; }
.day-evening { --day-color: #b46a62; }
.day-night { --day-color: #6576a5; }
.day-track .day-morning, .day-track .day-evening, .day-track .day-night { background: var(--day-color); }
.day-track .day-extended, .day-legend .day-extended::before {
  background: repeating-linear-gradient(135deg, var(--day-color, var(--muted)) 0 2px, transparent 2px 4px);
}
.day-tick { top: 3px; height: 19px; border-inline-start: 1px solid var(--muted); opacity: .45; }
.day-now { top: 0; height: 24px; background: var(--ink); width: 2px; transform: translateX(-50%); }
.day-now::before { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: inherit; left: -2px; }
.day-times { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 4px; font-size: 12px; }
.day-status { display: flex; flex-wrap: wrap; column-gap: 10px; row-gap: 3px; align-items: baseline; margin-block-start: 12px; font-size: 12px; }
.day-status > span { color: var(--muted); }
.day-extension { padding: 0; font-weight: 650; text-align: start; text-decoration: underline; text-underline-offset: 3px; }
.day-legend { display: flex; flex-wrap: wrap; gap: 4px 11px; margin-block: 7px 2px; color: var(--muted); font-size: 10px; }
.day-legend span::before { content: ""; display: inline-block; width: 10px; height: 5px; border-radius: 2px; background: var(--day-color); margin-inline-end: 4px; vertical-align: middle; }
.location-settings .btn { display: inline-flex; margin-block: 8px; }
.location-city { display: grid; gap: 5px; color: var(--muted); font-size: 13px; }
.location-city select {
  width: 100%; min-height: 42px; padding: 6px 10px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
[data-geo-status]:empty { display: none; }
.counter-grip { position: absolute; z-index: 2; top: -7px; left: 50%; transform: translateX(-50%); width: 64px; height: 28px; display: grid; place-items: center; border-radius: 12px; touch-action: manipulation; }
.counter-grip span { width: 32px; height: 4px; border-radius: 4px; background: var(--dock-muted); opacity: .65; }
.counter { padding-top: 8px; }
.reader.big-counter:not(.no-counter) { --dock-h: 33.333vh; --dock-h: 33.333dvh; }
.big-counter .dock-inner { max-width: none; }
.big-counter .counter { justify-content: center; justify-items: center; grid-template-columns: auto auto; gap: 20px; padding: 28px 16px 52px; }
.big-counter .ring { width: clamp(70px, 14vh, 116px); height: clamp(70px, 14vh, 116px); }
.big-counter .ring .num { font-size: 32px; }
.big-counter .ring .num.compact { font-size: 26px; }
.big-counter .ring .num small { font-size: 14px; }
.big-counter .c-label b { font-size: 20px; }
.big-counter .dock-actions { position: absolute; inset-inline-end: 8px; bottom: 8px; padding: 0; }
body:has(.reader.big-counter:not(.no-counter)) .toast { bottom: calc(33.333dvh + 20px + env(safe-area-inset-bottom, 0px)); }

/* La pastille reste hors du panneau : on lit et on navigue pendant la prise de son. */
.feedback-pill { position: fixed; z-index: 45; top: calc(4px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px); border: 1px solid var(--gold); border-radius: 999px; background: var(--surface); color: var(--ink); box-shadow: 0 3px 16px #0002; }
.feedback-pill[hidden] { display: none; }
.feedback-pill button { min-height: 36px; padding: 4px 16px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.has-feedback-pill .reader { padding-top: 42px; }
.has-feedback-pill .home-top { margin-top: 42px; }
.record-dot { color: #c03942; }
.feedback-panel { display: grid; gap: 12px; }
.feedback-panel .intro-head { gap: 6px; }
.feedback-card { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.feedback-card small { color: var(--muted); font-weight: 400; }
.feedback-label { font-size: 13px; font-weight: 600; }
.feedback-panel textarea { width: 100%; resize: vertical; min-height: 84px; max-height: 25vh; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; user-select: text; -webkit-user-select: text; }
.feedback-mic { min-height: 56px; display: flex; gap: 10px; justify-content: center; align-items: center; border: 1px solid var(--line); background: var(--gold-soft); color: var(--ink); border-radius: 16px; font-weight: 600; }
.feedback-mic svg { width: 24px; height: 24px; }
.feedback-panel audio { width: 100%; }
.feedback-status { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.feedback-panel button:disabled { opacity: .5; cursor: wait; }
@media (max-width: 370px) {
  .card-head { gap: 4px; flex-wrap: wrap; }
  .card-head .name { flex-basis: 35%; }
  .swap { padding: 0 8px; }
  .big-counter .counter { gap: 10px; }
  .big-counter .c-label b { font-size: 16px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .reader.big-counter:not(.no-counter) { --dock-h: 76px; --reader-side: calc(33.333vw + 12px); }
  .reader.big-counter .dock { width: 33.333vw; }
  .reader.big-counter .dock-inner { max-height: none; }
  .reader.big-counter .counter { display: flex; padding: 22px 8px 54px; gap: 8px; }
  .reader.big-counter .ring { width: 70px; height: 70px; }
  .reader.big-counter .ring .num { font-size: 23px; }
  .reader.big-counter .ring .num.compact { font-size: 18px; }
  .reader.big-counter .c-label b { font-size: 13px; }
  .reader.big-counter .dock-actions { flex-direction: row; }
  .reading-time { font-size: 10px; min-height: 22px; padding-bottom: 4px; }
  .has-feedback-pill .dock { top: calc(var(--top-h) + 57px); }
  .reader:has(.reading-time:not([hidden])) .dock { margin-top: 22px; }
  .has-feedback-pill .reader { padding-top: 42px; }
  body:has(.reader.big-counter:not(.no-counter)) .toast { bottom: 12px; max-width: 60%; }
  .feedback-panel { gap: 8px; }
}
