/* AMFWin — « Nuit d'étude » (sombre) / « Jour d'étude » (clair) :
   encre bleu nuit ou papier chaud, or, titres serif. Le thème est posé
   par data-theme sur <html> (script de tête, réglable dans Réglages). */
:root {
  --bg: #131522;
  --card: #1c1f31;
  --deep: #0d0f1a;
  --text: #f4f2ec;
  --soft: #c9cddd;
  --muted: #9ba0b8;
  --faint: #6a7089;
  --line: #262b44;
  --line-strong: #2e3350;
  --primary: #d9a441;
  --on-primary: #1a1405;
  --primary-soft: rgba(217, 164, 65, 0.1);
  --primary-line: #4b3d20;
  --ok: #66c993;
  --ok-soft: rgba(102, 201, 147, 0.09);
  --ok-line: #2c5a44;
  --warn: #d9a441;
  --warn-soft: rgba(217, 164, 65, 0.1);
  --danger: #e8927c;
  --danger-soft: rgba(232, 146, 124, 0.1);
  --veil: rgba(19, 21, 34, 0.92);
  --tabbar-bg: rgba(23, 26, 42, 0.94);
  --modal-bg: rgba(5, 6, 12, 0.6);
  --bg-fade: rgba(19, 21, 34, 0);
  --shadow-pill: 0 6px 22px rgba(0, 0, 0, 0.45);
  --shadow-seg: 0 1px 6px rgba(0, 0, 0, 0.35);
  --serif: "Instrument Serif", Georgia, serif;
  --radius: 18px;
  --tabbar-h: calc(60px + env(safe-area-inset-bottom));
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f3ea;
  --card: #fffdf7;
  --deep: #ece7d8;
  --text: #23263a;
  --soft: #454b63;
  --muted: #6f758c;
  --faint: #9298ac;
  --line: #e4ddcc;
  --line-strong: #d6cebb;
  --primary: #b5821c;
  --on-primary: #fffdf5;
  --primary-soft: rgba(181, 130, 28, 0.1);
  --primary-line: #e0c88f;
  --ok: #1e7a4c;
  --ok-soft: rgba(30, 122, 76, 0.09);
  --ok-line: #a7d0ba;
  --warn: #a4700d;
  --warn-soft: rgba(164, 112, 13, 0.11);
  --danger: #bf4f36;
  --danger-soft: rgba(191, 79, 54, 0.09);
  --veil: rgba(246, 243, 234, 0.92);
  --tabbar-bg: rgba(252, 250, 243, 0.94);
  --modal-bg: rgba(48, 42, 24, 0.35);
  --bg-fade: rgba(246, 243, 234, 0);
  --shadow-pill: 0 6px 20px rgba(96, 78, 28, 0.28);
  --shadow-seg: 0 1px 5px rgba(96, 86, 54, 0.22);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: var(--tabbar-h);
  -webkit-font-smoothing: antialiased;
  accent-color: var(--primary);
}

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 18px 10px;
  background: var(--veil);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-family: var(--serif); font-size: 25px; font-weight: 400; letter-spacing: .2px; }
.topbar h1 .dot { color: var(--primary); }

#main { padding: 16px 16px 24px; max-width: 760px; margin: 0 auto; }
.view > * + * { margin-top: 14px; }

h2 { font-family: var(--serif); font-size: 19px; font-weight: 400; margin: 0 0 10px; letter-spacing: .2px; }
.section-title { font-family: var(--serif); font-size: 19px; font-weight: 400; margin: 20px 0 8px; }
.section-title:first-child { margin-top: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 16px;
}

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { text-align: center; padding: 18px 8px 14px; }
.stat-num { font-family: var(--serif); font-size: 40px; font-weight: 400; color: var(--primary); line-height: 1; }
.stat-num.warn { color: var(--danger); }
.stat-num.ok { color: var(--ok); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 6px; }
.tap { cursor: pointer; }

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 8px;
  font-size: 11px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid var(--primary-line);
}
.badge-muted { background: var(--line); color: var(--muted); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--primary-line); }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

