/* Hassanates : identité « Le ciel vivant » (socle de toutes les surfaces : appli, site, espace mosquée, écran TV, pages SEO).
   Idée : un vrai ciel, calculé depuis la position du soleil, posé sur de l'encre et de la pierre. Le reste de l'interface
   reste sobre pour que lui seul vive. Signature constante : le vert Hassanates (actions, sélection, focus).
   Typo : Changa pour les vrais moments (nom de prière, heures, chiffres) ; Schibsted Grotesk pour le latin, Alexandria
   pour l'arabe courant. Le Coran garde Amiri Quran, sobre, jamais animé.
   Thème clair/sombre automatique, forçable avec <html data-theme="light|dark">.
   Ambiance : <html data-ambiance="aube|midi|apres|coucher|nuit"> posée par /assets/js/boot.js, affinée par ambiance.js. */
/* <polices> générées par npm run build:summaries depuis assets/fonts/fonts.css */
@font-face{font-family:'Alexandria';font-style:normal;font-weight:400 700;font-display:swap;src:url(../fonts/alexandria-arabic.woff2) format('woff2');unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:'Amiri';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/amiri-arabic-400.woff2) format('woff2');unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:'Amiri';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/amiri-latin-ext-400.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Amiri';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/amiri-latin-400.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Amiri';font-style:normal;font-weight:700;font-display:swap;src:url(../fonts/amiri-arabic-700.woff2) format('woff2');unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:'Amiri';font-style:normal;font-weight:700;font-display:swap;src:url(../fonts/amiri-latin-ext-700.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Amiri';font-style:normal;font-weight:700;font-display:swap;src:url(../fonts/amiri-latin-700.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Amiri Quran';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/amiri-quran-arabic-400.woff2) format('woff2');unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:'Amiri Quran';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/amiri-quran-latin-400.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Changa';font-style:normal;font-weight:500 800;font-display:swap;src:url(../fonts/changa-arabic.woff2) format('woff2');unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:'Changa';font-style:normal;font-weight:500 800;font-display:swap;src:url(../fonts/changa-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Changa';font-style:normal;font-weight:500 800;font-display:swap;src:url(../fonts/changa-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Schibsted Grotesk';font-style:normal;font-weight:400 800;font-display:swap;src:url(../fonts/schibsted-grotesk-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Schibsted Grotesk';font-style:normal;font-weight:400 800;font-display:swap;src:url(../fonts/schibsted-grotesk-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
/* </polices> */

/* Repli métrique : le texte de secours occupe presque la même place que la police finale (pas de saut). */
@font-face { font-family: 'Texte Repli'; src: local('Arial'), local('Helvetica'); size-adjust: 99%; ascent-override: 98%; descent-override: 26%; }
@font-face { font-family: 'Changa Repli'; src: local('Arial Narrow'), local('Arial'); size-adjust: 92%; ascent-override: 108%; descent-override: 30%; }

:root {
  /* les cinq temps : teintes du ciel (marque, écran TV, frises) */
  --k-aube: #8ec5f0; --k-midi: #f5cb4c; --k-asr: #ef9a50; --k-coucher: #e8657e; --k-nuit: #b9c6ff;
  --c-ink: #0e1210;
  /* signature : vert vif, texte encre dessus. --brand-fg : variante lisible sur fond clair (texte et marques fines) */
  --brand: #19ec8c; --brand-fg: #00704f; --on-brand: #04130d;
  --jade: var(--brand); --jade-fg: var(--brand-fg); --on-jade: var(--on-brand); /* anciens noms, encore lus par les écrans */
  --mark: var(--brand-fg); /* trait fin de sélection : 3:1 au moins sur le fond */

  /* ciel courant : repli par ambiance, précisé par ambiance.js (accueil, ouverture des pages du site, écran TV) */
  --sky-top: #298de9; --sky-mid: #84c6f6; --sky-low: #deecea; --on-sky: var(--c-ink);
  --sky: var(--sky-mid);
  --sky-grad: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 56%, var(--sky-low) 100%);

  /* action vive = le vert, constant quelle que soit l'heure */
  --accent: var(--brand); --accent-fg: var(--brand-fg); --on-accent: var(--on-brand);

  /* neutres clairs : pierre froide, jamais crème */
  --c-bg: #eef0ec; --c-surface: #ffffff; --c-surface-2: #e4e7e2; --c-surface-3: #d3d8d1;
  --c-line: rgb(14 18 16 / .12); --c-border: var(--c-line);
  --c-line-strong: rgb(14 18 16 / .46); /* contour d'un contrôle : 3:1 sur la pierre et le blanc */
  --c-text: #0e1210; --c-muted: #535b55;
  --c-solid: #0e1210; --c-on-solid: #ffffff;
  --c-field: #e4e7e2;
  --c-ok: #0b7a4b; --c-ok-fg: #075c39; --c-warn: #9a4a00; --c-err: #c42b1c;
  --on-warn: #fff; --on-err: #fff;
  --c-mistake: #c42b1c; --c-skip: #a5530a; --c-fixed: #1f5fbf;

  /* compat : anciens noms utilisés par les écrans */
  --c-primary: var(--c-solid); --c-primary-2: var(--accent-fg); --c-primary-3: var(--accent-fg);
  --c-gold: var(--accent); --c-gold-soft: color-mix(in srgb, var(--accent) 18%, var(--c-surface));
  --c-on-primary: var(--c-on-solid);

  --f-body: 'Schibsted Grotesk', 'Alexandria', 'Texte Repli', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-title: var(--f-body);                                   /* titres : même famille que le texte, plus grasse */
  --f-moment: 'Changa', 'Changa Repli', 'Alexandria', system-ui, sans-serif; /* nom de prière, heures, chiffres */
  --f-kufi: 'Changa', 'Alexandria', sans-serif;               /* arabe de l'interface (jamais le Coran) */
  --f-ar: 'Amiri', 'Traditional Arabic', serif;               /* arabe courant, leçons */
  --f-quran: 'Amiri Quran', 'Amiri', serif;                   /* texte du Coran : sobre, jamais décoré */

  /* trois niveaux de titre, jamais le même partout : écran fort (onglets), normal (rubriques), outil (réglages, formulaires) */
  --t-fort: 800 clamp(2.5rem, 11.4vw, 3.3rem)/1 var(--f-title);
  --t-normal: 800 clamp(1.72rem, 6.8vw, 2.15rem)/1.06 var(--f-title);
  --t-outil: 700 1.24rem/1.2 var(--f-title);
  /* rythme : l'écart dit la relation (lié, voisin, nouvelle partie) */
  --sp-lie: 6px; --sp-voisin: 12px; --sp-bloc: 20px; --sp-partie: 36px;

  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 22px; --r-pill: 999px;
  --sh-1: none; --sh-2: 0 -1px 0 var(--c-line), 0 24px 60px rgb(0 0 0 / .18);
  --gutter: 16px; --maxw: 1160px;
  --ease: cubic-bezier(.2, .8, .2, 1);                         /* sortie ferme */
  --ease-in: cubic-bezier(.5, 0, .75, 0);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.3, 1.35, .6, 1);                     /* repli si linear() n'existe pas */
  --dur: .28s;
  color-scheme: light;
}
@supports (transition-timing-function: linear(0, 1)) {
  /* vrai ressort (amorti, une seule petite oscillation) */
  :root { --spring: linear(0, .013 1.1%, .052 2.3%, .207 4.9%, .434 7.8%, .705 11.4%, .867 14.2%, .98 17.2%, 1.047 20.4%, 1.075 23.7%, 1.078 26.4%, 1.064 30%, 1.024 37.2%, 1.003 43.9%, .996 51.4%, .999 69.7%, 1); }
}

