/*
 * Iris — widget d'accessibilité visiteur.
 *
 * Tout est isolé sous #iris-root (reset local). Les effets visiteurs sont posés sur <html> (html.iris-*)
 * et ciblent « body > *:not(#iris-root) » : le bouton et le panneau ne subissent jamais leurs propres filtres.
 * Pile de z-index : bouton Iris 999997, badge Hermès 999998, panneau Iris 1000000.
 * Contrat : docs/superpowers/specs/2026-11-26-iris-lot1-contrat.md.
 */

/* Police dyslexie : le fichier est embarqué dans front/fonts/ ; pile de repli en son absence. */
@font-face {
  font-family: 'OpenDyslexic';
  src: url('fonts/OpenDyslexic-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Police de l'interface (Inter Tight, OFL, sous-ensemble latin) : téléchargée seulement quand le panneau s'affiche. */
@font-face {
  font-family: 'Inter Tight Iris';
  src: url('fonts/InterTight-Iris.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ===================================================================
   Interface du widget
   =================================================================== */

#iris-root,
#iris-root *,
#iris-root *::before,
#iris-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  text-shadow: none;
  float: none;
  font: inherit;
  letter-spacing: normal;
  word-spacing: normal;
  text-transform: none;
  text-decoration: none;
  text-indent: 0;
  text-align: inherit;
  color: inherit;
  opacity: 1;
  filter: none;
  zoom: normal;
  min-width: 0;
  max-width: none;
  -webkit-text-size-adjust: 100%;
}

#iris-root {
  font: 400 15px/1.45 'Inter Tight Iris', 'Inter Tight', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #f7f8fa;
  text-align: left;
  cursor: auto;
}

#iris-root [hidden] { display: none !important; }
#iris-root button,
#iris-root select,
#iris-root a { cursor: pointer; font: inherit; }

#iris-root svg { display: block; flex: none; }

#iris-root .iris-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Charte Cronos V2 : fond quasi noir, filets fins, angles droits, libellés mono en capitales,
   élément actif marqué par deux crochets d'angle et la teinte d'accent (--iris-accent, calculée
   en JS depuis la couleur du site, au moins 4,5:1 sur les surfaces du panneau). */
#iris-root {
  --iris-bg: #0a0c0f;
  --iris-bg-2: #0e1014;
  --iris-bg-3: #07080a;
  --iris-surface: rgba(255, 255, 255, .03);
  --iris-surface-hover: rgba(255, 255, 255, .055);
  --iris-line: rgba(255, 255, 255, .07);
  --iris-line-strong: rgba(255, 255, 255, .14);
  --iris-line-hover: rgba(255, 255, 255, .3);
  --iris-ink: #f7f8fa;
  --iris-ink-2: #9ba0aa;
  --iris-danger: #ef4444;
  --iris-warn: #f5b041;
  --iris-a: var(--iris-accent, #34b36b);
  --iris-a-rgb: var(--iris-accent-rgb, 52, 179, 107);
  --iris-sans: 'Inter Tight Iris', 'Inter Tight', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --iris-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

/* Bouton flottant : carré à la couleur réglée du site, crochets d'angle et halo de la charte */
#iris-root .iris-toggle {
  position: fixed;
  z-index: 999997;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--iris-size, 52px);
  height: var(--iris-size, 52px);
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: var(--iris-color, #2f8f5b);
  color: var(--iris-on-color, #fff);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 0 22px rgba(var(--iris-a-rgb), .3), 0 8px 24px rgba(0, 0, 0, .3);
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
#iris-root .iris-toggle::before,
#iris-root .iris-toggle::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: solid var(--iris-color, #2f8f5b);
  pointer-events: none;
  transition: transform .2s ease;
}
#iris-root .iris-toggle::before { top: -4px; left: -4px; border-width: 2px 0 0 2px; }
#iris-root .iris-toggle::after { bottom: -4px; right: -4px; border-width: 0 2px 2px 0; }
#iris-root .iris-toggle:hover {
  border-color: rgba(255, 255, 255, .4);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 0 34px rgba(var(--iris-a-rgb), .5), 0 10px 28px rgba(0, 0, 0, .35);
}
#iris-root .iris-toggle:hover::before { transform: translate(-2px, -2px); }
#iris-root .iris-toggle:hover::after { transform: translate(2px, 2px); }
#iris-root .iris-toggle:focus-visible { outline: 3px solid #0b57d0; outline-offset: 7px; box-shadow: 0 0 0 7px #fff; }

#iris-root.iris-pos-bottom-right .iris-toggle { bottom: calc(var(--iris-offset-y, 20px) + env(safe-area-inset-bottom, 0px)); right: calc(var(--iris-offset-x, 20px) + env(safe-area-inset-right, 0px)); }
#iris-root.iris-pos-bottom-left .iris-toggle  { bottom: calc(var(--iris-offset-y, 20px) + env(safe-area-inset-bottom, 0px)); left: calc(var(--iris-offset-x, 20px) + env(safe-area-inset-left, 0px)); }
#iris-root.iris-pos-top-right .iris-toggle    { top: calc(var(--iris-offset-y, 20px) + env(safe-area-inset-top, 0px)); right: calc(var(--iris-offset-x, 20px) + env(safe-area-inset-right, 0px)); }
#iris-root.iris-pos-top-left .iris-toggle     { top: calc(var(--iris-offset-y, 20px) + env(safe-area-inset-top, 0px)); left: calc(var(--iris-offset-x, 20px) + env(safe-area-inset-left, 0px)); }

/* Voile et panneau */
#iris-root .iris-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(3, 4, 6, .55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#iris-root .iris-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  width: min(420px, 100vw);
  max-width: 100vw;
  background: var(--iris-bg);
  color: var(--iris-ink);
  color-scheme: dark;
  border-left: 1px solid var(--iris-line-strong);
  box-shadow: -24px 0 60px rgba(0, 0, 0, .55);
  animation: iris-slide-right .24s cubic-bezier(.2, .7, .2, 1);
}
#iris-root.iris-pos-bottom-left .iris-panel,
#iris-root.iris-pos-top-left .iris-panel {
  right: auto;
  left: 0;
  border-left: 0;
  border-right: 1px solid var(--iris-line-strong);
  box-shadow: 24px 0 60px rgba(0, 0, 0, .55);
  animation-name: iris-slide-left;
}
#iris-root .iris-panel[hidden] { display: none !important; }