.theme-bar { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 12.5px; }
.theme-bar .code { width: 34px; font-weight: 600; color: var(--muted); flex: none; }
.theme-bar .track { flex: 1; background: var(--line); height: 7px; border-radius: 4px; overflow: hidden; }
.theme-bar .fill { height: 100%; background: var(--primary); border-radius: 4px; min-width: 2px; }
.theme-bar .n { width: 34px; text-align: right; font-weight: 600; color: var(--muted); flex: none; }

/* ---- upload ---- */
.dropzone { position: relative; border: 1.5px dashed rgba(217, 164, 65, 0.45); border-radius: var(--radius); background: transparent; }
.dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.dropzone-inner { padding: 30px 18px; text-align: center; pointer-events: none; }
.dropzone-icon { display: flex; justify-content: center; }
.dropzone-icon svg { width: 46px; height: 46px; padding: 10px; border-radius: 16px; background: var(--primary-soft); }
.dropzone-title { font-weight: 600; font-size: 16px; margin-top: 12px; }
.dropzone-sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.55; }

.file-list { margin: 10px 0; font-size: 13px; }
.file-row { display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.file-row:last-child { border-bottom: 0; }
.file-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .size { color: var(--muted); flex: none; }
.file-row .rm { border: 0; background: none; color: var(--danger); font-size: 16px; padding: 4px 8px; }

.progress-track { background: var(--line); border-radius: 6px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--primary); transition: width .3s; }
.progress-text { font-size: 13px; color: var(--muted); margin-top: 10px; }

.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.result-item { background: var(--deep); border: 1px solid var(--line); border-radius: 12px; padding: 12px 10px; text-align: center; }
.result-item b { display: block; font-family: var(--serif); font-size: 24px; font-weight: 400; color: var(--primary); }
.result-item span { font-size: 11.5px; color: var(--muted); }
.error-list { font-size: 12.5px; color: var(--danger); margin: 8px 0; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 14px;
  padding: 11px 16px; font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--soft); }
.btn-danger { background: transparent; border-color: rgba(232, 146, 124, 0.4); color: var(--danger); }
.btn-big { width: 100%; padding: 15px; margin-top: 10px; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 11px; }
.btn svg { flex: none; }

.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.grow { flex: 1; }

/* ---- question cards ---- */
.qcard {
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 14px 15px; margin-bottom: 10px; cursor: pointer;
}
.qcard .q { font-size: 14.5px; font-weight: 500; line-height: 1.5; }
.qcard .a { font-size: 12.5px; color: var(--muted); margin-top: 7px; line-height: 1.55; }
.qcard .a .good { color: var(--ok); font-weight: 600; }
.qcard .meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }

