/*
Theme Name: Fiqh Mālikī — Q&R
Theme URI: https://fiqhmalikite.fr
Author: Fiqh Mālikī
Description: Thème de questions-réponses en fiqh mālikite. Palette azur & or, ornements andalous, badges des qualifications juridiques, mode sombre, préférences de lecture.
Version: 1.3.19
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: fiqh-maliki
*/

/* ============================================================
   1. JETONS (identiques à la maquette Bleu clair)
   ============================================================ */
@property --fmq-line-c { syntax: '<color>'; inherits: false; initial-value: transparent; }
@property --fmq-net-a { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
@property --fmq-net-c { syntax: '<color>'; inherits: true; initial-value: transparent; }

:root {
  --accent: oklch(0.40 0.10 240);
  --accent-air: oklch(0.56 0.13 240);
  --bg: oklch(0.977 0.004 250);
  --bg2: color-mix(in oklch, var(--accent) 4%, oklch(0.967 0.006 250));
  --card: oklch(0.997 0.002 250);
  --well: color-mix(in oklch, var(--accent) 7%, oklch(0.962 0.007 250));
  --ink: oklch(0.29 0.06 240);
  --text: oklch(0.43 0.045 240);
  --muted: oklch(0.50 0.035 240);
  --line: oklch(0.899 0.010 250);
  --line2: color-mix(in oklch, var(--accent) 20%, oklch(0.977 0.004 250));
  --link: oklch(0.4 0.13 240);
  --gold: oklch(0.6 0.1 85);
  --gold-ink: oklch(0.5 0.09 85);
  --goldbright: oklch(0.83 0.13 92);
  --almagra: oklch(0.5 0.11 40);
  --verde: oklch(0.55 0.07 175);
  --sunna-ink: oklch(0.44 0.11 150);
  --tinte: color-mix(in oklch, var(--accent) 8%, oklch(0.992 0.002 250));
  --panel: oklch(0.27 0.045 238);
  --panelink: oklch(0.82 0.11 90);
  --focus: oklch(0.45 0.09 240);
  --chap-tahara: oklch(0.52 0.08 195);
  --chap-salat: oklch(0.46 0.11 268);
  --chap-zakat: oklch(0.52 0.10 85);
  --chap-siyam: oklch(0.52 0.11 40);
  --chap-hajj: oklch(0.50 0.07 150);
  --chap-muamalat: oklch(0.47 0.07 65);
  --fmq-body: 18px;
  --font-title: 'Marcellus', Georgia, serif;
  --font-text: 'Hanken Grotesk', system-ui, sans-serif;
  --font-read: 'Lora', Georgia, serif;
  --font-ar: 'Amiri', 'Scheherazade New', serif;
}
[data-theme="dark"], .dark {
  --accent: oklch(0.72 0.08 240); --accent-air: oklch(0.80 0.10 240); --bg: oklch(0.21 0.022 240); --bg2: oklch(0.235 0.026 240);
  --card: oklch(0.255 0.028 240); --well: oklch(0.185 0.02 240); --ink: oklch(0.93 0.012 240);
  --text: oklch(0.82 0.02 240); --muted: oklch(0.70 0.022 240); --line: oklch(0.33 0.03 240);
  --line2: oklch(0.42 0.05 240); --link: oklch(0.8 0.075 240); --gold: oklch(0.74 0.1 90);
  --gold-ink: oklch(0.74 0.1 90); --goldbright: oklch(0.83 0.12 92); --almagra: oklch(0.7 0.09 40); --verde: oklch(0.72 0.06 175);
  --sunna-ink: oklch(0.80 0.12 150);
  --chap-tahara: oklch(0.78 0.08 195); --chap-salat: oklch(0.78 0.10 268); --chap-zakat: oklch(0.80 0.10 85);
  --chap-siyam: oklch(0.78 0.10 40); --chap-hajj: oklch(0.78 0.07 150); --chap-muamalat: oklch(0.79 0.08 65);
  --tinte: oklch(0.29 0.04 240); --panel: oklch(0.165 0.02 240); --panelink: oklch(0.8 0.11 90); --focus: oklch(0.45 0.08 240);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --accent: oklch(0.72 0.08 240); --accent-air: oklch(0.80 0.10 240); --bg: oklch(0.21 0.022 240); --bg2: oklch(0.235 0.026 240);
  --card: oklch(0.255 0.028 240); --well: oklch(0.185 0.02 240); --ink: oklch(0.93 0.012 240);
  --text: oklch(0.82 0.02 240); --muted: oklch(0.70 0.022 240); --line: oklch(0.33 0.03 240);
  --line2: oklch(0.42 0.05 240); --link: oklch(0.8 0.075 240); --gold: oklch(0.74 0.1 90);
  --gold-ink: oklch(0.74 0.1 90); --goldbright: oklch(0.83 0.12 92); --almagra: oklch(0.7 0.09 40); --verde: oklch(0.72 0.06 175);
  --sunna-ink: oklch(0.80 0.12 150);
  --chap-tahara: oklch(0.78 0.08 195); --chap-salat: oklch(0.78 0.10 268); --chap-zakat: oklch(0.80 0.10 85);
  --chap-siyam: oklch(0.78 0.10 40); --chap-hajj: oklch(0.78 0.07 150); --chap-muamalat: oklch(0.79 0.08 65);
  --tinte: oklch(0.29 0.04 240); --panel: oklch(0.165 0.02 240); --panelink: oklch(0.8 0.11 90); --focus: oklch(0.45 0.08 240);
} }

