/* Espace de test ALMOHAMI — feuille de style unique (RTL arabe + LTR administration). */

@font-face { font-family: "Almarai"; font-weight: 400; font-display: swap; src: url("fonts/almarai-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Almarai"; font-weight: 700; font-display: swap; src: url("fonts/almarai-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Almarai"; font-weight: 800; font-display: swap; src: url("fonts/almarai-arabic-800-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Almarai"; font-weight: 400; font-display: swap; src: url("fonts/almarai-latin-400-normal.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: "Almarai"; font-weight: 700; font-display: swap; src: url("fonts/almarai-latin-700-normal.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: "Almarai"; font-weight: 800; font-display: swap; src: url("fonts/almarai-latin-800-normal.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; }

:root {
  --encre: #23355C;
  --encre-900: #17243F;
  --encre-50: #EEF1F7;
  --encre-100: #DCE3EF;
  --laiton: #9A7236;
  --laiton-50: #F8F1E5;
  --bg: #F4F2EC;
  --surface: #FFFFFF;
  --line: #E4E0D6;
  --line-strong: #CFC9BB;
  --text: #1E2330;
  --muted: #5D6472;
  --ok: #1D7A4E;  --ok-bg: #E6F4EC;  --ok-line: #9FD2B6;
  --warn: #8A5A00; --warn-bg: #FCF1D8; --warn-line: #E8C77E;
  --crit: #B3261E; --crit-bg: #FBEAE8; --crit-line: #EDB1AB;
  --idea: #5A3E9E; --idea-bg: #EFEAFA; --idea-line: #C6B7EA;
  --info: #1F5FA8; --info-bg: #E7EFFA; --info-line: #A9C5EA;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(23, 36, 63, .06), 0 4px 16px rgba(23, 36, 63, .05);
  --focus: 0 0 0 3px rgba(154, 114, 54, .45);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Almarai", "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.75;
}
body.is-admin { font-size: 15px; line-height: 1.55; }

h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; color: var(--encre-900); }
h1 { font-size: 1.65rem; font-weight: 800; }
.h2, h2 { font-size: 1.2rem; font-weight: 800; }
.h3, h3 { font-size: 1.02rem; font-weight: 700; }
.h2, .h3 { display: flex; align-items: center; gap: .5em; }
p { margin: 0 0 .8em; }
a { color: var(--encre); text-underline-offset: 3px; }
a:hover { color: var(--laiton); }
strong { font-weight: 700; }
small, .small { font-size: .86em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.nowrap { white-space: nowrap; }
.lead { font-size: 1.08em; color: #353b48; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font-family: inherit; font-size: .85em; background: #fff; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 0 .4em; white-space: nowrap; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .88em; background: var(--encre-50); padding: .05em .35em; border-radius: 5px; }
.num-ltr { direction: ltr; unicode-bidi: isolate; }

.ic { width: 1.2em; height: 1.2em; flex: 0 0 auto; vertical-align: -.22em; fill: none; stroke: currentColor; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

/* ---------- Mise en page ---------- */
.wrap { max-width: 920px; margin: 0 auto; padding: 24px 20px 120px; }
.wrap.wide { max-width: 1280px; }
.narrow { max-width: 560px; margin: 0 auto; padding: 40px 20px 80px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.cols-detail { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack > .btn { align-self: flex-start; margin-top: 8px; }
.inline { display: inline; margin: 0; }
.sticky { position: sticky; top: 84px; }

/* ---------- Barre supérieure ---------- */
.topbar { background: var(--encre); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 rgba(0,0,0,.15); }
.topbar-in { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 0 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--laiton); display: grid; place-items: center; }
.brand-mark .ic { width: 22px; height: 22px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt strong { font-size: 1rem; }
.brand-txt small { font-size: .75rem; opacity: .75; }
.topnav { display: flex; gap: 4px; flex: 1 1 auto; }
.topnav a { color: rgba(255,255,255,.82); text-decoration: none; display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 9px; font-size: .95rem; position: relative; }
.topnav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.topnav a.on { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 -3px 0 var(--laiton); }
.badge { background: var(--laiton); color: #fff; border-radius: 99px; font-size: .72rem; min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px; font-weight: 700; }
.topbar-side { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.icon-btn { background: transparent; border: 0; color: inherit; width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; }
.topbar .icon-btn:hover { background: rgba(255,255,255,.1); }
.version-pop { position: relative; }
.version-pop > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: .85rem; padding: 6px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 99px; color: #fff; }
.version-pop > summary::-webkit-details-marker { display: none; }
.version-pop[open] > summary { background: rgba(255,255,255,.12); }
.pop { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); width: 300px; background: #fff; color: var(--text); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 16px; z-index: 30; }
.pop .row input { flex: 1; width: auto; }

/* ---------- Cartes, alertes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head .h2 { margin: 0; }
.card-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.card-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 16px; border: 1px solid; }
.alert p { margin: 0; }
.alert-crit { background: var(--crit-bg); border-color: var(--crit-line); color: var(--crit); }
.alert-info { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.banner { display: flex; gap: 12px; align-items: center; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; border: 1px solid; flex-wrap: wrap; }
.banner-info { background: var(--info-bg); border-color: var(--info-line); color: #16487f; }
.banner-muted { background: #fff; border-color: var(--line); color: var(--muted); font-size: .95em; }
.banner-link { text-decoration: none; }
.banner-link:hover { color: #16487f; filter: brightness(.98); }
.toast { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); font-weight: 700; max-width: calc(100% - 32px); transition: opacity .4s, transform .4s; }
.toast-ok { background: var(--ok); color: #fff; }
.toast-warn { background: var(--warn); color: #fff; }
.toast.hide { opacity: 0; transform: translate(-50%, -10px); pointer-events: none; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { width: 42px; height: 42px; margin-bottom: 8px; opacity: .6; }
.note-admin { background: var(--laiton-50); border-inline-start: 4px solid var(--laiton); padding: 10px 14px; border-radius: 8px; }

/* ---------- Boutons, champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 18px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fff; color: var(--encre-900); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--encre-50); color: var(--encre-900); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--encre); border-color: var(--encre); color: #fff; }
.btn-primary:hover { background: var(--encre-900); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(35,53,92,.06); }
.btn-lg { min-height: 54px; padding: 12px 26px; font-size: 1.06rem; border-radius: 12px; }
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: .88rem; border-radius: 8px; }
.btn-wa { background: #1F9D55; border-color: #1F9D55; color: #fff; }
.btn-wa:hover { background: #17824A; color: #fff; }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: progress; }
.link { background: none; border: 0; padding: 6px 2px; font: inherit; color: var(--encre); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--laiton); }

.lbl { display: block; font-weight: 700; font-size: .95em; margin-top: 6px; color: var(--encre-900); }
.opt { font-weight: 400; color: var(--muted); font-size: .9em; }
.hint { color: var(--muted); font-size: .88em; margin: 0 0 4px; }
input[type="text"], input:not([type]), input[type="search"], input[type="password"], input[type="number"], select, textarea {
  font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px;
}
textarea { resize: vertical; line-height: 1.65; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--laiton); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: #9aa0ab; }
.w-sm { max-width: 220px; }
.w-xs { max-width: 100px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .95em; }
.check input { width: 18px; height: 18px; accent-color: var(--encre); }
.code-input { font-size: 1.5rem; letter-spacing: .12em; text-align: center; font-weight: 700; }

/* ---------- Connexion ---------- */
.login { text-align: center; padding: 34px 28px; }
.login .stack { text-align: start; max-width: 360px; margin: 20px auto 10px; }
.login .stack .btn { align-self: stretch; }
.login-mark { width: 64px; height: 64px; border-radius: 18px; background: var(--encre); color: #fff; display: grid; place-items: center; margin: 0 auto 16px; }
.login-mark .ic { width: 32px; height: 32px; }

/* ---------- Accueil ---------- */
.hero { background: linear-gradient(135deg, #fff 0%, #fbf8f1 100%); border: 1px solid var(--line); border-radius: 18px; padding: 26px 28px; margin-bottom: 20px; box-shadow: var(--shadow); }
.hero-home { display: flex; gap: 28px; align-items: center; }
.hero-home h1 { margin-bottom: .2em; }
.hero-txt { flex: 1 1 auto; }
.next-hint { margin: 10px 0 0; font-size: .95em; }
.done-line { display: flex; gap: 8px; align-items: center; font-weight: 700; color: var(--ok); }
.ring { --p: 0; width: 132px; height: 132px; flex: 0 0 132px; border-radius: 50%; background: conic-gradient(var(--laiton) calc(var(--p) * 1%), var(--encre-100) 0); display: grid; place-items: center; }
.ring span { width: 104px; height: 104px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 2rem; font-weight: 800; color: var(--encre-900); direction: ltr; }
.ring small { font-size: .5em; margin-top: .45em; }
.section-title { font-size: 1.1rem; margin: 26px 0 12px; }
.grid-parcours { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.pcard { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: var(--laiton); color: var(--text); transform: translateY(-2px); }
.pcard-done { background: #fbfdfb; }
.pcard-icon { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; background: var(--encre-50); color: var(--encre); display: grid; place-items: center; }
.pcard-icon .ic { width: 22px; height: 22px; }
.pcard-icon.lg { width: 56px; height: 56px; flex-basis: 56px; }
.pcard-icon.lg .ic { width: 28px; height: 28px; }
.pcard-done .pcard-icon { background: var(--ok-bg); color: var(--ok); }
.pcard-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.pcard-title { font-weight: 800; color: var(--encre-900); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pcard-desc { font-size: .88em; color: var(--muted); line-height: 1.55; }
.pcard-meta { display: flex; align-items: center; gap: 10px; font-size: .85em; margin-top: 6px; flex-wrap: wrap; }
.pcard-meta .bar { flex: 1 1 70px; }
.bar { height: 8px; background: var(--encre-100); border-radius: 99px; overflow: hidden; min-width: 60px; }
.bar span { display: block; height: 100%; background: var(--laiton); border-radius: 99px; }
.bar.ok span { background: var(--ok); }
.list { list-style: none; margin: 0; padding: 0; }
.list li a { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--warn-line); text-decoration: none; color: var(--text); }
.list li:last-child a { border-bottom: 0; }

/* ---------- Bienvenue ---------- */
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.step3 { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: relative; box-shadow: var(--shadow); }
.step3 .n { position: absolute; top: 14px; inset-inline-end: 14px; width: 28px; height: 28px; border-radius: 50%; background: var(--laiton); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.step3 > .ic { width: 30px; height: 30px; color: var(--encre); margin-bottom: 8px; }
.step3 h3 { margin-bottom: 4px; }
.step3 p { font-size: .93em; color: var(--muted); margin: 0; }
.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.checks li { padding-inline-start: 30px; position: relative; }
.checks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .45em; width: 18px; height: 18px; border-radius: 50%; background: var(--ok-bg); border: 2px solid var(--ok); }

/* ---------- Parcours ---------- */
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: .9em; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.phead { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.phead h1 { margin: 0; }
.phead p { margin: 0; }
.tasklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.task-row { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.task-row:hover { border-color: var(--laiton); color: var(--text); }
.task-row .grow { display: flex; flex-direction: column; }
.task-row .num { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: var(--encre-50); color: var(--encre); display: grid; place-items: center; font-weight: 800; }
.task-row.is-done .num { background: var(--ok); color: #fff; }
.task-row.is-skip .num { background: var(--warn-bg); color: var(--warn); }

/* ---------- Tâche ---------- */
.dots { display: flex; gap: 6px; margin: -4px 0 18px; flex-wrap: wrap; }
.dot { width: 26px; height: 8px; border-radius: 99px; background: var(--encre-100); display: block; }
.dot.done { background: var(--ok); }
.dot.skip { background: var(--warn-line); }
.dot.cur { background: var(--laiton); width: 42px; }
.task { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px 28px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.task-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.task-head h1 { margin: 2px 0 6px; }
.task-head .lead { margin: 0; }
.block { margin-top: 20px; }
.block-t { font-size: .92rem; color: var(--laiton); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 800; }
.path { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; }
.path li { display: flex; align-items: center; gap: 4px; }
.path li span, .path li { font-weight: 700; font-size: .95em; }
.path li { background: var(--encre-50); color: var(--encre-900); border: 1px solid var(--encre-100); padding: 6px 12px; border-radius: 9px; }
.path li + li { margin-inline-start: 18px; position: relative; }
.path li + li::before { content: "‹"; position: absolute; inset-inline-start: -15px; color: var(--laiton); font-weight: 800; font-size: 1.2em; }
[dir="ltr"] .path li + li::before { content: "›"; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 44px; min-height: 32px; padding-top: 2px; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--encre); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.expect { background: var(--ok-bg); border: 1px solid var(--ok-line); border-radius: var(--radius-sm); padding: 14px 16px; }
.expect .block-t { color: var(--ok); }
.expect p { margin: 0; }
.tip { display: flex; gap: 10px; align-items: flex-start; background: var(--laiton-50); border-radius: var(--radius-sm); padding: 12px 14px; margin: 18px 0 0; font-size: .95em; }
.tip .ic { color: var(--laiton); margin-top: .25em; }
.retest-box p { margin-bottom: .4em; }

.answer { border: 2px solid var(--encre-100); }
.choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 10px 0 6px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.choice-in { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; border: 2px solid var(--line); border-radius: 14px; padding: 16px 10px; background: #fff; height: 100%; transition: border-color .15s, background .15s, box-shadow .15s; }
.choice-in .ic { width: 32px; height: 32px; margin-bottom: 4px; }
.choice-in strong { font-size: 1.02rem; }
.choice-in small { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.choice:hover .choice-in { border-color: var(--line-strong); }
.choice input:focus-visible + .choice-in { box-shadow: var(--focus); }
.tone-ok .ic { color: var(--ok); }
.tone-warn .ic { color: var(--warn); }
.tone-crit .ic { color: var(--crit); }
.tone-idea .ic { color: var(--idea); }
.tone-ok input:checked + .choice-in { border-color: var(--ok); background: var(--ok-bg); }
.tone-warn input:checked + .choice-in { border-color: #D39B2A; background: var(--warn-bg); }
.tone-crit input:checked + .choice-in { border-color: var(--crit); background: var(--crit-bg); }
.tone-idea input:checked + .choice-in { border-color: var(--idea); background: var(--idea-bg); }
.details { margin-top: 12px; }
.details[data-state="none"] { display: none; }
[data-label-for] { display: none; }
.details:not([data-state]) [data-label-for="echec"] { display: block; }
.details[data-state="ok"] [data-label-for="ok"],
.details[data-state="gene"] [data-label-for="gene"],
.details[data-state="echec"] [data-label-for="echec"],
.details[data-state="introuvable"] [data-label-for="introuvable"] { display: block; }
.details[data-state] [data-show-for] { display: none; }
.details[data-state="echec"] [data-show-for~="echec"],
.details[data-state="gene"] [data-show-for~="gene"],
.details[data-state="introuvable"] [data-show-for~="introuvable"] { display: block; }
.yesno { border: 0; padding: 0; margin: 14px 0 0; }
.yesno legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.yesno label { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 99px; padding: 6px 14px; margin: 0 0 6px; margin-inline-end: 8px; cursor: pointer; background: #fff; }
.yesno label:has(input:checked) { border-color: var(--encre); background: var(--encre-50); }
.yesno input { accent-color: var(--encre); width: 17px; height: 17px; }
.more { margin-top: 14px; }
.more > summary { cursor: pointer; color: var(--encre); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more[open] > summary { margin-bottom: 8px; }
.answer-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.task-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: -4px; }

.capture { margin-top: 14px; }
.drop { display: flex; gap: 14px; align-items: center; border: 2px dashed var(--line-strong); border-radius: 12px; padding: 14px 16px; cursor: pointer; background: #fcfbf8; margin-top: 4px; transition: border-color .15s, background .15s; }
.drop:hover, .drop.is-over { border-color: var(--laiton); background: var(--laiton-50); }
.drop > .ic { width: 30px; height: 30px; color: var(--laiton); }
.drop-txt { display: flex; flex-direction: column; }
.drop-txt .hint { margin: 2px 0 0; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.thumbs:empty { display: none; }
.thumbs img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: block; }
.thumbs.big img { width: 220px; height: 150px; }
.thumb-wrap { position: relative; }
.thumb-del { position: absolute; top: -8px; inset-inline-end: -8px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--crit); color: #fff; cursor: pointer; display: grid; place-items: center; }
.thumb-del .ic { width: 14px; height: 14px; }
.warn-line { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .82em; margin: 6px 0 0; }

/* ---------- Bouton flottant et dialogues ---------- */
.fab { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 15; display: inline-flex; align-items: center; gap: 8px; background: var(--laiton); color: #fff; border: 0; border-radius: 99px; padding: 12px 20px; font: inherit; font-weight: 700; box-shadow: 0 8px 24px rgba(154,114,54,.35); cursor: pointer; }
.fab:hover { background: #85612c; }
.dlg { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100% - 24px)); max-height: calc(100% - 40px); box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--text); }
.dlg::backdrop { background: rgba(23,36,63,.45); }
.dlg-body { padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dlg-head h2 { margin: 0; }
.dlg-foot { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.tips { margin: 8px 0 14px; padding-inline-start: 20px; display: grid; gap: 10px; }
.tips + .btn { align-self: flex-start; }

/* ---------- Mes retours ---------- */
.fb-list { display: grid; gap: 12px; }
.fb { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.fb.is-new { border-color: var(--info-line); box-shadow: 0 0 0 3px var(--info-bg); }
.fb header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.fb footer { margin-top: 8px; }
.reply { background: var(--encre-50); border-radius: 10px; padding: 10px 14px; margin-top: 10px; }
.reply-t { font-weight: 700; color: var(--encre); display: flex; align-items: center; gap: 6px; font-size: .9em; }
.reply p { margin: 4px 0 0; }
.big-ok { width: 76px; height: 76px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; margin: 0 auto 14px; }
.big-ok .ic { width: 40px; height: 40px; }
.counts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }

/* ---------- Pastilles ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 2px 10px; font-size: .8rem; font-weight: 700; border: 1px solid transparent; white-space: nowrap; line-height: 1.6; font-family: inherit; }
button.chip { cursor: pointer; }
.chip .ic { width: 14px; height: 14px; }
.chip-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.chip-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.chip-crit { background: var(--crit-bg); color: var(--crit); border-color: var(--crit-line); }
.chip-idea { background: var(--idea-bg); color: var(--idea); border-color: var(--idea-line); }
.chip-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.chip-muted { background: #F1EFE9; color: var(--muted); border-color: var(--line); }

/* ---------- Administration ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; text-decoration: none; color: var(--text); }
.kpi span { color: var(--muted); font-size: .85rem; }
.kpi b { font-size: 1.9rem; font-weight: 800; color: var(--encre-900); line-height: 1.2; }
.kpi small { color: var(--muted); }
.kpi-link:hover { border-color: var(--laiton); color: var(--text); }
.kpi-crit { border-color: var(--crit-line); background: var(--crit-bg); }
.kpi-crit b { color: var(--crit); }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: start; font-weight: 700; color: var(--muted); font-size: .8rem; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #FAF9F6; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl-click tbody tr { cursor: pointer; }
.tbl-click tbody tr:hover { background: #FBFAF7; }
.tbl .clip { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .actions { white-space: nowrap; text-align: end; }
.tbl .actions form, .tbl .actions a { margin-inline-start: 4px; }
.w-prog { min-width: 150px; }
.w-prog .bar { display: inline-block; width: 100px; vertical-align: middle; margin-inline-end: 8px; }
.is-off { opacity: .55; }
.pad { padding: 16px 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.filters select, .filters input[type="search"] { width: auto; min-height: 36px; padding: 5px 10px; font-size: .9rem; border-radius: 8px; }
.filters input[type="search"] { min-width: 180px; flex: 1 1 180px; }
.form-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-inline input { width: auto; flex: 1 1 200px; min-height: 40px; }
.inline-edit > summary { cursor: pointer; list-style: none; }
.inline-edit > summary::-webkit-details-marker { display: none; }
.inline-edit[open] .form-inline { margin-top: 8px; }
.stack-bars { display: grid; gap: 10px; }
.sb-row { display: grid; grid-template-columns: minmax(120px, 200px) 1fr 36px; gap: 10px; align-items: center; }
.sb-label { font-size: .9rem; text-align: right; text-decoration: none; color: var(--text); }
.sb { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: var(--encre-50); }
.sb span { display: block; height: 100%; }
.sb-ok, .lg-ok::before { background: var(--ok); }
.sb-gene, .lg-gene::before { background: #D39B2A; }
.sb-echec, .lg-echec::before { background: var(--crit); }
.sb-introuvable, .lg-introuvable::before { background: var(--idea); }
.sb-n { font-size: .8rem; color: var(--muted); text-align: end; }
.legend { display: flex; gap: 14px; margin-top: 12px; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; }
.fb-head { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.rtl-title { text-align: right; }
.quote { background: #FAF9F6; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 1.02rem; line-height: 1.7; text-align: right; }
.hist { padding-inline-start: 18px; margin: 0 0 12px; display: grid; gap: 6px; font-size: .9rem; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.reveal code { font-size: .95rem; word-break: break-all; }
.reveal-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin: 10px 0 14px; }
.copybox { display: flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--ok-line); border-radius: 10px; padding: 8px 10px; }
.copybox code { background: transparent; flex: 1; }
.code-big { font-size: 1.25rem !important; font-weight: 700; letter-spacing: .08em; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick label { cursor: pointer; position: relative; }
.icon-pick input { position: absolute; opacity: 0; }
.icon-pick span { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--encre); background: #fff; }
.icon-pick input:checked + span { border-color: var(--laiton); background: var(--laiton-50); box-shadow: var(--focus); }
.narrow-form { max-width: 640px; }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; }
.checklist .ok { color: var(--ok); }
.checklist .ko { color: var(--crit); font-weight: 700; }
.code-block { background: #1E2330; color: #E8E6E0; padding: 14px; border-radius: 10px; overflow-x: auto; font-size: .85rem; direction: ltr; text-align: left; }
details.card.more > summary { margin: 0; }

/* ---------- Adaptation aux petits écrans ---------- */
@media (max-width: 900px) {
  .cols, .cols-detail { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .sticky { position: static; }
  .reveal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .topbar-in { gap: 8px; padding: 0 12px; }
  .brand-txt small, .topnav a span, .version-pop .v-lbl { display: none; }
  .topnav a { padding: 8px 10px; }
  .choices { grid-template-columns: 1fr 1fr; }
  .steps3 { grid-template-columns: 1fr; }
  .hero-home { flex-direction: column; text-align: center; }
  .hero-home .btn-lg { width: 100%; }
  .task { padding: 20px 18px; }
  .task-head .pcard-icon { display: none; }
  .answer-foot .btn-lg { width: 100%; }
  .fab span { display: none; }
  .fab { padding: 14px; }
  .wrap { padding: 16px 14px 110px; }
  .sb-row { grid-template-columns: 110px 1fr 30px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media print {
  .topbar, .fab, .answer, .task-nav, .dots { display: none !important; }
  body { background: #fff; }
}