@keyframes iris-slide-right { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes iris-slide-left  { from { transform: translateX(-28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes iris-spectre { from { background-position: 0 0; } to { background-position: 200% 0; } }

/* En-tête « Horizon » : glyphe lumineux, titre fin, readout ; lueur « spectre » d'Iris */
#iris-root .iris-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px 12px;
  padding: 16px 18px 20px;
  flex: none;
  border-bottom: 1px solid var(--iris-line-strong);
  background: var(--iris-bg);
  overflow: hidden;
}
#iris-root .iris-head-fx {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, #ff5f6d, #ffb347, #f9f871, #3ddc84, #36c5f0, #7b6cff, #e86bff, #ff5f6d) 0 0 / 200% 100%;
  animation: iris-spectre 9s linear infinite;
}
#iris-root .iris-head-fx::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 26px;
  background: inherit;
  filter: blur(18px);
  opacity: .32;
  animation: iris-spectre 9s linear infinite;
}
#iris-root .iris-head-id {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
#iris-root .iris-glyph {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(var(--iris-a-rgb), .6);
  background: rgba(var(--iris-a-rgb), .1);
  color: var(--iris-a);
  box-shadow: 0 0 28px rgba(var(--iris-a-rgb), .3), inset 0 0 14px rgba(var(--iris-a-rgb), .12);
}
#iris-root .iris-head-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#iris-root .iris-head h2 {
  font: 300 21px/1.15 var(--iris-sans);
  color: var(--iris-ink);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
#iris-root .iris-readout {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font: 400 10px/1.3 var(--iris-mono);
  color: var(--iris-ink-2);
  text-transform: uppercase;
}
#iris-root .iris-readout-n {
  font: 300 13px/1 var(--iris-sans);
  font-variant-numeric: tabular-nums;
  color: var(--iris-ink);
}
#iris-root .iris-readout[data-iris-active="true"] .iris-readout-n { color: var(--iris-a); font-weight: 300; }

#iris-root .iris-close {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--iris-line-strong);
  color: var(--iris-ink-2);
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
#iris-root .iris-close:hover { border-color: var(--iris-line-hover); color: var(--iris-ink); background: var(--iris-surface-hover); }

/* Corps */
#iris-root .iris-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 18px 22px;
  overscroll-behavior: contain;
  background: var(--iris-bg);
  scrollbar-color: rgba(255, 255, 255, .45) rgba(255, 255, 255, .06);
  scrollbar-width: thin;
}

#iris-root .iris-notice {
  position: relative;
  margin: 0 0 18px;
  padding: 11px 12px 11px 46px;
  border: 1px solid rgba(245, 176, 65, .45);
  background: rgba(245, 176, 65, .07);
  color: var(--iris-ink);
  font-size: 13.5px;
}
#iris-root .iris-notice::before {
  content: "[!]";
  content: "[!]" / "";
  position: absolute;
  left: 12px;
  top: 11px;
  font: 600 12px/1.45 var(--iris-mono);
  color: var(--iris-warn);
}