/* ============================================================
   2. BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-text); font-size: 16px; line-height: 1.55; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--focus); color: #fff; }
h1, h2, h3, h4 { font-family: var(--font-title); font-weight: 400; color: var(--ink); text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
[lang="ar"], .ar { font-family: var(--font-ar); direction: rtl; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; z-index: 100; background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { left: 12px; top: 12px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.wrap-mid { max-width: 820px; margin: 0 auto; padding: 0 24px; }

/* grain */
.fmq-grain-fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.05; width: 100%; height: 100%; }
.grain { position: relative; isolation: isolate; }
.grain > * { position: relative; z-index: 2; }
/* Le contenu passe au-dessus du grain. Ne pas viser « body > * » : cela écrasait le sticky de l'en-tête, le fixed de la barre mobile et le placement des popovers. */
body > main, body > .ornament, body > .site-footer { position: relative; z-index: 1; }

/* animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes revealY { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) { .rv { animation: revealY 0.7s cubic-bezier(.2,.7,.2,1) both; animation-timeline: view(); animation-range: entry 2% cover 26%; } }
.fade-up { animation: fadeUp .7s both; }
.lift { transition: transform .3s cubic-bezier(.2,.7,.2,1), border-color .3s, box-shadow .3s; }
.lift:hover { transform: translateY(-3px); border-color: var(--line2) !important; box-shadow: 0 20px 40px -24px oklch(0.35 0.09 240 / .35); }
.card-m { transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s, border-color .25s; }
.card-m:hover { transform: translateY(-3px); border-color: var(--line2) !important; box-shadow: 0 1px 2px oklch(0.3 0.05 240 / .05), 0 22px 44px -24px oklch(0.35 0.09 240 / .38); }
.arr { color: var(--link); transition: transform .25s; }
.card-m:hover .arr, .lift:hover .arr { transform: translateX(4px); }
.chip-h { transition: background .2s, border-color .2s; }
.chip-h:hover { background: var(--tinte) !important; border-color: var(--line2) !important; text-decoration: none; }
.fmq-cal { position: absolute; font-family: var(--font-ar); color: var(--accent-air); opacity: 0.04; pointer-events: none; line-height: 1; user-select: none;
  -webkit-mask-image: radial-gradient(closest-side, black 55%, transparent 100%); mask-image: radial-gradient(closest-side, black 55%, transparent 100%); }
@supports (animation-timeline: scroll()) {
  .fmq-cal { animation: calDrift linear both; animation-timeline: scroll(root); }
  .hdr-sub { animation: hdrSub linear both; animation-timeline: scroll(root); animation-range: 0px 130px; }
  .site-hdr { animation: hdrLine linear both; animation-timeline: scroll(root); animation-range: 0px 90px; }
  .fmq-progress { width: 100% !important; transform-origin: 0 50%; transform: scaleX(0); animation: fmqGrow linear both; animation-timeline: scroll(root); }
}
@keyframes calDrift { from { translate: 0 0; } to { translate: 0 -140px; } }
@keyframes hdrSub { to { max-height: 0; opacity: 0; } }
@keyframes hdrLine { from { --fmq-line-c: transparent; } to { --fmq-line-c: var(--gold); } }
@keyframes fmqGrow { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }

/* ============================================================
   3. EN-TÊTE
   ============================================================ */
/* Une seule ligne : 68 px, 58 px au défilement */
.site-hdr { position: sticky; top: 0; z-index: 50; background: var(--bg); background: color-mix(in oklch, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--fmq-line-c); }
.single-reponse .site-hdr { position: static; }
@supports not (animation-timeline: scroll()) { .site-hdr { border-bottom: 1px solid var(--gold); } }
.hdr-top { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 68px; display: flex; align-items: center; gap: 14px; }
@supports (animation-timeline: scroll()) { .hdr-top { animation: hdrH linear both; animation-timeline: scroll(root); animation-range: 0px 120px; } }
@keyframes hdrH { to { height: 58px; } }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand > span { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-title); font-size: 18px; color: var(--ink); letter-spacing: -0.005em; display: block; }
.hdr-sub { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 3px; overflow: hidden; max-height: 16px; display: block; white-space: nowrap; }
.hdr-nav { display: flex; align-items: center; gap: 2px; margin-left: 14px; }
.hdr-nav ul { list-style: none; margin: 0; padding: 0; display: contents; }
.hn-btn, .hn-link, .hdr-nav .menu-item a { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; font-size: 14.5px; white-space: nowrap; border: none; background: transparent; cursor: pointer; }
.hn-btn { font-weight: 600; color: var(--ink); }
.hn-link, .hdr-nav .menu-item a { font-weight: 500; color: var(--text); }
.hn-btn:hover, .hn-link:hover, .hdr-nav .menu-item a:hover, .hn-btn[aria-expanded="true"] { background: var(--tinte); text-decoration: none; }
.hn-btn svg { transition: transform .2s; }
.hn-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.hn-link[aria-current], .hdr-nav .current-menu-item a { color: var(--accent); font-weight: 600; }
.hn-link[aria-current]::after, .hdr-nav .current-menu-item a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--gold); }
.hdr-grow { flex: 1; }
.hs-pill { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 40px; min-width: 40px; padding: 0 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; white-space: nowrap; flex-shrink: 0; }
.hs-pill:hover { border-color: var(--line2); color: var(--ink); }
.hs-label { display: inline-flex; align-items: center; gap: 22px; }
.hs-label kbd, .kbd { font-family: inherit; font-size: 11px; border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.hdr-icon { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); flex-shrink: 0; padding: 0; }
.hdr-icon:hover { border-color: var(--line2); }
.hdr-cta { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; background: var(--accent); color: var(--bg); font-size: 14px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.hdr-cta:hover { filter: brightness(1.08); text-decoration: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--card); cursor: pointer; }
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; font-size: 12px; color: var(--ink); background: var(--card); cursor: pointer; white-space: nowrap; }
/* Masquage progressif */
@media (max-width: 1100px) { .hn-link, .hdr-nav .menu-item { display: none; } }
@media (max-width: 900px) { .hs-label { display: none; } .hs-pill { width: 40px; padding: 0; } }
@media (max-width: 640px) { .hdr-cta, .hdr-prefs { display: none; } .hdr-top { gap: 8px; padding: 0 16px; } }
/* Téléphone : la recherche est déjà dans la barre du bas, le sous-titre du logo ne tient pas */
@media (max-width: 480px) { .hdr-sub, .hs-pill { display: none; } .hdr-nav { margin-left: 2px; } }

