:root{color-scheme:light;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}html{scroll-padding-top:env(safe-area-inset-top,0px)}body{margin:0;padding:0;font:14px -apple-system,BlinkMacSystemFont,sans-serif;background:#fff;color:#000}img{max-width:100%}[hidden]:not([hidden=until-found i]){display:none!important}

/* Plateforme d'évaluation esentive — choix du profil, questionnaire sans corrigé, score automatique. */
:root {
  --bg: #F5F8FB; --surface: #FFFFFF; --ink: #142233; --muted: #586779; --line: #DAE4EE;
  --brand: #2B67A1; --brand-logo: #619ED5; --brand-soft: #E6F0FA; --tint2: #F3F8FC;
  --ok: #1D7349; --ok-soft: #E2F3E9; --warn: #8F5600; --warn-soft: #FCF0DA; --btn-ink: #FFFFFF; --bad: #B23B3B; --bad-soft: #FBEAEA;
  --expert: #1F3550; --expert-ink: #FFFFFF;
  --font-display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1520; --surface: #142131; --ink: #E4ECF4; --muted: #9AABBD; --line: #24364B;
    --brand: #82B6E6; --brand-logo: #619ED5; --brand-soft: #182C43; --tint2: #0F1A28;
    --ok: #63C793; --ok-soft: #14301F; --warn: #F2B866; --warn-soft: #33260F; --btn-ink: #0D1520; --bad: #E88; --bad-soft: #351A1A;
    --expert: #D5E3F2; --expert-ink: #0D1520; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1520; --surface: #142131; --ink: #E4ECF4; --muted: #9AABBD; --line: #24364B;
  --brand: #82B6E6; --brand-logo: #619ED5; --brand-soft: #182C43; --tint2: #0F1A28;
  --ok: #63C793; --ok-soft: #14301F; --warn: #F2B866; --warn-soft: #33260F; --btn-ink: #0D1520; --bad: #E88; --bad-soft: #351A1A;
  --expert: #D5E3F2; --expert-ink: #0D1520; color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15.5px; line-height: 1.6; }
.wrap { max-width: 880px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); padding-block: 24px 72px; }
code { font-family: var(--font-mono); font-size: .88em; background: var(--brand-soft); color: var(--ink); padding: .08em .35em; border-radius: 4px; overflow-wrap: anywhere; }
strong { font-weight: 600; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.hidden { display: none !important; }

header.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 2px solid var(--brand-logo); flex-wrap: wrap; }
header.top img { height: 30px; width: auto; }
header.top .kick { font-family: var(--font-display); font-weight: 600; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }

h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 3.6vw, 2.1rem); line-height: 1.2; margin: 0 0 6px; text-wrap: balance; }
.lead { color: var(--muted); margin: 0 0 20px; }

/* Cartes profils */
.profiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 22px 0; }
.pcard { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 6px; transition: border-color .15s, transform .15s; min-width: 0; }
.pcard:hover { border-color: var(--brand); transform: translateY(-1px); }
.pcard[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft) inset; }
.pcard .nm { font-family: var(--font-display); font-weight: 600; font-size: 1.04rem; color: var(--ink); }
.pcard .st { font-size: .86rem; color: var(--muted); }
.pcard .meta { font-size: .8rem; color: var(--brand); font-weight: 600; margin-top: 2px; }