/* Sections numérotées : « 01 TITRE ——— » */
#iris-root .iris-section { margin-bottom: 26px; }
#iris-root .iris-section:last-child { margin-bottom: 4px; }
#iris-root .iris-section h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font: 500 13px/1.3 var(--iris-mono);
  color: var(--iris-ink-2);
  text-transform: uppercase;
}
#iris-root .iris-section h3::after {
  content: "";
  flex: 1 1 auto;
  min-width: 16px;
  height: 1px;
  background: var(--iris-line-strong);
}
#iris-root .iris-num { flex: none; color: var(--iris-a); }
#iris-root .iris-section h3 label { cursor: pointer; }

#iris-root .iris-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* Tuile (module booléen ou profil) : pictogramme, mini-interrupteur, libellé */
#iris-root .iris-mod {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  gap: 10px 8px;
  min-height: 94px;
  padding: 12px;
  border: 1px solid var(--iris-line-strong);
  background: var(--iris-surface);
  color: var(--iris-ink);
  text-align: left;
  overflow-wrap: anywhere;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .2s ease;
}
#iris-root .iris-mod:hover { background: var(--iris-surface-hover); border-color: var(--iris-line-hover); }
#iris-root .iris-mod-icon { display: flex; color: var(--iris-ink-2); transition: color .15s ease; }
#iris-root .iris-mod > .iris-mod-icon { grid-column: 1; grid-row: 1; }
#iris-root .iris-mod > .iris-switch { grid-column: 2; grid-row: 1; }
#iris-root .iris-mod > .iris-mod-label { grid-column: 1 / -1; grid-row: 3; }
#iris-root .iris-mod-label { font: 500 13.5px/1.25 var(--iris-sans); color: var(--iris-ink); }
#iris-root .iris-mod-value {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: end;
  font: 500 11px/1.2 var(--iris-mono);
  color: var(--iris-a);
  text-transform: uppercase;
}
#iris-root .iris-mod-value:empty { display: none; }

#iris-root .iris-switch {
  position: relative;
  display: block;
  width: 30px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, .3);
  transition: background-color .15s ease, border-color .15s ease;
}
#iris-root .iris-switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  background: var(--iris-ink-2);
  transition: transform .18s ease, background-color .15s ease;
}

/* État pressé : liseré et teinte d'accent, halo, deux crochets d'angle (indicateur non chromatique) */
#iris-root .iris-mod[aria-pressed="true"] {
  border-color: rgba(var(--iris-a-rgb), .7);
  background: rgba(var(--iris-a-rgb), .12);
  box-shadow: 0 0 24px rgba(var(--iris-a-rgb), .14), inset 0 0 0 1px rgba(var(--iris-a-rgb), .18);
}
#iris-root .iris-mod[aria-pressed="true"] .iris-mod-icon { color: var(--iris-a); }
#iris-root .iris-mod[aria-pressed="true"] .iris-switch { border-color: var(--iris-a); background: var(--iris-a); }
#iris-root .iris-mod[aria-pressed="true"] .iris-switch::before { transform: translateX(14px); background: var(--iris-on-accent, #000); }
#iris-root .iris-mod[aria-pressed="true"]::before,
#iris-root .iris-mod[aria-pressed="true"]::after,
#iris-root .iris-opt[aria-pressed="true"]::before,
#iris-root .iris-opt[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: solid var(--iris-a);
  pointer-events: none;
}
#iris-root .iris-mod[aria-pressed="true"]::before,
#iris-root .iris-opt[aria-pressed="true"]::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
#iris-root .iris-mod[aria-pressed="true"]::after,
#iris-root .iris-opt[aria-pressed="true"]::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* Module gradué (sélecteur −/+ et jauge) ou à choix (barre segmentée) : une rangée pleine largeur */
#iris-root .iris-ctl {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--iris-line-strong);
  background: var(--iris-surface);
  color: var(--iris-ink);
  transition: border-color .15s ease, box-shadow .2s ease;
}
#iris-root .iris-ctl[data-iris-active="true"] {
  border-color: rgba(var(--iris-a-rgb), .55);
  box-shadow: inset 2px 0 0 var(--iris-a), 0 0 24px rgba(var(--iris-a-rgb), .08);
}
#iris-root .iris-ctl[data-iris-active="true"] .iris-mod-icon { color: var(--iris-a); }
#iris-root .iris-ctl-head { display: flex; align-items: center; gap: 10px; min-height: 26px; }
#iris-root .iris-ctl-head .iris-mod-label { flex: 1 1 auto; }
#iris-root .iris-ctl-value {
  flex: none;
  min-width: 2.2em;
  font: 200 24px/1 var(--iris-sans);
  font-variant-numeric: tabular-nums;
  color: var(--iris-ink-2);
  text-align: right;
}
#iris-root .iris-ctl[data-iris-active="true"] .iris-ctl-value { color: var(--iris-a); font-weight: 300; }
#iris-root .iris-stepper {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
}
#iris-root .iris-step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--iris-line-strong);
  background: var(--iris-bg-2);
  color: var(--iris-ink);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