/* Méga-menu « Explorer » */
.mega { position: absolute; left: 0; right: 0; top: 100%; z-index: 70; background: var(--bg); border-top: 1px solid var(--line); border-bottom: 2px solid var(--gold); }
.mega[hidden] { display: none; }
.mega-in { max-width: 1040px; margin: 0 auto; padding: 32px 24px 30px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px 44px; }
.mega-h { font-size: 11.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-ink); font-weight: 700; margin-bottom: 18px; }
.mega-col { display: flex; flex-direction: column; gap: 18px; }
.mega-col a { display: block; color: inherit; }
.mega-col a:hover { text-decoration: none; }
.mega-col a strong { display: block; font-family: var(--font-title); font-weight: 400; font-size: 21px; color: var(--ink); margin-bottom: 4px; }
.mega-col a:hover strong { color: var(--link); }
.mega-col a span { display: block; font-size: 15px; line-height: 1.5; color: var(--muted); }
.mega-chaps { display: flex; flex-direction: column; gap: 13px; }
.mega-chaps a { display: flex; align-items: center; gap: 11px; color: var(--ink); font-size: 16.5px; }
.mega-chaps a:hover { text-decoration: none; color: var(--link); }
.mega-chaps svg { flex-shrink: 0; }
.mega-chaps .cnt { margin-left: auto; font-size: 13px; color: var(--muted); }

/* ============================================================
   4. COMPOSANTS
   ============================================================ */