.field { display: grid; gap: 5px; margin: 16px 0; max-width: 420px; }
.field label { font-size: .9rem; font-weight: 600; }
.field input { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.consigne { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 18px 0; }
.consigne h2 { font-family: var(--font-display); font-size: 1rem; margin: 0 0 8px; }
.consigne ul { margin: 0; padding-left: 1.2em; display: grid; gap: 5px; }

.btn { font-family: var(--font-display); font-weight: 600; border: 0; border-radius: 10px; padding: 11px 22px; background: var(--brand); color: var(--btn-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--brand); border: 1px solid var(--line); }
.btn.sm { padding: 7px 14px; font-size: .9rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Barre de progression */
.progress { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); margin-inline: -20px; padding: 10px 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.progress .ttl { font-family: var(--font-display); font-weight: 600; color: var(--brand); }
.pbar { flex: 1; min-width: 120px; height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; }
.pbar > i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .25s; }
.pcount { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .86rem; }

/* Questions */
.sec-h { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--brand); margin: 30px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; margin-bottom: 14px; display: grid; gap: 11px; min-width: 0; }
.q.unanswered-flag { border-color: var(--bad); }
.q-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.q-num { font-family: var(--font-display); font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.q-type { font-size: .8rem; color: var(--muted); }
.lvl { font-size: .7rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; }
.lvl-inter { background: var(--brand-soft); color: var(--brand); }
.lvl-expert { background: var(--expert); color: var(--expert-ink); }
.prompt { margin: 0; }
.codewrap { overflow-x: auto; background: #12202F; border-radius: 8px; }
pre { margin: 0; padding: 13px 15px; font-family: var(--font-mono); font-size: 12.6px; line-height: 1.55; color: #DCE6F0; white-space: pre; tab-size: 2; }
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.t-kw{color:#8EC1F0}.t-str{color:#B8DB9A}.t-com{color:#7D8FA3;font-style:italic}.t-ann{color:#E9C07A}.t-num{color:#F0A98E}.t-tag{color:#8EC1F0}
.opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; min-width: 0; }
.opt:hover { border-color: var(--brand); }
.opt input { margin-top: 3px; accent-color: var(--brand); width: 15px; height: 15px; }
.opt.checked { border-color: var(--brand); background: var(--brand-soft); }
textarea { font: inherit; width: 100%; min-height: 92px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; resize: vertical; background: var(--surface); color: var(--ink); }
.open-note { font-size: .82rem; color: var(--muted); font-style: italic; }

.endbar { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); margin-inline: -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.endbar .msg { font-size: .86rem; color: var(--muted); }

/* Résultat */
.score-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; text-align: center; margin: 18px 0; }
.score-big { font-family: var(--font-display); font-weight: 700; font-size: 3rem; line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; }
.score-sub { color: var(--muted); margin-top: 6px; }
.band { display: inline-block; margin-top: 12px; font-weight: 600; padding: 4px 14px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); }
.secbreak { display: grid; gap: 8px; margin: 18px 0; }
.secbreak .r { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.secbar { height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.secbar > i { display: block; height: 100%; background: var(--brand); }
.capture-note { border-radius: 9px; padding: 11px 14px; font-size: .9rem; margin: 12px 0; }
.capture-ok { background: var(--ok-soft); color: var(--ok); }
.capture-info { background: var(--brand-soft); color: var(--brand); }

/* Évaluateur */
.subs { display: grid; gap: 10px; }
.sub { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.sub summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-weight: 600; }
.sub summary .sc { color: var(--brand); font-variant-numeric: tabular-nums; }
.sub summary .dt { color: var(--muted); font-weight: 400; font-size: .84rem; margin-left: auto; }
.detail { margin-top: 10px; display: grid; gap: 8px; }
.drow { border-top: 1px solid var(--line); padding-top: 8px; font-size: .92rem; }
.drow .qp { font-weight: 600; }
.ans { display: inline-block; margin-top: 3px; padding: 2px 8px; border-radius: 6px; font-size: .86rem; }
.ans.good { background: var(--ok-soft); color: var(--ok); }
.ans.bad { background: var(--bad-soft); color: var(--bad); }
.ans.neutral { background: var(--brand-soft); color: var(--brand); }
.eval-gate { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

footer { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
footer a { color: var(--muted); cursor: pointer; text-decoration: underline; }


/* Chronomètre et verrouillage (v2) */
.timer { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-weight: 500; font-size: .95rem; font-variant-numeric: tabular-nums; padding: 3px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.timer svg { width: 15px; height: 15px; flex: none; }
.timer.warn { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.timer.danger { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); animation: tpulse 1s ease-in-out infinite; }
@keyframes tpulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .timer.danger { animation: none; } }
.timeup { margin: 16px 0 4px; padding: 12px 14px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.locked .opt { cursor: not-allowed; opacity: .7; }
.locked .opt:hover { border-color: var(--line); }
.locked textarea { opacity: .7; }
.q-topic { font-weight: 600; }
.opt label { cursor: inherit; min-width: 0; overflow-wrap: anywhere; }
.olet { display: inline-block; min-width: 1.4em; font-family: var(--font-mono); font-size: .82em; font-weight: 500; color: var(--muted); }
.consigne li strong { color: var(--ink); }
.start-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.start-hint { font-size: .86rem; color: var(--muted); }
.field input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.secscore { font-variant-numeric: tabular-nums; }
.sub summary .dur { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.pill-auto { font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); }
.drow .choice { color: var(--muted); font-size: .86rem; }
.drow .opentext { margin-top: 4px; white-space: pre-wrap; }
.eval-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; }
#toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 9px; font-size: .9rem; z-index: 50; max-width: calc(100vw - 32px); transition: opacity .3s; }

@media (max-width: 620px) {
  .profiles { grid-template-columns: 1fr; }
  .wrap { padding-inline: 16px; }
  .progress, .endbar { margin-inline: -16px; padding-inline: 16px; }
}