/* PROMPT — design épuré et moderne.
   Schibsted Grotesk pour le titre et l'interface, Literata pour lire. Un seul accent : l'or du curseur. */
@font-face { font-family: "Grotesk"; src: url("../fonts/schibsted-grotesk-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Grotesk"; src: url("../fonts/schibsted-grotesk-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Grotesk"; src: url("../fonts/schibsted-grotesk-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Literata"; src: url("../fonts/literata-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Literata"; src: url("../fonts/literata-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Literata"; src: url("../fonts/literata-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "OpenDyslexic"; src: url("../fonts/opendyslexic-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #f5f5f2; --surface: #ffffff; --surface-2: #ecebe7; --ink: #1b1b1f; --ink-2: #5d5d66; --muted: #6b6b73; --rule: #e2e1dc;
  --gold: #b08a4e; --gold-text: #7d6136;
  --ui: "Grotesk", "Helvetica Neue", Arial, sans-serif; --read: "Literata", Georgia, serif;
  --r: 12px; --gutter: clamp(20px, 5vw, 64px); --max: 72rem; color-scheme: light;
}
html[data-theme="sepia"] { --bg: #f2e8d6; --surface: #faf3e6; --surface-2: #e9dcc4; --ink: #3a2e22; --ink-2: #6b5a45; --muted: #6b5a45; --rule: #ddcdb1; --gold-text: #7a5c30; }
html[data-theme="nuit"] { --bg: #131417; --surface: #1b1c20; --surface-2: #23252a; --ink: #e4e1da; --ink-2: #a6a39c; --muted: #a6a39c; --rule: #2c2e33; --gold: #cfae78; --gold-text: #cfae78; color-scheme: dark; }
html[data-theme="contraste"] { --bg: #ffffff; --surface: #ffffff; --surface-2: #f0f0f0; --ink: #000000; --ink-2: #1f1f1f; --muted: #2e2e2e; --rule: #000000; --gold: #6b4e1f; --gold-text: #5a4119; }
html[data-font="lisible"] { --read: "Atkinson", Verdana, sans-serif; --ui: "Atkinson", Verdana, sans-serif; }
html[data-font="dys"] { --read: "OpenDyslexic", Verdana, sans-serif; --ui: "OpenDyslexic", Verdana, sans-serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
html[data-motion="off"] *, html[data-motion="off"] *::before { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--ui); font-size: 1rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }
html[data-size="l"] body { font-size: 1.12rem; } html[data-size="xl"] body { font-size: 1.24rem; }
html[data-lh="aere"] body { line-height: 1.9; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-text); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 99; background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: var(--r); }
.skip:focus { left: .5rem; top: .5rem; }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 40rem; }

/* Le curseur doré — l'unique élément animé */
.cur { display: inline-block; width: .09em; height: .74em; margin-left: .06em; background: var(--gold); border-radius: 1px; vertical-align: baseline; animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3rem; padding: .7rem 1.4rem; font: 500 .98rem var(--ui); text-decoration: none; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); cursor: pointer; transition: transform .15s, background .2s, color .2s, border-color .2s; }
.btn:hover { color: var(--bg); background: color-mix(in srgb, var(--ink) 85%, var(--gold)); }
.btn:active { transform: scale(.98); }
.btn.line { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.line:hover { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn:disabled { opacity: .6; cursor: default; }
.btns { display: flex; flex-wrap: wrap; gap: .7rem; }

/* En-tête */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid var(--rule); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; position: relative; }
.brand { font: 700 1.3rem var(--ui); letter-spacing: -.03em; text-decoration: none; color: var(--ink); }
.top nav { display: flex; align-items: center; gap: clamp(.8rem, 2.4vw, 1.8rem); }
.top nav a { text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .95rem; }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }
.aa { min-width: 2.6rem; height: 2.4rem; padding: 0 .7rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--rule); color: var(--ink); font-weight: 700; cursor: pointer; }
.aa:hover, .aa[aria-expanded="true"] { border-color: var(--ink); }

/* Panneau Affichage et accessibilité */
.prefs { position: absolute; right: var(--gutter); top: calc(100% + 8px); width: min(25rem, calc(100vw - 2 * var(--gutter))); max-height: calc(100vh - 90px); overflow-y: auto; z-index: 70; background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 18px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.35); padding: 1.1rem 1.2rem 1rem; display: grid; gap: .9rem; }
.prefs[hidden] { display: none; }
.pref p { margin: 0 0 .4rem; font-size: .82rem; color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: .35rem; }
.seg button { min-height: 2.4rem; padding: .3rem .85rem; border-radius: 999px; background: var(--bg); color: var(--ink); border: 1px solid var(--rule); cursor: pointer; font-size: .9rem; }
.seg button:hover { border-color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.f-lisible { font-family: "Atkinson", sans-serif !important; } .f-dys { font-family: "OpenDyslexic", sans-serif !important; }
.pref-foot { display: flex; justify-content: space-between; border-top: 1px solid var(--rule); padding-top: .7rem; }
.pref-foot button { background: none; border: 0; color: var(--ink-2); cursor: pointer; padding: .4rem 0; text-decoration: underline; text-underline-offset: 3px; font-size: .9rem; }

/* Accueil : le titre, puis le temps */
.hero { min-height: calc(100svh - 64px); display: grid; align-content: center; gap: clamp(1.6rem, 4vh, 2.6rem); padding: clamp(3rem, 8vh, 6rem) var(--gutter) clamp(3rem, 7vh, 5rem); max-width: var(--max); margin-inline: auto; }
.title { font: 700 clamp(5rem, 21vw, 17rem)/.86 var(--ui); letter-spacing: -.065em; margin: 0 0 0 -.05em; color: var(--ink); }
.title .cur { width: .075em; height: .7em; margin-left: .05em; }
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, max-content)); gap: 0; justify-content: start; font-variant-numeric: tabular-nums; }
.countdown p { margin: 0; padding: .2rem clamp(1rem, 3vw, 2.4rem) .2rem 0; display: grid; gap: .25rem; }
.countdown p + p { padding-left: clamp(1rem, 3vw, 2.4rem); border-left: 1px solid var(--rule); }
.countdown b { font: 500 clamp(2rem, 5.6vw, 3.6rem)/1 var(--ui); letter-spacing: -.03em; }
.countdown p:last-of-type b { color: var(--gold); }
.countdown span { font-size: .85rem; color: var(--muted); }
.countdown .sep { display: none; }
.continue[hidden] { display: none; }

/* Compteurs */
.stats { display: flex; flex-wrap: wrap; gap: .4rem clamp(1.6rem, 5vw, 3.6rem); max-width: var(--max); margin-inline: auto; padding: 1.4rem var(--gutter); border-top: 1px solid var(--rule); }
.stat { margin: 0; display: flex; align-items: baseline; gap: .45rem; }
.stat b { font: 500 1.35rem var(--ui); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .95rem; }

/* Sections */
.sec { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.sec.alt { background: var(--surface); border-block: 1px solid var(--rule); }
.mini { font: 700 clamp(1.6rem, 3.6vw, 2.4rem)/1.1 var(--ui); letter-spacing: -.03em; margin: 0 0 1.6rem; color: var(--ink); }

/* Sommaire */
.toc { list-style: none; margin: 0; padding: 0; }
.toc li { border-top: 1px solid var(--rule); }
.toc li:last-child { border-bottom: 1px solid var(--rule); }
.toc a, .toc .locked { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 1.25rem .2rem; text-decoration: none; color: inherit; border-radius: var(--r); transition: background .2s; }
.toc a:hover { background: var(--surface-2); color: inherit; }
.toc .num { font: 500 .95rem var(--ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.toc .t { font: 500 1.25rem var(--ui); letter-spacing: -.01em; }
.toc .m { display: block; font-size: .88rem; color: var(--muted); margin-top: .15rem; }
.cs { display: inline-flex; gap: .9rem; }
.toc .go { font-weight: 500; color: var(--ink); }
.toc .locked { color: var(--muted); }
.toc .locked .t { filter: blur(4px); user-select: none; }
.toc .locked .go { color: var(--muted); }
.toc li.done .num::after { content: " ✓"; color: var(--gold-text); }

/* Abonnement */
form.mail { display: grid; gap: .6rem; }
.field { display: flex; gap: .5rem; padding: .35rem; background: var(--bg); border: 1px solid var(--rule); border-radius: 999px; }
.field:focus-within { border-color: var(--ink); }
.field input { flex: 1; min-width: 0; border: 0; background: transparent; padding: .55rem .9rem; font: inherit; font-size: 1rem; color: var(--ink); outline: none; }
.field .btn { min-height: 2.7rem; }
.small { font-size: .86rem; color: var(--muted); margin: 0; }
.note { min-height: 1.4em; margin: 0; font-size: .9rem; color: var(--gold-text); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }

/* Pied */
.foot { padding: 2.6rem 0 3rem; border-top: 1px solid var(--rule); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.foot .brand { font-size: 1.15rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.foot nav a { text-decoration: none; color: var(--ink-2); font-size: .92rem; }
.foot nav a:hover { color: var(--ink); }

/* ——— Lecture ——— */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--gold); z-index: 40; border-radius: 0 3px 3px 0; }
.chap-head { max-width: 40rem; margin: 0 auto; padding: clamp(3rem, 8vw, 5.5rem) var(--gutter) .5rem; }
.chap-head h1 { font: 700 clamp(2.6rem, 8vw, 4.6rem)/.95 var(--ui); letter-spacing: -.05em; margin: 0 0 1.1rem; }
.chap-head .meta { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin: 0; color: var(--muted); font-size: .92rem; }
.chap-head .meta b { color: var(--ink); font-weight: 500; }
.tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.3rem; }
.tools button { min-height: 2.5rem; padding: .35rem 1rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--rule); color: var(--ink); cursor: pointer; font-size: .92rem; display: inline-flex; align-items: center; gap: .4rem; }
.tools button:hover { border-color: var(--ink); }
.tools svg { width: 15px; height: 15px; }
.vote[aria-pressed="true"], #listen[aria-pressed="true"] { background: var(--ink) !important; color: var(--bg) !important; border-color: var(--ink) !important; }
.vote[aria-pressed="true"] svg { color: var(--gold); }

.reading { --fs: 1.16rem; max-width: 40rem; margin: 0 auto; padding: 2.2rem var(--gutter) 2.5rem; font-family: var(--read); font-size: var(--fs); line-height: 1.8; }
html[data-size="s"] .reading { --fs: 1.02rem; } html[data-size="l"] .reading { --fs: 1.32rem; } html[data-size="xl"] .reading { --fs: 1.52rem; }
html[data-lh="aere"] .reading { line-height: 2.1; }
html[data-sp="large"] .reading, html[data-sp="large"] .c-text { letter-spacing: .06em; word-spacing: .16em; }
.reading p { margin: 0; text-indent: 1.5em; text-align: justify; hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 6 3 2; orphans: 2; widows: 2; position: relative; }
.reading p.first { text-indent: 0; }
.reading p.first::first-letter { float: left; font: 700 3.9em/.78 var(--ui); letter-spacing: -.04em; padding: .06em .12em 0 0; }
.reading p.first + p { clear: left; }
.reading p.scene { text-indent: 0; text-align: center; color: var(--gold); letter-spacing: .5em; margin: 2rem 0; }
.reading p.scene + p { text-indent: 0; }
.reading p.demo { text-indent: 0; text-align: center; font: .82rem var(--ui); color: var(--muted); background: var(--surface-2); border-radius: var(--r); padding: .6rem; margin-bottom: 2rem; }
html[data-align="gauche"] .reading p, html[data-font="lisible"] .reading p, html[data-font="dys"] .reading p { text-align: left; hyphens: manual; }
html[data-font="lisible"] .reading p.first::first-letter, html[data-font="dys"] .reading p.first::first-letter { float: none; font: inherit; padding: 0; }

@media (max-width: 640px) { .reading { --fs: 1.08rem; line-height: 1.74; } }

/* Bulles par paragraphe */
.bubble { position: absolute; right: -2.8rem; top: .25em; min-width: 1.9rem; height: 1.7rem; display: inline-grid; place-items: center; padding: 0 .35rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--muted); font: 500 .74rem var(--ui); text-indent: 0; letter-spacing: 0; cursor: pointer; opacity: .45; transition: opacity .15s, border-color .15s, color .15s; }
.bubble::before { content: ""; position: absolute; inset: -9px; }
.reading p:hover .bubble, .bubble:focus-visible, .bubble.has { opacity: 1; }
.bubble.has { color: var(--ink); border-color: var(--gold); }
.bubble:hover { border-color: var(--ink); color: var(--ink); }
@media (max-width: 900px) { .bubble { position: relative; right: auto; top: -.1em; margin-left: .35rem; opacity: .7; } }

/* Fin de chapitre */
.after { max-width: 40rem; margin: 0 auto; padding: 2rem var(--gutter) 2.6rem; display: grid; gap: 1.2rem; justify-items: center; }
.reactions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.rx { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.9rem; min-width: 3.3rem; justify-content: center; padding: .4rem .85rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; cursor: pointer; font: 500 .88rem var(--ui); color: var(--ink); transition: transform .12s, border-color .15s; }
.rx .e { font-size: 1.3rem; line-height: 1; }
.rx:hover { border-color: var(--ink); }
.rx:active { transform: scale(.94); }
.rx[aria-pressed="true"] { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
.after-act { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.after .vote { display: inline-flex; align-items: center; gap: .5rem; min-height: 3rem; padding: .6rem 1.3rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--ink); color: var(--ink); cursor: pointer; font-weight: 500; }
.after .vote svg { width: 17px; height: 17px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; max-width: 40rem; margin: 0 auto; padding: 0 var(--gutter) 3.5rem; }
.pager a, .pager span { display: block; padding: 1rem 1.2rem; border: 1px solid var(--rule); border-radius: var(--r); text-decoration: none; background: var(--surface); }
.pager a:hover { border-color: var(--ink); color: inherit; }
.pager small { display: block; font-size: .82rem; color: var(--muted); }
.pager b { font-weight: 500; font-size: 1.05rem; }
.pager .nxt { text-align: right; }
.pager span { color: var(--muted); background: transparent; }

/* Commentaires */
.comments .wrap { max-width: 44rem; }
.c-form { display: grid; gap: .5rem; }
.c-row { display: grid; grid-template-columns: 10rem minmax(0, 1fr) auto; gap: .5rem; align-items: start; }
.c-row input, .c-row textarea { font: inherit; font-size: 1rem; padding: .75rem .9rem; background: var(--bg); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r); min-height: 3rem; }
.c-row textarea { resize: vertical; }
.c-row input:focus, .c-row textarea:focus { border-color: var(--ink); outline: none; }
.btn.send { width: 3rem; min-width: 3rem; padding: 0; font-size: 1.15rem; border-radius: 50%; }
.replying { font-size: .85rem; color: var(--ink-2); margin: 0; }
.replying button { background: none; border: 0; cursor: pointer; font-size: 1rem; color: var(--ink-2); }
.spoil-opt { display: inline-flex; align-items: center; gap: .45rem; font-size: .86rem; color: var(--ink-2); cursor: pointer; }
.spoil-opt input { accent-color: var(--gold); }
.c-list { list-style: none; margin: 1.8rem 0 0; padding: 0; }
.c-item { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: .9rem; padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.c-av { width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 700; }
.c-meta { margin: 0; }
.c-meta b { font-weight: 700; }
.c-meta time { font-size: .82rem; color: var(--muted); margin-left: .5rem; }
.c-text { margin: .2rem 0 0; font-family: var(--read); }
.c-act { display: flex; gap: 1.1rem; margin: .4rem 0 0; }
.c-act button { background: none; border: 0; padding: .25rem 0; cursor: pointer; font-size: .86rem; font-weight: 500; color: var(--muted); }
.c-act button:hover, .like[aria-pressed="true"] { color: var(--gold-text); }
.c-replies { list-style: none; margin: .5rem 0 0; padding: 0 0 0 .9rem; border-left: 2px solid var(--rule); }
.c-replies .c-item { border-top: 0; padding: .7rem 0 .2rem; grid-template-columns: 2rem minmax(0, 1fr); }
.c-replies .c-av { width: 2rem; height: 2rem; font-size: .85rem; }
.c-empty { color: var(--muted); }
.spoiler { filter: blur(5px); cursor: pointer; user-select: none; border-radius: 6px; background: var(--surface-2); transition: filter .2s; }
.spoiler.shown { filter: none; user-select: auto; background: none; cursor: auto; }
.spoil-tag { font-size: .76rem; font-weight: 500; color: var(--gold-text); margin-left: .5rem; }

/* Panneau d'un passage */
body.sheet-open { overflow: hidden; }
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(15,15,18,.32); display: flex; justify-content: flex-end; }
.sheet[hidden] { display: none; }
.sheet-in { width: min(30rem, 100%); height: 100%; overflow-y: auto; background: var(--surface); padding: 1.4rem 1.4rem 2rem; display: flex; flex-direction: column; box-shadow: -30px 0 60px -40px rgba(0,0,0,.4); animation: slide .22s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head .mini { font-size: 1.15rem; margin: 0; }
#s-close { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--bg); border: 1px solid var(--rule); font-size: 1.3rem; cursor: pointer; color: var(--ink); line-height: 1; }
.sheet blockquote { margin: 1.1rem 0 0; padding: .8rem 1rem; border-radius: var(--r); background: var(--bg); font-family: var(--read); font-style: italic; color: var(--ink-2); font-size: .98rem; }
.sheet .c-list { flex: 1; }
.sheet .c-row { grid-template-columns: minmax(0, 1fr) auto; }
.sheet .c-row input { grid-column: 1 / -1; }

/* Reprise et temps restant */
.resume { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: .4rem; padding: .45rem .45rem .45rem 1.1rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: .92rem; box-shadow: 0 18px 40px -20px rgba(0,0,0,.6); white-space: nowrap; }
.resume[hidden] { display: none; }
.resume button { background: none; border: 0; color: inherit; cursor: pointer; padding: .4rem .7rem; border-radius: 999px; }
.resume .go { background: var(--gold); color: #1b1b1f; font-weight: 500; }
.left { position: fixed; right: .9rem; bottom: .9rem; z-index: 35; font-size: .8rem; color: var(--ink-2); background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: .3rem .7rem; opacity: 0; transition: opacity .3s; pointer-events: none; }
.left.on { opacity: .95; }

/* Lire la suite */
.gate { position: relative; max-width: 40rem; margin: -7rem auto 0; padding: 8rem var(--gutter) 3rem; background: linear-gradient(transparent, var(--bg) 6.5rem); }
.gate[hidden] { display: none; }
.gate h2 { font: 700 clamp(1.8rem, 4.5vw, 2.4rem)/1.1 var(--ui); letter-spacing: -.03em; margin: 0 0 1.2rem; }
.reading.locked > p:nth-of-type(n+4) { display: none; }
.reading.locked ~ .after, .reading.locked ~ .pager, .reading.locked ~ .comments, .reading.locked ~ #recevoir { display: none; }

/* Pages simples */
.doc { max-width: 42rem; margin: 0 auto; padding: clamp(3rem, 7vw, 5rem) var(--gutter); }
.doc h1 { font: 700 clamp(2.2rem, 6vw, 3.2rem)/1 var(--ui); letter-spacing: -.04em; margin: 0 0 1.6rem; }
.doc h2 { font: 700 1.2rem var(--ui); margin: 2.2rem 0 .6rem; }
.doc p { color: var(--ink-2); }
.doc .eyebrow { display: none; }

@media (max-width: 640px) {
  .prefs { right: 10px; left: 10px; width: auto; }
  .countdown { grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .countdown p { padding-right: .6rem; }
  .countdown p + p { padding-left: .7rem; }
  .countdown b { font-size: clamp(1.6rem, 8.6vw, 2.4rem); }
  .countdown span { font-size: .74rem; }
  .c-row { grid-template-columns: minmax(0, 1fr) auto; }
  .c-row input { grid-column: 1 / -1; }
  .sheet { align-items: flex-end; }
  .sheet-in { height: 84vh; border-radius: 20px 20px 0 0; animation-name: up; }
  @keyframes up { from { transform: translateY(24px); opacity: 0; } }
  .pager { grid-template-columns: 1fr; }
  .pager .nxt { text-align: left; }
  .foot .wrap { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .toc a, .toc .locked { grid-template-columns: 2.4rem minmax(0, 1fr) auto; }
  .hero .btns .btn { width: 100%; }
}
.title { margin-bottom: .12em; }
form.mail, .field { min-width: 0; max-width: 100%; }
.field .btn { flex: none; padding: .55rem 1.15rem; }
.field input { width: 100%; }
@media (max-width: 640px) {
  .hero { min-height: 72svh; }
  .title { font-size: clamp(4.4rem, 25vw, 7rem); }
}

/* ——— Diagnostic lisibilité et navigation ——— */
:root { --edge: #8f8d86; }
html[data-theme="sepia"] { --edge: #8a7558; }
html[data-theme="nuit"] { --edge: #6a6c73; }
html[data-theme="contraste"] { --edge: #000000; }
/* Contours des éléments cliquables : contraste ≥ 3:1 */
.btn.line, .tools button, .rx, .pager a, .aa, .seg button, .field, .c-row input, .c-row textarea, .after .vote, #s-close { border-color: var(--edge); }
.pager span { border-color: var(--rule); }
/* Zones à toucher ≥ 44 px */
.top nav a { padding: .7rem .15rem; }
.aa { height: 2.75rem; min-width: 2.9rem; }
.foot nav a { display: inline-block; padding: .65rem 0; }
.small a { display: inline-block; padding: .35rem 0; }
.brand { padding: .55rem 0; display: inline-block; }
.tools button { min-height: 2.75rem; }
.c-act button { min-height: 2.5rem; padding: .3rem .1rem; }
.spoil-opt { min-height: 2.75rem; }
.spoil-opt input { width: 1.2rem; height: 1.2rem; }
/* Bulles de commentaire : visibles et faciles à toucher */
.bubble { min-width: 2.4rem; height: 2rem; gap: .25rem; grid-auto-flow: column; padding: 0 .5rem; opacity: 1; border-color: var(--rule); color: var(--muted); }
.bubble svg { width: 14px; height: 14px; }
.bubble .n:empty { display: none; }
.bubble::before { inset: -8px -6px; }
.reading p:hover .bubble { border-color: var(--edge); color: var(--ink); }
.bubble.has { border-color: var(--gold); color: var(--ink); }
/* Bouton Publier lisible */
.btn.send { width: auto; min-width: 0; padding: .6rem 1.2rem; border-radius: 999px; font-size: .95rem; }
/* Chapitre suivant : l'action principale en fin de lecture */
.next-cta { min-height: 3.4rem; padding: .8rem 2rem; font-size: 1.05rem; }
.after-note { margin: 0; color: var(--muted); font-size: .92rem; text-align: center; }
.sub { margin: -.4rem 0 0; font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--ink-2); }
.titling { display: grid; gap: .2rem; }
.genre { margin: 0; font-family: var(--read); font-style: italic; font-size: clamp(1.3rem, 3vw, 2rem); color: var(--ink-2); letter-spacing: .01em; }
.rdv { display: inline-flex; align-items: center; gap: .6rem; justify-self: start; margin: 0; padding: .55rem 1rem; border: 1px solid var(--edge); border-radius: 999px; background: var(--surface); font-size: .95rem; color: var(--ink); }
.rdv .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--gold); }
.hero .btns:empty { display: none; }

/* ——— Prochain chapitre ——— */
.next { display: grid; gap: .9rem; justify-items: start; padding-top: clamp(1.2rem, 3vh, 2rem); border-top: 1px solid var(--rule); }
.next-k { margin: 0; display: inline-flex; align-items: center; gap: .6rem; font-size: 1rem; font-weight: 500; color: var(--ink); letter-spacing: .01em; }
.next-k .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--gold); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
html[data-motion="off"] .next-k .dot { animation: none; }
@media (prefers-reduced-motion: reduce) { .next-k .dot { animation: none; } }
.next-rdv { margin: 0; font-size: .95rem; color: var(--muted); }

/* ——— Échanges avec Babil ——— */
.reading p.msg { text-indent: 0; text-align: left; hyphens: manual; -webkit-hyphens: manual; font-family: var(--ui); font-size: .9em; line-height: 1.55; margin: 1.3rem 0; padding: .75rem 1rem .85rem; border-radius: 16px; clear: both; }
.reading p.msg + p.msg { margin-top: .7rem; }
.msg .who { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.msg .ln { display: block; }
.msg .ln + .ln { margin-top: .6em; }
.msg .ln.tight { margin-top: 0; }
.msg .ln b { font-weight: 700; }
.reading p.msg.me { width: fit-content; max-width: 85%; margin-left: auto; background: var(--surface-2); border-bottom-right-radius: 4px; }
.reading p.msg.me .who { text-align: right; }
.reading p.msg.ai { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--gold); border-bottom-left-radius: 4px; }
.msg.ai .who::after { content: ""; display: inline-block; width: 2px; height: .95em; margin-left: .3em; vertical-align: -.12em; background: var(--gold); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
html[data-motion="off"] .msg.ai .who::after { animation: none; }
@media (prefers-reduced-motion: reduce) { .msg.ai .who::after { animation: none; } }
.reading p.msg + p:not(.msg) { text-indent: 1.5em; }
.chap-head .ch-label { margin: 0 0 .7rem; font-size: .95rem; font-weight: 600; letter-spacing: .02em; color: var(--gold-text); }
.toc .lab { display: block; font-size: .8rem; font-weight: 600; color: var(--gold-text); margin-bottom: .1rem; letter-spacing: .02em; }
@media (max-width: 640px) { .reading p.msg.me { max-width: 92%; } }
@media (max-width: 900px) {
  .reading p.msg { padding-right: 3.4rem; min-width: 9rem; }
  .reading p.msg .bubble { position: absolute; top: .45rem; right: .45rem; margin: 0; }
  .reading p.msg.me .who { text-align: left; }
}
.reading p.first.short::first-letter { float: none; font: inherit; padding: 0; letter-spacing: inherit; }
.reading p.first.short + p { text-indent: 1.5em; }
/* Bandeau du menu : opaque et bien détaché du texte */
.top { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid var(--edge); box-shadow: 0 6px 18px -12px rgba(0,0,0,.35); }
.top nav a { color: var(--ink); }
.top nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ——— Prologue : une voix, pas un récit ——— */
.reading.prologue { padding-top: 3.2rem; padding-bottom: 3.5rem; }
.reading.prologue p { text-indent: 0 !important; text-align: left; hyphens: manual; font-style: italic; font-size: 1.1em; line-height: 1.75; margin: 0 0 1.5em; }
.reading.prologue p.first::first-letter { float: none; font: inherit; padding: 0; }
.reading.prologue p:last-of-type { margin-bottom: 0; }
.reading.prologue::before { content: ""; display: block; width: 2.4rem; height: 2px; background: var(--gold); margin: 0 0 2.4rem; }

/* ——— Bulles de commentaire : discrètes ——— */
.bubble { border-color: transparent !important; background: transparent; color: var(--muted); }
.bubble.has { color: var(--gold-text); }
.bubble.has .n { font-weight: 700; }
@media (hover: hover) and (pointer: fine) {
  .reading p .bubble { opacity: 0; transition: opacity .2s; }
  .reading p:hover .bubble, .reading .bubble:focus-visible { opacity: .85; }
  .reading p .bubble.has { opacity: .85; }
  .reading p .bubble:hover { opacity: 1; color: var(--ink); background: var(--surface-2); }
}
@media (hover: none), (max-width: 900px) {
  .reading p .bubble { opacity: .38; min-width: 1.8rem; height: 1.6rem; padding: 0 .2rem; }
  .reading p .bubble.has { opacity: 1; }
  .reading p.msg { padding-right: 2.6rem; }
  .reading p.msg .bubble { top: .35rem; right: .3rem; }
}
.reading.prologue p { max-width: 31em; }

/* ——— Accueil plus compact : les chapitres arrivent vite ——— */
.hero { min-height: 0 !important; gap: clamp(1.1rem, 2.6vh, 1.8rem); padding: clamp(2.2rem, 6vh, 4rem) var(--gutter) clamp(2rem, 5vh, 3rem); align-content: start; }
.title { font-size: clamp(4.2rem, 13vw, 10.5rem); }
.titling { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: clamp(.8rem, 2vw, 1.6rem); row-gap: .2rem; }
.genre { font-size: clamp(1.7rem, 4vw, 3rem); color: var(--gold-text); font-weight: 400; }
.next { padding-top: 1rem; gap: .6rem; }
.countdown b { font-size: clamp(1.8rem, 4.2vw, 2.8rem); }
.hero + .sec { padding-top: clamp(1.6rem, 4vw, 2.6rem); }
.stats { border-top: 0; padding-bottom: 2.4rem; }
@media (max-width: 640px) {
  .title { font-size: clamp(4rem, 23vw, 6rem); }
  .genre { font-size: 1.7rem; }
  .countdown b { font-size: clamp(1.5rem, 8vw, 2.1rem); }
}

/* ——— Bulles de commentaire : visibles mais légères ——— */
.reading p .bubble { opacity: 1 !important; color: var(--ink-2); border: 1px solid var(--rule) !important; background: var(--surface); }
.reading p .bubble:hover, .reading p:hover .bubble { border-color: var(--edge) !important; color: var(--ink); }
.reading p .bubble.has { border-color: var(--gold) !important; color: var(--gold-text); }
.reading p.msg .bubble { background: transparent; }
.hint { display: flex; align-items: center; gap: .55rem; margin: 1.1rem 0 0; font-size: .88rem; color: var(--ink-2); }
.hint svg { flex: none; width: 1.6rem; height: 1.25rem; padding: .2rem .35rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); box-sizing: content-box; width: 13px; height: 13px; }
/* Courriel cité dans le récit */
.reading p.msg.mail { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--edge); border-radius: 6px; font-style: normal; }

/* ——— Inscription à partir du chapitre 3 ——— */
[data-subs-hide][hidden] { display: none !important; }
.toc .toc-gate { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; margin: .8rem 0; padding: 1.2rem 1.4rem; background: var(--surface); border: 1px solid var(--edge); border-left: 3px solid var(--gold); border-radius: var(--r); }
.toc-gate p { margin: 0; display: grid; gap: .2rem; }
.toc-gate b { font: 700 1.1rem var(--ui); }
.toc-gate span { color: var(--ink-2); font-size: .95rem; }
.cap { max-width: 40rem; margin: 1rem auto 0; padding: 2rem var(--gutter) 2.4rem; border-top: 3px solid var(--gold); }
.cap h2 { font: 700 clamp(1.7rem, 4.5vw, 2.3rem)/1.1 var(--ui); letter-spacing: -.03em; margin: 0 0 .7rem; }
.cap > p { margin: 0 0 1.3rem; color: var(--ink-2); }
.toc .toc-gate a.btn { display: inline-flex; grid-template-columns: none; padding: .75rem 1.5rem; color: var(--bg); background: var(--ink); border-radius: 999px; font-weight: 500; }
.toc .toc-gate a.btn:hover { background: var(--ink); opacity: .9; }
@media (max-width: 560px) { .toc .toc-gate a.btn { width: 100%; justify-content: center; } }

/* ——— Bouton Installer l'appli ——— */
.inst { display: inline-flex; align-items: center; gap: .4rem; height: 2.75rem; padding: 0 .95rem 0 .8rem; border-radius: 999px; background: var(--ink); color: var(--bg); border: 1px solid var(--ink); font: 500 .9rem var(--ui); cursor: pointer; }
.inst[hidden] { display: none; }
.inst svg { width: 18px; height: 18px; }
.inst:hover { opacity: .9; }
.inst-tip ol { margin: 0; padding-left: 1.2rem; display: grid; gap: .7rem; font-size: .95rem; line-height: 1.45; }
.inst-tip .it-t { margin: 0; font-weight: 700; font-size: 1.05rem; }
.inst-tip .ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; margin: 0 .1em; color: var(--gold-text); }
@media (max-width: 560px) {
  .inst { width: 2.75rem; padding: 0; justify-content: center; }
  .inst span { display: none; }
  .top nav { gap: .7rem; }
  .top nav a { font-size: .9rem; }
}
.brand { white-space: nowrap; flex: none; }
.top nav { min-width: 0; }
@media (max-width: 420px) {
  .top-in { gap: .6rem; }
  .top nav { gap: .55rem; }
  .top nav a { font-size: .88rem; padding-inline: .05rem; }
  .aa { min-width: 2.75rem; padding: 0 .5rem; }
}
@media (max-width: 370px) { .top nav a[href$="#recevoir"] { display: none; } }

/* Bandeaux : état « inscrit » */
[data-subs] .sub-yes { display: none; }
[data-subs].is-sub .sub-no { display: none !important; }
[data-subs].is-sub .sub-yes { display: flex; align-items: center; gap: .9rem; margin: 0; }
.sub-yes > span { display: grid; gap: .15rem; }
.sub-yes b { font: 700 1.05rem var(--ui); }
.sub-yes span span { color: var(--ink-2); font-size: .95rem; }
.sub-yes .ok, .merci-ok svg { flex: none; width: 2.2rem; height: 2.2rem; padding: .45rem; border-radius: 50%; background: var(--gold); color: #fff; box-sizing: border-box; }
.cap.is-sub { border-top-width: 1px; padding-top: 1.6rem; padding-bottom: 1.6rem; }

/* Fenêtre de confirmation */
.merci { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1.2rem; background: rgba(15,15,18,.45); animation: fadein .2s ease; }
.merci-in { width: min(26rem, 100%); background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 22px; padding: 2rem 1.6rem 1.6rem; text-align: center; box-shadow: 0 30px 80px -30px rgba(0,0,0,.5); animation: pop .25s ease; }
.merci-ok { margin: 0 0 .8rem; display: flex; justify-content: center; }
.merci-ok svg { width: 3.2rem; height: 3.2rem; padding: .7rem; }
.merci h2 { font: 700 1.6rem/1.15 var(--ui); letter-spacing: -.02em; margin: 0 0 .7rem; }
.merci p { margin: 0 0 .8rem; color: var(--ink-2); }
.merci .merci-small { font-size: .85rem; color: var(--muted); }
.merci .btn { margin-top: .6rem; min-width: 12rem; }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
html[data-motion="off"] .merci, html[data-motion="off"] .merci-in { animation: none; }
@media (prefers-reduced-motion: reduce) { .merci, .merci-in { animation: none; } }
.sub-yes b { color: var(--ink); } .sub-yes span span { color: var(--ink-2); }
.inst-tip .it-and { margin: 0; font-size: .95rem; line-height: 1.5; } .inst-tip [hidden] { display: none; }

/* ——— Note de 1 à 5 étoiles ——— */
.rate { display: grid; justify-items: center; gap: .4rem; margin-bottom: .6rem; }
.rate-t { margin: 0; font-weight: 700; font-size: 1.05rem; }
.stars { display: flex; gap: .25rem; }
.stars button { width: 3rem; height: 3rem; display: grid; place-items: center; padding: 0; border: 0; background: none; cursor: pointer; color: var(--edge); border-radius: 50%; }
.stars button svg { width: 2.1rem; height: 2.1rem; }
.stars button.on { color: var(--gold); }
.stars:hover button { color: var(--gold); }
.stars button:hover ~ button { color: var(--edge); }
.stars button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.stars-note { margin: 0; font-size: .88rem; color: var(--muted); }
.rate-link svg { width: 15px; height: 15px; }
@media (hover: none) { .stars:hover button { color: var(--edge); } .stars:hover button.on { color: var(--gold); } }

/* ——— Réactions emoji sur chaque passage ——— */
.bubble .rx-top { font-size: .78rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.bubble .rx-top:empty { display: none; }
.reading p .bubble.has-rx { opacity: 1 !important; }
html[data-rx="off"] .bubble .rx-top { display: none; }
.s-rx-t { margin: .9rem 0 .4rem; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.s-rx { justify-content: flex-start; margin: 0; }
.s-rx .rx[disabled] { opacity: .6; }
@media (min-width: 901px) { .reading p .bubble { right: auto; left: calc(100% + .55rem); } }

/* ——— V11 : bulles estompées ——— */
html .reading p .bubble { border: 0 !important; background: transparent !important; box-shadow: none; color: var(--muted); opacity: .32 !important; transition: opacity .2s, color .2s; }
html .reading p .bubble.has, html .reading p .bubble.has-rx { opacity: .6 !important; color: var(--muted); }
html .reading p .bubble.has .n { font-weight: 600; }
html .reading p:hover .bubble, html .reading p .bubble:hover, html .reading p .bubble:focus-visible, html .reading p .bubble:active { opacity: 1 !important; color: var(--ink); }
html .reading p .bubble:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
html .reading p .bubble .rx-top { color: inherit; font-weight: 500; }
html[data-rx="off"] .reading .bubble, html[data-rx="off"] .chap-head .hint { display: none !important; }
html[data-theme="contraste"] .reading p .bubble { opacity: .7 !important; }
.inst-tip .it-sam { margin: 0; font-size: .95rem; line-height: 1.5; }
.about { padding: 2.4rem 0 2.6rem; }
.about p { margin: 0; font-family: var(--read); font-size: 1.05rem; line-height: 1.7; color: var(--ink-2); }
.about b { font-family: var(--ui); color: var(--ink); }

/* ——— V13 : prologue intégré au chapitre 1 ——— */
.reading .part-k { text-indent: 0 !important; text-align: left; margin: 0 0 1.4rem; font: 700 .8rem var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text); }
.reading .part-ch { margin-top: 2.6rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
.reading .prologue p:not(.part-k) { text-indent: 0 !important; text-align: left; hyphens: manual; font-style: italic; font-size: 1.08em; line-height: 1.75; margin: 0 0 1.2em; }
.reading .prologue p.first::first-letter { float: none; font: inherit; padding: 0; }
.reading .prologue + .part-ch + p::first-letter { float: left; font: 700 3.9em/.78 var(--ui); letter-spacing: -.04em; padding: .06em .12em 0 0; }
.reading .prologue + .part-ch + p { text-indent: 0; }

/* ——— Carte « La suite » ——— */
.suite { max-width: 40rem; margin: .5rem auto 1.5rem; padding: 1.6rem var(--gutter) 1.8rem; text-align: left; }
.suite > * { max-width: 100%; }
.suite { border-top: 3px solid var(--gold); background: var(--surface); border-radius: 0 0 var(--r) var(--r); box-shadow: 0 20px 40px -32px rgba(0,0,0,.35); }
.suite-k { margin: 0 0 .3rem; font: 700 .8rem var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--gold-text); }
.suite h2 { margin: 0 0 .6rem; font: 700 clamp(1.5rem, 4.5vw, 2rem)/1.1 var(--ui); letter-spacing: -.03em; }
.suite-x { margin: 0 0 .5rem; font: italic 1.1rem/1.6 var(--read); color: var(--ink); }
.suite-m { margin: 0 0 1.1rem; font-size: .88rem; color: var(--muted); }
.suite .next-cta { width: 100%; }

/* ——— Réseaux ——— */
.socs { display: inline-flex; gap: .2rem; align-items: center; }
.soc { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; color: var(--ink); text-decoration: none; }
.soc svg { width: 19px; height: 19px; }
.soc:hover { background: var(--surface-2); }
.foot .socs { margin-left: .4rem; }
@media (max-width: 420px) { .top .soc { width: 2rem; } .top .soc svg { width: 17px; height: 17px; } }

/* ——— Barre de réaction rapide ——— */
.qbar { position: fixed; z-index: 80; background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 18px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.35); padding: .35rem; display: grid; gap: .25rem; max-width: calc(100vw - 16px); animation: pop .16s ease; }
.qbar[hidden] { display: none; }
.qrow { display: flex; gap: .1rem; align-items: center; justify-content: center; flex-wrap: nowrap; }
.qe, .qmore { position: relative; width: 2.6rem; height: 2.6rem; border: 0; border-radius: 50%; background: transparent; font-size: 1.45rem; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: transform .12s; }
.qe:hover, .qmore:hover { background: var(--surface-2); transform: scale(1.12); }
.qe[aria-pressed="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--gold); }
.qe small { position: absolute; right: -1px; bottom: -1px; font: 700 .62rem var(--ui); color: var(--ink-2); background: var(--surface); border-radius: 8px; padding: 0 3px; }
.qe.pop { animation: qpop .25s ease; }
@keyframes qpop { 50% { transform: scale(1.5); } }
.qmore { font: 600 1.2rem var(--ui); color: var(--ink-2); }
.qact { border-top: 1px solid var(--rule); padding-top: .3rem; gap: .3rem; }
.qact button { flex: 1; min-height: 2.5rem; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--ink); font: 500 .88rem var(--ui); cursor: pointer; padding: 0 .7rem; white-space: nowrap; }
.qact button:hover { background: var(--rule); }
html .reading p .bubble.bump { animation: qpop .5s ease; opacity: 1 !important; color: var(--gold-text); }
.coach { position: absolute; right: calc(100% + 6px); top: 50%; transform: translateY(-50%); white-space: nowrap; font: 600 .75rem var(--ui); color: var(--bg); background: var(--ink); padding: .3rem .55rem; border-radius: 8px; pointer-events: none; animation: fadein .3s ease; }
html .reading p .bubble:has(.coach) { opacity: 1 !important; }
@media (max-width: 900px) { .coach { right: auto; left: calc(100% + 6px); } .reading p.msg .coach { left: auto; right: calc(100% + 6px); } }
html[data-motion="off"] .qbar, html[data-motion="off"] .qe.pop, html[data-motion="off"] .bubble.bump { animation: none; }

/* ——— Partager une citation ——— */
.q-help { margin: 0 0 .8rem; font-size: .92rem; color: var(--ink-2); }
.q-list { display: grid; gap: .4rem; margin-bottom: 1rem; max-height: 30vh; overflow: auto; }
.q-item { text-align: left; padding: .6rem .8rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); color: var(--ink); font: italic .95rem/1.45 var(--read); cursor: pointer; }
.q-item[aria-pressed="true"] { border-color: var(--gold); background: var(--surface); box-shadow: inset 3px 0 0 var(--gold); }
.q-fmt { margin-bottom: .8rem; }
.q-fmt button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#q-canvas { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto 1rem; border: 1px solid var(--rule); border-radius: 10px; }
.q-act { display: flex; gap: .6rem; flex-wrap: wrap; }
.q-act .btn { flex: 1; }
.after-act { flex-wrap: wrap; }
@media (max-width: 480px) { .top nav a[href$="#recevoir"] { display: none; } .top nav { gap: .35rem; } }

/* ——— L'atelier d'écriture ——— */
.atelier .at-head { max-width: 72rem; }
.at-state { margin: 1rem 0; padding: 1rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--rule); }
.at-tools { flex-wrap: wrap; }
.at-tools button { min-height: 2.75rem; }
#at-draft { margin: .6rem 0; min-height: 2.6rem; border-radius: 999px; padding: 0 1rem; border: 1px solid var(--edge); background: var(--surface); color: var(--ink); }
.at-grid { display: grid; grid-template-columns: minmax(0, 40rem) minmax(0, 24rem); gap: 2.5rem; justify-content: center; padding: 0 var(--gutter) 4rem; }
.at-grid .reading { margin: 0; padding-left: 0; padding-right: 0; }
.at-panel { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; padding: 1rem; }
.at-ph { display: flex; justify-content: space-between; align-items: center; }
.at-ph .mini { margin: 0; }
#at-close-panel { display: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--edge); background: var(--surface); color: var(--ink); font-size: 1.3rem; cursor: pointer; }
.at-filter { margin: .7rem 0 1rem; }
.at-filter button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.at-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.at-card { border: 1px solid var(--rule); border-radius: 14px; padding: .75rem .85rem; background: var(--bg); cursor: pointer; transition: box-shadow .2s; }
.at-card.flash, mark.an.flash { box-shadow: 0 0 0 3px var(--gold); }
.at-card.st-accepted { border-left: 3px solid #3c8a5a; } .at-card.st-rejected { opacity: .65; }
.at-meta { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; margin: 0 0 .4rem; font-size: .8rem; color: var(--muted); }
.at-who { font-weight: 700; color: var(--ink); } .at-who.w-other { color: var(--gold-text); }
.at-kind { padding: .05rem .5rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.at-st { font-weight: 700; }
.at-card blockquote { margin: 0 0 .4rem; padding-left: .6rem; border-left: 2px solid var(--rule); font: italic .9rem/1.45 var(--read); color: var(--ink-2); }
.at-card p { margin: 0 0 .4rem; font-size: .92rem; }
.at-diff del { color: #a3392f; } .at-diff ins { color: #2f7a4e; text-decoration: none; font-weight: 600; }
.at-emo { font-size: 1.4rem; }
.at-reps { list-style: none; margin: .3rem 0; padding: .3rem 0 0 .7rem; border-left: 2px solid var(--gold); font-size: .88rem; display: grid; gap: .25rem; }
.at-act { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: .3rem 0 0 !important; }
.at-act button { min-height: 2.2rem; padding: 0 .65rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font: 500 .8rem var(--ui); cursor: pointer; }
.at-act .a-like[aria-pressed="true"] { color: #c0392b; border-color: #c0392b; }
.at-act .a-ok { border-color: #3c8a5a; color: #2f7a4e; } .at-act .a-no { color: #a3392f; }
.a-liked { font-size: .75rem; color: var(--muted); }
.at-rf { display: grid; gap: .4rem; margin-top: .5rem; } .at-rf textarea { width: 100%; border-radius: 10px; border: 1px solid var(--edge); padding: .5rem; font: inherit; background: var(--surface); color: var(--ink); }
/* marques dans le texte */
mark.an { background: transparent; color: inherit; border-radius: 2px; cursor: pointer; }
mark.an-highlight.c-jaune, mark.an-comment, mark.an-emoji { background: rgba(240, 200, 60, .38); }
mark.an-highlight.c-vert { background: rgba(110, 200, 120, .35); } mark.an-highlight.c-rose { background: rgba(240, 130, 170, .35); }
mark.an-suggest { background: rgba(214, 80, 60, .12); text-decoration: line-through; text-decoration-color: #a3392f; }
mark.an-suggest.ok { text-decoration: none; background: rgba(110, 200, 120, .18); }
mark.an-format { text-decoration: underline dashed var(--gold); text-underline-offset: 4px; }
.x-add { text-indent: 0; }
.x-ins { color: #2f7a4e; background: rgba(110, 200, 120, .2); text-decoration: underline; text-underline-offset: 3px; margin-left: .15em; }
.x-badge { font-size: .72em; vertical-align: super; margin-left: .1em; font-family: var(--ui); }
.x-fmt { color: var(--gold-text); font-weight: 600; }
html[data-theme="nuit"] mark.an-highlight.c-jaune, html[data-theme="nuit"] mark.an-comment, html[data-theme="nuit"] mark.an-emoji { background: rgba(240, 200, 60, .28); }
/* barre d'outils et fenêtre */
.atbar .t-hl { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--edge); cursor: pointer; margin: 0 .1rem; }
.t-hl.c-jaune { background: #f3d36b; } .t-hl.c-vert { background: #8fd49a; } .t-hl.c-rose { background: #f2a3c0; }
.atbar .t-btn { min-height: 2.4rem; padding: 0 .6rem; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--ink); font: 500 .85rem var(--ui); cursor: pointer; margin: 0 .1rem; white-space: nowrap; }
.atbar .qrow { flex-wrap: wrap; }
.atpop { position: fixed; z-index: 85; width: min(24rem, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.35); padding: .9rem; display: grid; gap: .5rem; }
.atpop[hidden] { display: none; }
.atp-t { margin: 0; font-weight: 700; }
.atpop blockquote { margin: 0; padding-left: .6rem; border-left: 2px solid var(--gold); font: italic .88rem var(--read); color: var(--ink-2); max-height: 5em; overflow: hidden; }
.atpop textarea { width: 100%; border-radius: 10px; border: 1px solid var(--edge); padding: .55rem; font: 1rem/1.45 var(--read); background: var(--bg); color: var(--ink); resize: vertical; }
.atp-a { display: flex; gap: .5rem; justify-content: flex-end; }
@media (max-width: 999px) {
  .at-grid { grid-template-columns: minmax(0, 1fr); }
  .at-panel { position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; top: auto; max-height: 78vh; border-radius: 20px 20px 0 0; transform: translateY(105%); transition: transform .25s; }
  body.panel-open .at-panel { transform: none; }
  #at-close-panel { display: inline-block; }
}

/* ——— Atelier V14 : étapes, écriture, publication, modération ——— */
.at-flow { margin: 1rem 0 .4rem; padding: 1rem 1.1rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--rule); display: grid; gap: .7rem; }
.at-flow[hidden] { display: none; }
.at-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem .5rem; counter-reset: s; }
.at-steps li { display: inline-flex; align-items: center; gap: .4rem; font: 500 .85rem var(--ui); color: var(--muted); padding: .25rem .7rem .25rem .3rem; border-radius: 999px; background: var(--surface-2); }
.at-steps li span { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: var(--bg); font-size: .75rem; font-weight: 700; }
.at-steps li.st-done { color: #2f7a4e; } .at-steps li.st-done span { background: #2f7a4e; color: #fff; }
.at-steps li.st-cur { color: var(--bg); background: var(--ink); } .at-steps li.st-cur span { background: var(--gold); color: #fff; }
.at-flow-t { margin: 0; font-size: .95rem; color: var(--ink-2); }
.at-flow-a { display: flex; flex-wrap: wrap; gap: .5rem; }
.at-flow-a .btn { min-height: 2.6rem; padding: .45rem 1rem; font-size: .9rem; }
.btn.sure, .at-act button.sure { background: #a3392f; border-color: #a3392f; color: #fff; }
.at-pick { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .6rem 0; }
.at-pick select { min-height: 2.6rem; max-width: 100%; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); padding: 0 .9rem; font: 500 .9rem var(--ui); }
.at-pick .btn { min-height: 2.6rem; padding: .4rem 1rem; font-size: .9rem; }
.at-round { padding: .05rem .45rem; border-radius: 999px; border: 1px solid var(--rule); }
.at-card.lost { border-style: dashed; } .at-lost { font-size: .8rem !important; color: var(--muted); font-style: italic; }
.a-likes { font-size: .8rem; color: var(--muted); }
body.at-ro #atbar { display: none !important; }
/* écriture */
.at-edbar { position: sticky; top: 64px; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; max-width: 68rem; margin: 0 auto 1rem; padding: .5rem .6rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--rule); box-shadow: 0 12px 30px -22px rgba(0,0,0,.35); }
.at-edbar[hidden] { display: none; }
.at-edbar button { min-height: 2.5rem; min-width: 2.5rem; padding: 0 .7rem; border-radius: 10px; border: 1px solid transparent; background: var(--surface-2); color: var(--ink); font: 500 .85rem var(--ui); cursor: pointer; }
.at-edbar button:hover { border-color: var(--gold); }
.at-edbar .ed-sep { width: 1px; height: 1.6rem; background: var(--rule); margin: 0 .2rem; }
.at-edbar .ed-info { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; font-size: .75rem; color: var(--muted); line-height: 1.3; }
.at-edbar .ed-state.ok { color: #2f7a4e; } .at-edbar .ed-state.bad { color: #a3392f; font-weight: 700; }
.at-edbar .btn.ed-done { min-height: 2.5rem; padding: .3rem 1rem; background: var(--ink); color: var(--bg); border-color: var(--ink); }
body.writing #at-texte { outline: 2px dashed color-mix(in srgb, var(--gold) 55%, transparent); outline-offset: 14px; border-radius: 4px; caret-color: var(--gold-text); min-height: 50vh; }
body.writing #at-texte:focus { outline-style: solid; }
body.writing #at-title { outline: 2px dashed color-mix(in srgb, var(--gold) 55%, transparent); outline-offset: 6px; border-radius: 4px; }
body.writing #at-texte p:empty::before, body.writing #at-texte p > br:only-child::after { content: ''; }
body.writing #at-texte p.first:only-child:empty::before { content: 'Commencez à écrire ici…'; color: var(--muted); }
body.writing #at-texte .msg .ln:empty::before { content: '…'; color: var(--muted); }
body.writing .at-panel { opacity: .55; }
/* feuilles de l'atelier */
.at-form { display: grid; gap: .9rem; margin-top: 1rem; }
.at-form label { display: grid; gap: .3rem; font: 500 .92rem var(--ui); }
.at-form label small { color: var(--muted); font-weight: 400; }
.at-form input:not([type=radio]), .at-form textarea { width: 100%; box-sizing: border-box; border-radius: 10px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink); padding: .6rem .7rem; font: 1rem/1.45 var(--ui); }
.at-form textarea { font-family: var(--read); resize: vertical; }
.at-form code { font-size: .85em; background: var(--surface-2); padding: 0 .25em; border-radius: 4px; }
.at-radio { border: 0; padding: 0; margin: 0; display: grid; gap: .45rem; }
.at-radio legend { font: 500 .92rem var(--ui); margin-bottom: .2rem; }
.at-radio label { display: flex !important; align-items: center; gap: .5rem; flex-wrap: wrap; font-weight: 400 !important; }
.at-radio input[type=radio] { width: 1.15rem; height: 1.15rem; accent-color: var(--ink); }
.at-radio input[type=datetime-local] { width: auto; padding: .35rem .5rem; }
.at-form-a { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.at-form-a .btn { min-height: 2.75rem; }
.at-og canvas { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--rule); display: block; }
.at-pub-err { color: #a3392f; font-weight: 600; margin: 0; }
.at-mod { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .6rem; }
.at-mod li { border: 1px solid var(--rule); border-radius: 12px; padding: .65rem .8rem; background: var(--bg); }
.at-mod li p { margin: 0 0 .35rem; font-size: .92rem; overflow-wrap: anywhere; }
.at-mod li.is-hidden { opacity: .6; }
.at-mod .at-act a { font-size: .8rem; color: var(--ink-2); }
.at-toast { position: fixed; z-index: 95; left: 50%; bottom: 1.2rem; transform: translate(-50%, 1rem); max-width: min(34rem, calc(100vw - 32px)); padding: .75rem 1.1rem; border-radius: 14px; background: var(--ink); color: var(--bg); font: 500 .92rem/1.4 var(--ui); box-shadow: 0 18px 40px -16px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.at-toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 640px) {
  body.writing .at-tools, body.writing #at-hint, body.writing .at-pick, body.writing .at-flow { display: none; }
  .at-edbar { top: 56px; border-radius: 12px; padding: .4rem; gap: .25rem; }
  .at-edbar button { min-height: 2.4rem; padding: 0 .5rem; font-size: .8rem; }
  .at-edbar .ed-info { order: 9; width: 100%; flex-direction: row; justify-content: space-between; margin: .2rem 0 0; }
  .at-flow-a .btn { flex: 1 1 auto; }
}

.at-grid[hidden], .at-tools[hidden], .at-pick[hidden] { display: none !important; }
.atelier [hidden] { display: none !important; }

/* ——— Compte lecteur (connexion par lien) ——— */
.c-ok { display: inline-grid; place-items: center; width: 1.05rem; height: 1.05rem; margin-left: .25rem; border-radius: 50%; background: #2f7a4e; color: #fff; font-size: .62rem; font-weight: 700; vertical-align: .1em; }
.acct { margin: 0 0 .6rem; }
.acct-in { margin: 0; font-size: .92rem; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.acct-out { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; padding: .3rem; min-height: 2.2rem; }
.acct-login { padding: .9rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--rule); }
.acct-login p { margin: 0 0 .6rem; font-size: .92rem; }
.acct-login .field { display: flex; gap: .5rem; flex-wrap: wrap; }
.acct-login .field label { flex: 1 1 12rem; display: block; }
.acct-login input { width: 100%; box-sizing: border-box; min-height: 2.75rem; border-radius: 999px; border: 1px solid var(--edge); padding: 0 1rem; font: 1rem var(--ui); background: var(--bg); color: var(--ink); }
.acct-form { display: grid; gap: .8rem; margin-top: 1rem; }
.acct-form input#acct-ps { min-height: 2.9rem; border-radius: 12px; border: 1px solid var(--edge); padding: 0 .9rem; font: 1.05rem var(--ui); background: var(--bg); color: var(--ink); }
.acct-nt { display: flex; gap: .5rem; align-items: center; font-size: .92rem; }
.acct-sheet .sheet-in { height: auto; max-height: 100%; }