.dup-pair { background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.dup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
@media (max-width: 540px) { .dup-grid { grid-template-columns: 1fr; } }
.dup-q { background: var(--deep); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 12.5px; line-height: 1.5; }
.dup-q .qt { font-weight: 600; font-size: 13px; }
.dup-q ul { margin: 6px 0 0; padding-left: 18px; }
.dup-q .good { color: var(--ok); font-weight: 600; }

/* ---- filters / list ---- */
.filters { display: flex; flex-direction: column; gap: 8px; }
.filters input[type=search] {
  width: 100%; padding: 13px 15px; border: 1px solid var(--line-strong); border-radius: 14px;
  font-size: 15px; font-family: inherit; background: var(--card); color: var(--text); min-height: 48px;
}
.filters input[type=search]::placeholder { color: var(--faint); }
select {
  width: 100%; padding: 12px 13px; border: 1px solid var(--line-strong); border-radius: 14px;
  font-size: 14px; font-family: inherit; background: var(--card); color: var(--text); min-height: 48px;
}
.list-meta { font-size: 12.5px; color: var(--muted); margin: 10px 2px; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: 14px; }

/* ---- export options ---- */
.option { display: flex; gap: 12px; align-items: flex-start; padding: 10px 2px; font-size: 14px; cursor: pointer; }
.option input { margin-top: 3px; width: 19px; height: 19px; flex: none; }
.option small { color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.65; margin: 12px 0 0; }
.hint b, .hint strong { color: var(--soft); }
.hint code { color: var(--primary); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---- modal editor ---- */
.modal { position: fixed; inset: 0; background: var(--modal-bg); z-index: 50; overflow-y: auto; }
.modal-box {
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 22px 22px 0 0; margin-top: 40px;
  min-height: calc(100vh - 40px); padding: 16px 18px calc(20px + env(safe-area-inset-bottom));
  max-width: 760px; margin-left: auto; margin-right: auto;
}
@media (min-width: 760px) { .modal-box { border-radius: 22px; margin: 40px auto; min-height: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-actions {
  display: flex; gap: 8px; margin-top: 18px;
  position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 4px;
}
.modal-actions .btn { flex: 1; }

.field-label { display: block; font-size: 11.5px; font-weight: 600; color: var(--faint); margin: 16px 0 6px; text-transform: uppercase; letter-spacing: 1px; }
textarea, input[type=text], input[type=password] {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 13px;
  font-size: 15px; font-family: inherit; background: var(--card); color: var(--text);
}
textarea::placeholder, input::placeholder { color: var(--faint); }
textarea { resize: vertical; line-height: 1.5; }

.answer-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.answer-row textarea { flex: 1; min-height: 44px; }
.answer-check {
  width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--ok); font-size: 18px; flex: none; cursor: pointer;
}
.answer-check.on { background: var(--ok-soft); border-color: var(--ok-line); }
.answer-rm { width: 34px; height: 44px; border: 0; background: none; color: var(--danger); font-size: 17px; flex: none; cursor: pointer; }

.sources { display: flex; gap: 8px; flex-wrap: wrap; }
.sources img { width: 92px; height: 92px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line-strong); cursor: zoom-in; }

/* ---- toast ---- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 14px);
  background: var(--deep); color: var(--text); font-size: 14px;
  border: 1px solid var(--primary-line);
  padding: 11px 18px; border-radius: 999px; z-index: 100;
  max-width: 88vw; text-align: center;
}
.toast.err { background: #3a1d16; border-color: rgba(232, 146, 124, 0.5); color: var(--danger); }

/* ---- tab bar ---- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; background: var(--tabbar-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; border: 0; background: none; padding: 9px 0 7px;
  font-size: 10.5px; font-weight: 500; font-family: inherit; color: var(--faint);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; position: relative; -webkit-tap-highlight-color: transparent;
}
.tab-icon { display: flex; }
.tab-icon svg { width: 22px; height: 22px; }
.tab.active { color: var(--primary); font-weight: 600; }
.tab-dot {
  position: absolute; top: 5px; right: calc(50% - 17px);
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
}

/* ---- static-app additions ---- */
.warn-card { background: var(--warn-soft); border-color: var(--primary-line); font-size: 14px; line-height: 1.6; }
.export-preview {
  width: 100%; margin: 8px 0 10px; font-size: 12.5px; line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre; overflow-x: auto; background: var(--deep); color: var(--muted);
  border-color: var(--line);
}
.row.wrap { flex-wrap: wrap; }
#settings h2 { margin: 0; }
#provider-badge { font-size: 11px; letter-spacing: .3px; }
.app-version { text-align: center; color: var(--faint); font-size: 11px; margin-top: 18px; }

/* ---- study / quiz ---- */
.quiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.quiz-count { font-size: 12.5px; color: var(--muted); flex: none; }
/* Segmented progress: live green/red map of the session. */
.quiz-progress-seg { display: flex; gap: 2px; height: 9px; align-items: stretch; }
.qseg { flex: 1; min-width: 2px; border-radius: 3px; background: var(--line); transition: background 0.2s; }
.qseg.cur { background: var(--primary); }
.qseg.good { background: var(--ok); }
.qseg.bad { background: var(--danger); }
/* Longue session : barre continue, sans code-barres. */
.quiz-progress-seg.stack { gap: 0; background: var(--line); border-radius: 5px; overflow: hidden; }
.quiz-progress-seg.stack .qseg { flex: 1; min-width: 0; border-radius: 0; }
.quiz-progress-seg.stack .qseg.cur { flex: 0 0 4px; }

.quiz-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.quiz-question { font-size: 17px; font-weight: 500; line-height: 1.5; margin-bottom: 16px; }
.quiz-option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 15px;
  padding: 14px; margin-bottom: 9px; font-size: 14.5px; font-family: inherit; color: var(--soft);
  cursor: pointer; -webkit-tap-highlight-color: transparent; line-height: 1.45;
}
.quiz-option .letter {
  width: 27px; height: 27px; border-radius: 9px; background: var(--line); color: var(--muted);
  font-size: 12.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none;
}
.quiz-option.good { border-color: var(--ok-line); background: var(--ok-soft); color: var(--text); font-weight: 600; }
.quiz-option.good .letter { background: var(--ok); color: #10241a; }
.quiz-option.bad { border-color: rgba(232, 146, 124, 0.5); background: var(--danger-soft); color: var(--text); }
.quiz-option.bad .letter { background: var(--danger); color: #33130b; }
.quiz-option:disabled { cursor: default; opacity: 1; }
.quiz-option.dim { opacity: .45; }
.quiz-feedback {
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 15px;
  padding: 14px; font-size: 13.5px; line-height: 1.6; color: var(--muted); margin-top: 6px;
}
.quiz-bookref { margin-top: 8px; font-size: 12px; color: var(--faint); }
.quiz-score { font-family: var(--serif); font-size: 34px; text-align: center; margin: 24px 0 6px; color: var(--primary); }
/* Action bar pinned above the tab bar: « Valider » / « Question suivante »
   stay under the thumb instead of below the feedback text. */
.quiz-actions {
  position: fixed; left: 0; right: 0; bottom: var(--tabbar-h); z-index: 19;
  padding: 26px 14px 12px; display: none; justify-content: flex-end;
  background: linear-gradient(to top, var(--bg) 55%, var(--bg-fade));
  pointer-events: none;
}
.quiz-actions.vis { display: flex; }
/* ✗ Ratée / ✓ Acquise : en haut, à droite des badges de la question. */
.quiz-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.quiz-meta-row .quiz-meta { margin-bottom: 0; min-width: 0; }
.quiz-marks { display: flex; gap: 6px; flex: none; }
.btn-mark {
  font-family: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 999px;
  cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background 0.15s, color 0.15s;
}
.btn-mark-bad { background: var(--card); color: var(--danger); border: 1.5px solid var(--danger); }
.btn-mark-good { background: var(--card); color: var(--ok); border: 1.5px solid var(--ok); }
.btn-mark-bad.on { background: var(--danger); color: #fff; }
.btn-mark-good.on { background: var(--ok); color: #fff; }
/* Compact pill on the right — where the thumb already rests. */
.quiz-actions .btn {
  pointer-events: auto; margin: 0; width: auto; min-width: 62%;
  min-height: 56px; border-radius: 999px;
  box-shadow: var(--shadow-pill);
}
#study-quiz { padding-bottom: 110px; }
.kbd-hint { display: none; font-size: 11.5px; color: var(--faint); margin: 14px 0 0; }
@media (hover: hover) and (pointer: fine) { .kbd-hint { display: block; } }

/* Wide screens: the mobile type is too small on a monitor — scale up the
   reading surfaces (quiz first) and let the column breathe. */
@media (min-width: 900px) {
  #main { max-width: 880px; }
  .quiz-question { font-size: 25px; line-height: 1.45; margin-bottom: 22px; }
  .quiz-option { font-size: 17.5px; padding: 17px 18px; line-height: 1.5; }
  .quiz-option .letter { width: 32px; height: 32px; font-size: 14px; }
  .quiz-meta .badge { font-size: 12.5px; }
  .quiz-feedback { font-size: 15.5px; }
  .quiz-bookref { font-size: 13.5px; }
  .qcard { font-size: 15px; }
  .stat-row, .theme-bar { font-size: 14px; }
}

/* User text-size tweak (Réglages → Taille du texte), any device. */
:root[data-zoom="large"] body { zoom: 1.15; }
:root[data-zoom="xlarge"] body { zoom: 1.32; }

/* ---- session builder (Réviser) ---- */
.seg {
  display: flex; gap: 4px; background: var(--deep); border: 1px solid var(--line-strong);
  border-radius: 14px; padding: 4px; margin-bottom: 4px;
}
.seg-btn {
  flex: 1; min-height: 42px; padding: 9px 6px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); font-family: inherit; font-size: 13.5px;
  font-weight: 600; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.seg-btn.on { background: var(--card); color: var(--text); box-shadow: var(--shadow-seg); }
.seg-btn:disabled { opacity: 0.4; cursor: default; }
.setup-label { margin: 14px 0 7px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.card-head { margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.card-head .grow { flex: 1; }
.seg-mini { margin-bottom: 0; padding: 3px; border-radius: 11px; }
.seg-mini .seg-btn { min-height: 30px; padding: 5px 10px; font-size: 12px; border-radius: 8px; flex: none; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 7px 13px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--deep);
  color: var(--soft); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip-n { font-size: 11px; font-weight: 700; opacity: 0.65; }
#btn-study-start { margin-top: 16px; }
.size-label { color: var(--primary); font-weight: 700; text-transform: none; letter-spacing: 0; font-size: 13px; }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type="range"] { flex: 1; min-height: 40px; accent-color: var(--primary); }
#size-all.on { border-color: var(--primary); color: var(--primary); }
.list-head { align-items: center; margin-bottom: 4px; }
.list-head .grow { flex: 1; }

.stat-row { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 10px; margin: 9px 0; font-size: 12.5px; }
.stat-row.tap { cursor: pointer; border-radius: 10px; margin: 3px -6px; padding: 6px; }
/* Exam heat: share of the AMF exam carried by the theme/chapter. */
.heat { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.heat-4 { background: #d94f35; box-shadow: 0 0 6px rgba(217, 79, 53, 0.55); }
.heat-3 { background: #dd8433; }
.heat-2 { background: #cfa63f; }
.heat-1 { background: #7b88ad; }
.heat-0 { background: var(--line); }
.heat-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.heat-legend > span { display: inline-flex; align-items: center; }
.heat-legend .heat { margin-right: 4px; }
.stat-row.tap:active { background: var(--deep); }
.row-play { flex: none; display: inline-flex; color: var(--muted); }
.stat-row .k { width: 64px; font-weight: 600; color: var(--muted); flex: none; }
.stat-row .track { flex: 1; background: var(--line); height: 7px; border-radius: 4px; overflow: hidden; }
.stat-row .fill { height: 100%; background: var(--ok); border-radius: 4px; }
.stat-row .fill.bad { background: var(--danger); }
.stat-row .v { width: 44px; text-align: right; color: var(--faint); flex: none; }
.stat-row .vq { width: 44px; text-align: right; color: var(--soft); font-weight: 700; flex: none; }
/* Coverage line: exam share + how much of the estimated pool we hold. */
.stat-sub { flex-basis: 100%; margin: -1px 0 1px 19px; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
/* Couverture du pool : petite couleur discrète (rouge doux → ambre → vert doux). */
.stat-sub .cov { font-weight: 600; }
.cov-lo { color: #c2705a; }
.cov-mid { color: #b8935a; }
.cov-hi { color: #5a9a6f; }
/* Finance durable — the one cross-cutting sub-topic row, set apart with a green accent. */
.esg-row { background: rgba(63, 174, 106, 0.10); box-shadow: inset 3px 0 0 #3fae6a; }
.esg-row .k { color: #2f8f57; font-weight: 700; }
.worst-row { padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.45; cursor: pointer; }
.worst-row:last-child { border-bottom: 0; }
.worst-row .w-meta { color: var(--danger); font-size: 11.5px; margin-top: 3px; }
.quiz-option.sel { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.quiz-option.sel .letter { background: var(--primary); color: var(--on-primary); }