.badge { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; background: var(--bg2); color: var(--muted); border: 1px solid var(--line); }
.badge-lg { padding: 6px 14px; font-size: 12.5px; }
.badge-wajib { background: #1C1917; color: #fff; border: 1px solid #44403C; }
.badge-sunna { background: #2F7D4F; color: #fff; border: none; }
.badge-mandub { background: transparent; color: var(--sunna-ink); border: 1.5px dotted var(--sunna-ink); }
.badge-mubah { background: #E7E5E4; color: #57534E; border: none; }
.badge-makruh { background: #F6E6BE; color: #8A5A0C; border: none; }
.badge-haram { background: #C0392B; color: #fff; border: none; }
.badge-divergence { background: transparent; color: var(--almagra); border: 1.5px solid var(--almagra); }
.badge-none { background: transparent; color: var(--muted); border: 1px dashed var(--line2); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.card-q { display: flex; flex-direction: column; gap: 11px; color: inherit; }
.card-q:hover { text-decoration: none; }
.card-q .card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-q .q { font-family: var(--font-title); font-size: 20px; line-height: 1.28; color: var(--ink); }
.card-q .brief { font-size: 14.5px; line-height: 1.55; color: var(--text); }
.card-q .meta { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text); padding-top: 4px; }
.card-q .meta .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.card-q .meta .lbl { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-q .meta .arr { margin-left: auto; font-size: 16px; }
.card-q:has(.badge-divergence) { border-left: 3px solid var(--almagra); }
.card-q:has(.badge-divergence) .q { color: var(--almagra); }
.num { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; container-type: inline-size; }
@supports (grid-template-rows: subgrid) { .grid-cards > .card-q { display: grid; grid-template-rows: subgrid; grid-row: span 4; row-gap: 11px; align-content: start; } }
@container (max-width: 560px) { .card-q { padding: 16px; } }
@container (max-width: 420px) { .card-q { padding: 14px; gap: 8px; } .card-q .brief { display: none; } .card-q .q { font-size: 16px; } }
/* Accueil : cartes de 20 px de rayon, grille plus large */
.grid-home { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.grid-home > .card { border-radius: 20px; padding: 22px; }
.grid-home > .card-q .q { font-size: 21px; line-height: 1.25; letter-spacing: -0.005em; }
.grid-home > .card-q .brief { line-height: 1.6; }
.grid-home > .card-q .num { font-size: 11.5px; }

.chap { position: relative; overflow: hidden; color: inherit; display: flex; flex-direction: column; padding: 22px 22px 18px; }
.chap:hover { text-decoration: none; }
.chap-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.chap-ico { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 14px; color: var(--chap); background: color-mix(in oklch, var(--chap) 12%, transparent); }
.chap-ar { font-size: 30px; line-height: 1.2; color: var(--chap); opacity: 0.9; }
.chap-head { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 6px; }
.chap-n { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.chap-title { font-family: var(--font-title); font-size: 23px; line-height: 1.15; color: var(--ink); }
.chap-desc { font-size: 14.5px; line-height: 1.55; color: var(--text); }
.chap-prev { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.chap-prev span { font-size: 13px; line-height: 1.45; color: var(--text); display: flex; gap: 8px; }
.chap-prev span::before { content: "›"; color: var(--chap); flex-shrink: 0; }
.chap-foot { margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; }
.chap-count { display: inline-block; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--text); background: var(--bg2); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }
.chap-foot .arr { font-size: 18px; }
.chap.is-soon { border-style: dashed; opacity: 0.82; }
.chap.is-soon .chap-count { font-style: italic; }
.grid-chap { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; container-type: inline-size; }
.grid-chap > .chap { border-radius: 20px; }
@container (max-width: 480px) { .chap { padding: 16px; } .chap .chap-prev { display: none; } }
@container (min-width: 860px) { .chap { padding: 24px; } }
@media (max-width: 720px) { .grid-chap { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 80%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; } .grid-chap > * { scroll-snap-align: center; } }

/* Titre de section : surtitre doré + H2 à gauche, lien d'action à droite */
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.sec-head .over { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 8px; }
.sec-head h2 { font-size: clamp(28px, 3.4vw, 38px); line-height: 1.1; letter-spacing: -0.012em; }
.sec-head .more { font-size: 14px; font-weight: 600; color: var(--link); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer; background: var(--accent); color: var(--bg); font-weight: 600; font-size: 14px; padding: 12px 22px; border-radius: 999px; }
.btn:hover { text-decoration: none; }
.btn-sq { border-radius: 16px; }
.btn-soft { background: var(--tinte); color: var(--link); border: 1px solid var(--line2); }
.btn-ok { background: #2F7D4F; color: #fff; }
.chip { cursor: pointer; font-size: 12.5px; padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--text); }
.chip.is-on { background: var(--accent); color: var(--bg); font-weight: 600; border-color: var(--accent); }
.chip:hover { text-decoration: none; border-color: var(--line2); }
.chip-sq { border-radius: 8px; font-size: 12.5px; font-weight: 600; padding: 6px 14px; color: var(--text); }
.chip-sq.is-on { background: var(--tinte); color: var(--link); border-color: var(--accent); }

.field label, .field legend { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 8px; padding: 0; }
.field label.sub { font-size: 12.5px; color: var(--text); margin-bottom: 6px; }
/* 16 px dans les champs : en dessous, iOS zoome la page à chaque saisie */
.field input:not([type=radio]):not([type=checkbox]), .field select, .field textarea { width: 100%; border: 1px solid var(--line2); background: var(--bg); border-radius: 12px; padding: 12px 14px; font-size: 16px; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.field textarea { resize: vertical; line-height: 1.6; min-height: 150px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent-air); box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent-air) 20%, transparent); }
/* Champ rempli : la bordure passe au vert, sans décaler le champ */
.field input:not(:placeholder-shown):not(:focus):not([type=radio]):not([type=checkbox]), .field textarea:not(:placeholder-shown):not(:focus) { border-color: var(--verde); }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.check input { margin-top: 1px; width: 19px; height: 19px; accent-color: var(--accent); flex-shrink: 0; }
.check:has(input:checked) { border-color: var(--accent); background: var(--tinte); }
.req { color: var(--almagra); }
.alert { background: var(--bg2); border: 1.5px solid var(--almagra); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--almagra); }
.notice { background: var(--tinte); border: 1px solid var(--line2); border-radius: 16px; padding: 20px 22px; }
.well { background: var(--well); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; }
.eyebrow { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-ink); font-weight: 700; }
.eyebrow-muted { color: var(--muted); }
.eyebrow-red { color: var(--almagra); }

/* ============================================================
   5. ACCUEIL
   ============================================================ */
.hero { max-width: 900px; margin: 0 auto; padding: 76px 24px 36px; text-align: center; position: relative; }
.hero-pill { animation: fadeUp .6s both; display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); white-space: nowrap; max-width: 100%; }
.hero-pill .n { display: inline-flex; align-items: center; gap: 6px; background: var(--tinte); color: var(--link); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.hero-pill .n::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--verde); }
.hero-pill .t { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.hero h1 { animation: fadeUp .7s .05s both; font-size: clamp(42px, 6.8vw, 76px); line-height: 1.02; letter-spacing: -0.022em; margin: 24px 0 18px; color: var(--ink); }
.hero h1 span { color: var(--accent-air); }
.hero .lead { animation: fadeUp .7s .1s both; font-size: clamp(16.5px, 1.7vw, 19px); line-height: 1.6; color: var(--text); max-width: 560px; margin: 0 auto 34px; }
.hero-search { animation: fadeUp .7s .15s both; display: flex; align-items: center; gap: 12px; max-width: 660px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 8px 8px 8px 22px; box-shadow: 0 1px 2px oklch(0.3 0.05 240 / 0.05), 0 18px 40px -18px oklch(0.35 0.09 240 / 0.28); transition: border-color .2s, box-shadow .2s; }
.hero-search:focus-within { border-color: var(--accent-air); box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent-air) 18%, transparent), 0 18px 40px -18px oklch(0.35 0.09 240 / .3); }
.hero-search > svg { color: var(--muted); flex-shrink: 0; }
.hero-search input { flex: 1; min-width: 0; height: 48px; border: none; outline: none; background: transparent; font-size: 17px; color: var(--ink); }
.hero-search button { border: none; cursor: pointer; flex-shrink: 0; height: 48px; padding: 0 24px; border-radius: 14px; background: var(--accent); color: var(--bg); font-size: 15px; font-weight: 600; }
@media (max-width: 560px) { .hero-search button { padding: 0 16px; } .hero-search { padding-left: 14px; } }
.hero-pop { animation: fadeUp .7s .2s both; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 18px; }
.hero-pop > span { font-size: 13px; color: var(--muted); margin-right: 2px; }
.hero-pop a { font-size: 13px; color: var(--ink); background: var(--card); border: 1px solid var(--line); padding: 6px 13px; border-radius: 999px; white-space: nowrap; }
.hero-more { animation: fadeUp .7s .25s both; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin-top: 30px; font-size: 14px; }
.hero-more a { white-space: nowrap; }
.hero-more a:first-child { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.hero-more a + a { color: var(--text); }
.home-sec { padding-top: 56px; padding-bottom: 20px; position: relative; }
/* Reprendre (historique local) */
.recent { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.recent[hidden] { display: none; }
.recent .over { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-ink); margin-right: 4px; }
.recent-list { display: contents; }
.recent-list a { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13.5px; color: var(--ink); }
.recent-list a span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-clear { margin-left: auto; cursor: pointer; font-size: 12.5px; color: var(--muted); border: none; background: transparent; padding: 0; }
/* Trois engagements */
.pledges { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-bottom: 18px; }
.pledge { display: flex; gap: 14px; align-items: flex-start; padding: 4px; }
.pledge .ico { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--tinte); color: var(--link); }
.pledge .ico-red { background: color-mix(in oklch, var(--almagra) 12%, transparent); color: var(--almagra); }
.pledge .ico-green { background: color-mix(in oklch, var(--verde) 14%, transparent); color: var(--verde); }
.pledge strong { display: block; font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.pledge span.d { display: block; font-size: 13.5px; line-height: 1.55; color: var(--text); }
/* Panneau d'appel */
.cta-panel { background: var(--panel); border-radius: 28px; padding: clamp(28px, 4vw, 48px); display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px; position: relative; overflow: hidden; }
.cta-panel .cal { position: absolute; font-family: var(--font-ar); line-height: 1; pointer-events: none; color: var(--panelink); }
.cta-panel > div, .cta-panel > a { position: relative; }
.cta-count { display: flex; align-items: baseline; gap: 16px; }
.cta-count .count { font-family: var(--font-title); font-size: clamp(56px, 8vw, 84px); line-height: 0.9; color: var(--panelink); font-variant-numeric: tabular-nums; }
.cta-count .cap { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: #C6D4EE; max-width: 120px; line-height: 1.4; }
.cta-text { flex: 1 1 300px; }
.cta-text strong { display: block; font-family: var(--font-title); font-weight: 400; font-size: clamp(22px, 2.6vw, 28px); line-height: 1.2; color: #fff; margin-bottom: 6px; }
.cta-text span { font-size: 14.5px; line-height: 1.55; color: #C6D4EE; }
.cta-btn { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 14px; background: var(--panelink); color: #14224F; font-size: 15px; font-weight: 700; white-space: nowrap; }
.cta-btn:hover { filter: brightness(1.06); text-decoration: none; }
.search-form { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1.5px solid var(--line2); border-radius: 999px; padding: 10px 10px 10px 22px; box-shadow: inset 0 1px 4px oklch(0.4 0.06 240 / 0.07); }
.search-form input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 17px; color: var(--ink); }
.search-form .btn { padding: 12px 26px; font-size: 14.5px; flex-shrink: 0; }
.hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.hero-links a { border-bottom: 1px solid var(--line2); }
#fmq-sebka { position: absolute; top: 0; left: 0; width: 100%; height: 460px; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent); mask-image: linear-gradient(to bottom, black 55%, transparent); }
.band { background: var(--bg2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 24px; }
.panel { background: var(--panel); border-radius: 16px; padding: 42px 32px; text-align: center; position: relative; overflow: hidden; color: #fff; }
.panel .count { font-family: var(--font-title); font-size: clamp(46px, 9vw, 64px); line-height: 1; color: var(--panelink); }
.panel .cap { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: #C6D4EE; margin-top: 10px; }
.panel .sub { font-size: 12.5px; color: #9FB2D8; margin-top: 8px; }
.panel .cal { position: absolute; font-family: var(--font-ar); line-height: 1; pointer-events: none; }

/* ============================================================
   6. RÉPONSE
   ============================================================ */
.progress-wrap { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 5px; pointer-events: none; }
.fmq-progress { height: 5px; background: repeating-linear-gradient(90deg, var(--ink) 0 22px, var(--gold) 22px 44px); }
.mini-hdr { position: sticky; top: 0; z-index: 45; background: var(--bg); border-bottom: 1px solid var(--line); }
.mini-hdr .in { max-width: 760px; margin: 0 auto; padding: 9px 28px; display: flex; align-items: center; gap: 12px; }
.mini-hdr .q { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.answer h1 { font-size: clamp(31px, 6vw, 44px); line-height: 1.14; margin: 0 0 16px; letter-spacing: -0.01em; }
.cred { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 22px; }
.cred strong { color: var(--text); }
.raw { background: var(--well); border-radius: 16px; padding: 16px 20px; margin-bottom: 22px; }
.raw p { margin: 0; font-family: var(--font-read); font-size: 15.5px; line-height: 1.65; color: var(--text); font-style: italic; max-width: 66ch; }
.brief-box { display: flex; align-items: flex-start; gap: 14px; background: var(--tinte); border: 1px solid var(--line2); border-radius: 16px; padding: 20px 22px; margin-bottom: 26px; }
.brief-box .badge { flex-shrink: 0; }
.brief-box p { margin: 0; font-family: var(--font-read); font-size: calc(var(--fmq-body) * 1.08); line-height: 1.6; color: var(--ink); }
.toc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; margin-bottom: 30px; }
.toc .eyebrow { font-size: 10.5px; }
.prose h2 { font-size: 26px; margin: 0 0 14px; }
.prose p { font-family: var(--font-read); font-size: var(--fmq-body); line-height: 1.75; color: var(--text); margin: 0 0 14px; max-width: 68ch; }
.terms { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.term-btn { cursor: help; font-size: 12px; color: var(--link); border: none; background: transparent; padding: 0; border-bottom: 1px dotted var(--link); }
.fmq-tip { border: 1px solid var(--line2); border-radius: 6px; background: var(--card); color: var(--text); padding: 12px 14px; max-width: 300px; font-size: 13px; line-height: 1.55; box-shadow: 0 6px 20px -12px oklch(0.3 0.06 240 / 0.5); margin: 8px 0; }
@supports (anchor-name: --a) {
  .fmq-tip { position: fixed; margin: 0 0 8px; bottom: anchor(top); justify-self: anchor-center; position-try-fallbacks: --fmq-below, flip-inline; }
  @position-try --fmq-below { top: anchor(bottom); bottom: auto; margin: 8px 0 0; }
}
.cite { margin: 0 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.cite-head { padding: 10px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.cite-copy { margin-left: auto; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--link); border: 1px solid var(--line2); border-radius: 8px; padding: 3px 9px; background: transparent; opacity: 0; transition: opacity .15s; }
.cite:hover .cite-copy, .cite:focus-within .cite-copy { opacity: 1; }
@media (hover: none) { .cite-copy { opacity: 1; } }
.cite-ar { padding: 24px 24px 20px; background: var(--well); border-right: 4px solid var(--gold); }
.cite-ar p { font-size: calc(var(--fmq-body) * 1.62); line-height: 2.15; color: var(--ink); margin: 0; text-align: right; }
.hide-ar .cite-ar { display: none; }
.cite figcaption { padding: 16px 22px; border-top: 1px solid var(--line); }
.cite figcaption p { font-family: var(--font-read); font-size: 16px; line-height: 1.75; color: var(--text); margin: 0 0 10px; font-style: italic; padding-left: 16px; border-left: 2px solid var(--line); max-width: 62ch; }
.cite-ref { font-size: 12.5px; color: var(--muted); }
.cite-note { font-family: var(--font-read); font-size: calc(var(--fmq-body) * 0.94); line-height: 1.7; color: var(--text); margin: 14px 0 12px; max-width: 68ch; }
.note-call { font-family: var(--font-text); font-size: 0.68em; line-height: 0; margin-left: 1px; }
.note-call a { font-weight: 700; color: var(--gold-ink); padding: 0 2px; }
.notes-h { font-family: var(--font-text); font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.notes { margin: 0; padding-left: 22px; font-size: 13.5px; line-height: 1.65; color: var(--text); }
.notes li { margin-bottom: 6px; padding-left: 4px; }
.notes li::marker { color: var(--gold-ink); font-weight: 700; font-size: 12px; }
.notes li:target { background: var(--tinte); border-radius: 6px; }
.diverg { border: 1.5px solid var(--almagra); border-radius: 16px; padding: 20px 22px; margin-bottom: 30px; }
.diverg h2 { font-size: 22px; color: var(--almagra); margin-bottom: 12px; }
.diverg p { margin: 0; font-family: var(--font-read); font-size: 15px; line-height: 1.7; color: var(--text); max-width: 68ch; }
.sources { border-top: 2px solid var(--accent); padding-top: 16px; margin-bottom: 26px; }
.sources h2 { font-size: 22px; margin-bottom: 12px; }
.src-types { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.src-type { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line2); border-radius: 16px; padding: 8px 13px; background: var(--card); font-size: 13px; color: var(--text); }
.refs { width: 100%; min-width: 460px; border-collapse: collapse; font-size: 14px; }
.refs th { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line2); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10.5px; }
.refs td { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.refs td:first-child { color: var(--ink); font-weight: 600; }
.refs th + th, .refs td + td { padding-left: 16px; }
.byline { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding: 14px 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 26px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.actions .btn-soft { font-size: 13px; padding: 9px 16px; }
.actions .report { margin-left: auto; font-size: 12.5px; color: var(--almagra); }
.cursus-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.cursus-nav a { flex: 1 1 240px; border: 1px solid var(--line); border-radius: 16px; padding: 13px 16px; background: var(--card); color: inherit; }
.cursus-nav a:hover { text-decoration: none; border-color: var(--accent); }
.cursus-nav small { display: block; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.cursus-nav .next { text-align: right; }
.related { display: flex; flex-direction: column; gap: 8px; }
.related a { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 13px 16px; color: var(--text); font-size: 14px; }
.related a span:last-child { margin-left: auto; color: var(--accent); }
.useful { margin-bottom: 24px; }
.useful h2 { font-size: 18px; margin-bottom: 12px; }
.useful .btn-soft { border: 2px solid var(--accent); background: var(--card); padding: 9px 24px; border-radius: 16px; }

/* ============================================================
   7. AUTRES PAGES
   ============================================================ */
.page-head { padding: 48px 0 20px; }
.page-head h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.12; margin: 14px 0 12px; }
.page-head p { font-size: 16px; line-height: 1.6; color: var(--text); margin: 0; }
.read p { font-family: var(--font-read); font-size: 16px; line-height: 1.75; color: var(--text); max-width: 68ch; }
.tbl { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.tbl .scroll { overflow-x: auto; }
.tbl table { width: 100%; min-width: 620px; border-collapse: collapse; }
.tbl th { text-align: left; padding: 13px 18px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); background: var(--bg2); }
.tbl td { padding: 14px 18px; vertical-align: top; line-height: 1.55; font-size: 13.5px; color: var(--text); border-top: 1px solid var(--line); }
.rank { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; font-size: 14px; line-height: 1.6; color: var(--text); }
.rank .n { font-family: var(--font-title); font-size: 22px; color: var(--gold-ink); flex-shrink: 0; }
.gloss { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; }
.gloss .t { font-family: var(--font-title); font-size: 18px; color: var(--ink); min-width: 170px; }
.gloss .a { font-size: 20px; color: var(--gold-ink); }
.gloss .d { flex: 1 1 100%; font-family: var(--font-read); font-size: 14px; line-height: 1.65; color: var(--text); max-width: 68ch; }
.step { display: flex; align-items: center; gap: 16px; background: var(--card); border: 1px solid var(--line); border-left-width: 4px; border-left-style: solid; border-radius: 16px; padding: 15px 18px; color: inherit; }
.step:hover { text-decoration: none; }
.step .n { font-family: var(--font-title); font-size: 22px; color: var(--gold-ink); min-width: 30px; text-align: center; }
.step .ch { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 3px; }
.step .q { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.progress-dots { display: flex; gap: 5px; }
.progress-dots span { flex: 1; height: 5px; border-radius: 2px; background: var(--line); }
.progress-dots span.on { background: var(--accent); }
.list-dense a { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); color: inherit; }
.list-dense a:hover { background: var(--well); text-decoration: none; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
/* Les calligraphies en filigrane dépassent à droite : on les rogne sans créer de défilement horizontal */
#contenu { overflow-x: clip; }
/* Poser une question : le formulaire d'abord, le cadre et les conseils sur le côté */
.ask-head { max-width: 640px; margin-bottom: 24px; }
.ask-head h1 { font-size: clamp(30px, 4.6vw, 42px); line-height: 1.1; margin: 10px 0 10px; }
.ask-head p { font-size: 16.5px; line-height: 1.6; color: var(--text); margin: 0; }
.ask-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.ask-form { min-width: 0; background: var(--card); border: 1px solid var(--line2); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 22px; box-shadow: 0 1px 2px oklch(0.3 0.05 240 / .05), 0 18px 40px -26px oklch(0.35 0.09 240 / .3); }
.ask-done { text-align: center; align-items: center; padding: 44px 28px; gap: 14px; }
.ask-hint { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.ask-hint a { font-weight: 600; white-space: nowrap; }
.step-n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--tinte); color: var(--link); font-size: 12px; font-weight: 700; vertical-align: 1px; }
.field .opt { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.chap-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.field label.chap-opt { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 0; padding: 10px 14px; border: 1px solid var(--line2); border-radius: 12px; background: var(--bg); font-size: 14.5px; font-weight: 600; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.chap-opt .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.chap-opt small { flex: 1 1 100%; padding-left: 17px; font-size: 12px; font-weight: 400; color: var(--muted); }
.chap-opt:hover { border-color: var(--accent-air); }
.chap-opt:has(input:checked) { border-color: var(--accent); background: var(--tinte); box-shadow: inset 0 0 0 1px var(--accent); }
.chap-opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.q-meta { display: flex; justify-content: space-between; gap: 12px; margin: 7px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.ask-checks { display: flex; flex-direction: column; gap: 10px; }
.ask-submit { width: 100%; padding: 16px; font-size: 15.5px; border-radius: 14px; transition: filter .15s; }
.ask-submit:hover { filter: brightness(1.08); }
.ask-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; min-width: 0; }
.ask-side .scope { grid-template-columns: 1fr; gap: 9px; }
.ask-aside { min-width: 0; background: var(--tinte); border: 1px solid var(--line2); border-radius: 16px; padding: 24px; }
:target { scroll-margin-top: 90px; }
@media (max-width: 860px) { .ask-layout { grid-template-columns: 1fr; } .ask-side { position: static; } }
@media (max-width: 520px) { .ask-form { padding: 20px 16px; border-radius: 16px; gap: 20px; } .field-row { grid-template-columns: 1fr; } .chap-pick { grid-template-columns: 1fr 1fr; } }
.tip-n { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.scope { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 20px; }
.scope span { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.scope span::before { content: "✕"; color: var(--almagra); font-weight: 700; flex-shrink: 0; }
.ok-icon { width: 54px; height: 54px; margin-bottom: 14px; }

/* ============================================================
   8. PALETTE CTRL+K & PRÉFÉRENCES
   ============================================================ */
.fmq-cmdk { border: 1.5px solid var(--line2); border-radius: 8px; background: var(--card); color: var(--ink); padding: 0; width: min(620px, 92vw); margin: 14vh auto auto; }
.fmq-cmdk::backdrop { background: oklch(0.2 0.05 240 / 0.42); backdrop-filter: blur(3px); }
body:has(.fmq-cmdk:popover-open) { overflow: hidden; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cmdk-in input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 15px; color: var(--ink); }
.cmdk-list { max-height: 330px; overflow: auto; padding: 8px; }
.cmdk-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 6px; color: var(--ink); font-size: 14px; }
.cmdk-list a:hover, .cmdk-list a:focus { background: var(--tinte); text-decoration: none; }
.cmdk-list .k { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-ink); font-weight: 700; min-width: 64px; }
.fmq-prefs { border: 1px solid var(--line2); border-radius: 6px; background: var(--card); color: var(--text); padding: 0; width: min(360px, 92vw); margin: auto; }
.fmq-prefs::backdrop { background: oklch(0.2 0.05 240 / 0.4); }
.prefs-head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; font-size: 15px; color: var(--ink); font-weight: 700; }
.prefs-body { padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.seg { display: flex; gap: 8px; }
.seg button { cursor: pointer; padding: 8px 15px; font-size: 13px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); }
.seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--tinte); color: var(--link); font-weight: 700; }

/* ============================================================
   9. BARRE MOBILE, ORNEMENT, PIED
   ============================================================ */
.fmq-bbar { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 55; background: var(--bg); border-top: 2px solid var(--gold); justify-content: space-around; height: 60px; }
.fmq-bbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--ink); }
.fmq-bbar a.ask { color: var(--accent); font-weight: 700; }
@media (max-width: 720px) { .fmq-bbar { display: flex; } body { padding-bottom: 64px; } .hdr-search { display: none; } }
.ornament { margin-top: 46px; line-height: 0; -webkit-mask-image: linear-gradient(to bottom, transparent, black 62%); mask-image: linear-gradient(to bottom, transparent, black 62%); }
.ornament svg { width: 100%; height: 38px; display: block; }
.site-footer { border-top: 1px solid var(--line); background: var(--bg); }
.site-footer .in { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 32px 24px; font-size: 12.5px; color: var(--muted); }
.site-footer .brand-name { font-size: 15px; }
.site-footer a { color: var(--muted); border-bottom: 1px solid var(--line); }
@media print { .site-hdr, .site-footer, .fmq-bbar, .noprint, .ornament, .fmq-grain-fx, .mini-hdr, .progress-wrap { display: none !important; } }

/* ============================================================
   Bibliothèque : texte intégral d'un livre, arabe et français
   ============================================================ */
.livre { margin: 0 0 30px; }
.livre-h { font-size: 24px; margin-bottom: 10px; }
.livre-avert { font-size: 13.5px; line-height: 1.6; color: var(--text); background: var(--tinte); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; }
.livre-bar { position: sticky; top: var(--livre-top, 57px); z-index: 5; background: var(--bg); padding: 12px 0 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.livre-search { padding: 8px 18px; }
.livre-search input { font-size: 16px; padding: 6px 0; }
.livre-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 10px; }
.livre-modes { display: inline-flex; border: 1px solid var(--line2); border-radius: 999px; overflow: hidden; background: var(--card); }
.livre-modes button { border: none; background: transparent; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); padding: 7px 14px; }
.livre-modes button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
.livre-status { margin: 0; font-size: 12.5px; color: var(--muted); }
.livre-toc { border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 12px 18px; margin: 14px 0 6px; }
.livre-toc summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.livre-toc ol { list-style: none; margin: 12px 0 2px; padding: 0; columns: 2 260px; column-gap: 28px; }
.livre-toc li { break-inside: avoid; }
.livre-toc a { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13.5px; color: var(--text); }
.livre-toc .toc-n { color: var(--muted); font-size: 12px; white-space: nowrap; }
.livre-vide { text-align: center; color: var(--text); padding: 30px 12px; }
.livre-part { scroll-margin-top: 190px; }
.livre-part-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; font-size: 21px; line-height: 1.3; margin: 34px 0 4px; padding-bottom: 10px; border-bottom: 2px solid var(--gold); }
.livre-part-h .ar { font-size: 24px; color: var(--accent); }
.vers-list { list-style: none; margin: 0; padding: 0; }
.vers { display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 14px; padding: 16px 0 14px; border-bottom: 1px solid var(--line); scroll-margin-top: 190px; }
.vers:target { background: var(--tinte); border-radius: 12px; padding-left: 10px; padding-right: 10px; }
.vers-n { grid-row: 1 / span 3; align-self: start; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--gold-ink); text-align: center; border: 1px solid var(--line2); border-radius: 999px; padding: 2px 0; font-variant-numeric: tabular-nums; }
.vers-n:hover { text-decoration: none; border-color: var(--accent); }
.vers-ar { grid-column: 2; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 34px; font-size: calc(var(--fmq-body) * 1.34); line-height: 2.05; color: var(--ink); }
.vers-ar span:last-child { text-align: left; }
.vers-ar.is-prose { display: block; font-size: calc(var(--fmq-body) * 1.28); line-height: 2.1; }
.vers-ar.is-prose span:last-child { text-align: right; padding-right: 0; }
.vers-fr { grid-column: 2; margin: 6px 0 0; font-family: var(--font-read); font-size: calc(var(--fmq-body) * 0.92); line-height: 1.7; color: var(--text); max-width: 68ch; }
.vers-note { grid-column: 2; margin: 6px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); max-width: 68ch; }
.vers-note::before { content: 'Note · '; font-weight: 700; color: var(--gold-ink); }
.livre[data-mode="ar"] .vers-fr, .livre[data-mode="ar"] .vers-note, .livre[data-mode="fr"] .vers-ar { display: none; }
.livre[data-mode="fr"] .vers-fr { margin-top: 2px; }
.vers.is-cite { background: var(--tinte); border-radius: 12px; padding-left: 10px; padding-right: 10px; }
.livre-cite { font-size: 13px; line-height: 1.55; color: var(--text); background: var(--tinte); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 14px; margin: 12px 0 0; }
.livre mark { background: oklch(0.9 0.12 90); color: inherit; border-radius: 3px; padding: 0 1px; }
@media (max-width: 620px) {
  .livre-bar { padding: 8px 0 6px; }
  .livre-search { padding: 4px 16px; }
  .livre-tools { margin-top: 6px; gap: 4px 12px; }
  .livre-status { font-size: 11.5px; }
  .vers { grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; }
  .vers-ar { grid-template-columns: 1fr; font-size: calc(var(--fmq-body) * 1.24); line-height: 1.95; }
  .vers-ar span:last-child { padding-right: 1.6em; text-align: right; }
  .livre-modes button { padding: 7px 11px; }
}
.vers-hits { margin: 0 0 30px; }
.vers-hits h2 { font-family: var(--font-text); margin: 0 0 12px; }
.vers-hit { display: grid; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; margin-bottom: 8px; color: var(--text); }
.vers-hit:hover { text-decoration: none; border-color: var(--line2); }
.vh-ref { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-ink); }
.vh-ar { font-size: 21px; line-height: 1.9; color: var(--ink); }
.vh-fr { font-family: var(--font-read); font-size: 14.5px; line-height: 1.6; }
@media print { .livre-bar, .livre-toc { display: none !important; } }
.livre-toc ul { list-style: none; margin: 0 0 6px; padding: 0 0 0 14px; border-left: 1px solid var(--line2); }
.livre-toc ul a { font-size: 12.5px; padding: 3px 0; color: var(--muted); }
.livre-toc .toc-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.livre-toc > ol > li > a { font-weight: 600; }
.livre [hidden] { display: none !important; }

/* Audit du 07/10/2026 : cibles tactiles d'au moins 24 px de haut */
.crumbs a,.toc a,.site-footer .in > a{display:inline-flex;align-items:center;min-height:24px}

/* Audit du 07/10/2026 : aucun texte de lecture sous 12 px */
.badge, .num, .grid-home > .card-q .num, .eyebrow, .toc .eyebrow, .terms, .cite-copy, .notes-h, .refs th, .tbl th, .cursus-nav small, .step .ch, .fmq-bbar a, .vh-ref, .mega-h { font-size: 12px; }
.eyebrow, .notes-h, .cursus-nav small { letter-spacing: 0.12em; }