#iris-root .iris-step:hover {
  border-color: var(--iris-a);
  background: rgba(var(--iris-a-rgb), .12);
  color: var(--iris-a);
}
#iris-root .iris-step[aria-disabled="true"],
#iris-root .iris-step[aria-disabled="true"]:hover {
  border-color: var(--iris-line);
  background: transparent;
  color: rgba(255, 255, 255, .3);
  cursor: not-allowed;
}
#iris-root .iris-ctl-mid { display: flex; align-items: center; min-width: 0; }
#iris-root .iris-gauge { display: flex; align-items: center; gap: 3px; width: 100%; }
#iris-root .iris-gauge i { flex: 1 1 0; height: 8px; background: rgba(255, 255, 255, .1); transition: background-color .15s ease, box-shadow .15s ease; }
#iris-root .iris-gauge i.is-zero { flex: 0 0 2px; height: 16px; background: var(--iris-ink-2); }
#iris-root .iris-gauge i.is-fill { background: var(--iris-a); }
#iris-root .iris-gauge i.is-cur:not(.is-zero) { height: 14px; box-shadow: 0 0 10px rgba(var(--iris-a-rgb), .6); }

#iris-root .iris-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 1px;
  padding: 1px;
}
#iris-root .iris-opt {
  position: relative;
  min-height: 42px;
  padding: 6px 6px;
  background: var(--iris-bg-2);
  box-shadow: 0 0 0 1px var(--iris-line-strong);
  color: var(--iris-ink-2);
  font: 500 11.5px/1.2 var(--iris-mono);
  text-transform: uppercase;
  text-align: center;
  overflow-wrap: anywhere;
  transition: background-color .15s ease, color .15s ease;
}
#iris-root .iris-opt:hover { background: #15181d; color: var(--iris-ink); }
#iris-root .iris-opt[aria-pressed="true"] {
  background: linear-gradient(rgba(var(--iris-a-rgb), .16), rgba(var(--iris-a-rgb), .16)), var(--iris-bg-2);
  color: var(--iris-ink);
  box-shadow: inset 0 -2px 0 var(--iris-a), 0 0 0 1px var(--iris-line-strong);
}
/* Filets en box-shadow et écart de 1 px : l'option focalisée passe devant ses voisines, anneau de focus entier. */
#iris-root .iris-opt:focus-visible { z-index: 1; }

@media (forced-colors: active) {
  #iris-root .iris-mod[aria-pressed="true"],
  #iris-root .iris-opt[aria-pressed="true"] {
    background: Highlight;
    color: HighlightText;
    border-color: HighlightText;
    outline: 2px solid HighlightText;
    outline-offset: -4px;
    forced-color-adjust: none;
  }
  #iris-root .iris-mod[aria-pressed="true"] .iris-mod-icon,
  #iris-root .iris-mod[aria-pressed="true"] .iris-mod-label,
  #iris-root .iris-mod[aria-pressed="true"] .iris-mod-value { color: HighlightText; }
  #iris-root .iris-opt { border: 1px solid ButtonBorder; }
  #iris-root .iris-panel .iris-mod[aria-pressed="true"]:focus-visible,
  #iris-root .iris-panel .iris-opt[aria-pressed="true"]:focus-visible { outline-color: CanvasText; }
  #iris-root .iris-mod[aria-pressed="true"]::before,
  #iris-root .iris-mod[aria-pressed="true"]::after,
  #iris-root .iris-opt[aria-pressed="true"]::before,
  #iris-root .iris-opt[aria-pressed="true"]::after { border-color: HighlightText; }
  #iris-root .iris-switch { forced-color-adjust: none; border-color: CanvasText; }
  #iris-root .iris-switch::before { background: CanvasText; }
  #iris-root .iris-mod[aria-pressed="true"] .iris-switch { background: HighlightText; border-color: HighlightText; }
  #iris-root .iris-mod[aria-pressed="true"] .iris-switch::before { background: Highlight; }
  #iris-root .iris-gauge i { forced-color-adjust: none; background: GrayText; }
  #iris-root .iris-gauge i.is-fill, #iris-root .iris-gauge i.is-zero { background: Highlight; }
  #iris-root .iris-step[aria-disabled="true"] { color: GrayText; border-color: GrayText; }
  #iris-root .iris-head-fx { display: none; }
}

/* « Aller à » : lignes avec bouton flèche à droite */
#iris-root .iris-links { display: flex; flex-direction: column; border-top: 1px solid var(--iris-line); }
#iris-root .iris-links .iris-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 0 0 2px;
  border-bottom: 1px solid var(--iris-line);
  color: var(--iris-ink);
  font: 500 14px/1.3 var(--iris-sans);
  transition: color .15s ease;
}
#iris-root .iris-link-go {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--iris-line-strong);
  color: var(--iris-a);
  transition: background-color .15s ease, border-color .15s ease;
}
#iris-root .iris-links .iris-link:hover { color: var(--iris-a); }
#iris-root .iris-links .iris-link:hover .iris-link-go { border-color: var(--iris-a); background: rgba(var(--iris-a-rgb), .12); }

