/* [12/09 — porteur : «clean, pro, robuste et very mobile friendly»] Page publique وزّان (/wezzan/).
 *
 * Identité ديار (jetons de waran.css) : fond crème, ambre pour l'action, olive pour ce qui est juste.
 * Un seul élément fort : le verdict et sa RÈGLE DE MESURE, où chaque تفعيلة occupe une largeur
 * proportionnelle à sa longueur (le vers « pesé »). Le reste est sobre : saisie sur lignes de cahier,
 * en Amiri, qui rend les harakat.
 * Mobile d'abord : une colonne, cibles de 44 px au moins, texte de 14 px au moins, champs à 20 px
 * (pas de zoom automatique sur iPhone), rien ne déborde en largeur.
 */

.page-wezzan main { padding-block-end: 32px; }
.wz { max-width: 820px; }
/* L'attribut hidden doit toujours l'emporter : une règle display:flex l'écrasait (barre de تشكيل rendue au
   chargement, en bas de page, et Amiri téléchargé pour rien). */
.wz [hidden] { display: none !important; }
.wz-invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- en-tête --------------------------------------------------------------------------------- */
.wz-tete { padding-block: 12px 4px; }
.wz-tete h1 { font-size: clamp(28px, 7vw, 40px); line-height: 1.1; }
.wz-tete p { margin: 4px 0 0; color: var(--text-mute); font-size: 17px; max-width: 58ch; }

/* --- choix du registre ----------------------------------------------------------------------- */
.wz-saisie { margin-top: 12px; }
.wz-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 0 8px; padding: 3px; border: 1px solid var(--border);
  border-radius: var(--radius-pill); background: var(--surface-2); }
.wz-mode label { position: relative; display: block; cursor: pointer; }
.wz-mode input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.wz-mode span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 42px; padding: 3px 10px;
  border-radius: var(--radius-pill); font-weight: 700; font-size: 16px; line-height: 1.2; color: var(--text-mute);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease); }
.wz-mode small { font-weight: 400; font-size: 13px; color: var(--text-mute); }
.wz-mode input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.wz-mode input:focus-visible + span { box-shadow: var(--focus-ring); }

.wz-consigne { margin: 0 0 12px; color: var(--text-mute); font-size: 15px; }

/* --- les أبيات : lignes de cahier ------------------------------------------------------------------ */
.wz-abyat { list-style: none; margin: 0; padding: 0; counter-reset: bayt; }
.wz-bayt { position: relative; display: grid; grid-template-columns: 30px 1fr 44px; grid-template-areas: "num sadr retirer" "num ajuz retirer" "num indice indice" "num apercu apercu" "barre barre barre";
  column-gap: 8px; padding: 6px 0 4px; border-bottom: 1px solid var(--border); }
.wz-num { grid-area: num; align-self: start; padding-top: 22px; font-weight: 700; font-size: 16px; color: var(--muted); text-align: center; }
.wz-shatr:nth-of-type(1) { grid-area: sadr; }
.wz-shatr:nth-of-type(2) { grid-area: ajuz; }
.wz-shatr { display: block; min-width: 0; }
.wz-etiquette { display: block; font-size: 12px; color: var(--text-mute); line-height: 1.3; }
.wz-shatr input { width: 100%; min-height: 48px; padding: 4px 2px 6px; border: 0; border-bottom: 2px solid var(--border); border-radius: 0;
  background: transparent; color: var(--ink); font-family: var(--font-body); font-size: 21px; line-height: 1.9;
  transition: border-color var(--fast) var(--ease); }