/* ---------- Ambiances : le ciel du moment, repli sans calcul (valeurs tirées de sky-model.js) ---------- */
:root[data-ambiance="aube"] { --sky-top: #5294e0; --sky-mid: #bcc8e5; --sky-low: #fadbb0; }
:root[data-ambiance="midi"] { --sky-top: #298de9; --sky-mid: #84c6f6; --sky-low: #deecea; }
:root[data-ambiance="apres"] { --sky-top: #468dd9; --sky-mid: #c1c8ca; --sky-low: #fccf8f; }
:root[data-ambiance="coucher"] { --sky-top: #2b3886; --sky-mid: #a2518b; --sky-low: #ba4d2a; --on-sky: #f5f7ff; }
:root[data-ambiance="nuit"] { --sky-top: #05091e; --sky-mid: #0c1437; --sky-low: #182354; --on-sky: #f5f7ff; }

/* ---------- Thème sombre ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #090b0a; --c-surface: #131715; --c-surface-2: #1c211e; --c-surface-3: #282e2a;
    --c-line: rgb(236 240 236 / .1); --c-text: #ecf0ec; --c-muted: #a8b2ab;
    --c-solid: #ecf0ec; --c-on-solid: #0e1210; --c-field: #1c211e;
    --brand-fg: var(--brand); --mark: var(--brand);
    --c-ok: #4fd08a; --c-ok-fg: #4fd08a; --c-warn: #f2a65a; --c-err: #ff7b70; --c-mistake: #ff7b70; --c-skip: #f2a65a; --c-fixed: #7db2ff;
    --c-line-strong: rgb(236 240 236 / .46); --on-warn: #241300; --on-err: #2c0704;
    color-scheme: dark;
  }
  :root[data-ambiance="aube"]:not([data-theme="light"]) { --sky-top: #06246a; --sky-mid: #573b9d; --sky-low: #af5324; --on-sky: #f5f7ff; }
  :root[data-ambiance="midi"]:not([data-theme="light"]) { --sky-top: #06246a; --sky-mid: #0b52b0; --sky-low: #1373bc; --on-sky: #f5f7ff; }
  :root[data-ambiance="apres"]:not([data-theme="light"]) { --sky-top: #06246a; --sky-mid: #4640a1; --sky-low: #8b5c49; --on-sky: #f5f7ff; }
  :root[data-ambiance="coucher"]:not([data-theme="light"]) { --sky-top: #1c307b; --sky-mid: #864892; --sky-low: #b94f25; --on-sky: #f5f7ff; }
}
:root[data-theme="dark"] {
  --c-bg: #090b0a; --c-surface: #131715; --c-surface-2: #1c211e; --c-surface-3: #282e2a;
  --c-line: rgb(236 240 236 / .1); --c-text: #ecf0ec; --c-muted: #a8b2ab;
  --c-solid: #ecf0ec; --c-on-solid: #0e1210; --c-field: #1c211e;
  --brand-fg: var(--brand); --mark: var(--brand);
  --c-ok: #4fd08a; --c-ok-fg: #4fd08a; --c-warn: #f2a65a; --c-err: #ff7b70; --c-mistake: #ff7b70; --c-skip: #f2a65a; --c-fixed: #7db2ff;
  --c-line-strong: rgb(236 240 236 / .46); --on-warn: #241300; --on-err: #2c0704;
  color-scheme: dark;
}
:root[data-theme="dark"][data-ambiance="aube"] { --sky-top: #06246a; --sky-mid: #573b9d; --sky-low: #af5324; --on-sky: #f5f7ff; }
:root[data-theme="dark"][data-ambiance="midi"] { --sky-top: #06246a; --sky-mid: #0b52b0; --sky-low: #1373bc; --on-sky: #f5f7ff; }
:root[data-theme="dark"][data-ambiance="apres"] { --sky-top: #06246a; --sky-mid: #4640a1; --sky-low: #8b5c49; --on-sky: #f5f7ff; }
:root[data-theme="dark"][data-ambiance="coucher"] { --sky-top: #1c307b; --sky-mid: #864892; --sky-low: #b94f25; --on-sky: #f5f7ff; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 76px; scroll-padding-bottom: 88px; }
:root[data-text="115"] { font-size: 115%; }
:root[data-text="130"] { font-size: 130%; }
body { margin: 0; background: var(--c-bg); color: var(--c-text); font: 400 1rem/1.5 var(--f-body); overflow-x: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-fg); text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1, h2, h3 { font-family: var(--f-title); font-weight: 700; line-height: 1.1; letter-spacing: -.022em; margin: 0 0 .45em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 6vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: clamp(1.3rem, 3.6vw, 1.9rem); }
h3 { font-size: 1.08rem; font-weight: 700; letter-spacing: -.012em; }
p { margin: 0 0 1em; text-wrap: pretty; }
.ar { font-family: var(--f-ar); direction: rtl; }
.ar, .kufi, .quran, [lang="ar"], [dir="rtl"] { unicode-bidi: isolate; }
.kufi { font-family: var(--f-kufi); direction: rtl; font-weight: 700; }
.quran { font-family: var(--f-quran); direction: rtl; line-height: 2.25; font-size: clamp(1.5rem, 4vw, 2.1rem); font-feature-settings: 'calt', 'liga'; }
.muted { color: var(--c-muted); }
.container { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent-fg); outline-offset: 2px; border-radius: var(--r-sm); }
.skip-link { position: fixed; z-index: 3000; top: 8px; left: 8px; padding: 12px 16px; border-radius: var(--r-md); background: var(--c-solid); color: var(--c-on-solid); font-weight: 600; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
::selection { background: var(--jade); color: var(--on-jade); }
.num { font-family: var(--f-moment); font-variant-numeric: tabular-nums; }

/* ---------- Boutons : rectangles francs, pression physique ---------- */
.btn[hidden] { display: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .6em 1.25em; border-radius: var(--r-md);
  border: 0; font: 600 .97rem/1.1 var(--f-body); cursor: pointer; text-decoration: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  background: var(--c-solid); color: var(--c-on-solid);
  transition: transform .4s var(--spring), background-color .2s, color .2s, opacity .2s;
}
.btn:active { transform: scale(.95); transition-duration: .08s; }
.btn[disabled] { opacity: .38; cursor: not-allowed; transform: none; }
.btn-gold { background: var(--jade); color: var(--on-jade); }
.btn-ghost { background: transparent; color: var(--c-text); box-shadow: inset 0 0 0 1.5px var(--c-line-strong); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--c-text); }
.btn-danger { background: var(--c-err); color: var(--on-err); }
.btn-sm { min-height: 44px; padding: .4em 1em; font-size: .88rem; }
.btn-lg { min-height: 56px; padding-inline: 1.6em; font-size: 1.04rem; }
.btn-icon { width: 48px; padding: 0; }
.link-btn { background: none; border: 0; padding: 8px 4px; min-height: 44px; color: var(--accent-fg); font: 600 .9rem var(--f-body); text-decoration: underline; cursor: pointer; }
@media (hover: hover) { .btn:not(.btn-ghost):hover { filter: brightness(1.08); } }

/* ---------- Surfaces, champs, étiquettes ---------- */
.card { background: var(--c-surface); border-radius: var(--r-lg); padding: 18px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: .6em .85em; border-radius: var(--r-md);
  border: 1.5px solid var(--c-line-strong); background: var(--c-field); color: var(--c-text); font: inherit; transition: border-color .15s, background-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-fg); background: var(--c-surface); box-shadow: inset 0 0 0 1px var(--accent-fg); }
:is(input, select, textarea):focus-visible { outline: 0; } /* la bordure épaissie suffit : pas de double contour */
input::placeholder, textarea::placeholder { color: var(--c-muted); opacity: 1; }
textarea { min-height: 110px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 22px; min-height: 22px; accent-color: var(--brand-fg); }
input[type="checkbox"]:focus, input[type="radio"]:focus { box-shadow: none; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--accent-fg); }
input[type="color"] { padding: 4px; width: 64px; }
.field { margin-bottom: 14px; }
.hint { font-size: .84rem; color: var(--c-muted); margin-top: 4px; }
.badge { display: inline-flex; align-items: center; gap: .35em; padding: .18em .5em; border-radius: var(--r-sm); font: 600 .8125rem/1.3 var(--f-body); background: var(--c-surface-2); color: var(--c-text); }
.badge-gold { background: var(--jade); color: var(--on-jade); }
.badge-ok { background: color-mix(in srgb, var(--c-ok) 15%, transparent); color: var(--c-ok-fg); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--c-line); text-align: left; }
th { font-size: .8125rem; color: var(--c-muted); font-weight: 600; }

/* ---------- Bulles (succès / échec + raison) ---------- */
.toasts { position: fixed; z-index: 1000; inset: auto 16px 16px auto; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  display: grid; grid-template-columns: 4px 1fr; column-gap: 12px; align-items: start; padding: 12px 16px 12px 12px; border-radius: var(--r-md);
  background: var(--c-ink); color: #f1f4f1; animation: toast-in .5s var(--spring);
}
:root[data-theme="dark"] .toast { background: var(--c-surface-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: var(--c-surface-3); } }
.toast::before { content: ''; grid-row: 1 / 3; align-self: stretch; border-radius: 2px; background: var(--k-midi); }
.toast .muted { display: block; color: #cfd6d1; }
.toasts-live { display: contents; }
.toast.ok::before { background: var(--brand); }
.toast.err::before { background: #ff7b70; }
.toast > * { grid-column: 2; }
.toast b { display: block; font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ---------- Messages de la plateforme (core/notices.js) ---------- */
.notice-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 10px var(--gutter); font-size: .9rem; background: var(--c-surface-2); color: var(--c-text); box-shadow: inset 3px 0 0 var(--jade); }
.notice-bar.is-warn { box-shadow: inset 3px 0 0 var(--c-warn); }
.notice-bar.is-danger { box-shadow: inset 3px 0 0 var(--c-err); }
.notice-bar > span { flex: 1 1 220px; }
.notice-bar a { font-weight: 600; }
.notice-close { min-height: 44px; border: 0; background: none; color: var(--c-muted); font: 600 .82rem var(--f-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.maintenance-wall { position: fixed; inset: 0; z-index: 2000; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; display: grid; align-content: center; gap: 6px; padding: 32px var(--gutter); background: var(--c-solid); color: var(--c-on-solid); text-align: center; }
.maintenance-wall p { max-width: 46ch; margin-inline: auto; }

/* ---------- Ouverture : une fois par session (boot.js). Noir, le mot, puis le rideau se lève sur le ciel.
   Calque sans aucune interaction : la page dessous est déjà utilisable. Se termine seul, sans JavaScript. */
:root.is-opening::before, :root.is-opening::after { pointer-events: none; position: fixed; }
:root.is-opening::before {
  content: ''; z-index: 4000; inset: 0 0 -24vh; background: linear-gradient(180deg, #000 calc(100% - 24vh), transparent);
  animation: ouv-lever .36s var(--ease-in-out) .58s both;
}
:root.is-opening::after {
  content: 'حسنات'; z-index: 4001; inset: 0; display: grid; place-items: center; color: #fff; direction: rtl;
  font: 700 clamp(3.2rem, 17vw, 4.6rem)/1 var(--f-kufi);
  animation: ouv-mot .2s ease-out .04s both, ouv-fin .16s ease-in .5s forwards;
}
:root.is-opening.is-ready::before { animation: ouv-lever-vite .3s var(--ease-in-out) both; }
:root.is-opening.is-ready::after { animation: ouv-fin .14s ease-in both; }
@keyframes ouv-lever { to { transform: translateY(-125%); } }
@keyframes ouv-lever-vite { to { transform: translateY(-125%); } }
@keyframes ouv-mot { from { opacity: 0; transform: translateY(6px); } }
@keyframes ouv-fin { to { opacity: 0; } }

/* ---------- Transitions entre pages (View Transitions, navigateurs compatibles) ---------- */
@view-transition { navigation: auto; }
::view-transition-group(root) { animation-duration: var(--dur); }
html:active-view-transition-type(push)::view-transition-old(root) { animation: vt-out-left .26s var(--ease) both; }
html:active-view-transition-type(push)::view-transition-new(root) { animation: vt-in-right .34s var(--ease) both; }
html:active-view-transition-type(back)::view-transition-old(root) { animation: vt-out-right .26s var(--ease) both; }
html:active-view-transition-type(back)::view-transition-new(root) { animation: vt-in-left .34s var(--ease) both; }
html:active-view-transition-type(tab)::view-transition-old(root) { animation: vt-fade-out .14s linear both; }
html:active-view-transition-type(tab)::view-transition-new(root) { animation: vt-fade-in .2s linear both; }
@keyframes vt-in-right { from { transform: translateX(28px); opacity: 0; } }
@keyframes vt-in-left { from { transform: translateX(-28px); opacity: 0; } }
@keyframes vt-out-left { to { transform: translateX(-12px); opacity: 0; } }
@keyframes vt-out-right { to { transform: translateX(12px); opacity: 0; } }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }

/* ---------- Démonstration du correcteur (core/recite-demo.js) : couleur seule, le texte ne bouge jamais ---------- */
.rd { margin: 0; display: grid; gap: 8px; padding: 18px 16px 8px; border-radius: var(--r-lg); background: var(--c-surface); color: var(--c-text); }
.rd-line { margin: 0; text-align: center; min-height: 2.25em; }
.rd-w { color: var(--c-muted); }
.rd-w[data-state="ok"] { color: var(--c-ok-fg); }
.rd-w[data-state="err"] { color: var(--c-mistake); text-decoration: underline wavy; text-underline-offset: 8px; }
.rd-cap { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; font-size: .875rem; color: var(--c-muted); }
.rd-cap i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; }
.rd-ok { background: var(--c-ok-fg); }
.rd-err { background: var(--c-mistake); }
.rd-cap .link-btn { margin-left: auto; color: var(--accent-fg); font-size: .875rem; }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