/* CTA mono en capitales */
#iris-root .iris-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--iris-line-strong);
  background: var(--iris-bg-2);
  color: var(--iris-ink);
  font: 500 11.5px/1.25 var(--iris-mono);
  text-transform: uppercase;
  text-align: center;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
#iris-root .iris-btn:hover { border-color: var(--iris-a); color: var(--iris-a); background: rgba(var(--iris-a-rgb), .08); }
#iris-root .iris-hide { display: flex; flex-direction: column; gap: 6px; }
#iris-root .iris-hide .iris-btn { justify-content: flex-start; }
#iris-root .iris-btn-main:hover { border-color: var(--iris-danger); color: var(--iris-danger); background: rgba(239, 68, 68, .08); }

/* Liste de langue */
#iris-root .iris-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 0 12px;
  min-height: 44px;
  border: 1px solid var(--iris-line-strong);
  background: var(--iris-bg-2);
  color: var(--iris-a);
  transition: border-color .15s ease;
}
#iris-root .iris-select-wrap:hover { border-color: var(--iris-line-hover); }
#iris-root .iris-select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -6px;
  border: solid var(--iris-a);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
#iris-root .iris-select {
  flex: 1 1 auto;
  min-height: 42px;
  padding: 0 40px 0 0;
  background: transparent;
  color: var(--iris-ink);
  font: 500 14px/1.3 var(--iris-sans);
  appearance: none;
  -webkit-appearance: none;
}
#iris-root .iris-select option { background: var(--iris-bg-2); color: var(--iris-ink); }

/* Pied */
#iris-root .iris-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  flex: none;
  border-top: 1px solid var(--iris-line-strong);
  background: var(--iris-bg-3);
}
/* Le reset pose text-transform: none sur chaque élément : les enfants des libellés en capitales en héritent ici. */
#iris-root .iris-readout *,
#iris-root .iris-section h3 *,
#iris-root .iris-btn *,
#iris-root .iris-link-statement * { text-transform: inherit; }
#iris-root .iris-link-statement {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  color: var(--iris-ink-2);
  font: 500 11px/1.3 var(--iris-mono);
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(255, 255, 255, .3);
  transition: color .15s ease;
}
#iris-root .iris-link-statement:hover { color: var(--iris-ink); text-decoration-color: var(--iris-a); }

#iris-root .iris-panel button:focus-visible,
#iris-root .iris-panel a:focus-visible,
#iris-root .iris-panel select:focus-visible { outline: 2px solid var(--iris-a); outline-offset: 2px; }
#iris-root .iris-panel .iris-select:focus-visible { outline: 0; }
#iris-root .iris-select-wrap:focus-within { border-color: var(--iris-a); outline: 2px solid var(--iris-a); outline-offset: 2px; }

/* Effets du widget (guide, masque, loupe) : dans la racine, donc jamais filtrés */
#iris-root .iris-guide {
  position: fixed;
  left: 0;
  top: -100px;
  width: 100%;
  height: 36px;
  z-index: 999996;
  pointer-events: none;
  border-top: 3px solid #000;
  border-bottom: 3px solid #000;
  background: rgba(255, 230, 0, .22);
  box-shadow: 0 0 0 1px #fff;
}
#iris-root .iris-mask {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 999996;
  pointer-events: none;
  background: rgba(0, 0, 0, .72);
}
#iris-root .iris-mask-top { top: 0; height: 0; }
#iris-root .iris-mask-bottom { top: 100vh; bottom: 0; }
#iris-root .iris-magnifier {
  position: fixed;
  z-index: 999996;
  pointer-events: none;
  width: max-content;
  max-width: min(80vw, 520px);
  padding: 12px 16px;
  border: 3px solid #000;
  border-radius: 10px;
  background: #fff;
  color: #000;
  font: 600 28px/1.35 system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .35);
  overflow-wrap: anywhere;
}

@media (max-width: 400px) {
  #iris-root .iris-body { padding: 14px 12px 18px; }
  #iris-root .iris-head, #iris-root .iris-foot { padding-left: 12px; padding-right: 12px; }
  #iris-root .iris-grid { gap: 6px; }
  #iris-root .iris-mod { min-height: 86px; padding: 10px; }
  #iris-root .iris-glyph { width: 40px; height: 40px; }
  #iris-root .iris-head h2 { font-size: 18px; }
}

