/* Look « Banc d'essai » : clair et sobre, bande sombre en haut, orange d'atelier pour les actions.
   Polices incluses dans l'application (aucun chargement depuis Internet). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("/static/fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("/static/fonts/space-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #F6F5F2;
  --surface: #FFFFFF;
  --surface-2: #FAF9F7;
  --text: #1C1F23;
  --muted: #5B616B;
  --border: #E3E1DC;
  --border-strong: #D6D3CD;
  --dark: #1C1F23;
  --dark-2: #3A3F46;
  --dark-text: #C9CDD3;
  --accent: #F97316;
  --primary: #C2410C;
  --primary-hover: #9A3412;
  --danger: #B91C1C;
  --ok-bg: #E7F5EC;   --ok-text: #166534;
  --error-bg: #FDECEC; --error-text: #991B1B;
  --info-bg: #E6EEFC;  --info-text: #1E40AF;
  --test-bg: #FDEDE3;  --test-text: #9A3412;
  --warn-bg: #FFFBEB;  --warn-border: #E7C66B; --warn-text: #854D0E;
  --password-bg: #FFFBEB; --password-text: #854D0E;
  --radius: 16px;
  --radius-s: 10px;
  --font-title: "Space Grotesk", "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
h1 { font-family: var(--font-title); font-size: 1.9rem; letter-spacing: -0.02em; line-height: 1.2; margin: .5rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.topbar { background: var(--dark); color: #fff; }
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 1.5rem; min-height: 64px;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 2rem;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: #fff;
  font-family: var(--font-title); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand:hover { color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; flex: 1 1 560px; }
.nav a { display: inline-flex; align-items: center; height: 44px; padding: 0 14px; border-radius: 8px;
  color: var(--dark-text); text-decoration: none; font-size: .9rem; font-weight: 600; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav a.active { color: #fff; box-shadow: inset 0 -3px 0 var(--accent); border-radius: 8px 8px 0 0; }
.user-menu { position: relative; margin-left: auto; }
.user-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; color: var(--dark-text); font-size: .85rem; min-height: 44px; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--dark-2); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; }
.user-menu .popover { right: 0; width: 230px; color: var(--text); }
.user-menu .popover a, .user-menu .popover button.link { display: block; padding: .45rem .6rem; border-radius: 8px; text-decoration: none; color: var(--text); text-align: left; width: 100%; }
.user-menu .popover a:hover, .user-menu .popover button.link:hover { background: var(--surface-2); }
.user-menu .popover hr { border: 0; border-top: 1px solid var(--border); margin: .3rem 0; width: 100%; }
.container { max-width: 1240px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0 0 .3rem; }
.page-head p { margin: 0; color: var(--muted); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.5rem; margin: 1rem 0;
}
.narrow { max-width: 440px; margin: 2rem auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.breadcrumb { margin: 0; font-size: .9rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.tile { display: flex; flex-direction: column; gap: .25rem; margin: 0; text-decoration: none; color: var(--text); }
.tile:hover { border-color: var(--primary); }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin: .5rem 0; }
.row.between { justify-content: space-between; align-items: center; }
.grow { flex: 1 1 180px; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; color: var(--muted); }
label { font-weight: 600; color: #3A3F46; font-size: .85rem; }
input, select, textarea {
  font: inherit; font-weight: 400; font-size: .95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-s); padding: .55rem .75rem; min-height: 44px;
}
input[type=file] { padding: .4rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px;
  font: inherit; font-weight: 600; font-size: .95rem; padding: .5rem 1.15rem; border-radius: var(--radius-s); cursor: pointer;
  background: var(--primary); color: #fff; border: 1px solid var(--primary); text-decoration: none;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn.secondary { background: var(--surface); color: var(--primary); }
.btn.secondary:hover { background: var(--test-bg); color: var(--primary-hover); }
.btn.dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn.dark:hover { background: var(--dark-2); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--error-bg); color: var(--danger); }
.btn.small { min-height: 36px; padding: .3rem .8rem; font-size: .85rem; border-radius: 8px; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; }
form.inline { display: inline; }
.flash { padding: .8rem 1rem; border-radius: var(--radius-s); margin: .75rem 0; }
.flash ul { margin: 0; padding-left: 1.2rem; }
.flash-ok { background: var(--ok-bg); color: var(--ok-text); }
.flash-error { background: var(--error-bg); color: var(--error-text); }
.flash-info { background: var(--info-bg); color: var(--info-text); }
.flash-password { background: var(--password-bg); color: var(--password-text); font-weight: 600; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid #EEECE8; vertical-align: middle; }
th { font-size: .75rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: var(--surface-2); border-bottom-color: var(--border); }
tbody tr:last-child td { border-bottom: 0; }
tr.dim td { color: var(--muted); }
.actions { white-space: nowrap; text-align: right; }
.actions form { margin-left: .25rem; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; background: #EEECE8; color: var(--text); padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.badge.mode-test { background: var(--test-bg); color: var(--test-text); }
.badge.mode-exercise { background: var(--info-bg); color: var(--info-text); }
.badge.done { background: var(--ok-bg); color: var(--ok-text); }
.badge.warn { background: #FEF6DD; color: var(--warn-text); }
.badge.objective { background: var(--surface-2); border: 1px solid var(--border); }
.code { font-family: ui-monospace, "DejaVu Sans Mono", monospace; font-size: 1.05rem; letter-spacing: .1em; }
.code.big { font-size: 1.4rem; }
.card .code.big { font-size: 2.2rem; }
details.edit { position: relative; display: inline-block; text-align: left; }
details.edit summary { list-style: none; }
details.edit summary::-webkit-details-marker { display: none; }
.popover {
  position: absolute; right: 0; z-index: 5; width: 260px; margin-top: .25rem;
  display: flex; flex-direction: column; gap: .5rem; white-space: normal;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .75rem; box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
details.card > summary { cursor: pointer; }
details.card[open] > summary { margin-bottom: .75rem; }

/* Cartes de codes à imprimer */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0; padding: 1rem; }
.code-card { border: 1px dashed #888; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .2rem; break-inside: avoid; background: #fff; color: #000; }
.code-card .name { font-size: 1.15rem; font-weight: 700; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .cards { grid-template-columns: repeat(3, 1fr); padding: 0; }
}
@media (max-width: 600px) {
  h1 { font-size: 1.35rem; }
  .card { padding: .85rem 1rem; }
  th, td { padding: .5rem; }
}

/* Questions et tests */
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.list-item { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .75rem 1rem; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); }
.question { margin: .75rem 0; }
.q-head { margin: 0 0 .5rem; }
.q-text { white-space: pre-wrap; font-size: 1.05rem; }
.q-img { display: block; max-width: 100%; max-height: 320px; margin: .5rem 0; border-radius: 6px; border: 1px solid var(--border); background: #fff; }
.choices { margin: .5rem 0; padding-left: 1.2rem; }
.choices li.right { color: var(--ok-text); font-weight: 600; }
.choices li.right::marker { content: "✓ "; }
.sr-tag { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.answer { margin: .5rem 0 0; color: var(--ok-text); font-weight: 600; }
.answer .muted { font-weight: 400; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; margin: 0; }
legend { padding: 0 .3rem; color: var(--muted); font-size: .9rem; }
.label { font-size: .9rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); font-size: 1rem; }
label.check input { min-height: 0; width: 1.2rem; height: 1.2rem; }
.choice-row { display: flex; gap: .6rem; align-items: center; }
.choice-row input[type=checkbox] { width: 1.4rem; height: 1.4rem; min-height: 0; flex: none; }
label.points { flex-direction: row; align-items: center; gap: .4rem; }
label.points input { width: 5rem; min-height: 36px; }
label.pick { display: block; cursor: pointer; color: var(--text); font-size: 1rem; }
label.pick.dim { opacity: .6; cursor: default; }
label.pick input[type=checkbox] { width: 1.3rem; height: 1.3rem; min-height: 0; }
.sticky-save { position: sticky; bottom: 0; background: var(--bg); padding: .75rem 0; border-top: 1px solid var(--border); margin-top: 1rem; z-index: 4; }
details.menu { position: relative; }
details.menu summary { list-style: none; }
details.menu summary::-webkit-details-marker { display: none; }
.menu-item { display: flex; flex-direction: column; text-decoration: none; color: var(--text); padding: .4rem .5rem; border-radius: 6px; }
.menu-item:hover { background: var(--surface-2); }
.btn:disabled { opacity: .4; cursor: default; }

/* Élèves */
body.student { font-size: 17px; }
.narrow-page { max-width: 760px; }
.btn.big { min-height: 52px; font-size: 1.05rem; padding: .6rem 1.2rem; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; margin: 1rem 0; }
.pick-list .btn { justify-content: flex-start; text-align: left; }
.code-input { font-size: 1.6rem; letter-spacing: .3em; text-align: center; }
.qnav { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0 0; }
.qdot { min-width: 2.4rem; height: 2.4rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; }
.qdot.done { background: var(--info-bg); border-color: var(--primary); color: var(--info-text); }
.qdot.current { outline: 3px solid var(--primary); outline-offset: 1px; font-weight: 700; }
.question-screen .q-text { font-size: 1.15rem; margin: .25rem 0 .75rem; }
.answer-zone { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
label.option { flex-direction: row; align-items: center; gap: .75rem; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 1.05rem; cursor: pointer; background: var(--surface); }
label.option:has(input:checked) { border-color: var(--primary); background: var(--info-bg); }
label.option input { width: 1.4rem; height: 1.4rem; min-height: 0; flex: none; margin: 0; }
.with-unit { display: flex; align-items: center; gap: .5rem; }
.with-unit input { flex: 1; font-size: 1.1rem; }
.with-unit span { color: var(--text); font-weight: 600; }
.save-state { min-height: 1.4em; margin: .75rem 0 0; }
.save-state.bad { color: var(--danger); font-weight: 600; }
.nav-buttons { margin-top: 1rem; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; padding: .2rem .6rem; border-radius: 6px; background: var(--info-bg); color: var(--info-text); }
.timer.urgent { background: var(--error-bg); color: var(--error-text); }
button.zoom { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; text-align: left; font: inherit; color: var(--muted); }
.zoom-hint { font-size: .8rem; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.92); display: flex; flex-direction: column; }
.lightbox[hidden] { display: none; }
.lightbox-close { align-self: flex-end; margin: .5rem; }
.lightbox-scroll { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; }
.lightbox-scroll img { max-width: 100%; max-height: 100%; background: #fff; cursor: zoom-in; }
.lightbox-scroll img.natural { max-width: none; max-height: none; cursor: zoom-out; }

/* Suivi enseignant */
.badge.live { background: var(--ok-bg); color: var(--ok-text); }
.connect-info .address { font-size: 1.3rem; font-family: ui-monospace, "DejaVu Sans Mono", monospace; }
.counters { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 1rem 0 .25rem; }
.counters div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem; text-align: center; display: flex; flex-direction: column; }
.counters strong { font-size: 1.6rem; }
.counters span { font-size: .8rem; color: var(--muted); }
.online-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .45rem; vertical-align: middle; }
.online-dot.on { background: #2e9d52; }
.online-dot.off { background: #c9a227; }
tr.state-absent td { color: var(--muted); }
tr.state-fini td:nth-child(2) { color: var(--ok-text); font-weight: 600; }
@media (max-width: 600px) {
  .counters { grid-template-columns: repeat(2, 1fr); }
  .nav-buttons .btn { flex: 1; }
}

/* Correction */
table.results th, table.results td { text-align: center; padding: .45rem .4rem; }
table.results th:first-child, table.results td:first-child { text-align: left; white-space: nowrap; }
table.results .qcol a { text-decoration: none; font-weight: 700; }
td.cell.full { background: var(--ok-bg); color: var(--ok-text); }
td.cell.zero { background: var(--error-bg); color: var(--error-text); }
td.cell.part { background: var(--password-bg); color: var(--password-text); }
td.cell.pending { background: var(--info-bg); color: var(--info-text); font-weight: 700; }
td.cell.off, th.qcol.off { color: var(--muted); text-decoration: line-through; }
td.cell.edited { text-decoration: underline; }
.grade-row { margin: .4rem 0; }
.grade-row.pending { border-color: var(--primary); }
.student-answer { white-space: pre-wrap; background: var(--bg); border-radius: 6px; padding: .5rem .7rem; margin: .5rem 0; }
.ok-text { color: var(--ok-text); font-weight: 600; }
.bad-text { color: var(--error-text); font-weight: 600; }
.small-text { font-size: .95rem; }
.q-img.small-img { max-height: 160px; }

/* ---------- étape 2 : modes Test et Exercice ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 15, 20, .82); padding: 1rem;
}
.overlay[hidden] { display: none; }
.overlay .card { max-width: 32rem; width: 100%; }
.warn-card { border: 3px solid var(--danger); }
.warn-card h2 { color: var(--danger); }
.rules li { margin: .35rem 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.stack legend, legend { font-weight: 600; margin-bottom: .25rem; }
.feedback { margin-top: .75rem; padding: .65rem .8rem; border-radius: var(--radius); }
.feedback.ok { background: var(--ok-bg); color: var(--ok-text); }
.feedback.bad { background: var(--error-bg); color: var(--error-text); }
.feedback.neutral { background: var(--info-bg); color: var(--info-text); }
.feedback p { margin: .4rem 0 0; }
.feedback-card { margin: .5rem 0; }
.score { font-size: 2rem; font-weight: 700; margin: .5rem 0; }
.center-row { justify-content: center; }
.linklike { background: none; border: 0; padding: 0 .1rem; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; min-height: 0; }
.badge.alert { background: var(--error-bg); color: var(--error-text); }
tr.blocked td { background: var(--error-bg); }
.mode-tag { font-size: .8rem; }
.infraction-log td { font-size: .9rem; }

/* ---------- étape 3 : schémas ---------- */
.diagram { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--border); border-radius: 6px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.diagram-scroll { overflow: auto; }
.diagram-scroll.big .diagram { width: 220%; max-width: none; }
.diagram-small { max-width: 640px; }
.diagram-wrap { margin: .5rem 0; }
.diagram .shape { fill: transparent; stroke: none; cursor: pointer; }
.diagram rect.shape.show { stroke: #1e63c8; stroke-width: 2px; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.diagram rect.shape.picked { fill: rgba(30, 99, 200, .3); stroke: #1e63c8; stroke-width: 3px; vector-effect: non-scaling-stroke; }
.diagram rect.shape.key { stroke: #2e7d32; stroke-width: 3px; stroke-dasharray: none; vector-effect: non-scaling-stroke; }
.diagram rect.shape.picked-ok { fill: rgba(46, 125, 50, .35); }
.diagram rect.shape.picked-bad { fill: rgba(211, 47, 47, .35); stroke: #d32f2f; stroke-width: 3px; vector-effect: non-scaling-stroke; }
.diagram .cable .hit { fill: none; stroke: transparent; stroke-width: 22px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.diagram .cable .wire { fill: none; stroke: transparent; stroke-width: 4px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.diagram .cable.show .wire { stroke: rgba(30, 99, 200, .55); stroke-dasharray: 8 5; }
.diagram .cable:hover .wire { stroke: rgba(30, 99, 200, .6); }
.diagram .cable.picked .wire { stroke: #1e63c8; stroke-width: 6px; stroke-dasharray: none; }
.diagram .cable.key .wire { stroke: #2e7d32; stroke-width: 6px; stroke-dasharray: none; }
.diagram .cable.picked-bad .wire { stroke: #d32f2f; }
.diagram polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.diagram .seg-under { stroke: rgba(0, 0, 0, .55); stroke-width: 7px; }
.diagram .seg { stroke-width: 5px; }
.diagram .seg.wrong, .diagram .seg.extra { stroke-dasharray: 7 5; }
.diagram .seg-hit { stroke: transparent; stroke-width: 20px; cursor: pointer; }
.diagram .seg-empty { stroke: rgba(90, 100, 110, .7); stroke-width: 3px; stroke-dasharray: 6 4; }
.diagram .key-under { stroke: rgba(0, 0, 0, .25); stroke-width: 15px; }
.diagram .key-seg { stroke-width: 13px; opacity: .45; }
.diagram .node { fill: #fff; stroke: #1b1b1b; stroke-width: 2px; vector-effect: non-scaling-stroke; pointer-events: none; }
.diagram .node.armed { fill: #f2c200; stroke-width: 3px; }
.diagram .node-hit { fill: transparent; cursor: pointer; }
.diagram .draft-line { stroke: #ef7d00; stroke-width: 3px; stroke-dasharray: 6 4; }
.diagram rect.draft { fill: rgba(239, 125, 0, .2); }
.diagram .shape-label { fill: #fff; stroke: #1b1b1b; stroke-width: 3px; paint-order: stroke; font-weight: 700; pointer-events: none; }
.circuit-tools { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .4rem 0; }
.swatch { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: .3rem .6rem; border-radius: 999px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.swatch .dot { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--c); border: 1px solid #555; }
.swatch.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.btn.active { background: var(--primary); color: #fff; }
.circuit-message { min-height: 1.2em; color: var(--info-text); }
.editor-svg { touch-action: none; cursor: crosshair; min-height: 120px; }
.diagram-editor.no-image .editor-canvas, .diagram-editor.no-image .editor-tools { display: none; }
.diagram-editor:not(.no-image) .no-image-msg { display: none; }
.editor-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .3rem; border-radius: 6px; }
.editor-row.flash-row { background: var(--info-bg); }
.editor-help { color: var(--info-text); min-height: 1.2em; }

/* ---------- étape 4 : autres activités ---------- */
.order-list { list-style: none; padding: 0; margin: .5rem 0; counter-reset: step; }
.order-item { display: flex; align-items: center; gap: .5rem; padding: .5rem; margin: .35rem 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; counter-increment: step; }
.order-item::before { content: counter(step) "."; font-weight: 700; min-width: 1.6rem; }
.order-item .handle { cursor: grab; touch-action: none; font-size: 1.4rem; padding: .2rem .45rem; color: var(--muted); }
.order-item.dragging { opacity: .7; border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.order-item .move { min-width: 44px; }
.match-row { display: flex; flex-direction: row; align-items: center; gap: .75rem; flex-wrap: wrap; color: var(--text); font-size: 1rem; padding: .35rem 0; border-bottom: 1px solid var(--border); }
.match-row span { flex: 1 1 12rem; }
.match-row select { flex: 1 1 12rem; }
.dragdrop { display: flex; flex-direction: column; gap: .75rem; }
.dd-zone { min-height: 3.2rem; padding: .5rem; border: 2px dashed var(--border); border-radius: 8px; display: flex; flex-wrap: wrap; gap: .4rem; align-items: flex-start; }
.dd-pool { background: var(--bg); }
.dd-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .6rem; }
.dd-group strong { flex-basis: 100%; }
.chip { display: inline-block; padding: .45rem .7rem; border-radius: 999px; background: var(--info-bg); color: var(--info-text); border: 1px solid var(--border); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; min-height: 44px; line-height: 1.7; }
.chip.selected { outline: 3px solid var(--primary); }
.chip.dragging { position: relative; z-index: 20; box-shadow: 0 3px 10px rgba(0,0,0,.25); opacity: .9; }
.group-edit { align-items: flex-start; }
.video-player { width: 100%; max-height: 70vh; background: #000; border-radius: 8px; }
.video-box { position: relative; }
.video-stop { position: absolute; inset: auto 0 0 0; margin: .5rem; max-height: 90%; overflow: auto; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.video-status { color: var(--info-text); min-height: 1.2em; }
.qr-poster { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 1rem 0; }
.qr-card { background: #fff; color: #000; border: 1px solid var(--border); border-radius: 8px; padding: 1rem; text-align: center; }
.qr-card h2 { color: #000; }
.qr { width: 100%; max-width: 20rem; height: auto; }
.qr-caption { font-size: 1.2rem; word-break: break-all; }
@media print { .qr-card { border: 2px solid #000; break-inside: avoid; } .qr { max-width: 9cm; } }

[hidden] { display: none !important; }
.steps { padding-left: 1.3rem; }
.steps li { margin: .35rem 0; }
.steps .btn { margin: .15rem .2rem; }

/* ---------- Banc d'essai : pages enseignant ---------- */
.hero-title { font-size: 2.15rem; }
.eyebrow { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.eyebrow.live { color: var(--danger); margin-bottom: .4rem; }
.row-link { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  padding: .75rem .9rem; margin: .5rem 0; border-radius: var(--radius-s); background: var(--surface-2);
  color: var(--text); text-decoration: none; }
.row-link:hover { background: var(--test-bg); color: var(--text); }
.action-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin: 1.25rem 0; }
.action-card { display: flex; flex-direction: column; gap: .8rem; min-height: 160px; padding: 1.5rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.action-card svg { color: var(--primary); }
.action-card:hover { border-color: var(--primary); color: var(--text); }
.action-card.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.action-card.primary svg { color: #fff; }
.action-card.primary:hover { background: var(--primary-hover); color: #fff; }
.action-title { font-family: var(--font-title); font-size: 1.35rem; font-weight: 700; }
.action-text { font-size: .9rem; color: var(--muted); }
.action-card.primary .action-text { color: #FFE8DB; }
.two-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.two-cols .card { margin: 0; }
.empty { display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center; padding: 3rem 1.5rem; border-style: dashed; border-color: var(--border-strong); color: var(--muted); }
.empty strong { color: var(--text); font-size: 1.05rem; }
.launch-layout { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.launch-form { flex: 999 1 480px; min-width: 0; margin: 0; padding: 1.75rem; gap: 1.3rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.note { margin: 0; font-size: .85rem; color: var(--muted); background: var(--surface-2); border-radius: var(--radius-s); padding: .75rem .9rem; }
.segmented-field legend { font-size: .85rem; color: #3A3F46; margin-bottom: .4rem; }
.segmented { display: flex; gap: 8px; background: #F1EFEB; padding: 4px; border-radius: 12px; }
.segmented label { flex: 1; flex-direction: row; justify-content: center; align-items: center; height: 42px; border-radius: 9px;
  font-size: .95rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label:has(input:checked) { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); }
.btn.big { min-height: 52px; font-size: 1.05rem; border-radius: 12px; }
.beamer { flex: 1 1 300px; background: var(--dark); color: #fff; border-radius: var(--radius); padding: 1.75rem; display: flex; flex-direction: column; gap: 1.1rem; }
.beamer .eyebrow { color: var(--dark-text); }
.beamer-label { display: block; font-size: .8rem; color: var(--dark-text); }
.beamer-value { font-size: 1.4rem; font-weight: 700; word-break: break-word; }
.beamer-address { display: block; font-family: var(--font-title); font-size: 2.1rem; font-weight: 700; color: #FDBA8C; word-break: break-all; line-height: 1.15; }
.beamer-link { color: var(--dark-text); font-size: .85rem; }
.beamer-link:hover { color: #fff; }
.muted-dark { color: var(--dark-text); font-weight: 400; font-size: 1rem; }
@media (max-width: 600px) {
  .container { padding: 1.25rem 1rem 3rem; }
  .topbar-inner { padding: 0 1rem; }
  .topbar-inner { gap: 0 1rem; padding-top: .5rem; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; }
  .user-menu { order: 2; }
  .user-menu summary span:not(.avatar) { display: none; }
  .hero-title { font-size: 1.7rem; }
}

/* ---------- Banc d'essai : en direct ---------- */
.live-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; }
.live-head h1 { font-size: 1.5rem; margin: .25rem 0 .4rem; }
.live-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.live-actions form { margin: 0; }
.clock { font-family: var(--font-title); font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.connect-info { margin: .25rem 0 1rem; }
.connect-info .address { font-family: var(--font-title); font-size: 1.15rem; color: var(--text); }
.counters { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .75rem; }
.counters div { border-radius: 12px; padding: .7rem; }
.counters strong { font-family: var(--font-title); }
.student-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin: 1rem 0 1.5rem; }
.student-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem; display: flex; flex-direction: column; gap: .7rem; }
.student-card.warn { background: var(--warn-bg); border-color: var(--warn-border); }
.student-card.state-absent { opacity: .75; }
.student-card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.student-name { font-size: 1rem; }
.progress { height: 8px; border-radius: 99px; background: #EEECE8; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s; }
.progress-fill.done { background: #16A34A; }
.student-detail { font-size: .85rem; color: var(--muted); }
.student-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.student-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.student-actions form { margin: 0; }
.btn.warn-btn { background: #fff; color: var(--warn-text); border-color: #A16207; }
.btn.warn-btn:hover { background: var(--warn-bg); color: var(--warn-text); }
.online-dot.on { background: #16A34A; }
.extra-form { margin: 0; }
.extra-form label.check { font-size: .9rem; font-weight: 400; }

/* ---------- Banc d'essai : écran élève (pensé d'abord pour le téléphone) ---------- */
body.student { font-size: 16px; }
.student-topbar { min-height: 56px; }
.narrow-page { max-width: 760px; padding-top: 1.25rem; }
.test-head { max-width: 760px; margin: 0 auto; padding: 1rem 1.25rem .9rem; display: flex; flex-direction: column; gap: .75rem; }
.test-head-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.test-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.test-sub { font-size: .75rem; color: var(--dark-text); }
.test-title { font-family: var(--font-title); font-weight: 700; font-size: 1rem; overflow-wrap: anywhere; }
.test-progress { height: 6px; border-radius: 99px; background: var(--dark-2); overflow: hidden; }
.test-progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.timer { font-family: var(--font-title); font-size: 1.4rem; font-weight: 700; color: #FDBA8C; background: none; padding: 0; font-variant-numeric: tabular-nums; flex: none; }
.timer.urgent { color: #fff; background: var(--danger); padding: .1rem .5rem; border-radius: 8px; }
.overview { margin-bottom: 1rem; }
.overview-toggle { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: 0 .9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  font: inherit; font-size: .9rem; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; }
.overview-summary { margin: 0; font-weight: 600; color: var(--muted); }
.overview-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .9rem; display: flex; flex-direction: column; gap: .75rem; }
.overview .qnav { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; margin: 0; }
.qdot { min-width: 0; height: 40px; border-radius: 9px; border: 1px solid var(--border-strong); background: #fff; color: var(--text); font-weight: 700; font-size: .85rem; }
.qdot.done { background: var(--dark); border-color: var(--dark); color: #fff; }
.qdot.flagged { background: var(--test-bg); border-color: var(--primary); color: var(--test-text); }
.qdot.flagged::after { content: " ⚑"; }
.qdot.current { outline: 2px solid var(--accent); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: .9rem; color: var(--muted); align-items: center; }
.legend-box { display: inline-block; width: .8rem; height: .8rem; border: 1px solid var(--border-strong); border-radius: 3px; vertical-align: -1px; background: #fff; }
.legend-box.done { background: var(--dark); border-color: var(--dark); }
.flag-text { color: var(--test-text); }
.question-screen { padding: 1.1rem; }
.q-head-line { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.q-counter { font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.flag-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 99px; flex: none;
  font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; background: #fff; color: var(--test-text); border: 1px solid var(--primary); }
.flag-btn[aria-pressed="true"] { background: var(--primary); color: #fff; }
.question-screen .q-text { font-size: 1.07rem; font-weight: 600; line-height: 1.45; margin: 0 0 .9rem; }
.answer-zone { gap: .6rem; }
label.option { min-height: 56px; gap: .9rem; padding: .6rem .9rem; border-radius: 12px; border: 1px solid var(--border); font-size: 1rem; font-weight: 400; position: relative; }
label.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.option .letter { width: 32px; height: 32px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; background: #F1EFEB; color: var(--dark-2); }
label.option.multi .letter { border-radius: 8px; }
label.option:has(input:checked) { border: 2px solid var(--primary); background: var(--test-bg); padding: calc(.6rem - 1px) calc(.9rem - 1px); }
label.option:has(input:checked) .letter { background: var(--primary); color: #fff; }
label.option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
fieldset[disabled] label.option { cursor: default; opacity: .85; }
.nav-buttons { position: sticky; bottom: 0; z-index: 4; display: flex; gap: .6rem; margin: 1rem -1rem 0; padding: .75rem 1rem 1rem;
  background: var(--bg); border-top: 1px solid var(--border); }
.nav-buttons .btn { flex: 1; min-height: 50px; }
.nav-buttons .btn[value=next], .nav-buttons .btn[value=finish] { flex: 1.4; }
.flash-warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); }
@media (max-width: 600px) {
  .narrow-page { padding: 1rem 1rem 0; }
  .question-screen { margin-top: 0; }
}
.pick-list .btn.secondary { color: var(--text); border-color: var(--border-strong); }
.pick-list .btn.secondary:hover { border-color: var(--primary); background: var(--surface); }

/* ---------- vrai/faux par 4 ---------- */
.tf4-row { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; }
.tf4-answer { display: flex; gap: 1rem; padding-bottom: .6rem; }
.tf4-scale { display: flex; flex-wrap: wrap; gap: .75rem; }
.tf4-scale input { width: 5rem; }
.tf4-statement { border: 1px solid var(--border); border-radius: 12px; padding: .75rem; background: var(--surface-2); }
.tf4-text { margin: 0 0 .6rem; display: flex; gap: .7rem; align-items: flex-start; font-weight: 600; }
.tf4-text .letter { width: 28px; height: 28px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--dark); color: #fff; font-size: .85rem; }
.tf4-choices { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
label.option.tf4-option { min-height: 48px; justify-content: center; font-weight: 600; background: #fff; }
.tf4-list { margin: .5rem 0; padding-left: 1.4rem; }

/* ---------- correction : choix de la façon de corriger ---------- */
.correct-box h2 { margin: 0 0 .35rem; }
.correct-box-head p { margin: 0 0 .9rem; }
.correct-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.correct-mode { display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.1rem; border: 1px solid var(--border-strong);
  border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; min-height: 44px; }
.correct-mode strong { font-family: var(--font-title); font-size: 1.1rem; color: var(--primary); }
.correct-mode span { color: var(--muted); font-size: .9rem; }
.correct-mode:hover, .correct-mode:focus-visible { border-color: var(--primary); background: var(--surface-2); }
.results-summary { margin: 1.25rem 0 .5rem; }
.corr-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 .4rem; }
.corr-nav a { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 .4rem;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; }
.corr-nav a.pending { border-color: var(--primary); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.corr-nav a.off { color: var(--muted); text-decoration: line-through; }
.corr-nav a.current { background: var(--dark); border-color: var(--dark); color: #fff; box-shadow: none; }
.corr-nav a:hover { border-color: var(--primary); }
.corr-legend { margin: 0 0 1rem; }
.corr-dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; }
.corr-dot.pending { border: 2px solid var(--primary); }
.infraction-kinds { display: block; color: var(--muted); font-size: .8rem; max-width: 220px; margin: .15rem auto 0; white-space: normal; }