/* Amiri (125 Ko, rend les harakat) ne se charge qu'à l'écriture : un visiteur qui lit la page ne le paie pas. */
.wz-shatr input:focus, .wz-shatr input.wz-rempli { font-family: var(--font-verse); }
.wz-shatr input:focus { outline: none; border-bottom-color: var(--primary); }
/* شطر du كاف affiché en texte : ses lettres sans signe se touchent, le clavier reste fermé */
.wz-shatr--affiche input { display: none; }
.wz-signe--editer .wz-signe-glyphe { font-family: var(--font-body); font-size: 20px; line-height: 42px; }
.wz-signe--editer { order: 2; }
.wz-shatr input:focus-visible { box-shadow: 0 3px 0 -1px rgba(228, 163, 61, .35); }
.wz-retirer { grid-area: retirer; align-self: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.wz-retirer:hover, .wz-retirer:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }
.wz-indice { grid-area: indice; margin: 2px 0 0; font-size: 13px; color: var(--text-mute); }
.wz-bayt--ok .wz-indice { color: var(--olive); }
.wz-bayt--attention .wz-indice { color: var(--amber-text); }
.wz-bayt--erreur .wz-indice { color: #9B2C2C; font-weight: 600; }
.wz-bayt--erreur input { border-bottom-color: #C0504D; }

/* --- barre de تشكيل : sous le بيت en cours de saisie ------------------------------------------------ */
/* barre de تشكيل : chaque signe posé sur un tatweel (visible dans toutes les polices arabes) et nommé ;
   tout tient à l'écran (grille), les signes utiles au لغن d'abord */
.wz-tashkil { grid-area: barre; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin-top: 8px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.wz-tashkil button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 56px; padding: 2px 4px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-alt); color: var(--ink); cursor: pointer; touch-action: manipulation;
  font-family: var(--font-body); font-size: 16px; }
.wz-signe-glyphe { font-family: var(--font-verse); font-size: 26px; line-height: 1.9; height: 42px; overflow: visible; }
.wz-signe-nom { font-family: var(--font-body); font-size: 14px; line-height: 1.2; color: var(--text-mute); }
.wz-signe--effacer .wz-signe-glyphe { font-family: var(--font-body); font-size: 20px; line-height: 42px; }
.wz[data-mode="lghna"] .wz-signe--tanwin { display: none; }
.wz[data-mode="fasih"] .wz-tashkil button[data-haraka="\64E"], .wz[data-mode="fasih"] .wz-tashkil button[data-haraka="\64F"],
.wz[data-mode="fasih"] .wz-tashkil button[data-haraka="\650"] { order: -1; }
.wz-signe--effacer { order: 1; }
.wz-tashkil button:active { background: var(--surface-2); }
.wz-tashkil button:disabled { opacity: .3; cursor: not-allowed; }  /* signe que l'arabe n'écrit pas sur la lettre choisie */
.wz-bayt { scroll-margin-top: calc(var(--header-h, 64px) + 8px); }
@media (max-width: 899px) {
  /* تشكيل au toucher : la barre flotte au-dessus du menu du site, sous le pouce, et ne bouge jamais */
  .wz-tashkil--flottante { position: fixed; inset-inline: 0; bottom: var(--barre-basse-h, 0px); z-index: 91; margin: 0;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px 10px; border-radius: 16px 16px 0 0;
    border-bottom: 0; box-shadow: 0 -6px 20px rgba(44, 38, 32, .12); }
  .wz-tashkil--flottante button { flex: 1 1 0; min-width: 44px; max-width: 76px; min-height: 58px; }
  .wz--barre-flottante { padding-bottom: 170px; }
}
.wz-tashkil button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* --- outils et action ------------------------------------------------------------------------------------ */
.wz-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 2px 0 0; }
/* toutes les actions sur la même ligne de base, quelle que soit leur importance */
.wz-outils > * { display: inline-flex; align-items: center; min-height: 32px; }
.wz-lien { min-height: 32px; padding: 0 2px; border: 0; background: none; color: var(--accent-text); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
/* hiérarchie des actions (porteur 16/09) : écrire d'abord, puis ديار, et en bout ce qui efface ou signale */
.wz-lien[data-action="effacer"] { margin-inline-start: auto; font-size: 13px; font-weight: 500; color: var(--text-mute); }
.wz-lien[data-action="effacer"]:hover { color: #9B2C2C; }
.wz-lien:hover { text-decoration: underline; }
.wz-lien:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }
.wz-erreur { margin: 10px 0; padding: 10px 14px; border-radius: 12px; background: #FBEAEA; color: #7F1D1D; font-weight: 600; }
.wz-peser { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; margin-top: 14px; padding: 0 22px;
  border: 0; border-radius: var(--radius-pill); background: var(--primary-grad); color: var(--primary-ink); font: inherit; font-size: 19px; font-weight: 800;
  box-shadow: var(--shadow); cursor: pointer; touch-action: manipulation; }
.wz-peser:hover { filter: brightness(1.03); }
.wz-peser:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.wz-peser:disabled { cursor: not-allowed; opacity: .45; filter: grayscale(.5); }
/* exigence de تشكيل : message court au-dessus du bouton, lettres sans signe en couleur sous le بيت */
.wz-reste { margin: 10px 0 0; font-size: 15px; color: var(--amber-text); font-weight: 600; text-align: center; }
.wz-bayt--cible { box-shadow: inset -3px 0 0 #E4A33D; border-radius: 10px; }
.wz-bayt--cible.wz-bayt--shakl-ok { box-shadow: inset -3px 0 0 #3B8A5A; }
.wz-apercu { grid-area: apercu; min-width: 0; overflow-wrap: anywhere; display: grid; gap: 2px; margin: 4px 0 0; font-family: var(--font-verse); font-size: 20px; line-height: 1.9; color: var(--ink); }
.wz-apercu-shatr { display: block; }
/* couleur et soulignement seulement : un fond ou une marge par lettre casserait la liaison des lettres arabes */
/* la ligne du vers (porteur 16/09 : « une seule écriture, sans découper les lettres ») : un seul texte, lettres colorées par surlignage */
.wz-lettres { position: relative; z-index: 0; display: block; min-height: 42px; padding: 2px 2px 4px; border-bottom: 2px solid var(--border); font-family: var(--font-verse); font-size: 23px; line-height: 1.75; color: var(--ink); overflow-wrap: anywhere; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; }
::highlight(wz-attente) { color: #C2410C; }
::highlight(wz-survol) { background-color: #FBEFD9; }
::highlight(wz-active) { color: #C2410C; background-color: #FDEBD8; }
::highlight(wz-ouverte) { background-color: #F4DFB5; }
.wz-lettres--menu { z-index: 40; }  /* ligne dont le menu est ouvert : au-dessus des lignes suivantes */
/* le vers se touche : un pointillé continu le dit, sans fond ni boîte (les touches par lettre gênaient la lecture) */
.wz-lettres { text-decoration: underline; text-decoration-style: dotted; text-decoration-thickness: 2px; text-decoration-color: rgba(183, 121, 31, .45); text-underline-offset: 8px; }
.wz-lettres:hover { text-decoration-color: rgba(183, 121, 31, .8); }
.wz-editer-ligne { float: left; margin: 4px 0 0 8px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--text-mute); font-size: 15px; line-height: 1; cursor: pointer; opacity: .75; }
.wz-editer-ligne:hover, .wz-editer-ligne:focus-visible { opacity: 1; background: var(--surface-2); outline: none; }
@media (max-width: 420px) { .wz-lettres { font-size: 22px; } }
/* تقطيع en direct sous chaque تافلويت du premier كاف : le style de la page de jugement du porteur (pastilles chaudes, une ligne) */
.wz-vivant { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 8px 0 2px; font-size: 12px; color: #8A8073; }
.wz-unites--vivant { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.wz-unites--vivant .wz-unite { display: inline-block; padding: 0 6px; border-radius: 7px; background: rgba(239, 231, 214, .55); color: #6F6656; font-family: var(--font-verse); font-size: 15px; line-height: 1.85; box-shadow: none; }
.wz-unites--vivant .wz-unite--kad3a { background: rgba(243, 223, 180, .8); color: #6B5320; box-shadow: inset 0 -2px 0 rgba(183, 121, 31, .75); }
.wz-unites--vivant .wz-unite--casse { background: rgba(246, 226, 220, .8); color: #9A3B2A; }
.wz-vivant-compte { white-space: nowrap; }
.wz-vivant-bett { padding: 0 9px; border-radius: 999px; background: rgba(230, 238, 216, .85); color: #44730F; font-weight: 700; font-size: 12px; white-space: nowrap; }
.wz-vivant-alt { padding: 0 9px; border-radius: 999px; background: rgba(239, 231, 214, .6); color: #8A8073; font-size: 12px; white-space: nowrap; }
.wz-vivant-non { padding: 1px 10px; border-radius: 999px; background: #F6E2DC; color: #9A3B2A; font-weight: 700; font-size: 13px; white-space: nowrap; }
/* menu de la lettre (porteur 16/09) : à côté de la lettre touchée, حركات puis « تغيير الحرف » discret */
.wz-menu-lettre { position: absolute; z-index: 30; display: grid; gap: 4px; margin-top: 2px; padding: 5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); direction: rtl; line-height: 1; cursor: default; }
.wz-menu-rang { display: flex; gap: 3px; align-items: center; }
.wz-menu-lettre button { min-width: 44px; min-height: 44px; padding: 0 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
  color: var(--ink); font: inherit; font-family: var(--font-verse); font-size: 24px; line-height: 1.6; cursor: pointer; touch-action: manipulation; }
.wz-menu-lettre button:active { background: var(--border); }
.wz-menu-lettre button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.wz-menu-lettre .wz-menu-plus { min-height: 28px; padding: 0 8px; border-style: dashed; background: transparent; color: var(--text-mute); font-family: inherit; font-size: 13px; line-height: 1; }
.wz-shatr .wz-menu-lettre input { display: inline-block; width: 48px; min-height: 44px; padding: 0; border: 1px dashed var(--border); border-radius: 8px; background: var(--surface);
  color: var(--ink); font-family: var(--font-verse); font-size: 22px; text-align: center; }
.wz-shatr .wz-menu-lettre input:focus { border-color: var(--primary); }
.wz-reste-go { margin-inline-start: 8px; min-height: 44px; padding: 0 14px; border: 1px solid #E4A33D; border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
@keyframes wz-tourne { to { transform: rotate(360deg); } }

/* --- verdict, en direct et compact (porteur 16/09 : plus de bouton, tout tient sur un écran) --------------------- */
.wz-bayt > .wz-resultat { grid-column: 2 / -2; margin: 10px 0 4px; }
.wz-bayt > .wz-plus { grid-column: 2 / -2; justify-self: start; min-height: 34px; margin: 0 0 2px; padding: 0 12px; border: 1px dashed var(--border);
  border-radius: 999px; background: transparent; color: var(--text-mute); font: inherit; font-size: 13px; cursor: pointer; }
.wz-bayt > .wz-plus:hover, .wz-bayt > .wz-plus:focus-visible { color: var(--ink); background: var(--surface); outline: none; }  /* le verdict, juste sous le premier كاف */
.wz-resultat { margin-top: 10px; scroll-margin-top: calc(var(--header-h) + 12px); outline: none; display: grid; gap: 8px; transition: opacity .18s ease; }
.wz-resultat { position: relative; padding-top: 3px; }
/* squelette du verdict : la forme exacte de ce qui arrive */
.wz-sque { display: grid; gap: 6px; }
.wz-sque-carte { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 68px; border-radius: var(--radius-card);
  background: var(--surface); border: 1px solid var(--border); }
.wz-sque-type { width: 34px; height: 10px; }
.wz-sque-nom { width: 180px; height: 26px; }
.wz-sque-pastille { width: 56px; height: 20px; border-radius: 999px; margin-inline-start: auto; }
.wz-sque-ligne { height: 34px; border-radius: 12px; }
@media (max-width: 560px) { .wz-sque-nom { width: 130px; height: 22px; } .wz-sque-ligne { height: 28px; } }
.wz-retour-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.wz-retour-annuler { min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--text-mute); font: inherit; font-size: 15px; cursor: pointer; }
.wz-retour-annuler:hover { color: var(--ink); text-decoration: underline; }
.wz-verdict { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px;
  padding: 8px 14px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.wz-verdict-id { min-width: 0; }
.wz-verdict-type { margin: 0; color: var(--text-mute); font-size: 13px; font-weight: 600; }
.wz-verdict-nom { margin: 0; font-family: var(--font-poem-title); font-weight: 700; font-size: clamp(24px, 6vw, 32px); line-height: 1.15; }
.wz-verdict-sous { margin: 2px 0 0; font-size: 14px; color: var(--text-mute); }
.wz-verdict-cote { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wz-niveau { padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--text-mute); }
.wz-niveau--sur { background: #E3EDD3; color: #2F5A12; }
.wz-niveau--probable { background: #FBEFD9; color: #8A5B10; }
.wz-niveau--incertain { background: #F6E2DC; color: #9A3B2A; }
.wz-verdict-ou { font-size: 13px; color: var(--text-mute); }
.wz-verdict--aucun .wz-verdict-nom { font-size: clamp(22px, 5vw, 28px); color: var(--text-mute); }
.wz-verdict .wz-wazn { margin: 2px 0 0; font-family: var(--font-verse); font-size: 16px; color: var(--text-mute); }

/* les quatre تيفلواتن qui décident : le vers, ses unités, son compte */
.wz-res-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.wz-res { display: flex; align-items: center; gap: 8px; padding: 3px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.wz-res--ecart { border-color: #E9C4BA; background: #FFF9F7; }
.wz-res-rang { flex: none; width: 46px; color: var(--text-mute); font-size: 12px; font-weight: 600; }
.wz-res-unites { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.wz-res-compte { flex: none; padding: 2px 10px; border-radius: 999px; direction: ltr; unicode-bidi: isolate;
  background: #E3EDD3; color: #2F5A12; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }  /* « 8 / 6 » : le compte d'abord, le requis ensuite, sans inversion bidi */
.wz-res-compte--ecart { background: #F6E2DC; color: #9A3B2A; }
.wz-unite { padding: 0 6px; border-radius: 7px; background: rgba(239, 231, 214, .55); color: #6F6656;
  font-family: var(--font-verse); font-size: 14px; line-height: 1.8; }
.wz-unite--kad3a { background: rgba(243, 223, 180, .85); color: #6B5320; box-shadow: inset 0 -2px 0 rgba(183, 121, 31, .75); }
.wz-unite--casse { background: rgba(246, 226, 220, .85); color: #9A3B2A; }
.wz-diar { font-size: 14px; font-weight: 700; color: var(--accent-text); }
.wz-outils .wz-diar { padding: 2px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); text-decoration: none; }
.wz-outils .wz-diar:hover { border-color: var(--primary); }

.wz-outils .wz-retour { margin-top: 0; }  /* dans la rangée d'actions : même ligne que les autres */
.wz-outils .wz-retour-lien { min-height: 0; font-size: 12px; font-weight: 400; color: var(--text-mute); text-decoration: underline; text-underline-offset: 3px; }
.wz-outils .wz-retour-lien:hover { color: var(--ink); }
.wz-bascule { min-height: 36px; padding: 0 14px; border: 1px solid var(--primary); border-radius: 999px; background: var(--surface);
  color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }

/* --- guide et référence --------------------------------------------------------------------------------------------- */
.wz-credit { margin: 32px 0 0; font-size: 14px; color: var(--text-mute); opacity: .8; line-height: 1.8; text-align: center; }
.wz-guide, .wz-reference { margin-top: 20px; border-top: 1px solid var(--border); }
.wz-guide > summary, .wz-ref-details > summary { display: flex; align-items: center; min-height: 52px; font-family: var(--font-display); font-weight: 800; font-size: 19px; cursor: pointer; list-style: none; }
.wz-guide > summary::-webkit-details-marker, .wz-ref-details > summary::-webkit-details-marker { display: none; }
.wz-guide > summary::before, .wz-ref-details > summary::before { content: "+"; display: inline-grid; place-items: center; width: 28px; height: 28px; margin-inline-end: 10px;
  border-radius: 50%; background: var(--surface-2); font-family: var(--font-body); font-size: 20px; }
.wz-guide[open] > summary::before, .wz-ref-details[open] > summary::before { content: "−"; }
.wz-guide > summary:focus-visible, .wz-ref-details > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 8px; }
.wz-guide-cols { display: grid; gap: 18px; padding-bottom: 12px; }
.wz-guide h3 { font-size: 17px; margin-bottom: 4px; }
.wz-guide ul { margin: 0; padding-inline-start: 20px; }
.wz-guide li { margin: 4px 0; }
.wz-reference h3 { font-size: 17px; margin-bottom: 8px; }
.wz-liste { margin: 0; display: grid; gap: 2px; }
.wz-liste div { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px dotted var(--border); }
.wz-liste dt { font-weight: 700; }
.wz-liste dd { margin: 0; color: var(--text-mute); font-size: 15px; }

/* --- dialogue de collage ------------------------------------------------------------------------------------------------ */
.wz-dialogue { width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 20px; border: 0; border-radius: var(--radius-card);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.wz-dialogue::backdrop { background: rgba(30, 25, 18, .45); }
.wz-dialogue h2 { font-size: 22px; }
.wz-dialogue p { margin: 6px 0 10px; color: var(--text-mute); font-size: 15px; }
.wz-dialogue textarea { width: 100%; min-height: 200px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; font-family: var(--font-verse); font-size: 20px; line-height: 1.9; resize: vertical; }
.wz-dialogue textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
.wz-dialogue-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.wz-peser--second { width: auto; min-height: 44px; margin-top: 0; background: var(--surface); border: 2px solid var(--primary); box-shadow: none; color: var(--ink); font-size: 16px; }
.wz-dialogue-actions .wz-peser { width: auto; margin-top: 10px; }

/* --- ordinateur : شطران côte à côte, comme dans un ديوان imprimé ------------------------------------------------------------ */
@media (min-width: 720px) {
  .wz-bayt { grid-template-columns: 36px 1fr 1fr 44px; grid-template-areas: "num sadr ajuz retirer" "num indice indice indice" "num apercu apercu apercu" "barre barre barre barre"; column-gap: 28px; }
  .wz-num { padding-top: 32px; }
  .wz-guide-cols { grid-template-columns: 1fr 1fr; gap: 32px; }
  .wz-verdict { padding: 28px 30px 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .wz-mode span, .wz-shatr input { transition: none; }
}

/* retour du visiteur : discret, sous le résultat */
.wz-retour { margin-top: 16px; }
.wz-retour-lien { min-height: 44px; padding: 0; border: 0; background: none; color: var(--text-mute); font: inherit; font-size: 16px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.wz-retour-lien:hover, .wz-retour-lien:focus-visible { color: var(--ink); }
.wz-retour-form { padding-top: 12px; border-top: 1px solid var(--border); }
.wz-retour-form { position: relative; display: grid; gap: 10px; max-width: 420px; }
.wz-retour-form label { font-weight: 700; }
.wz-retour-form select, .wz-retour-form textarea { min-height: 44px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; }
.wz-retour-form .wz-retour-accord { display: flex; align-items: center; gap: 8px; font-weight: 400; min-height: 44px; }
.wz-retour-form .wz-retour-accord input { width: 22px; height: 22px; }
.wz-retour-hp { position: absolute; inset-block-start: 0; inset-inline-start: 0; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.wz-retour-echec { margin: 8px 0 0; color: #9B2C2C; }
.wz-retour-form .wz-peser { width: auto; justify-self: start; margin-top: 0; }
.wz-retour-merci { margin: 0; color: var(--text-mute); }
/* [19/09] un signalement sans بت et sans note ne dit rien : l'envoi attend que l'un des deux soit rempli */
.wz-retour-aide { margin: 0; color: var(--text-mute); font-size: .9rem; }
.wz-retour-aide[hidden] { display: none; }
.wz-retour-form .wz-peser[disabled] { opacity: .55; cursor: not-allowed; }

/* mots laissés nus par le visiteur : la lecture retenue et les autres, à choisir à l'oreille (16/09) */
.wz-mots-nus{margin-block:14px 6px;padding:12px 14px;border:1px dashed var(--wz-bordure,#d9d2c3);border-radius:12px}
.wz-mots-nus h3{margin:0 0 6px;font-size:1rem}
.wz-mot-nu{margin-block:6px}
.wz-mot-nu p{margin:0 0 4px}
.wz-mot-nu-aide{font-size:.9rem;opacity:.8}
.wz-lectures{display:flex;flex-wrap:wrap;gap:8px}
.wz-lecture{font:inherit;min-height:40px;padding:0 12px;border:1px solid var(--wz-bordure,#d9d2c3);border-radius:10px;background:var(--wz-surface,#fff);color:inherit;cursor:pointer}
.wz-lecture--retenue{border-width:2px;font-weight:700}

/* tableau récapitulatif des أبتوتة (porteur, 17/09) : tous les بتوتة, supportés ou non */
.wz-reference { padding-top: 6px; }
.wz-ref-details > summary { font-size: 16px; color: var(--accent-text); }
.wz-reference h2 { font-size: clamp(22px, 5vw, 28px); margin: 0 0 6px; }
.wz-reference-intro { margin: 0 0 14px; color: var(--text-mute); max-width: 70ch; }
.wz-tableau { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 12px; }
.wz-abtoutet { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 15px; color: var(--ink); }
.wz-col-nom { width: 15%; } .wz-col-def { width: 18%; } .wz-col-ex { width: 40%; } .wz-col-oui { width: 9%; }
.wz-abtoutet th, .wz-abtoutet td { padding: 10px 10px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.wz-abtoutet thead th { font-weight: 700; background: var(--surface-2); }
.wz-abtoutet tbody th { font-weight: 700; }
.wz-abtoutet tbody tr:last-child th, .wz-abtoutet tbody tr:last-child td { border-bottom: 0; }
.wz-kaf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; font-family: var(--font-body); font-size: 16px; line-height: 1.8; color: var(--ink); }
/* [17/09 — mesuré] Amiri (125 Ko) n'est nommée qu'une fois le tableau OUVERT : replié, il est bien caché
   (checkVisibility() = false) mais Chrome résout quand même les polices de son contenu et téléchargeait Amiri
   ~6 s après l'affichage, pour un texte que personne ne voyait. Rendu identique une fois ouvert. */
.wz-ref-details[open] .wz-kaf { font-family: var(--font-verse); }
.wz-kaf span { min-width: 0; }
.wz-kaf--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wz-kaf-plus { margin-top: 2px; }
.wz-kaf-plus summary { font-family: var(--font-body); font-size: 12px; color: var(--accent-text); cursor: pointer; list-style: none; }
.wz-kaf-plus summary::-webkit-details-marker { display: none; }
.wz-kaf-plus summary::before { content: "+ "; }
.wz-kaf-plus[open] summary::before { content: "− "; }
@media (max-width: 1000px) { .wz-kaf, .wz-kaf--3 { grid-template-columns: minmax(0, 1fr); } }
.wz-kaf-source { display: block; margin-top: 4px; font-size: 12.5px; color: var(--text-mute); }
.wz-statut { display: inline-block; min-width: 40px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; text-align: center; background: var(--surface-2); white-space: nowrap; }
.wz-statut--oui { background: #E3EDD3; color: #2F5A12; }
.wz-reference-note { margin: 12px 0 0; font-size: 13px; color: var(--text-mute); max-width: 70ch; }
.wz-buhur { margin-top: 26px; }
.wz-buhur h3 { font-size: 17px; margin-bottom: 8px; }
@media (max-width: 720px) {
  /* téléphone : chaque بت devient une carte, l'intitulé de chaque colonne devant sa valeur */
  .wz-tableau { border: 0; overflow: visible; }
  .wz-abtoutet, .wz-abtoutet tbody, .wz-abtoutet tr, .wz-abtoutet th, .wz-abtoutet td { display: block; }
  .wz-abtoutet thead { display: none; }
  .wz-abtoutet tr { margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
  .wz-abtoutet th, .wz-abtoutet td { padding: 4px 0; border: 0; }
  .wz-abtoutet tbody th { font-size: 18px; margin-bottom: 4px; white-space: normal; }
  .wz-abtoutet td::before { content: attr(data-label) " : "; font-weight: 700; color: var(--text-mute); }
  .wz-abtoutet td.wz-exemple::before { display: block; }
  .wz-kaf { grid-template-columns: 1fr; gap: 0; font-size: 18px; }
}

/* --- téléphone : tout tient sur un écran (porteur 16/09) ------------------------------------------------------- */
@media (max-width: 560px) {
  .wz-tete { padding-block: 6px 2px; }
  .wz-outils { gap: 0 9px; justify-content: flex-start; }
  .wz-lien { font-size: 13px; min-height: 30px; }   /* les quatre outils tiennent sur une seule ligne */
    .wz-diar, .wz-retour-lien { font-size: 13px; }
  .wz-shatr input { min-height: 40px; font-size: 19px; }
  /* l'en-tête du site porte déjà « وزّان » : sur téléphone le titre reste pour les moteurs mais sort de l'écran,
     et la saisie commence en haut pour que tout tienne sans défiler */
  .wz-tete { padding: 0; }
  .wz-tete h1, .wz-tete p { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wz-retour-lien { min-height: 30px; }
  .wz-mode small { display: none; }
  .wz-mode span { min-height: 34px; font-size: 15px; }
  .wz-long { display: none; }                      /* « ألصق قصيدة » suffit sur téléphone */
  .wz-outils > * { min-height: 28px; }
  .wz-outils .wz-lien { font-size: 13px; }
  .wz-outils .wz-diar { font-size: 12.5px; padding: 1px 9px; }
  .wz-outils .wz-retour-lien { font-size: 11px; }
  .wz-lien[data-action="effacer"] { font-size: 11.5px; margin-inline-start: 0; }  /* la marge auto ferait déborder la rangée sur plusieurs lignes */
  .wz-bayt > .wz-plus { min-height: 26px; font-size: 12px; margin: 0; }
  .wz-verdict .wz-wazn { font-size: 14px; }
  .wz-mode { margin-bottom: 6px; }
  .wz-etiquette { font-size: 10px; margin: 0; }
  .wz-res-liste { gap: 3px; }
  .wz-resultat { gap: 6px; margin-top: 8px; }
    .wz-lettres { font-size: 21px; line-height: 1.55; min-height: 36px; }
  .wz-etiquette { font-size: 11px; }
  .wz-verdict-nom { font-size: 22px; }
  .wz-res { padding: 0 8px; gap: 5px; }
  .wz-res-rang { width: 32px; font-size: 10px; }
  .wz-unite { font-size: 12px; padding: 0 5px; line-height: 1.7; }
  .wz-res-compte { font-size: 12px; padding: 1px 8px; }
  .wz-verdict { padding: 6px 12px; }
  .wz-etiquette { margin: 0; }
  .wz-bayt { padding: 3px 0 2px; }
  .wz-lettres { min-height: 30px; padding: 0 2px 2px; }
  .wz-etiquette { line-height: 1.2; }
}