/* Mouvement : coupé sous prefers-reduced-motion et quand le visiteur a arrêté les animations (module Iris) */
@media (prefers-reduced-motion: reduce) {
  #iris-root,
  #iris-root *,
  #iris-root *::before,
  #iris-root *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
html.iris-stop-animations #iris-root,
html.iris-stop-animations #iris-root *,
html.iris-stop-animations #iris-root *::before,
html.iris-stop-animations #iris-root *::after { animation: none !important; transition: none !important; }

/* ===================================================================
   Effets sur la page (html.iris-*), hors #iris-root
   =================================================================== */

/* Contenu : taille du texte (zoom ; repli sur la taille de l'élément racine) */
html.iris-font-size body > *:not(#iris-root) { zoom: var(--iris-font-scale, 1); }
@supports not (zoom: 1) {
  html.iris-font-size { font-size: calc(100% * var(--iris-font-scale, 1)); }
}

/* Hauteur de ligne */
html[data-iris-line-height="1"] body > *:not(#iris-root),
html[data-iris-line-height="1"] body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { line-height: 1.6 !important; }
html[data-iris-line-height="2"] body > *:not(#iris-root),
html[data-iris-line-height="2"] body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { line-height: 1.9 !important; }
html[data-iris-line-height="3"] body > *:not(#iris-root),
html[data-iris-line-height="3"] body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { line-height: 2.3 !important; }

/* Espacement des lettres (effet visiteur : autorisé) */
html.iris-letter-spacing body > *:not(#iris-root),
html.iris-letter-spacing body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { letter-spacing: .12em !important; word-spacing: .16em !important; }

/* Polices */
html.iris-readable-font body > *:not(#iris-root),
html.iris-readable-font body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { font-family: Verdana, Tahoma, 'Segoe UI', Arial, sans-serif !important; }
html.iris-dyslexia-font body > *:not(#iris-root),
html.iris-dyslexia-font body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { font-family: 'OpenDyslexic', 'Lexend', 'Comic Sans MS', sans-serif !important; }
html.iris-font-weight body > *:not(#iris-root),
html.iris-font-weight body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { font-weight: 700 !important; }

/* Alignement */
html[data-iris-text-align="left"] body > *:not(#iris-root),
html[data-iris-text-align="left"] body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { text-align: left !important; }
html[data-iris-text-align="center"] body > *:not(#iris-root),
html[data-iris-text-align="center"] body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { text-align: center !important; }
html[data-iris-text-align="right"] body > *:not(#iris-root),
html[data-iris-text-align="right"] body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { text-align: right !important; }
html[data-iris-text-align="justify"] body > *:not(#iris-root),
html[data-iris-text-align="justify"] body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { text-align: justify !important; }

/* Liens. Le soulignement vaut dans tous les cas. L'aplat jaune et le texte noir, seulement hors contraste :
   un contraste a déjà sa couleur de lien, et un aplat jaune sous un lien cyan serait illisible.
   Un lien qui contient une image ou une vidéo (logo blanc, carte à vignette) ne reçoit pas l'aplat, pas plus que
   l'élément qui enveloppe l'image : un logo blanc resterait blanc sur jaune. Ses éléments de texte, eux, le reçoivent. */
html.iris-highlight-links body > *:not(#iris-root) a,
html.iris-highlight-links body > *:not(#iris-root) a * {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
}
html.iris-highlight-links:not([class*="iris-contrast-"]) body > *:not(#iris-root) a:not(:has(img, picture, video, canvas, iframe, embed, object)),
html.iris-highlight-links:not([class*="iris-contrast-"]) body > *:not(#iris-root) a *:not(img):not(picture):not(video):not(canvas):not(svg):not(svg *):not(iframe):not(embed):not(object):not(:has(img, picture, video, canvas, iframe, embed, object)) {
  background-color: #ffeb3b !important;
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}

/* Grand curseur */
html.iris-big-cursor body > *:not(#iris-root),
html.iris-big-cursor body > *:not(#iris-root) * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 24 24'><path d='M5 3l14 8-6 2 4 7-3 1.5-4-7-5 4z' fill='black' stroke='white' stroke-width='1.4' stroke-linejoin='round'/></svg>") 4 2, auto !important;
}

/* Couleurs : contrastes (exclusifs entre eux côté JS).
   Le texte et les bordures prennent les couleurs du contraste partout ; les fonds, seulement là où il y en a un :
   le JS classe chaque élément d'après son style d'origine (data-iris-bg) puis pose html.iris-bg-ready.
   solid = fond opaque ou image derrière du texte → couleur du contraste ; soft = voile ou calque décoratif →
   transparent ; sans attribut = transparent d'origine, inchangé. Un <canvas> fixe, un calque en dégradé ou un
   fond semi-transparent ne deviennent donc jamais des plaques opaques. Les médias ne reçoivent aucun fond.
   Avant le classement (premier rendu, préférence stockée) : repli opaque, médias exclus. */
html.iris-contrast-dark,
html.iris-contrast-dark body { background: #121212 !important; color: #f2f2f2 !important; }
html.iris-contrast-dark body > *:not(#iris-root),
html.iris-contrast-dark body > *:not(#iris-root) * {
  color: #f2f2f2 !important;
  -webkit-text-fill-color: currentColor !important;
  border-color: #7a7a7a !important;
  text-shadow: none !important;
}
html.iris-contrast-dark:not(.iris-bg-ready) body > *:not(#iris-root):not(img):not(picture):not(video):not(canvas):not(svg):not(iframe):not(embed):not(object),
html.iris-contrast-dark:not(.iris-bg-ready) body > *:not(#iris-root) *:not(img):not(picture):not(video):not(canvas):not(svg):not(iframe):not(embed):not(object),
html.iris-contrast-dark body > *:not(#iris-root)[data-iris-bg="solid"],
html.iris-contrast-dark body > *:not(#iris-root) [data-iris-bg="solid"] {
  background-color: #121212 !important;
  background-image: none !important;
}
html.iris-contrast-dark body > *:not(#iris-root) a,
html.iris-contrast-dark body > *:not(#iris-root) a * { color: #8ab4f8 !important; }

html.iris-contrast-light,
html.iris-contrast-light body { background: #fff !important; color: #000 !important; }
html.iris-contrast-light body > *:not(#iris-root),
html.iris-contrast-light body > *:not(#iris-root) * {
  color: #000 !important;
  -webkit-text-fill-color: currentColor !important;
  border-color: #000 !important;
  text-shadow: none !important;
}
html.iris-contrast-light:not(.iris-bg-ready) body > *:not(#iris-root):not(img):not(picture):not(video):not(canvas):not(svg):not(iframe):not(embed):not(object),
html.iris-contrast-light:not(.iris-bg-ready) body > *:not(#iris-root) *:not(img):not(picture):not(video):not(canvas):not(svg):not(iframe):not(embed):not(object),
html.iris-contrast-light body > *:not(#iris-root)[data-iris-bg="solid"],
html.iris-contrast-light body > *:not(#iris-root) [data-iris-bg="solid"] {
  background-color: #fff !important;
  background-image: none !important;
}
html.iris-contrast-light body > *:not(#iris-root) a,
html.iris-contrast-light body > *:not(#iris-root) a * { color: #0000c8 !important; }

html.iris-contrast-high,
html.iris-contrast-high body { background: #000 !important; color: #ff0 !important; }
html.iris-contrast-high body > *:not(#iris-root),
html.iris-contrast-high body > *:not(#iris-root) * {
  color: #ff0 !important;
  -webkit-text-fill-color: currentColor !important;
  border-color: #ff0 !important;
  text-shadow: none !important;
}
html.iris-contrast-high:not(.iris-bg-ready) body > *:not(#iris-root):not(img):not(picture):not(video):not(canvas):not(svg):not(iframe):not(embed):not(object),
html.iris-contrast-high:not(.iris-bg-ready) body > *:not(#iris-root) *:not(img):not(picture):not(video):not(canvas):not(svg):not(iframe):not(embed):not(object),
html.iris-contrast-high body > *:not(#iris-root)[data-iris-bg="solid"],
html.iris-contrast-high body > *:not(#iris-root) [data-iris-bg="solid"] {
  background-color: #000 !important;
  background-image: none !important;
}
html.iris-contrast-high body > *:not(#iris-root) a,
html.iris-contrast-high body > *:not(#iris-root) a * { color: #0ff !important; }

html.iris-bg-ready[class*="iris-contrast-"] body > *:not(#iris-root)[data-iris-bg="soft"],
html.iris-bg-ready[class*="iris-contrast-"] body > *:not(#iris-root) [data-iris-bg="soft"] {
  background-color: transparent !important;
  background-image: none !important;
}
/* Fond d'état (survol, focus, bouton pressé) d'un élément transparent au repos : jamais classé, il garderait son
   fond clair d'origine sous un texte forcé clair. Il reste transparent. */
html.iris-bg-ready[class*="iris-contrast-"] body > *:not(#iris-root) :not([data-iris-bg]):is(:hover, :focus, :focus-visible, :active),
html.iris-bg-ready[class*="iris-contrast-"] body > *:not(#iris-root):not([data-iris-bg]):is(:hover, :focus, :focus-visible, :active) {
  background-color: transparent !important;
  background-image: none !important;
}
/* Image décorative en calque derrière un texte (halo, forme floutée) : classée « decor » par le JS, effacée. Elle
   garderait sinon ses couleurs sous un texte forcé clair. visibility et non display : la mise en page ne bouge pas. */
html.iris-bg-ready[class*="iris-contrast-"] body > *:not(#iris-root):is([data-iris-bg="decor"], [data-iris-bg="decor"] *),
html.iris-bg-ready[class*="iris-contrast-"] body > *:not(#iris-root) :is([data-iris-bg="decor"], [data-iris-bg="decor"] *) {
  visibility: hidden !important;
  transition: none !important;
}
/* Lecture des fonds d'origine (JS) : aucune transition ne doit fausser la valeur lue. */
html.iris-bg-probe body *,
html.iris-bg-probe body *::before,
html.iris-bg-probe body *::after { transition: none !important; }

/* Monochrome et saturation partagent une seule propriété filter */
html.iris-monochrome { --iris-gray: 1; }
html[data-iris-saturation="low"] { --iris-sat: .45; }
html[data-iris-saturation="high"] { --iris-sat: 2; }
/* Surcouche fixe sous le bouton (999997) et le panneau (1000000) : aucun filter sur le contenu,
   donc les position:fixed du thème restent intacts et le widget n'est pas filtré.
   Pseudo-élément de <html> : il existe dès que le mini-script de tête a posé la classe,
   avant le JS différé, donc aucun flash en couleur. */
html.iris-monochrome::after,
html[data-iris-saturation]::after {
  content: "";
  display: block;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
  z-index: 999996;
  -webkit-backdrop-filter: grayscale(var(--iris-gray, 0)) saturate(var(--iris-sat, 1));
  backdrop-filter: grayscale(var(--iris-gray, 0)) saturate(var(--iris-sat, 1));
}

/* Orientation */
html.iris-keyboard-nav body > *:not(#iris-root):focus,
html.iris-keyboard-nav body > *:not(#iris-root) *:focus {
  outline: 4px solid #ff6a00 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px #fff !important;
}

html.iris-hide-images img,
html.iris-hide-images picture,
html.iris-hide-images video,
html.iris-hide-images canvas,
html.iris-hide-images [role="img"] { opacity: 0 !important; }
html.iris-hide-images body > *:not(#iris-root),
html.iris-hide-images body > *:not(#iris-root) * { background-image: none !important; }

/* Titres. Hors contraste : aplat jaune pâle, texte noir jusque dans les éléments du titre (un span blanc d'origine
   resterait blanc sur jaune). Sous un contraste : aucun aplat (il perdrait contre le fond du contraste et laisserait
   un texte noir sur noir), contour de la couleur du texte du contraste. */
html.iris-highlight-titles body > *:not(#iris-root) :is(h1, h2, h3, h4, h5, h6) {
  outline: 3px solid #6200ea !important;
  outline-offset: 3px !important;
}
html.iris-highlight-titles:not([class*="iris-contrast-"]) body > *:not(#iris-root) :is(h1, h2, h3, h4, h5, h6) {
  background-color: #fff59d !important;
  background-image: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
}
html.iris-highlight-titles:not([class*="iris-contrast-"]) body > *:not(#iris-root) :is(h1, h2, h3, h4, h5, h6),
html.iris-highlight-titles:not([class*="iris-contrast-"]) body > *:not(#iris-root) :is(h1, h2, h3, h4, h5, h6) *:not(svg *) {
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}
html.iris-highlight-titles.iris-contrast-dark body > *:not(#iris-root) :is(h1, h2, h3, h4, h5, h6) { outline-color: #f2f2f2 !important; }
html.iris-highlight-titles.iris-contrast-light body > *:not(#iris-root) :is(h1, h2, h3, h4, h5, h6) { outline-color: #000 !important; }
html.iris-highlight-titles.iris-contrast-high body > *:not(#iris-root) :is(h1, h2, h3, h4, h5, h6) { outline-color: #ff0 !important; }

html.iris-highlight-content main,
html.iris-highlight-content [role="main"],
html.iris-highlight-content article,
html.iris-highlight-content .entry-content {
  outline: 3px solid #6200ea !important;
  outline-offset: 6px !important;
  background-color: rgba(255, 245, 157, .35) !important;
}

html.iris-stop-animations { scroll-behavior: auto !important; }
html.iris-stop-animations body > *:not(#iris-root),
html.iris-stop-animations body > *:not(#iris-root) *,
html.iris-stop-animations body > *:not(#iris-root)::before,
html.iris-stop-animations body > *:not(#iris-root)::after,
html.iris-stop-animations body > *:not(#iris-root) *::before,
html.iris-stop-animations body > *:not(#iris-root) *::after {
  animation-duration: .001ms !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}
html.iris-stop-animations body > *:not(#iris-root) [class*="marquee"],
html.iris-stop-animations body > *:not(#iris-root) [class*="ticker"],
html.iris-stop-animations body > *:not(#iris-root) [class*="carousel"],
html.iris-stop-animations body > *:not(#iris-root) [class*="slider"] { animation-play-state: paused !important; }

/* Lecture vocale : bloc en cours de lecture */
.iris-speaking { outline: 3px solid #f5a300 !important; outline-offset: 2px !important; }
