/* Le Capital — outil de lecture et d'écoute. Le texte d'abord : une colonne
   étroite en serif pour les résumés, l'interface en sans-serif autour. */

:root {
  color-scheme: light;
  --ground:      #faf8f5;
  --surface:     #ffffff;
  --surface-2:   #f1ede7;
  --ink:         #1b1915;
  --ink-2:       #5e5850;
  --ink-3:       #948c82;
  --rule:        #e6e0d7;
  --rule-strong: #cfc6b9;
  --accent:      #b3261e;
  --accent-ink:  #ffffff;
  --accent-soft: #f8e6e3;
  --good:        #2f7d4f;
  --good-soft:   #e3f1e8;
  --mark-surligne: #fff1a8;
  --mark-creuser:  #d8ecff;
  --mark-desaccord:#ffdcd6;
  --mark-question: #e5dcff;
  --shadow: 0 1px 2px rgba(27,25,21,.05), 0 10px 30px -20px rgba(27,25,21,.35);
  --sans: "Public Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Iowan Old Style", "Charter", "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #16140f; --surface: #1f1c17; --surface-2: #29251e;
    --ink: #f1ece4; --ink-2: #b6ada0; --ink-3: #847b6f;
    --rule: #332e26; --rule-strong: #474035;
    --accent: #ef6a5f; --accent-ink: #1b1915; --accent-soft: #3a211d;
    --good: #5cbf85; --good-soft: #1b2e22;
    --mark-surligne: #5b4d12; --mark-creuser: #1d3a57; --mark-desaccord: #5a2620; --mark-question: #3b2d63;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -20px rgba(0,0,0,.9);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #16140f; --surface: #1f1c17; --surface-2: #29251e;
  --ink: #f1ece4; --ink-2: #b6ada0; --ink-3: #847b6f;
  --rule: #332e26; --rule-strong: #474035;
  --accent: #ef6a5f; --accent-ink: #1b1915; --accent-soft: #3a211d;
  --good: #5cbf85; --good-soft: #1b2e22;
  --mark-surligne: #5b4d12; --mark-creuser: #1d3a57; --mark-desaccord: #5a2620; --mark-question: #3b2d63;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.mark {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-family: var(--serif); font-weight: 700; font-size: 19px;
}
.brand-sur {
  display: block; font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent); line-height: 1.3;
}
.brand-title { display: block; font-weight: 700; letter-spacing: -.01em; }
.brand-sub { display: block; font-size: 12px; color: var(--ink-2); }
.tabs { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.tabs a {
  text-decoration: none; padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.tabs a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.badge { font-size: 11px; background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 6px; font-weight: 600; }

/* Ce qui demande un compte, là où le contenu se serait affiché. */
.invite {
  border: 1px solid var(--rule); border-radius: 12px; background: var(--surface);
  padding: 20px; text-align: center; margin: 16px 0;
}
.invite p { margin: 0 0 14px; color: var(--ink-2); }
.invite b { color: var(--ink); }

main { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; outline: none; }

/* ---------- Accueil ---------- */
.hero { margin: 8px 0 24px; }
.hero h1 { font-family: var(--serif); font-size: 30px; line-height: 1.15; margin: 0 0 6px; letter-spacing: -.01em; }
.hero p { margin: 0; color: var(--ink-2); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 8px; }
.stat { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--ink-2); }
.continue {
  display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; padding: 12px 14px;
  background: var(--accent-soft); border-radius: 12px; text-decoration: none;
}
.continue b { display: block; }
.continue span { font-size: 13px; color: var(--ink-2); }
.continue .go { margin-left: auto; font-weight: 600; color: var(--accent); }

.livre { margin: 28px 0 8px; }
/* Un seul livre à la fois : les trois titres deviennent des onglets. */
.livres { display: flex; gap: 22px; border-bottom: 2px solid var(--rule); }
.livres a {
  font-family: var(--serif); font-size: 21px; color: var(--ink-3); text-decoration: none;
  padding-bottom: 8px; margin-bottom: -2px; border-bottom: 2px solid transparent; white-space: nowrap;
}
.livres a:hover { color: var(--ink-2); }
.livres a.on { color: var(--ink); border-bottom-color: var(--accent); }
.livre-info { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.livre-titre { font-size: 14px; color: var(--ink-2); }
.livre-info .meta { font-size: 12.5px; color: var(--ink-2); margin-left: auto; }
.meter { height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin: 8px 0 4px; }
.meter i { display: block; height: 100%; background: var(--accent); }
details.section { border-bottom: 1px solid var(--rule); }
details.section > summary {
  list-style: none; cursor: pointer; padding: 12px 0; display: flex; gap: 10px; align-items: baseline;
}
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::before { content: "›"; color: var(--ink-3); transition: transform .15s; display: inline-block; width: 10px; }
details.section[open] > summary::before { transform: rotate(90deg); }
.section-title { font-weight: 600; }
.section-num { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.section-count { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.chap-list { list-style: none; margin: 0 0 10px; padding: 0; }
.chap {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 10px; border-radius: 10px; text-decoration: none;
}
.chap:hover { background: var(--surface); }
.chap .n { font-family: var(--mono); font-size: 12px; color: var(--ink-3); text-align: right; }
.chap .t { line-height: 1.3; }
.chap .t small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.chap.todo .t { color: var(--ink-3); }
.pill { font-size: 11px; border-radius: 99px; padding: 2px 8px; white-space: nowrap; border: 1px solid var(--rule-strong); color: var(--ink-2); }
.pill.ecoute { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.pill.lu { background: var(--surface-2); border-color: transparent; color: var(--ink); }
.pill.maitrise { background: var(--good-soft); border-color: transparent; color: var(--good); }

/* ---------- Fiche chapitre ---------- */
.crumbs { font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.crumbs a { text-decoration: none; }
.chapter-title { font-family: var(--serif); font-size: 29px; line-height: 1.15; margin: 0 0 10px; letter-spacing: -.01em; }
.these { font-family: var(--serif); font-size: 18px; line-height: 1.45; color: var(--ink-2); margin: 0 0 16px; font-style: italic; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.btn {
  border: 1px solid var(--rule-strong); background: var(--surface); border-radius: 10px;
  padding: 8px 14px; cursor: pointer; font-weight: 500; font-size: 14px; display: inline-flex; gap: 6px; align-items: center;
  text-decoration: none;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--accent); }
.status-select { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.status-select button { border: 0; background: transparent; padding: 5px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.status-select button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.subtabs { display: flex; gap: 18px; border-bottom: 1px solid var(--rule); margin: 8px 0 18px; }
.subtabs button { border: 0; background: none; padding: 10px 0; cursor: pointer; font-weight: 500; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs button.on { color: var(--ink); border-color: var(--accent); }

.phrase { font-size: 15.5px; background: var(--surface); border-left: 3px solid var(--accent); padding: 12px 14px; border-radius: 0 10px 10px 0; margin: 0 0 20px; }
.warning { font-size: 13px; background: var(--surface-2); padding: 10px 12px; border-radius: 10px; color: var(--ink-2); margin: 0 0 18px; }
.prose p, .prose h3 { font-family: var(--serif); }
.prose p { font-size: 18px; line-height: 1.62; margin: 0 0 1em; }
.prose h3 { font-size: 19px; margin: 1.6em 0 .6em; }
.prose .table { font-family: var(--mono); font-size: 12px; color: var(--ink-2); background: var(--surface-2); padding: 10px; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; }
.prose p.playing { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); border-radius: 6px; }
mark.anno { color: inherit; border-radius: 3px; padding: 0 1px; cursor: pointer; }
mark.anno.surlignage { background: var(--mark-surligne); }
mark.anno.creuser { background: var(--mark-creuser); }
mark.anno.desaccord { background: var(--mark-desaccord); }
mark.anno.question { background: var(--mark-question); }
mark.anno.has-note { text-decoration: underline dotted; text-underline-offset: 3px; }

.block { margin: 30px 0; }
.block > h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 10px; font-weight: 600; }
.concepts { display: grid; gap: 8px; }
.concept { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; }
.concept b { display: block; margin-bottom: 2px; }
.concept span { color: var(--ink-2); font-size: 14px; }
blockquote { margin: 0 0 12px; padding: 4px 0 4px 14px; border-left: 2px solid var(--rule-strong); font-family: var(--serif); font-size: 17px; line-height: 1.5; font-style: italic; }
.cite-src { font-size: 12px; color: var(--ink-3); }
ul.plain { margin: 0; padding-left: 18px; }
ul.plain li { margin-bottom: 6px; }
.quiz { display: grid; gap: 8px; }
.quiz details { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; }
.quiz summary { cursor: pointer; font-weight: 500; }
.quiz details p { margin: 8px 0 0; color: var(--good); }
.figure { background: var(--surface); border: 1px dashed var(--rule-strong); border-radius: 10px; padding: 12px; font-size: 14px; color: var(--ink-2); margin-bottom: 8px; }
.figure img { width: 100%; height: auto; display: block; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.links a { font-size: 13px; text-decoration: none; background: var(--surface-2); border-radius: 99px; padding: 4px 10px; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 36px; border-top: 1px solid var(--rule); padding-top: 16px; }
.pager a { text-decoration: none; max-width: 48%; font-size: 14px; }
.pager small { display: block; color: var(--ink-3); font-size: 12px; }
.pager .next { text-align: right; margin-left: auto; }
.notes-list { font-size: 14px; color: var(--ink-2); padding-left: 22px; }
.notes-list li { margin-bottom: 8px; }
.empty { color: var(--ink-3); padding: 30px 0; text-align: center; }

/* ---------- Glossaire & notes ---------- */
.search { width: 100%; padding: 10px 12px; font: inherit; border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--surface); color: var(--ink); margin-bottom: 16px; }
.gloss { border-bottom: 1px solid var(--rule); padding: 12px 0; }
.gloss h3 { font-size: 16px; margin-bottom: 4px; }
.gloss p { margin: 4px 0; color: var(--ink-2); font-size: 14px; }
.gloss a { font-size: 12px; font-family: var(--mono); color: var(--accent); text-decoration: none; margin-right: 6px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filters button { border: 1px solid var(--rule-strong); background: var(--surface); border-radius: 99px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.filters button.on { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.note-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.note-card .q { font-family: var(--serif); font-size: 16px; margin: 6px 0; }
.note-card .n { font-size: 14px; }
.note-card .meta { font-size: 12px; color: var(--ink-3); display: flex; gap: 8px; }
.note-card .meta a { color: var(--accent); text-decoration: none; }
.tag { font-size: 11px; border-radius: 99px; padding: 1px 8px; }
.tag.surlignage { background: var(--mark-surligne); }
.tag.creuser { background: var(--mark-creuser); }
.tag.desaccord { background: var(--mark-desaccord); }
.tag.question { background: var(--mark-question); }

/* ---------- Annotation ---------- */
.anno-fab {
  position: fixed; z-index: 40; transform: translate(-50%, -100%);
  background: var(--ink); color: var(--ground); border: 0; border-radius: 99px; padding: 8px 14px;
  font-weight: 600; font-size: 14px; box-shadow: var(--shadow); cursor: pointer;
}
dialog.sheet {
  border: 0; border-radius: 16px; padding: 18px; width: min(520px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
dialog.sheet::backdrop { background: rgba(0,0,0,.35); }
.sheet-quote { font-family: var(--serif); font-style: italic; margin: 0 0 12px; max-height: 6.5em; overflow: auto; color: var(--ink-2); }
.tags { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags input { position: absolute; opacity: 0; }
.tags span { display: inline-block; border: 1px solid var(--rule-strong); border-radius: 99px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.tags input:checked + span { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.tags input:focus-visible + span { outline: 2px solid var(--accent); }
textarea { width: 100%; font: inherit; border: 1px solid var(--rule-strong); border-radius: 10px; padding: 10px; background: var(--ground); color: var(--ink); resize: vertical; }
.sheet-actions { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.grow { flex: 1; }

/* ---------- Lecteur ---------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--rule); box-shadow: 0 -10px 30px -20px rgba(0,0,0,.4);
  padding: 0 12px calc(10px + env(safe-area-inset-bottom));
}
.player-bar { height: 18px; display: flex; align-items: center; cursor: pointer; }
.player-bar::before { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--surface-2); }
.player-bar span { position: relative; height: 3px; background: var(--accent); width: 0; }
.player-row { display: flex; align-items: center; gap: 6px; max-width: 760px; margin: 0 auto; }
.icon-btn { border: 0; background: transparent; min-width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.play { background: var(--accent); color: var(--accent-ink); font-size: 16px; width: 44px; height: 44px; border-radius: 50%; }
.player-meta { flex: 1; min-width: 0; padding: 0 6px; }
.player-meta a { display: block; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-meta span { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 560px) {
  .topbar { padding-left: 16px; padding-right: 16px; }
  .tabs { width: 100%; }
  .tabs a { flex: 1; justify-content: center; padding: 6px 4px; }
  .hero h1 { font-size: 25px; }
  .chapter-title { font-size: 24px; }
  .prose p { font-size: 17.5px; }
  .stat b { font-size: 19px; }
  /* Huit commandes sur 375 px : on resserre plutôt que de laisser le titre
     se réduire à trois points. */
  .player { padding-left: 6px; padding-right: 6px; }
  .player-row { gap: 2px; }
  .icon-btn { min-width: 32px; padding: 0; }
  #p-back, #p-fwd { min-width: 30px; font-size: 12px; }
  .player-meta { padding: 0 2px; }
  .player-meta a { font-size: 13px; }
  .player-meta span { font-size: 11px; }
  .icon-btn.play { width: 40px; height: 40px; }
  .livres { gap: 16px; }
  .livres a { font-size: 19px; }
}

/* Version publiée : lien de déconnexion injecté par deploy/build_site.py */
.logout { text-decoration: none; color: var(--ink-3); font-size: 18px; padding: 4px 6px; border-radius: 8px; }
.logout:hover { background: var(--surface-2); color: var(--ink); }

/* Réponses de Claude aux « Questions pour Claude » */
.reponse { margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: 14.5px; }
.reponse > b { color: var(--accent); }
.reponse p { margin: 6px 0 0; line-height: 1.55; }
.attente { font-size: 13px; color: var(--ink-3); font-style: italic; margin: 8px 0 0; }

/* ---------- Reprise et enchaînement (à la manière des plateformes de séries) ---------- */
.resume {
  display: flex; align-items: center; gap: 14px; width: 100%; margin: 16px 0 6px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow);
  text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.resume:hover { border-color: var(--rule-strong); }
.resume-play {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 18px; padding-left: 3px;
}
.resume-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.resume-txt small { font-size: 12px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.resume-txt b { font-family: var(--serif); font-size: 18px; line-height: 1.25; }
.resume-txt > span { font-size: 13px; color: var(--ink-2); }
.meter.thin { display: block; height: 3px; margin: 6px 0 0; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.meter.thin i { display: block; height: 100%; background: var(--accent); }
.meter.thin.done i { background: var(--good); }
.btn.small { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.livre-head .btn.small { margin-left: 4px; }

.icon-btn.auto { font-size: 15px; opacity: .45; }
.icon-btn.auto.on { opacity: 1; color: var(--accent); }

.next-up {
  display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 8px auto 0;
  padding: 10px 12px; background: var(--surface-2); border-radius: 12px;
}
.next-ring {
  --p: 0%; flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) var(--p), var(--rule) 0); position: relative; font-weight: 700; font-size: 14px;
}
.next-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface-2); }
.next-ring span { position: relative; }
.next-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.next-txt small { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.next-txt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Citation du jour ---------- */
.citation-jour {
  margin: 18px 0 6px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--rule);
  border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0;
}
.citation-jour blockquote { margin: 0; padding: 0; border: 0; font-size: 17px; }
.citation-jour figcaption { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.citation-jour figcaption a { color: var(--accent); text-decoration: none; }

/* ---------- Le Labo ---------- */
.labo { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; }
.labo h2 { font-family: var(--serif); font-size: 20px; display: flex; align-items: baseline; gap: 10px; }
.labo-chap { font-family: var(--mono); font-size: 11px; color: var(--accent); text-decoration: none; margin-left: auto; }
.labo-intro { margin: 6px 0 14px; font-size: 14px; color: var(--ink-2); }
.labo-controles { display: grid; gap: 10px; margin-bottom: 14px; }
.curseur span { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.curseur b { color: var(--ink); font-variant-numeric: tabular-nums; }
.curseur input[type="range"] { width: 100%; accent-color: var(--accent); }
.bascule { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.bascule input { accent-color: var(--accent); width: 16px; height: 16px; }
.bande { display: flex; width: 100%; border-radius: 6px; overflow: hidden; margin-bottom: 6px; background: var(--surface-2); }
.bande span {
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600;
  color: var(--ink); white-space: nowrap; overflow: hidden; transition: width .12s ease-out;
}
.b-gris { background: var(--surface-2); } .b-bleu { background: var(--mark-creuser); }
.b-acc { background: var(--accent-soft); color: var(--accent); } .b-or { background: #f3e2b8; }
.b-vert { background: var(--good-soft); } .b-vide { background: transparent; }
:root[data-theme="dark"] .b-or, :root:not([data-theme="light"]) .b-or { background: #4a3c17; }
.courbe { width: 100%; height: 120px; background: var(--surface-2); border-radius: 8px; }
.labo-chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 8px; }
.labo-chiffres div { background: var(--ground); border-radius: 10px; padding: 8px 10px; }
.labo-chiffres b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.labo-chiffres span { font-size: 11.5px; color: var(--ink-2); }
.labo-note { margin: 0; font-size: 13.5px; color: var(--ink-2); font-style: italic; min-height: 2.6em; }
.labo-pied { text-align: center; font-size: 12.5px; color: var(--ink-3); margin: 22px 0 8px; }
@media (max-width: 560px) { .labo-chiffres { grid-template-columns: 1fr 1fr; } }

/* ---------- La BD ---------- */
.planches { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.planche-carte {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
.planche-carte:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--rule-strong); }
.planche { margin: 0; background: var(--surface); padding: 10px; }
.planche img { width: 100%; height: auto; display: block; }
.planche.grande { border: 1px solid var(--rule); border-radius: 14px; padding: 14px; margin-bottom: 18px; }
.planche-txt { padding: 2px 14px 14px; display: block; }
.planche-txt small { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.planche-txt b { display: block; font-family: var(--serif); font-size: 17px; margin: 2px 0 4px; }
.planche-txt span { font-size: 13px; color: var(--ink-2); }

/* ---------- « En clair » ---------- */
.enclair {
  background: var(--accent-soft); border-radius: 14px; padding: 14px 16px; margin: 4px 0 18px;
  border-left: 4px solid var(--accent);
}
.enclair h2 {
  font-family: var(--serif); font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 6px;
}
.enclair p { margin: 0; font-size: 15.5px; line-height: 1.6; }
.enclair-bd {
  display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; text-decoration: none;
  background: var(--surface); border-radius: 99px; padding: 5px 12px;
}

/* La bande dessinée en tête de résumé */
.planche.bande { border: 1px solid var(--rule); border-radius: 14px; padding: 8px; margin: 0 0 16px; }

/* Passage du résumé au texte intégral */
.icon-btn.niveau { font-size: 12px; padding: 0 10px; min-width: 0; border: 1px solid var(--rule-strong); }
.icon-btn.niveau.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.astuce { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-radius: 10px; padding: 8px 12px; margin: 0 0 14px; }
[data-zone="texte"] p[data-t] { cursor: pointer; }
[data-zone="texte"] p[data-t]:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); border-radius: 6px; }

/* Bouton de voix du lecteur (Denise / Rémy) */
.icon-btn.voix { font-size: 17px; line-height: 1; }
