/*
 * Calico — thème inspiré de Hestia (ThemeIsle) : en-tête plein écran avec image filtrée,
 * conteneur principal « surélevé » qui chevauche l'en-tête, cartes à ombres douces,
 * titres en Roboto Slab, accent rose.
 * Licence : AGPL-3.0-or-later
 */

@font-face { font-family: "Roboto"; font-weight: 300; font-display: swap; src: url(../fonts/roboto-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 400; font-display: swap; src: url(../fonts/roboto-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 500; font-display: swap; src: url(../fonts/roboto-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 700; font-display: swap; src: url(../fonts/roboto-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto Slab"; font-weight: 400; font-display: swap; src: url(../fonts/roboto-slab-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto Slab"; font-weight: 700; font-display: swap; src: url(../fonts/roboto-slab-latin-700-normal.woff2) format("woff2"); }

:root {
    --accent: #7b1fa2; /* violet, contraste 8:1 sur blanc */
    --accent-dark: #6a1b9a;
    --accent-shadow: rgba(123, 31, 162, .28);
    --text: #3c4858;
    --muted: #6b6f76; /* contraste 5:1 sur blanc */
    --bg: #e5e5e5;
    --surface: #fff;
    --surface-alt: #f7f7f7;
    --border: #e7e7e7;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #00bcd4;
    --radius: 6px;
    --shadow-1: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12);
    --shadow-2: 0 16px 38px -12px rgba(0,0,0,.56), 0 4px 25px 0 rgba(0,0,0,.12), 0 8px 10px -5px rgba(0,0,0,.2);
    --shadow-raised: 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12), 0 8px 10px -5px rgba(0,0,0,.2);
    --font: "Roboto", "Helvetica Neue", Arial, sans-serif;
    --font-title: "Roboto Slab", "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4 { font-family: var(--font-title); font-weight: 700; line-height: 1.25; color: var(--text); margin: 0 0 .6em; }
h1 { font-size: 2.6rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
strong, b { font-weight: 500; }
.container { width: 100%; max-width: 1170px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 780px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Barre de navigation (transparente au-dessus de l'en-tête, blanche au défilement) ---------- */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 18px 0;
    color: #fff;
    transition: background .3s, padding .3s, box-shadow .3s, color .3s;
}
.navbar.is-solid, .navbar.navbar-default {
    background: var(--surface); color: var(--text); padding: 8px 0;
    box-shadow: 0 4px 18px 0 rgba(0,0,0,.12), 0 7px 10px -5px rgba(0,0,0,.15);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font-family: var(--font-title); font-weight: 700; font-size: 1.35rem; }
.brand:hover { color: inherit; }
.brand svg { width: 34px; height: 34px; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
    display: block; padding: 8px 14px; border-radius: 3px; color: inherit;
    font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em;
}
.nav-links a:hover { background: rgba(255,255,255,.15); }
.navbar.is-solid .nav-links a:hover, .navbar.navbar-default .nav-links a:hover { background: rgba(0,0,0,.06); color: var(--accent); }
.nav-links .btn, .nav-links .btn:hover { margin-left: 8px; color: #fff; background: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; color: inherit; padding: 6px; cursor: pointer; }
.nav-toggle svg { width: 26px; height: 26px; }
.badge { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 500; text-align: center; }

/* ---------- En-tête de page ---------- */
.page-header {
    position: relative;
    min-height: 62vh;
    display: flex; align-items: center;
    background-size: cover; background-position: center;
    color: #fff;
    padding: 120px 0 140px;
}
.page-header { overflow: hidden; }
.header-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
/* Couverture utilisée en fond : floutée et agrandie pour masquer les marges de la planche */
.header-blur .header-bg { inset: -40px; filter: blur(14px) saturate(1.2); transform: scale(1.15); }
.page-header::before {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: rgba(0,0,0,.5);
}
.page-header.header-small { min-height: 38vh; padding: 110px 0 120px; }
.page-header > .container { position: relative; z-index: 2; }
.page-header h1, .page-header h2 { color: #fff; }
.page-header .title { font-size: 3.4rem; margin-bottom: .3em; text-shadow: 0 2px 8px rgba(0,0,0,.25); }
.page-header .subtitle { font-size: 1.25rem; font-weight: 300; max-width: 640px; opacity: .92; }
.page-header.text-center .subtitle { margin-left: auto; margin-right: auto; }
.header-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.text-center .header-actions { justify-content: center; }

/* ---------- Conteneur principal surélevé (signature Hestia) ---------- */
.main { position: relative; z-index: 3; background: var(--surface); min-height: 30vh; }
.footer { margin-top: 40px; }
.main-raised {
    margin: -70px 30px 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-raised);
}
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-alt { background: var(--surface-alt); }
.section-title { text-align: center; margin-bottom: 8px; }
.section-description { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 44px; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 30px;
    border: 0; border-radius: 3px;
    background: var(--accent); color: #fff;
    font: 500 12px/1.4 var(--font); text-transform: uppercase; letter-spacing: .03em;
    box-shadow: 0 2px 2px 0 var(--accent-shadow), 0 3px 1px -2px rgba(233,30,99,.2), 0 1px 5px 0 rgba(233,30,99,.12);
    cursor: pointer; transition: box-shadow .2s, background .2s, transform .1s;
}
.btn:hover, .btn:focus-visible { color: #fff; background: var(--accent); box-shadow: 0 14px 26px -12px rgba(233,30,99,.42), 0 4px 23px 0 rgba(0,0,0,.12), 0 8px 10px -5px rgba(233,30,99,.2); }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 16px 40px; font-size: 14px; }
.btn-sm { padding: 6px 14px; font-size: 11px; }
.btn-white { background: #fff; color: var(--text); box-shadow: var(--shadow-1); }
.btn-white:hover { background: #fff; color: var(--accent); box-shadow: var(--shadow-2); }
.btn-ghost { background: transparent; color: inherit; box-shadow: none; border: 1px solid currentColor; }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: inherit; box-shadow: none; }
.btn-success { background: var(--success); box-shadow: 0 2px 2px 0 rgba(76,175,80,.28); }
.btn-success:hover { background: var(--success); box-shadow: 0 14px 26px -12px rgba(76,175,80,.42), 0 8px 10px -5px rgba(76,175,80,.2); }
.btn-danger { background: var(--danger); box-shadow: 0 2px 2px 0 rgba(244,67,54,.28); }
.btn-danger:hover { background: var(--danger); box-shadow: 0 14px 26px -12px rgba(244,67,54,.42), 0 8px 10px -5px rgba(244,67,54,.2); }
.btn-neutral { background: #999; box-shadow: 0 2px 2px 0 rgba(153,153,153,.28); }
.btn-neutral:hover { background: #888; box-shadow: 0 14px 26px -12px rgba(153,153,153,.42); }
.btn-link { background: none; box-shadow: none; color: var(--accent); padding-left: 0; padding-right: 0; }
.btn-link:hover { background: none; box-shadow: none; color: var(--accent-dark); }
.btn-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btn-group form { margin: 0; }

/* ---------- Grille de couvertures ---------- */
.grid { display: grid; gap: 30px; }
.grid-covers { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.card {
    position: relative; background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow-1); transition: box-shadow .25s;
}
.card-plain { box-shadow: none; background: transparent; }
.card-body { padding: 18px 20px 22px; }
.card-header-image {
    position: relative; display: block; overflow: hidden;
    margin: -20px 15px 0; border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    transition: box-shadow .3s;
}
.card-blog { margin-top: 30px; }
.card-blog:hover .card-header-image { box-shadow: 0 30px 50px -18px rgba(0,0,0,.6), 0 8px 20px 0 rgba(0,0,0,.15); }
.card-header-image img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.card-category { display: block; margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.card-title { font-size: 1.15rem; margin: 0 0 8px; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-description { color: var(--muted); font-size: .95rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted); }
.card-footer .author { display: flex; align-items: center; gap: 8px; color: var(--text); }

.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 500; flex: none; }
.avatar-lg { width: 130px; height: 130px; font-size: 3rem; box-shadow: var(--shadow-2); border: 4px solid #fff; }

/* Pages récentes : vignettes horizontales */
.page-thumb { display: block; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow-1); transition: box-shadow .25s; background: #fff; }
.page-thumb:hover { box-shadow: var(--shadow-2); }
.page-thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; object-position: top; }
.page-thumb span { display: block; padding: 10px 14px; color: var(--text); font-size: .9rem; }
.page-thumb small { display: block; color: var(--muted); }

/* ---------- Bloc « fonctionnalités » ---------- */
.info { text-align: center; padding: 0 12px; }
.info .icon { display: inline-flex; width: 64px; height: 64px; align-items: center; justify-content: center; color: var(--accent); margin-bottom: 14px; }
.info .icon svg { width: 52px; height: 52px; }
.info h4 { font-size: 1.2rem; }
.info p { color: var(--muted); }

/* ---------- Lecteur de page ---------- */
.reader { background: #222; padding: 36px 0; border-radius: var(--radius) var(--radius) 0 0; }
.reader figure { margin: 0 auto; max-width: 960px; }
.reader img { margin: 0 auto; box-shadow: 0 20px 50px rgba(0,0,0,.6); background: #fff; }
.reader-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 16px; max-width: 960px; margin: 0 auto; }
.reader-nav .btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.reader-nav .position { color: #ddd; font-size: .9rem; }
.page-meta { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 40px; }
.reactions { display: flex; gap: 20px; color: var(--muted); font-size: .95rem; margin: 10px 0 20px; }
.reactions span { display: inline-flex; align-items: center; gap: 6px; }
.reactions svg { width: 18px; height: 18px; color: var(--accent); }
.reply { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.reply-body { flex: 1; min-width: 0; }
.reply-author { font-weight: 500; color: var(--text); }
.reply-content { white-space: pre-line; overflow-wrap: anywhere; margin: 4px 0 0; }

.fedi-box { background: var(--surface-alt); border-radius: var(--radius); padding: 22px; box-shadow: inset 0 0 0 1px var(--border); }
.fedi-box h4 { display: flex; align-items: center; gap: 8px; }
.fedi-box svg { width: 22px; height: 22px; color: #6364ff; }
.fedi-box .feed-link { margin: 14px 0 0; }
.fedi-box .feed-link a { display: inline-flex; align-items: center; gap: 6px; }
.fedi-box .feed-link svg { width: 16px; height: 16px; color: #f28c28; }
.handle { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92rem; background: #fff; padding: 6px 10px; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--border); display: inline-block; overflow-wrap: anywhere; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input { flex: 1; min-width: 0; }

/* Liste des pages d'un comic */
.page-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
.page-list a { display: block; color: var(--text); text-align: center; font-size: .9rem; }
.page-list img { width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: top; border-radius: var(--radius); box-shadow: var(--shadow-1); margin-bottom: 8px; transition: box-shadow .25s; }
.page-list a:hover img { box-shadow: var(--shadow-2); }
.comic-intro { display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: start; }
.comic-intro .cover { margin-top: -120px; border-radius: var(--radius); box-shadow: var(--shadow-2); }
.license svg { width: 16px; height: 16px; flex: none; }
.license { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 4px 10px; border-radius: 3px; background: var(--surface-alt); font-size: .8rem; font-weight: 500; color: var(--text); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tag { padding: 3px 10px; border-radius: 12px; background: rgba(233,30,99,.1); color: var(--accent); font-size: .8rem; font-weight: 500; }
.tag-suggest { margin: 0 0 16px; }
.tag-suggest summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.tag-suggest form { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.tag-suggest input[type=text] { max-width: 220px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Formulaires ---------- */
.form-card { max-width: 640px; margin: 0 auto; }
.form-row { margin-bottom: 22px; }
.form-row .form-row { margin-bottom: 0; }
.form-row:has(> div > .form-row) > div > .form-row + .form-row { margin-top: 22px; }
.has-error input, .has-error textarea { border-color: var(--danger); }
label { display: block; font-size: .85rem; font-weight: 500; color: #666; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], textarea, select {
    width: 100%; padding: 9px 0 7px; border: 0; border-bottom: 1px solid #d2d2d2; border-radius: 0;
    background: transparent no-repeat center bottom / 0 2px; background-image: linear-gradient(var(--accent), var(--accent));
    font: 400 1rem var(--font); color: var(--text); transition: background-size .3s;
}
textarea { border: 1px solid #d2d2d2; border-radius: 3px; padding: 10px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; background-size: 100% 2px; }
textarea:focus { border-color: var(--accent); }
input[type=file] { font: inherit; font-size: .9rem; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); vertical-align: middle; margin-right: 8px; }
.checkbox-row label, form div > input[type=checkbox] + label { display: inline; font-weight: 400; }
.help-text, .form-help { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; }
ul.form-errors { color: var(--danger); font-size: .85rem; }
ul.form-errors { list-style: none; padding: 0; margin: 4px 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 30px; }

/* ---------- Alertes ---------- */
.flashes { position: fixed; top: 80px; right: 20px; z-index: 200; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.alert { padding: 14px 18px; border-radius: 3px; color: #fff; box-shadow: var(--shadow-2); font-weight: 400; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.alert button { background: none; border: 0; color: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; opacity: .8; }
.alert-success { background: var(--success); }
.alert-error { background: var(--danger); }
.alert-info { background: var(--info); }
.alert-warning { background: var(--warning); }
.callout { padding: 16px 20px; border-left: 4px solid var(--accent); background: var(--surface-alt); border-radius: 0 3px 3px 0; margin-bottom: 24px; }

/* ---------- Tableaux (admin, studio) ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 2px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: #fafafa; }
.status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .75rem; font-weight: 500; color: #fff; }
.status-pending { background: var(--warning); }
.status-active { background: var(--success); }
.status-banned { background: var(--danger); }
.status-hidden { background: #999; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; margin-bottom: 40px; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 18px; text-align: center; }
.stat strong { display: block; font-family: var(--font-title); font-size: 2rem; color: var(--accent); }
.stat span { color: var(--muted); font-size: .85rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 30px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 18px; color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active, .tabs a:hover { color: var(--accent); border-color: var(--accent); }
.pending-card { padding: 20px; margin-bottom: 16px; }
.pending-card blockquote { margin: 10px 0 16px; padding: 10px 16px; background: var(--surface-alt); border-left: 3px solid var(--warning); white-space: pre-line; }

/* ---------- Pied de page ---------- */
.footer { padding: 40px 0; background: var(--surface); color: var(--muted); font-size: .9rem; border-top: 1px solid var(--border); }
.footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: center; }
.footer ul { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; margin: 0; padding: 0; }
.footer a { color: var(--text); font-size: 12px; font-weight: 500; text-transform: uppercase; }
.footer a:hover { color: var(--accent); }
.footer-dark { background: #323437; color: #aaa; border: 0; }
.footer-dark a { color: #fff; }
.footer .languages { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; }
.footer .languages a, .footer .languages strong { font-size: .85rem; text-transform: none; font-weight: 500; }
.footer .languages strong { color: var(--accent); }

/* ---------- Mise en page de lecture : menu latéral + contenu ---------- */
.reader-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); align-items: start; }
.reader-main { min-width: 0; }
.comic-sidebar {
    position: sticky; top: 64px; max-height: calc(100vh - 64px); overflow-y: auto; overscroll-behavior: contain;
    padding: 20px 18px 30px; border-right: 1px solid var(--border); background: var(--surface);
    border-radius: var(--radius) 0 0 0; font-size: .92rem;
}
.sidebar-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.sidebar-comic { display: flex; gap: 10px; align-items: center; color: var(--text); }
.sidebar-comic img { width: 48px; height: 64px; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow-1); flex: none; }
.sidebar-comic strong { display: block; line-height: 1.25; }
.sidebar-comic small, .sidebar-comics small { display: block; color: var(--muted); font-size: .78rem; }
.sidebar-close { display: none; background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }
.sidebar-search { margin-bottom: 18px; }
.sidebar-search label.small { display: flex; align-items: center; margin-top: 6px; font-weight: 400; }
.sidebar-section { margin-top: 18px; }
.sidebar-section h3 { font-size: .78rem; font-family: var(--font); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; }
.sidebar-episode { border-bottom: 1px solid var(--border); }
.sidebar-episode summary { display: flex; justify-content: space-between; gap: 8px; padding: 8px 2px; cursor: pointer; font-weight: 500; list-style-position: inside; }
.sidebar-episode summary .count { color: var(--muted); font-weight: 400; font-size: .8rem; }
.sidebar-episode ol { list-style: none; margin: 0 0 8px; padding: 0 0 0 10px; }
.sidebar-episode li a { display: block; padding: 3px 8px; border-radius: 3px; color: var(--text); }
.sidebar-episode li a:hover { background: var(--surface-alt); color: var(--accent); }
.sidebar-episode li a[aria-current="page"], .sidebar-episode li a[aria-current="location"] { background: rgba(233,30,99,.1); color: var(--accent); font-weight: 500; }
.sidebar-scroll-link { display: inline-block; margin: 0 0 10px 10px; font-size: .8rem; }
.sidebar-comics { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.sidebar-comics a { display: flex; gap: 10px; align-items: center; color: var(--text); }
.sidebar-comics img { width: 36px; height: 48px; object-fit: cover; border-radius: 3px; flex: none; }
.sidebar-toggle { display: none; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 140; background: rgba(0,0,0,.45); }
.sidebar-backdrop[hidden] { display: none; }
.reader-layout-light .comic-intro .cover { margin-top: 0; }
/* Lecture à la suite : le menu occupe toute la hauteur de l'écran et reste en place pendant le défilement */
.reader-layout-scroll { align-items: stretch; }
.reader-layout-scroll .comic-sidebar { align-self: start; height: calc(100vh - 64px); max-height: none; }
.scroll-page { scroll-margin-top: 80px; }

/* Barre d'outils du lecteur */
.reader-toolbar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; padding: 0 16px 6px; }
.segmented { display: inline-flex; border-radius: 3px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.segmented a { padding: 6px 12px; color: #ddd; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.segmented a:hover { background: rgba(255,255,255,.1); color: #fff; }
.segmented a[aria-current="true"] { background: var(--accent); color: #fff; }
.reader-note { max-width: 760px; margin: 16px auto 0; padding: 10px 16px; color: #ddd; font-size: .9rem; text-align: center; }
.header-reader.page-header.header-small { min-height: 0; padding: 96px 0 100px; }
.header-reader .title { font-size: 2rem !important; }

/* Transcription */
.transcript { margin: 10px 0; }
.transcript summary { cursor: pointer; color: var(--accent); }
.transcript-text { white-space: pre-line; padding: 10px 14px; background: var(--surface-alt); border-left: 3px solid var(--accent); border-radius: 0 3px 3px 0; font-size: .95rem; }

/* Lecture en défilement vertical */
.reader-scroll { padding-bottom: 60px; }
.scroll-page { margin: 0 auto; max-width: 960px; padding: 0 0 4px; }
.scroll-page img { margin: 0 auto; background: #fff; }
.scroll-page figcaption { max-width: 760px; margin: 8px auto 24px; padding: 0 16px; color: #bbb; font-size: .85rem; text-align: center; }
.scroll-page figcaption a { color: #ddd; }
.scroll-page .transcript { text-align: left; }
.scroll-page .transcript-text { background: #2c2c2c; color: #eee; }
.scroll-episode { color: #fff; text-align: center; margin: 40px 16px 24px; }
.back-to-top { position: fixed; right: 20px; bottom: 20px; z-index: 90; }
.back-to-top[hidden] { display: none; }

/* Commentaires */
.discussion { margin-top: 30px; }
.reply-local .reply-author::after { content: ""; }
.comment-form { margin-top: 20px; }
.comment-form textarea { min-height: 100px; }

/* Contenus pour adultes */
.badge-nsfw { display: inline-block; padding: 2px 8px; border-radius: 10px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.badge-restricted { display: inline-block; padding: 2px 8px; border-radius: 10px; background: #455a64; color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.card-header-image .badge-restricted { position: absolute; top: 10px; right: 10px; z-index: 2; }
.card-header-image .badge-nsfw { position: absolute; top: 10px; left: 10px; z-index: 2; }
.card-header-image.is-nsfw img, .nsfw-blur { filter: blur(18px) saturate(.7); }
.card-header-image.is-nsfw { background: #333; }
.comic-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.badge-lang { display: inline-block; padding: 2px 10px; border-radius: 10px; background: var(--surface-alt); box-shadow: inset 0 0 0 1px var(--border); font-size: .78rem; font-weight: 500; }

/* Soutien financier */
.support-box { margin: 20px 0; padding: 18px 20px; border-radius: var(--radius); background: #fff8e6; box-shadow: inset 0 0 0 1px #f5d98b; }
.support-box h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.support-box h4 svg { width: 18px; height: 18px; color: var(--accent); }
.support-box ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.btn-support { background: #f6c915; color: #1a171b; box-shadow: none; }
.btn-support:hover { background: #e9bb00; color: #1a171b; box-shadow: var(--shadow-1); }
.support-box-compact { margin: 0; padding: 12px 14px; }
.support-box-compact h4 { font-size: .9rem; }

/* Actualités */
.news-list { display: grid; gap: 24px; }
.news-item .card-title { font-size: 1.3rem; }
.news-body { white-space: normal; overflow-wrap: anywhere; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 30px; }

/* Recherche */
.search-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; max-width: 720px; margin: 0 auto 20px; }
.search-form input[type=search] { flex: 1 1 280px; font-size: 1.2rem; }
.search-form label.small { display: flex; align-items: center; font-weight: 400; margin: 0; }
.search-heading { margin: 50px 0 20px; }
.author-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.author-list a { display: flex; align-items: center; gap: 10px; color: var(--text); padding: 10px; border-radius: var(--radius); box-shadow: var(--shadow-1); }
.nav-icon { width: 16px; height: 16px; vertical-align: -3px; }
.nav-search-label { display: none; }

/* Pied de page : Liberapay */
.footer .liberapay { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 3px; background: #f6c915; color: #1a171b; text-transform: none; font-size: .85rem; }
.footer .liberapay:hover { color: #1a171b; box-shadow: var(--shadow-1); }
.footer .liberapay svg { width: 16px; height: 16px; color: #c2185b; }

/* Studio : épisodes, commentaires, imports, traduction */
.episode-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 36px 0 14px; }
.episode-head h3 { margin: 0; }
.row-hidden td { opacity: .55; }
.mono, textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; line-height: 1.6; }
.container-wide { max-width: 1400px; }
fieldset.form-row { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
fieldset.form-row legend { font-weight: 500; padding: 0 6px; }
.import-log { white-space: pre-wrap; background: #222; color: #ddd; padding: 16px; border-radius: var(--radius); max-height: 60vh; overflow: auto; font-size: .82rem; }
.import-jobs { list-style: none; padding: 0; display: grid; gap: 10px; }
.import-sites { padding-left: 18px; }
.import-sites li { margin-bottom: 6px; }

.translation-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.translation-source { position: sticky; top: 70px; max-height: calc(100vh - 80px); overflow: auto; padding-right: 6px; }
.translation-figure { margin: 0 0 16px; }
.translation-figure img { max-height: 70vh; width: auto; margin: 0 auto; border-radius: 3px; box-shadow: var(--shadow-1); cursor: zoom-in; }
.translation-figure.is-zoomed img { max-height: none; width: 100%; cursor: zoom-out; }
.translation-images { display: flex; gap: 6px; margin-bottom: 10px; }
.translation-image { border: 1px solid var(--border); background: var(--surface); border-radius: 3px; padding: 4px 10px; font: inherit; font-size: .8rem; cursor: pointer; }
.translation-image.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.source-lines { margin: 0; padding: 8px 8px 8px 44px; background: var(--surface-alt); border-radius: 3px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; line-height: 1.6; }
.source-lines li { padding: 0 6px; border-radius: 2px; white-space: pre-wrap; }
.source-lines li.is-current { background: rgba(233,30,99,.15); }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.line-editor { display: flex; border: 1px solid #d2d2d2; border-radius: 3px; overflow: hidden; }
.line-editor:focus-within { border-color: var(--accent); }
.line-gutter { flex: none; width: 40px; padding: 10px 6px 10px 0; background: var(--surface-alt); color: var(--muted); text-align: right; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; line-height: 1.6; overflow: hidden; user-select: none; white-space: pre; }
.line-editor textarea { border: 0; border-radius: 0; flex: 1; white-space: pre; overflow-wrap: normal; overflow-x: auto; min-height: 320px; }
.line-status-warn { color: var(--warning); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .translation-workspace { grid-template-columns: 1fr; }
    .translation-source { position: static; max-height: none; }
}
@media (max-width: 1100px) {
    .reader-layout { grid-template-columns: 240px minmax(0, 1fr); }
    .comic-sidebar { padding: 16px 12px 24px; }
}
@media (max-width: 760px) {
    /* menu latéral en tiroir */
    .reader-layout { grid-template-columns: minmax(0, 1fr); }
    .comic-sidebar {
        position: fixed; top: 0; bottom: 0; left: 0; z-index: 150; width: min(320px, 86vw); max-height: none;
        border-radius: 0; box-shadow: var(--shadow-raised); transform: translateX(-105%); transition: transform .25s ease;
        visibility: hidden;
    }
    .comic-sidebar.is-open { transform: none; visibility: visible; }
    .sidebar-close, .sidebar-toggle { display: inline-flex; }
    .reader-layout-scroll .comic-sidebar { height: auto; }
    /* en lecture à la suite, le bouton du sommaire reste à portée de main */
    .reader-layout-scroll .reader-toolbar .sidebar-toggle { position: fixed; left: 12px; bottom: 16px; z-index: 120; box-shadow: var(--shadow-raised); }
}
@media (max-width: 900px) {
    .page-meta, .comic-intro { grid-template-columns: 1fr; }
    .comic-intro .cover { max-width: 240px; margin: -110px auto 0; }
}
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .page-header .title { font-size: 2.3rem; }
    .main-raised { margin: -50px 10px 0; }
    .section { padding: 44px 0; }
    .nav-toggle { display: block; }
    .nav-links {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; padding: 10px 16px 18px;
        background: var(--surface); color: var(--text); box-shadow: var(--shadow-2);
    }
    .nav-links.is-open { display: flex; }
    .nav-links .btn { margin: 8px 0 0; }
    .nav-search-label { display: inline; margin-left: 6px; }
    .grid-covers { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
.text-warning { color: #a35a00; }

/* ---------- Accessibilité ---------- */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 300; padding: 10px 16px; background: var(--text); color: #fff; border-radius: 0 0 var(--radius) var(--radius); font-weight: 500; }
.skip-link:focus { top: 0; color: #fff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.navbar:not(.is-solid) :focus-visible, .page-header :focus-visible, .reader :focus-visible, .footer-dark :focus-visible { outline-color: #fff; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
main:focus { outline: none; }
.btn:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
.reader-hint { flex-basis: 100%; margin: 0; text-align: center; color: #bbb; font-size: .78rem; }
.suggest-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 8px 0 4px; }
.suggest-box p { flex-basis: 100%; margin: 0; }
.is-suggested { background-color: #fff8e1 !important; }
.favorite-form { display: inline; margin: 0; }
.favorite-button, .reshare-button { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 14px; background: none; color: inherit; font: inherit; cursor: pointer; }
.favorite-button:hover, .favorite-button[aria-pressed="true"], .reshare-button:hover, .reshare-button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.favorite-button[aria-pressed="true"] svg { fill: currentColor; }
.support-declare { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,.08); display: grid; gap: 8px; justify-items: start; }
.support-declare p { margin: 0; }
.people-list { list-style: none; margin: 8px 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 18px; }
.people-list a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.people-list .avatar { width: 32px; height: 32px; font-size: .9rem; }
.h4 { font-size: 1.1rem; }
/* Statistiques */
.stats-filter { margin: 20px 0; align-items: center; flex-wrap: wrap; }
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 20px 0 30px; }
.stat-card { display: grid; padding: 16px; border-radius: var(--radius); background: var(--surface-alt); color: var(--text); }
a.stat-card:hover { box-shadow: var(--shadow-1); }
.stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-label { font-size: .85rem; color: var(--muted); }
.bar-chart { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.bar-chart .bar { flex: 1; min-height: 1px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .85; }
.stats-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin: 30px 0; }
.stats-list { padding-left: 22px; }
.stats-list li { margin: 6px 0; }
.follower-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.follower { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.follower > div:first-of-type { flex: 1; display: grid; gap: 2px; min-width: 200px; }
.callout-warning { border-left-color: var(--warning); background: #fff8e1; }
.quota-form { margin-top: 6px; align-items: center; gap: 6px; }
meter { width: 100%; max-width: 160px; display: block; }
.report-form { margin-top: 4px; }
.report-form summary { cursor: pointer; color: var(--muted); }
.report-form form { display: grid; gap: 6px; max-width: 420px; margin-top: 6px; justify-items: start; }
.report-form textarea { width: 100%; }
.home-feeds { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; align-items: start; }
.comment-feed { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.comment-feed li { display: flex; gap: 12px; align-items: flex-start; }
.comment-feed p { margin: 0 0 4px; }
.feed-links { margin-top: 16px; text-align: center; font-size: .9rem; }
/* Tutoriels */
.guide-list { list-style: none; padding: 0; display: grid; gap: 20px; }
.guide article h2 { margin-top: 2em; }
.guide article h3 { margin-top: 1.5em; }
.guide article li { margin: .3em 0; }
.guide article code { overflow-wrap: anywhere; }
.guide .steps { counter-reset: step; list-style: none; padding-left: 0; }
.guide .steps > li { counter-increment: step; position: relative; padding-left: 2.4em; margin: .8em 0; }
.guide .steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--accent); color: #fff; text-align: center; font-weight: 700; line-height: 1.7em; font-size: .9em; }
.schedule-form { display: grid; gap: 16px; max-width: 720px; margin-bottom: 40px; }
.schedule-form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.schedule-form legend { font-weight: 500; padding: 0 6px; }
.schedule-form .radio { display: block; margin: 4px 0; }
.schedule-form .inline-form { margin-top: 8px; align-items: center; flex-wrap: wrap; }
.bulk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0; } .strong { font-weight: 700; }
.event-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.event-list .card-title { font-size: 1.05rem; }
.countdown { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 12px 0 0; padding: 8px 14px; border-radius: var(--radius); background: var(--surface-alt); }
.reader-countdown { text-align: center; }
.reader .countdown { background: rgba(255,255,255,.08); color: #eee; }
.reader .countdown .muted { color: #bbb; }
.link-list { list-style: none; padding: 0; display: grid; gap: 12px; margin-bottom: 30px; }
.link-list p { margin: 4px 0 0; }
.link-form { display: grid; gap: 8px; max-width: 560px; }
.link-form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; }
.link-form .radio { display: block; }
/* Badges */
.badges { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badge-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 14px; background: var(--surface-alt); border: 1px solid var(--border); font-size: .8rem; font-weight: 500; }
.badge-week-gold { background: #fff4cc; border-color: #d4a017; }
.badge-week-silver { background: #f0f2f5; border-color: #9aa3ad; }
.badge-week-bronze { background: #f8e6d8; border-color: #b0703c; }
.badge-medal { position: absolute; bottom: 10px; left: 10px; z-index: 2; font-size: 1.6rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
/* Succès de la page du compte : à venir, avec progression */
.achievements-next { margin: 6px 0 18px; }
.achievements-next summary { cursor: pointer; font-size: .9rem; color: var(--muted); }
.achievements { list-style: none; padding: 0; margin: 10px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.achievement-locked { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-alt); }
.achievement-locked > span:first-child { font-size: 1.4rem; filter: grayscale(1); opacity: .6; }
.achievement-locked small { display: block; }
.achievement-locked progress { width: 100%; height: 8px; margin-top: 6px; accent-color: var(--accent); }
.profile-city { margin: 6px 0 0; opacity: .9; }
/* Crédits d'un webcomic (scénario, dessin…) */
.comic-credits { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0; font-size: .9rem; }
.comic-credits div { display: flex; gap: 6px; }
.comic-credits dt { font-weight: 600; }
.comic-credits dt::after { content: " :"; }
.comic-credits dd { margin: 0; }
.credited-card > .small { margin: 4px 0 0; }
/* Commentaire importé d'un autre site */
.reply-imported { font-style: italic; }
/* Défis */
.challenge-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; margin-top: 30px; }
.challenge-card { margin-bottom: 18px; }
.challenge-status { padding: 12px 16px; border-radius: var(--radius); background: var(--surface-alt); border-left: 4px solid var(--muted); margin: 10px 0; }
.challenge-status p { margin: 4px 0; }
.challenge-on_time, .challenge-ahead, .challenge-done { border-left-color: var(--success); }
.challenge-late, .challenge-missed { border-left-color: #c62828; }
.progress { height: 10px; border-radius: 5px; background: var(--border); overflow: hidden; margin: 8px 0; }
.progress span { display: block; height: 100%; background: var(--accent); }
.story-text { max-width: 720px; margin: 24px auto; padding: 36px 40px; background: #fffdf8; color: #2b2b2b; border-radius: var(--radius); font-family: Georgia, 'Times New Roman', serif; font-size: 1.15rem; line-height: 1.75; box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.story-text h2 { font-family: inherit; margin-top: 0; }
.story-text p { margin: 0 0 1em; text-indent: 1.5em; }
.text-thumb { display: block; padding: 10px; font-size: .75rem; line-height: 1.3; color: var(--muted); background: #fffdf8; border-radius: 3px; aspect-ratio: 3/4; overflow: hidden; }
@media (max-width: 600px) { .story-text { padding: 22px 18px; font-size: 1.05rem; } }
.sr-only-empty:empty { display: none; }
/* Lettrage */
.lettering, .lettering-eraser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 1.1fr); gap: 24px; align-items: start; margin-top: 24px; }
.lettering-stage { position: relative; user-select: none; touch-action: none; }
.lettering-stage img { display: block; width: 100%; height: auto; }
.lettering-block { position: absolute; display: flex; align-items: center; justify-content: center; padding: .3em; border: 2px dashed var(--accent); color: #111; line-height: 1.2; white-space: pre-wrap; overflow: hidden; cursor: move; }
.lettering-block.has-bg { background: rgba(255,255,255,.92); border-radius: .6em; }
.lettering-resize { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; background: var(--accent); cursor: nwse-resize; }
.lettering-list { padding-left: 20px; display: grid; gap: 14px; }
.lettering-list textarea { width: 100%; }
.lettering-tools { display: flex; gap: 8px; align-items: center; }
.lettering-langs { margin-top: 10px; }
.lettering-langs a { color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
@media (max-width: 900px) { .lettering, .lettering-eraser { grid-template-columns: 1fr; } }
.message-unread { border-left: 4px solid var(--accent); }

/* ---------- Thèmes ---------- */
/* Clair : le thème par défaut (variables de :root). */

/* doom-nord : la palette Nord (doom-emacs), bleu ardoise et givre */
[data-theme="doom-nord"] {
    --accent: #88c0d0;
    --accent-dark: #8fbcbb;
    --accent-shadow: rgba(136, 192, 208, .3);
    --text: #e5e9f0;
    --muted: #a3acbd;
    --bg: #2e3440;
    --surface: #3b4252;
    --surface-alt: #434c5e;
    --border: #4c566a;
    --success: #a3be8c;
    --warning: #ebcb8b;
    --danger: #bf616a;
    --info: #81a1c1;
    --on-accent: #2e3440;
}
/* bismillah : thème sombre, vert profond et or */
[data-theme="bismillah"] {
    --accent: #d4af37;
    --accent-dark: #e6c65c;
    --accent-shadow: rgba(212, 175, 55, .3);
    --text: #f1ead2;
    --muted: #bdb48f;
    --bg: #0b1a13;
    --surface: #10241a;
    --surface-alt: #173022;
    --border: #2a4a39;
    --success: #6fbf73;
    --warning: #e6b450;
    --danger: #e57373;
    --info: #64b5c6;
    --on-accent: #10241a;
}
[data-theme="doom-nord"], [data-theme="bismillah"] { color-scheme: dark; }
[data-theme="doom-nord"] body, [data-theme="bismillah"] body { background: var(--bg); color: var(--text); }
[data-theme="doom-nord"] h1, [data-theme="doom-nord"] h2, [data-theme="doom-nord"] h3, [data-theme="doom-nord"] h4,
[data-theme="bismillah"] h1, [data-theme="bismillah"] h2, [data-theme="bismillah"] h3, [data-theme="bismillah"] h4 { color: var(--text); }
[data-theme="doom-nord"] .page-header h1, [data-theme="doom-nord"] .page-header h2,
[data-theme="bismillah"] .page-header h1, [data-theme="bismillah"] .page-header h2 { color: #fff; }
/* boutons pleins : texte foncé sur l'accent clair (contraste) */
[data-theme="doom-nord"] .btn:not(.btn-white):not(.btn-link), [data-theme="bismillah"] .btn:not(.btn-white):not(.btn-link),
[data-theme="doom-nord"] .badge, [data-theme="bismillah"] .badge,
[data-theme="doom-nord"] .segmented a[aria-current="true"], [data-theme="bismillah"] .segmented a[aria-current="true"],
[data-theme="doom-nord"] .nav-links .btn, [data-theme="bismillah"] .nav-links .btn { color: var(--on-accent); }
[data-theme="doom-nord"] .btn-white, [data-theme="bismillah"] .btn-white,
[data-theme="doom-nord"] .btn-white:hover, [data-theme="bismillah"] .btn-white:hover { background: var(--surface-alt); color: var(--text); }
[data-theme="doom-nord"] .handle, [data-theme="bismillah"] .handle { background: var(--surface-alt); color: var(--text); }
[data-theme="doom-nord"] label, [data-theme="bismillah"] label { color: var(--muted); }
[data-theme="doom-nord"] input, [data-theme="doom-nord"] textarea, [data-theme="doom-nord"] select,
[data-theme="bismillah"] input, [data-theme="bismillah"] textarea, [data-theme="bismillah"] select { background-color: var(--surface-alt); color: var(--text); border-color: var(--border); }
[data-theme="doom-nord"] .navbar.is-solid, [data-theme="doom-nord"] .navbar.navbar-default,
[data-theme="bismillah"] .navbar.is-solid, [data-theme="bismillah"] .navbar.navbar-default { background: var(--surface); color: var(--text); }
[data-theme="doom-nord"] .navbar.is-solid .nav-links a, [data-theme="bismillah"] .navbar.is-solid .nav-links a { color: var(--text); }
[data-theme="doom-nord"] .reader, [data-theme="bismillah"] .reader { background: #1f232b; }
[data-theme="bismillah"] .reader { background: #07120d; }
[data-theme="doom-nord"] .story-text, [data-theme="bismillah"] .story-text, [data-theme="doom-nord"] .text-thumb, [data-theme="bismillah"] .text-thumb { background: var(--surface-alt); color: var(--text); }
[data-theme="doom-nord"] .callout-warning, [data-theme="bismillah"] .callout-warning { background: var(--surface-alt); }
[data-theme="doom-nord"] .badge-week-gold, [data-theme="doom-nord"] .badge-week-silver, [data-theme="doom-nord"] .badge-week-bronze,
[data-theme="bismillah"] .badge-week-gold, [data-theme="bismillah"] .badge-week-silver, [data-theme="bismillah"] .badge-week-bronze { color: #1a1a1a; }
[data-theme="doom-nord"] .is-suggested, [data-theme="bismillah"] .is-suggested { background-color: #5a4a20 !important; }
[data-theme="doom-nord"] table th, [data-theme="bismillah"] table th { color: var(--muted); }
[data-theme="doom-nord"] .footer a, [data-theme="bismillah"] .footer a { color: var(--text); }

/* Préférences */
.prefs-form .theme-choice { display: flex; align-items: center; gap: 8px; }
.theme-swatch { display: inline-block; width: 42px; height: 18px; border-radius: 4px; border: 1px solid #999; }
.theme-swatch-light { background: linear-gradient(90deg, #fff 50%, #d81b60 50%); }
.theme-swatch-doom-nord { background: linear-gradient(90deg, #2e3440 50%, #88c0d0 50%); }
.theme-swatch-bismillah { background: linear-gradient(90deg, #10241a 50%, #d4af37 50%); }
.alt-visible { max-width: 760px; margin: 10px auto 0; padding: 10px 16px; border-radius: var(--radius); background: rgba(255,255,255,.08); color: #eee; font-size: .95rem; line-height: 1.5; text-align: left; }
[data-theme="doom-nord"] .support-box, [data-theme="bismillah"] .support-box { background: var(--surface-alt); border-color: var(--border); color: var(--text); }
[data-theme="doom-nord"] .support-box h4, [data-theme="bismillah"] .support-box h4 { color: var(--text); }
/* Icônes Fork Awesome */
.fa { line-height: 1; }
.nav-links .fa, .btn .fa, .footer .fa { margin-right: .3em; }
.nav-links a .fa-search { margin-right: 0; font-size: 1.05em; }
.reader-nav .fa { margin: 0 .2em; }
/* Lecteur : cliquer à gauche / à droite de l'image */
.reader-figure { scroll-margin-top: 72px; }
.reader-image { position: relative; display: block; width: fit-content; max-width: 100%; margin: 0 auto; }
.reader-zone { position: absolute; top: 0; bottom: 0; width: 50%; display: flex; align-items: center; color: #fff; font-size: 2.2rem; opacity: 0; transition: opacity .2s; text-shadow: 0 2px 6px rgba(0,0,0,.7); }
.reader-zone-prev { left: 0; justify-content: flex-start; padding-left: 12px; cursor: w-resize; background: linear-gradient(90deg, rgba(0,0,0,.18), transparent 40%); }
.reader-zone-next { right: 0; justify-content: flex-end; padding-right: 12px; cursor: e-resize; background: linear-gradient(270deg, rgba(0,0,0,.18), transparent 40%); }
.reader-zone:hover { opacity: 1; color: #fff; }
@media (hover: none) { .reader-zone { opacity: 0; } }
.reader-image img { display: block; }
.home-stats ul { list-style: none; margin: 0; padding: 22px 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 36px; border-bottom: 1px solid var(--border); }
.home-stats li { display: flex; align-items: baseline; gap: 6px; color: var(--muted); }
.home-stats strong { font-size: 1.6rem; color: var(--text); }
.home-stats .fa { color: var(--accent); }
.home-stats ul { list-style: none; margin: 0; padding: 22px 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 36px; border-bottom: 1px solid var(--border); }
.home-stats li { display: flex; align-items: baseline; gap: 6px; color: var(--muted); }
.home-stats strong { font-size: 1.6rem; color: var(--text); }
.home-stats .fa { color: var(--accent); }
.guide-image { margin: 0 0 20px; }
.guide-image img { width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--radius); }
.guide-image figcaption { margin-top: 4px; text-align: right; }
.guide-list .guide-image { margin: 0; }
.guide-list .guide-image img { border-radius: var(--radius) var(--radius) 0 0; max-height: 220px; }
.guide-list .guide-image figcaption { padding: 0 12px; }
.guide-image { margin: 0 0 20px; }
.guide-image img { width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--radius); }
.guide-image figcaption { margin-top: 4px; text-align: right; }
.guide-list .guide-image { margin: 0; }
.guide-list .guide-image img { border-radius: var(--radius) var(--radius) 0 0; max-height: 220px; }
.guide-list .guide-image figcaption { padding: 0 12px; }
/* Police de lecture choisie (textes des épisodes, actualités, légendes, transcriptions) */
[data-font="literata"] :is(.story-text, .news-body, .card-description, .transcript-text, .page-meta p),
.font-literata { font-family: 'Literata', Georgia, serif; }
[data-font="atkinson"] :is(.story-text, .news-body, .card-description, .transcript-text, .page-meta p),
.font-atkinson { font-family: 'Atkinson Hyperlegible', Verdana, sans-serif; }
[data-font="opendyslexic"] :is(.story-text, .news-body, .card-description, .transcript-text, .page-meta p),
.font-opendyslexic { font-family: 'OpenDyslexic', 'Comic Sans MS', sans-serif; }
[data-font="comic-neue"] :is(.story-text, .news-body, .card-description, .transcript-text, .page-meta p),
.font-comic-neue { font-family: 'Comic Neue', 'Comic Sans MS', sans-serif; }
[data-font="serif"] :is(.story-text, .news-body, .card-description, .transcript-text, .page-meta p),
.font-serif { font-family: Georgia, 'Times New Roman', serif; }
.font-choice { font-size: 1.05rem; }
.comment-visibility { border: 0; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.comment-visibility .radio { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; color: var(--text); }
.reply-private { border-left: 3px solid var(--accent); padding-left: 10px; }
.reading-discussion { background: var(--surface); }
.comment-target { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; margin-bottom: 12px; }
.comment-target .radio { display: block; margin: 4px 0; font-weight: 400; color: var(--text); }
.comment-target select { margin: 4px 0 0 24px; }
/* Graphiques de l'administration */
.admin-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; margin: 24px 0; }
.chart-card { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.chart-card h3 { margin-top: 0; }
.chart-columns { display: flex; align-items: flex-end; gap: 2px; height: 150px; border-bottom: 1px solid var(--border); }
.chart-col { flex: 1; height: 100%; display: flex; flex-direction: column-reverse; }
.chart-col .seg { display: block; width: 100%; }
.seg-pages { background: var(--accent); }
.seg-comments { background: var(--info); }
.seg-accounts { background: var(--success); }
.chart-legend .key { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin: 0 4px 0 12px; vertical-align: middle; }
.chart-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.chart-bars li { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; align-items: center; font-size: .9rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 12px; border-radius: 6px; background: var(--surface-alt); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); }
.bar-fill.is-warning { background: var(--warning); }
.bar-value { color: var(--muted); font-size: .85rem; }
.news-since { background: var(--surface-alt); }
.since-counts { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; font-weight: 500; }
.since-counts .fa { color: var(--accent); }
.artist-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 18px; }
.comic-tools { margin: 14px 0; align-items: flex-start; }
.footer-credits { flex-basis: 100%; margin: 0; text-transform: none; } .footer-credits a { text-transform: none; font-size: inherit; }
/* Avatar par défaut, avatar dans la barre */
.avatar-default { background: #e8d5df url('../images/default-avatar.svg') center / cover no-repeat; }
.nav-avatar a { padding: 4px; display: flex; align-items: center; }
.nav-avatar .avatar { width: 34px; height: 34px; border: 2px solid rgba(255,255,255,.8); display: flex; line-height: 1; font-size: .95rem; }
.navbar.is-solid .nav-avatar .avatar { border-color: var(--border); }
/* Navigation du studio */
.studio-nav { border-bottom: 1px solid var(--border); background: var(--surface-alt); border-radius: var(--radius) var(--radius) 0 0; }
.studio-nav ul { list-style: none; margin: 0; padding: 8px 0; display: flex; flex-wrap: wrap; gap: 2px 4px; }
.studio-nav a { display: inline-block; padding: 6px 10px; border-radius: 3px; color: var(--text); font-size: .85rem; }
.studio-nav a:hover { background: var(--surface); color: var(--accent); }
.studio-nav a[aria-current="page"] { background: var(--surface); color: var(--accent); font-weight: 500; box-shadow: inset 0 -2px 0 var(--accent); }
.account-tips ul { margin: 0; padding-left: 20px; }
.support-platforms { display: block; margin-top: 4px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
.home-guide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; align-items: center; }
.home-guide .guide-image { margin: 0; }
.home-guide h2 { margin: 6px 0 10px; }
@media (max-width: 760px) { .home-guide { grid-template-columns: 1fr; } }
/* Plusieurs pages : dépôt, ordre, actions groupées */
.drop-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 24px; text-align: center; background: var(--surface-alt); transition: border-color .2s, background .2s; }
.drop-zone.is-over { border-color: var(--accent); background: var(--surface); }
.drop-zone > .fa { font-size: 2.4rem; color: var(--accent); }
.drop-zone input[type=file] { margin: 10px auto; }
.drop-list { list-style: decimal; text-align: left; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding-left: 20px; margin: 12px 0 0; }
.drop-list li { font-size: .8rem; overflow-wrap: anywhere; }
.drop-list img { display: block; width: 100%; height: 90px; object-fit: cover; border-radius: 3px; margin-bottom: 4px; }
.pages-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0; }
.pages-toolbar-sep { flex: 1; }
.page-position { white-space: nowrap; }
.page-position input { width: 64px; }
.drag-handle { cursor: grab; color: var(--muted); padding: 0 6px; }
tr.is-dragging { opacity: .5; background: var(--surface-alt); }
.pages-toolbar select { width: auto; min-width: 180px; }

/* Mentions légales, confidentialité */
.legal-text { max-width: 760px; margin: 0 auto; overflow-wrap: anywhere; }
.legal-text h2 { margin-top: 2em; }
.legal-text h3 { margin-top: 1.5em; }

/* Fil des abonnements, composants sociaux (templates/components) */
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.profile-actions form { margin: 0; }
.feed-list { display: flex; flex-direction: column; gap: 24px; }
.feed-card { padding: 18px 20px; }
.feed-card-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.feed-card-image img { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; border-radius: var(--radius); background: var(--border); }
.feed-context { margin: 0 0 8px; }
.feed-comment { margin-top: 12px; }
.feed-comment summary { cursor: pointer; }
.reaction-form { display: inline; margin: 0; }
.reaction-count { display: inline-flex; align-items: center; gap: 6px; color: inherit; }
.reactions .reaction-form + .reaction-form, .reactions .reaction-form + .reaction-count { margin-left: 0; }
.subscription-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.subscription-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.profile-comments { margin-top: 36px; max-width: 700px; }
.pagination-links { display: flex; justify-content: space-between; gap: 12px; }

/* Lettrage : effacement, zones tracées à la souris, tableau des textes */
.lettering-clean-options { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.lettering-eraser { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.lettering-eraser[hidden] { display: none; }
.lettering-erase-stage canvas { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: none; }
.lettering-stage { cursor: crosshair; }
.lettering-stage:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lettering-block.is-selected { border-style: solid; box-shadow: 0 0 0 3px rgba(0,0,0,.15); }
.lettering-num { position: absolute; left: -2px; top: -2px; min-width: 1.4em; padding: 0 .3em; font: 600 11px/1.6 system-ui, sans-serif; background: var(--accent); color: #fff; border-radius: 0 0 4px 0; }
.lettering-ghost { position: absolute; border: 2px dashed var(--accent); background: rgba(255,255,255,.25); pointer-events: none; }
.lettering-table-wrap { margin: 12px 0; max-height: 70vh; overflow: auto; }
.lettering-table { min-width: 100%; }
.lettering-table th[scope="row"] { min-width: 150px; vertical-align: top; }
.lettering-table td { min-width: 180px; vertical-align: top; }
.lettering-table textarea { width: 100%; min-height: 4.5em; }
.lettering-table tr.is-selected th, .lettering-table tr.is-selected td { background: rgba(0,0,0,.04); }
.lettering-row-tools { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.lettering-row-tools input[type="range"] { width: 100%; }

/* Gestion d'une page depuis sa page publique (components/page_manage) */
.page-manage { margin: 0 auto 24px; padding: 12px 16px; max-width: var(--container, 1140px); border: 1px dashed var(--border); border-radius: var(--radius); }
.page-manage form { margin: 0; }
.page-quick-edit { margin-top: 12px; }
.page-quick-edit summary { cursor: pointer; font-weight: 500; }
.page-quick-edit textarea { width: 100%; }

/* Mots-clés proposés sous le champ des tags du webcomic */
.tag-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-choice { padding: 3px 10px; border: 1px solid var(--border); border-radius: 14px; background: none; color: inherit; font: inherit; font-size: .85rem; cursor: pointer; }
.tag-choice:hover, .tag-choice[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.tag-choice[aria-pressed="true"]::before { content: "✓ "; }

/* Flux de commentaires avec réactions, panneau de gestion d'un webcomic */
.feed-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.feed-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.feed-item.is-hidden { opacity: .55; }
.feed-item-head { display: flex; gap: 10px; align-items: center; }
.feed-actions { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: flex-start; }
.feed-actions form { margin: 0; }
.feed-replies { margin-left: 2.5rem; }
.like-button[aria-pressed="true"] .fa { color: #d81b60; }
.page-order { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.page-order li { width: 7rem; display: flex; flex-direction: column; gap: 4px; cursor: grab; }
.page-order li.is-dragging { opacity: .4; }
.page-order img { width: 100%; height: 9rem; object-fit: cover; border-radius: 4px; }
.manage-actions { flex-wrap: wrap; align-items: flex-start; }
.page-order-moves { display: flex; gap: 4px; }
.page-order-moves button, .feed-actions button.btn-link, .feed-actions summary.btn-link {
    background: none; border: 0; padding: 2px 4px; color: var(--accent); cursor: pointer; font: inherit; font-size: .9rem;
}
.page-order-moves button:hover, .page-order-moves button:focus-visible, .feed-actions .btn-link:hover { text-decoration: underline; }
.feed-reply form { display: grid; gap: 6px; margin-top: 6px; min-width: min(28rem, 80vw); }
/* Styles de texte du lettrage */
.text-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 18px; }
.text-style-card .form-row { margin-bottom: 8px; }
.text-style-flags { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.text-style-preview { min-height: 4.5rem; padding: 12px 16px; border-radius: 12px; background: #d9d9d9; margin: 0 0 12px; line-height: 1.2; }
.text-style-preview.has-bg { background: #fff; box-shadow: inset 0 0 0 2px #222; }
.text-style-delete { margin-top: 4px; }
/* Partage d'un webcomic sur le fediverse : aperçu du statut */
.manage-share form { display: grid; gap: 8px; max-width: 40rem; }
.share-preview { display: grid; grid-template-columns: 6rem 1fr; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-alt); font-size: .9rem; }
.share-preview img { width: 100%; border-radius: 4px; }
.share-preview p { margin: 0 0 8px; }
.drop-list li { position: relative; }
.drop-list .drop-remove { position: absolute; top: 4px; right: 4px; width: 1.8rem; height: 1.8rem; padding: 0; border-radius: 50%; background: rgba(255,255,255,.92); box-shadow: 0 1px 3px rgba(0,0,0,.3); color: #c62828; cursor: pointer; }
.drop-list .drop-remove:hover, .drop-list .drop-remove:focus-visible { background: #c62828; color: #fff; }
.drop-count { margin: 4px 0 0; font-weight: 600; }
.manage-upload .schedule-form { margin-top: 10px; }
/* Barre de modération des pages de lecture (admins) */
.admin-moderation-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; padding: 8px 10px; border: 1px solid #e0a800; border-radius: var(--radius); background: #fff8e1; color: #5d4300; }
.admin-moderation-bar form { margin: 0; }
.admin-moderation-title { font-weight: 700; margin-right: 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .admin-moderation-bar { background: #3a2f00; color: #ffe08a; } }
:root[data-theme="dark"] .admin-moderation-bar { background: #3a2f00; color: #ffe08a; }
/* Envoi des pages en XHR : progression par vignette */
.drop-list progress { display: block; width: 100%; height: 6px; margin-top: 4px; }
.drop-list .drop-state { display: block; font-size: .75rem; }
.drop-list li.is-done .drop-state { color: #2e7d32; }
.drop-list li.is-done img { outline: 3px solid #2e7d32; }
.drop-list li.is-error .drop-state { color: #c62828; }
.drop-list li.is-error img { outline: 3px solid #c62828; opacity: .6; }
.drop-zone.is-sending { border-style: solid; }
.upload-status { font-weight: 600; }
/* Dock de lecture : réactions et commentaire fixes en bas de l'écran */
body:has(.reading-dock) { padding-bottom: 5.5rem; }
.reading-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -2px 10px rgba(0,0,0,.12); padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); }
.reading-dock-inner { max-width: 1100px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 14px; }
.reading-dock-actions { display: flex; align-items: center; gap: 6px; }
.reading-dock-actions form { margin: 0; }
.reading-dock-form { flex: 1 1 22rem; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; margin: 0; }
.reading-dock-form textarea { flex: 1 1 14rem; min-height: 2.5rem; max-height: 40vh; resize: none; margin: 0; padding: 8px 10px; line-height: 1.4; }
.reading-dock-form select { width: auto; max-width: 12rem; margin: 0; }
.reading-dock-form .btn { margin: 0; min-height: 2.5rem; }
.reading-dock-reply { flex-basis: 100%; margin: 0; font-size: .85rem; }
.reading-dock-reply .btn-link { padding: 0 4px; color: inherit; }
.reading-dock-status { flex-basis: 100%; }
.reading-dock-status:empty { display: none; }
.reply.is-reply-target { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.reply-parent { margin: 0 0 4px; }
@media (max-width: 600px) {
    .reading-dock { padding-top: 6px; }
    .reading-dock-inner { gap: 4px; }
    .reading-dock-form { flex-wrap: nowrap; flex-basis: 100%; }
    .reading-dock-form textarea { flex: 1 1 auto; min-width: 0; }
    .reading-dock-form select { max-width: 3.4rem; padding-left: 4px; padding-right: 4px; }
    .reading-dock-reply, .reading-dock-status { position: absolute; bottom: 100%; left: 0; right: 0; padding: 4px 16px; background: var(--surface); border-top: 1px solid var(--border); }
    body:has(.reading-dock) { padding-bottom: 7rem; }
}
.reading-dock-actions.reactions { margin: 0; padding: 0; border: 0; }
/* Liste des pages du studio : affichage en vignettes */
.pages-view-toggle .btn[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.pages-list [data-page-row].is-selected { background: var(--surface-alt); }
.pages-list.is-grid table, .pages-list.is-grid tbody { display: block; }
.pages-list.is-grid thead { display: none; }
.pages-list.is-grid tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 12px; }
.pages-list.is-grid [data-page-row] { position: relative; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 6px; cursor: grab; }
.pages-list.is-grid [data-page-row].is-selected { outline: 3px solid var(--accent); }
.pages-list.is-grid [data-page-row] > td { display: block; border: 0; padding: 2px 4px; width: auto !important; }
.pages-list.is-grid [data-page-row] > td:first-child { position: absolute; top: 10px; left: 10px; z-index: 1; padding: 0; }
.pages-list.is-grid [data-page-row] > td:first-child input { width: 1.2rem; height: 1.2rem; }
.pages-list.is-grid .page-position { position: absolute; top: 8px; right: 8px; z-index: 1; padding: 0; display: flex; align-items: center; gap: 2px; background: rgba(255,255,255,.9); border-radius: 4px; }
.pages-list.is-grid .page-position input { width: 3.4rem; margin: 0; padding: 2px 4px; }
.pages-list.is-grid .page-thumb { order: -1; cursor: pointer; }
.pages-list.is-grid .page-thumb img { width: 100% !important; height: 12rem; object-fit: cover; object-position: top; }
.pages-list.is-grid .btn-text { display: none; }
.pages-list.is-grid .btn-group { flex-wrap: nowrap; gap: 4px; }
.pages-list.is-grid .btn-group .btn { padding-left: 8px; padding-right: 8px; }
.preview-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; border-color: var(--warning); }
.search-results-list { list-style: none; padding: 0; display: grid; gap: 14px; }
.search-results-list li { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.search-results-list p { margin: 6px 0 0; }
.drop-list .drop-doc { display: flex; align-items: center; justify-content: center; gap: 6px; height: 90px; border-radius: 3px; margin-bottom: 4px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; color: var(--accent); }
/* Outils d'images : aperçu du bandeau retiré */
.band-preview { position: relative; margin: 10px 0; }
.band-preview img { display: block; width: 100%; max-height: 22rem; object-fit: cover; object-position: bottom; border: 1px solid var(--border); }
.band-preview .band-cut { position: absolute; left: 0; right: 0; bottom: 1.6rem; background: repeating-linear-gradient(45deg, rgba(198,40,40,.45) 0 8px, rgba(198,40,40,.25) 8px 16px); border-top: 2px dashed #c62828; pointer-events: none; }
.band-preview figcaption { height: 1.6rem; line-height: 1.6rem; }
.credits-sample { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; padding: 10px; background: var(--surface-alt); border-radius: var(--radius); overflow-wrap: anywhere; }
.credits-sample dt { font-family: monospace; color: var(--muted, #777); }
.credits-sample dd { margin: 0; }
/* Lecture à la suite : commentaires à côté de chaque page */
.scroll-comments-option { margin: 4px 0 10px; text-align: center; }
.scroll-comments { display: none; }
.has-side-comments .scroll-row { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 12px; align-items: stretch; }
.has-side-comments .scroll-row .scroll-page { margin: 0; }
.has-side-comments .scroll-comments { display: block; position: relative; min-height: 12rem; }
.scroll-comments-inner { position: absolute; inset: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text, inherit); overflow: hidden; }
.scroll-comments-toggle { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface-alt); font: inherit; font-weight: 600; text-align: left; cursor: pointer; color: inherit; }
.scroll-comments-chevron { margin-left: auto; transition: transform .2s; }
.scroll-comments-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll-comments-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px; overscroll-behavior: contain; }
.scroll-comment { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.scroll-comment p { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.scroll-comments-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--border); margin: 0; }
.scroll-comments-form textarea { flex: 1; min-height: 2.4rem; margin: 0; resize: vertical; font-size: .9rem; }
.scroll-comments-form .btn { margin: 0; align-self: flex-end; }
/* panneau replié : une étroite colonne avec le nombre de commentaires */
.has-side-comments .scroll-row:has(.scroll-comments.is-collapsed) { grid-template-columns: minmax(0, 1fr) 2.6rem; }
.scroll-comments.is-collapsed .scroll-comments-body, .scroll-comments.is-collapsed .scroll-comments-title { display: none; }
.scroll-comments.is-collapsed .scroll-comments-toggle { flex-direction: column; height: 100%; border-bottom: 0; padding: 10px 4px; }
.scroll-comments.is-collapsed .scroll-comments-chevron { margin: 0; transform: rotate(180deg); }
@media (max-width: 800px) {
    .has-side-comments .scroll-row, .has-side-comments .scroll-row:has(.scroll-comments.is-collapsed) { grid-template-columns: 1fr; }
    .has-side-comments .scroll-comments { min-height: 0; }
    .scroll-comments-inner { position: static; max-height: 60vh; }
    .scroll-comments.is-collapsed .scroll-comments-toggle { flex-direction: row; }
    .scroll-comments.is-collapsed .scroll-comments-chevron { transform: rotate(90deg); }
}
/* Fiche d'un webcomic : couverture grande (au moins la moitié de l'écran), compte à rebours en vedette */
.comic-intro { grid-template-columns: auto minmax(0, 1fr); }
.comic-intro .cover { height: max(50vh, 22rem); min-height: 50vh; width: auto; max-width: min(42vw, 640px); object-fit: cover; }
.countdown-hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 0 0 14px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface-alt); border-left: 4px solid var(--accent); font-size: 1.1rem; }
.countdown-hero [data-countdown-value] { font-size: 1.5rem; color: var(--accent); }
.countdown-private { margin: -8px 0 14px; color: var(--muted, #777); }
.countdown-private .btn-link { padding: 0 4px; }
@media (max-width: 900px) {
    .comic-intro { grid-template-columns: 1fr; }
    .comic-intro .cover { max-width: 100%; height: 50vh; margin: -110px auto 0; display: block; }
}
.recent-comments-react { margin-top: 18px; max-width: 46rem; }
/* Pages pas encore publiques : cadre pointillé (orange : programmée, gris : brouillon, rouge : masquée) */
:root { --scheduled: #ef6c00; }
.page-scheduled, .page-draft, .page-hidden { outline-offset: 3px; }
.page-scheduled { outline: 3px dashed var(--scheduled); }
.page-draft { outline: 3px dashed #9e9e9e; }
.page-hidden { outline: 3px dashed #c62828; }
tr.page-scheduled, tr.page-draft, tr.page-hidden { outline-offset: -3px; }
.comic-sidebar a.page-scheduled, .comic-sidebar a.page-draft { outline-width: 2px; outline-offset: -2px; border-radius: 4px; }
.comic-sidebar a.page-scheduled .fa { color: var(--scheduled); }
.status-scheduled { background: #fff3e0; color: #e65100; border: 1px dashed var(--scheduled); }
.page-state-label { margin: 0 0 6px; font-weight: 600; color: var(--scheduled); }
.page-draft .page-state-label { color: #757575; }
.page-hidden .page-state-label { color: #c62828; }
/* Barre fixe : panneau de gestion */
.dock-manage { position: relative; }
.dock-manage-panel { position: absolute; bottom: calc(100% + 12px); left: 0; z-index: 70; width: min(34rem, calc(100vw - 32px)); max-height: 70vh; overflow: auto; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 -4px 18px rgba(0,0,0,.18); }
.dock-manage-panel h3 { margin: 10px 0 6px; font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dock-manage-panel h3:first-child { margin-top: 0; }
.dock-manage-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dock-manage-row form { margin: 0; display: flex; gap: 6px; align-items: center; }
.dock-schedule input { margin: 0; width: auto; }
@media (max-width: 600px) { .dock-manage-panel { position: fixed; left: 8px; right: 8px; bottom: 7.5rem; width: auto; } }
/* Notifications : pastilles bleues à côté de l'avatar */
.nav-notifs a { display: inline-flex; gap: 4px; align-items: center; }
.notif-dot { display: inline-flex; align-items: center; gap: 4px; min-width: 1.6rem; height: 1.6rem; padding: 0 8px; border-radius: 999px; background: #1e88e5; color: #fff; font-size: .78rem; font-weight: 700; line-height: 1; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.notif-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.notif-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.notif-list { list-style: none; padding: 0; display: grid; gap: 10px; margin-top: 14px; }
.notif-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--border); border-left: 4px solid #1e88e5; border-radius: var(--radius); background: var(--surface); }
.notif-item p { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.notif-item form { margin: 0; }
.notif-pages .notif-item { grid-template-columns: 4rem 1fr auto; align-items: center; }
.notif-thumb img { width: 4rem; height: 4rem; object-fit: cover; border-radius: 4px; display: block; }
.notif-thumb .fa { font-size: 2rem; color: var(--muted); }
@media (max-width: 600px) { .notif-item .btn span { display: none; } }

/* ===== Fedimeet ===== */
.hero-love { background: linear-gradient(135deg, #4a148c 0%, #7b1fa2 45%, #d81b60 100%); }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 18px; }
.profile-card { display: flex; flex-direction: column; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1); overflow: hidden; }
.profile-card-photo { aspect-ratio: 4 / 5; background: linear-gradient(135deg, #ede7f6, #fce4ec); display: flex; align-items: center; justify-content: center; }
.profile-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-card-photo .initial { font: 700 4rem/1 var(--font-title); color: var(--accent); }
.profile-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.profile-card h3 { margin: 0; font-size: 1.15rem; }
.score { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #f3e5f5; color: #4a148c; font-size: .8rem; }
.chip-shared { background: var(--accent); color: #fff; }
.profile-card-actions { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.like-button[aria-pressed="true"] { background: #d81b60; color: #fff; border-color: #d81b60; }
.match-badge { display: inline-flex; align-items: center; gap: 4px; color: #d81b60; font-weight: 700; }
.search-map { height: 22rem; border-radius: var(--radius); border: 1px solid var(--border); margin: 8px 0; z-index: 0; }
.map-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.map-tools input[type=range] { flex: 1 1 12rem; }
.pending-banner { border-left: 4px solid var(--warning); }
.conversation { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; padding: 8px; background: var(--surface-alt); border-radius: var(--radius); }
.bubble { max-width: 75%; padding: 8px 12px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-1); overflow-wrap: anywhere; }
.bubble-text { white-space: pre-line; }
.bubble.mine { align-self: flex-end; background: #f3e5f5; }
.bubble time { display: block; font-size: .72rem; color: var(--muted); margin-top: 4px; }
.profile-header { display: grid; grid-template-columns: 14rem 1fr; gap: 24px; align-items: start; }
.profile-header .profile-card-photo { border-radius: var(--radius); overflow: hidden; }
@media (max-width: 700px) { .profile-header { grid-template-columns: 1fr; } }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 4px 12px; }
.review-card { display: grid; grid-template-columns: 8rem 1fr; gap: 16px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 14px; }
.hp { position: absolute; left: -9999px; }

/* Modération */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.admin-tabs a { padding: 8px 14px; border-radius: var(--radius) var(--radius) 0 0; color: inherit; text-decoration: none; }
.admin-tabs a[aria-current="page"] { background: var(--accent); color: #fff; }
.application { margin: 8px 0; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--surface-alt); white-space: pre-line; overflow-wrap: anywhere; }
.mod-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 12px; margin: 10px 0; }
.mod-photo { margin: 0; border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.mod-photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.mod-photo figcaption { padding: 6px 8px; }
.mod-photo-pending { border: 2px dashed var(--warning); }
.mod-photo-hidden { border: 2px dashed var(--danger); }
.mod-photo-hidden img { opacity: .45; }
.mod-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.table-wrap { overflow-x: auto; }
.mod-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.mod-table th, .mod-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.mod-table .avatar { width: 28px; height: 28px; vertical-align: middle; }
.mod-row { background: var(--surface-alt); }
.activity-list { padding-left: 1.2rem; }
.danger-zone { border: 1px solid var(--danger); border-radius: var(--radius); padding: 10px 14px; }
.danger-zone summary { color: var(--danger); cursor: pointer; }
.bubble.moderated { font-style: italic; color: var(--muted); }
.bubble .report-message { margin-top: 2px; }
.bubble .report-message:not([open]) summary { list-style: none; }
.bubble .report-message summary { font-size: .72rem; color: var(--muted); cursor: pointer; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 10px; margin: 12px 0; }
.gallery figure { margin: 0; position: relative; }
.gallery img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
.gallery .photo-pending img { outline: 2px dashed var(--warning); outline-offset: -2px; }
.gallery .photo-hidden img { outline: 2px dashed var(--danger); outline-offset: -2px; opacity: .5; }
.gallery figcaption { font-size: .78rem; }
.support { text-align: center; }
.profile-header h3.h5 { margin: 22px 0 8px; }

/* Mosaïque de photos de l'accueil */
.home-mosaic { padding-bottom: 0; }
.mosaic { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.mosaic figure { position: relative; margin: 0; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); background: var(--surface-alt); }
.mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.mosaic figure:hover img { transform: scale(1.04); }
.mosaic figcaption { position: absolute; inset: auto 0 0 0; padding: 14px 6px 4px; background: linear-gradient(transparent, rgba(0,0,0,.65)); line-height: 1.1; }
.mosaic .photo-credit { color: #fff; font-size: .62rem; }
.mosaic .photo-credit a { color: #fff; }
@media (max-width: 900px) { .mosaic { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 480px) { .mosaic { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; } .mosaic figure:nth-child(n+17) { display: none; } }
.photo-credit { display: block; font-size: .72rem; color: var(--muted); margin-top: 4px; }
.photo-credit a { color: inherit; text-decoration: underline; }
.profile-card > .photo-credit { padding: 2px 12px 0; margin: 0; }
