* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f0f2f5;
  color: #1d2125;
  font-family: Roboto, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

/* En-tête */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 18px 40px 28px 52px;
}
.title-wrap { display: flex; align-items: center; gap: 12px; }
.quiz-icon {
  width: 56px; height: 56px; border-radius: 6px;
  background: #e8559b;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.page-header h1 { margin: 0; font-size: 34px; font-weight: 700; word-break: break-all; }
.breadcrumb { text-align: right; color: #0f6cbf; max-width: 640px; flex: 0 1 auto; min-width: 0; }
.breadcrumb span { white-space: nowrap; }
.breadcrumb .sep { color: #8f959e; margin: 0 8px; }
.breadcrumb .current { color: #1d2125; }

/* Page */
.page {
  background: #fff;
  border-radius: 8px;
  max-width: 1160px;
  margin: 24px auto 40px;
  padding: 28px 40px 40px;
}
button { font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: 9px 14px; }
.btn-grey { background: #ced4da; color: #1d2125; }
.btn-grey:hover { background: #b8c0c8; }
.btn-blue { background: #2b4e85; color: #fff; padding: 10px 16px; }
.btn-blue:hover { background: #213d69; }
#retour { margin-bottom: 28px; }

.summary {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  margin-bottom: 28px;
  overflow: hidden;
}
.summary table { width: 100%; border-collapse: collapse; }
.summary th, .summary td { padding: 9px 14px; text-align: left; border-bottom: 1px solid #dee2e6; }
.summary tr:last-child th, .summary tr:last-child td { border-bottom: 0; }
.summary th { width: 220px; background: #f8f9fa; font-weight: 700; }


[hidden] {display:none !important}
.page-header h1 {word-break:normal; line-height:1.15}
h2,h3,p,fieldset {margin:0}
h2 {font-size:24px;line-height:1.25}
.subject,.exercise-index,.hint {color:#495057}
.controls,.timer,.actions,.sheet-header,.statement {display:flex;align-items:center;flex-wrap:wrap;gap:12px}
.controls {align-items:end;margin:20px 0 16px}
.function-picker {display:grid;gap:4px;max-width:100%;font-weight:600;font-size:14px}
select,input[type=text] {font:inherit;color:inherit;background:#fff;border:1px solid #8f959e;border-radius:6px;padding:7px 10px;min-width:0;max-width:100%}
button:disabled {opacity:.55;cursor:default}
:focus-visible {outline:3px solid #0f6cbf;outline-offset:2px}
.clock,.result {font-weight:700;font-variant-numeric:tabular-nums}
.instructions {margin:0 0 22px}
.sheet-header {justify-content:space-between;margin-top:20px;border-top:1px solid #dee2e6;padding-top:18px}
.sheet-header h2 {font-size:21px}
.weight,.exercise-index,.pts {font-size:13px;color:#495057}
.statement {margin:14px 0;gap:12px 36px}
.math {font:1.5rem Georgia,serif;display:inline-flex;align-items:center;gap:.45em}
.fraction {display:inline-grid;text-align:center;line-height:1.12}
.fraction span {padding:1px 5px}
.fraction span:first-child {border-bottom:1px solid}
.correction-tools {margin:12px 0 24px}
.part {display:grid;grid-template-columns:118px minmax(0,1fr);gap:24px;margin-bottom:28px}
.info {align-self:start;padding:8px;background:#f8f9fa;border:1px solid #dee2e6;border-radius:3px;font-size:13px}
.info b {font-size:19px}.info .pts {display:block;margin-top:6px}
.formulation {background:#e7f3f5;border-radius:8px;padding:18px 22px}
h3 {font-size:16px;line-height:1.4;margin-bottom:12px}
.hint {font-size:14px;margin:8px 0}
fieldset {min-width:0;padding:0;border:0}
.group {border-top:1px solid #c6d9dc;margin:14px 0 0;padding:6px 0}
.group legend,.radios legend {font-weight:600}
.group legend {padding-right:10px}
.answer:not(.radios) {display:grid;grid-template-columns:minmax(120px,200px) minmax(0,290px) auto;align-items:center;gap:4px 12px;padding:5px 0}
.answer .pts {white-space:nowrap}
.option {display:flex;align-items:baseline;gap:8px;padding:4px 6px;cursor:pointer;border-radius:4px}
.option:hover {background:#fff9}
input[type=radio] {accent-color:#0f6cbf;flex:none}
.feedback,.explanation {padding:8px 12px;border-radius:6px;font-size:14px}
.feedback {grid-column:2/-1;background:#fcefdc;color:#724d1b}
[data-status=good] .feedback {background:#d7ead3;color:#1e4d1c}
[data-status=wrong] .feedback {background:#f7d7d3;color:#7a1f14}
.explanation {margin-top:12px;background:#fff}.explanation summary {color:#0f6cbf;cursor:pointer}.explanation p {margin-top:6px}
.actions {justify-content:flex-end}.result {color:#2b4e85}
@media(max-width:700px){
  .page-header {flex-direction:column;padding:16px;gap:12px}.page-header h1 {font-size:26px}
  .breadcrumb {text-align:left;font-size:13px}.page {margin-top:0;padding:20px 16px;border-radius:0}
  .part {grid-template-columns:minmax(0,1fr);gap:10px}.info {display:flex;align-items:baseline;gap:14px}.info .pts {margin:0}
  .formulation {padding:15px}.answer:not(.radios) {grid-template-columns:minmax(0,1fr) auto}.answer>label,.feedback {grid-column:1/-1}
}
@media print {
  .controls,.actions,.instructions,.correction-tools,.breadcrumb {display:none!important}
  body,.formulation {background:white}.page {max-width:none;margin:0;padding:0}.group,h3 {break-inside:avoid}
}

.subject {margin:4px 0 20px}
.function-picker {width:fit-content}.notation {margin:12px 0;color:#495057;font-size:14px}.notation summary {cursor:pointer;color:#0f6cbf}.notation p {margin:7px 0}
.progress {position:sticky;top:0;z-index:2;background:white;padding:10px 0;border-bottom:1px solid #dee2e6;display:flex;align-items:center;flex-wrap:wrap;gap:8px 18px;font-size:14px}
.progress progress {flex:1 1 170px;height:8px;accent-color:#2b4e85}
.sheet-header {border:0}.statement {margin-bottom:24px}
.status {margin:5px 0}.mark-question {color:#0f6cbf;padding:0;background:none;text-decoration:underline;font-size:13px;text-align:left}
.question-actions {margin-top:14px}.verify {padding:7px 14px;font-size:14px}.empty-warning {color:#a12b1b;margin-top:8px}
.series-nav,.actions {display:flex;flex-wrap:wrap;gap:10px}.series-nav {justify-content:space-between}.actions {justify-content:flex-start;margin-top:24px}
.summary {padding:12px;margin:12px 0}.answer:not(.radios) {grid-template-columns:minmax(120px,200px) minmax(0,290px)}
@media(max-width:700px){.answer:not(.radios){grid-template-columns:1fr}.info{flex-wrap:wrap}.progress progress{flex-basis:100%}}
@media print{.progress,.mark-question,.question-actions,.series-nav,.function-picker,.notation{display:none}}

/* Énoncés complets et consignes de rédaction */
.problem {margin:6px 0 24px;padding:14px 18px;background:#f8f9fa;border:1px solid #dee2e6;border-radius:6px}
.problem p {margin:0 0 8px}
.problem ol {margin:8px 0 0;padding-left:22px}
.problem li {margin:3px 0}
.problem .math {font-size:1.25rem}
.redaction {margin:0 0 24px;color:#495057;font-size:14px}
.redaction summary {cursor:pointer;color:#0f6cbf}
.redaction ul {margin:7px 0 0;padding-left:20px}
.redaction li {margin:3px 0}
.intro {margin:0 0 10px}
.chapter {font-size:13px;color:#495057}
.math {flex-wrap:wrap;row-gap:.3em}.fraction span {white-space:nowrap}
@media(max-width:700px){.math {font-size:1.15rem}.problem {padding:12px 14px}}

.answer .format{grid-column:1/-1;display:block;margin-top:2px;font-size:.85em;color:#555}
.answer input::placeholder{color:#aaa}
.notation-table{border-collapse:collapse;width:100%;max-width:620px;margin:8px 0 4px;background:#fff;border:2px solid #9b1c1c;font-size:14px}
.notation-table th{background:#9b1c1c;color:#fff;text-align:left;padding:8px 12px;font-weight:700}
.notation-table td{padding:7px 12px;border-top:1px solid #e5b4b4;color:#212529}
.notation-table tbody tr:nth-child(even){background:#fdf2f2}
.notation-table td.sym{font-size:16px;font-weight:600;color:#7f1d1d;white-space:nowrap}
.notation-table code{font-family:Consolas,Menlo,monospace;font-size:14px;font-weight:700;color:#b91c1c;background:#fde8e8;padding:2px 6px;border-radius:4px;white-space:pre}
@media(max-width:520px){.notation-table th,.notation-table td{padding:6px 8px}.notation-table th:nth-child(3),.notation-table td:nth-child(3){display:none}}
