/* Scrollarr — encre, papier et trame d'imprimerie.
   Deux couleurs d'accent issues de la quadrichromie : magenta (actions),
   cyan (nouveautés, hors ligne). */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("../fonts/BigShouldersDisplay.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #F1F0F5;
  --sheet: #FFFFFF;
  --ink: #15141C;
  --tone: #63617A;
  --line: #DAD8E3;
  --accent: #C4005D;
  --accent-ink: #FFFFFF;
  --cyan: #007894;
  --block: #15141C;        /* aplat d'encre des bandeaux */
  --block-ink: #F4F3F8;
  --display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --pad: 16px;
  --tab-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --dots: radial-gradient(circle, currentColor 1.15px, transparent 1.5px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111017; --sheet: #1C1B26; --ink: #F0EFF5; --tone: #A09EB2; --line: #2F2E3D;
    --accent: #FF4D97; --accent-ink: #1C0010; --cyan: #4CCDE9; --block: #1F1D2B;
  }
}
:root[data-theme="dark"] {
  --paper: #111017; --sheet: #1C1B26; --ink: #F0EFF5; --tone: #A09EB2; --line: #2F2E3D;
  --accent: #FF4D97; --accent-ink: #1C0010; --cyan: #4CCDE9; --block: #1F1D2B;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 var(--body);
  padding-bottom: calc(var(--tab-h) + var(--safe-b));
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
h1, h2, p, ul, ol, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
#view { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ico { display: inline-flex; flex: none; }

.page { max-width: 1080px; margin: 0 auto; min-height: 60vh; }

/* ── Barres de titre ── */
.topbar {
  display: flex; align-items: center; gap: 6px;
  padding: calc(8px + var(--safe-t)) 8px 8px;
  min-height: calc(52px + var(--safe-t));
}
.topbar h1 { flex: 1; font: 700 24px/1.1 var(--display); letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar.large { padding-left: var(--pad); padding-top: calc(18px + var(--safe-t)); }
.topbar.large h1 { font-size: 36px; font-weight: 800; }
.topbar.brand { padding-left: var(--pad); }
.topbar-actions { display: flex; gap: 2px; margin-left: auto; }
.wordmark { font: 900 30px/1 var(--display); letter-spacing: .015em; }
.wordmark::after { content: ""; display: inline-block; width: .34em; height: .34em; margin-left: .12em; border-radius: 50%; background: var(--accent); }

.iconbtn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 50%; background: none; color: inherit;
}
.iconbtn:active { background: color-mix(in srgb, currentColor 12%, transparent); }
.iconbtn:disabled { opacity: .3; cursor: default; }
.iconbtn.glass { background: rgba(10, 9, 16, .55); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1.5px solid var(--ink); border-radius: 4px;
  background: transparent; color: var(--ink);
  font-weight: 650; font-size: 15px; line-height: 1.1; text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.on { background: var(--ink); color: var(--paper); }
.btn.wide { width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.textbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 4px; border: 0; background: none; color: var(--tone); font-size: 14px; font-weight: 600; }

/* ── Bandeau d'accueil ── */
.hero {
  position: relative; display: block; overflow: hidden; isolation: isolate;
  margin: 4px var(--pad) 8px; min-height: 236px; border-radius: 6px;
  background: var(--block); color: var(--block-ink);
}
.hero-tone {
  position: absolute; inset: 0; z-index: -1; color: var(--accent);
  background: var(--dots) 0 0 / 9px 9px;
  -webkit-mask-image: linear-gradient(105deg, transparent 38%, #000 100%);
  mask-image: linear-gradient(105deg, transparent 38%, #000 100%);
}
.hero-no {
  position: absolute; right: 30%; bottom: -34px; z-index: -1;
  font: 900 210px/1 var(--display); letter-spacing: -.03em;
  color: transparent; -webkit-text-stroke: 2px color-mix(in srgb, var(--block-ink) 26%, transparent);
  user-select: none;
}
.hero-cover {
  position: absolute; right: -14px; top: 22px; width: 39%; max-width: 190px; aspect-ratio: 2 / 3;
  transform: rotate(4deg); background: #2a2836; border-radius: 3px; overflow: hidden;
  box-shadow: -10px 14px 0 rgba(0, 0, 0, .45);
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-text { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 22px 18px 20px; width: 64%; min-height: 236px; }
.hero-kicker { font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--block-ink) 70%, transparent); }
.hero h2 { font: 800 38px/.98 var(--display); letter-spacing: .005em; text-wrap: balance; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-sub { font-size: 14px; color: color-mix(in srgb, var(--block-ink) 82%, transparent); }
.hero .btn { margin-top: auto; border-color: transparent; }
.hero .btn.primary { background: #FF4D97; color: #1C0010; }

/* ── Rangées ── */
.row { margin-top: 22px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 var(--pad); margin-bottom: 10px; }
.row-head h2, h2.sub, .eps-head h2, .block h2 { font: 700 23px/1.1 var(--display); letter-spacing: .01em; }
.row-more { color: var(--tone); font-size: 14px; font-weight: 600; padding: 6px 0 6px 12px; }
.scroller {
  display: flex; gap: 12px; overflow-x: auto; padding: 2px var(--pad) 6px;
  scroll-snap-type: x proximity; scroll-padding-left: var(--pad); scrollbar-width: none;
}
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { flex: none; scroll-snap-align: start; }
.scroller .card { width: 116px; }

.card { display: block; min-width: 0; }
.card-img { position: relative; aspect-ratio: 2 / 3; border-radius: 3px; overflow: hidden; background: var(--line); }
.card-img img, .resume-img img, .ep-img img, .line-img img, .shero-cover img, .nextcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
img.missing { visibility: hidden; }
.card-title { margin-top: 7px; font-weight: 650; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-sub { margin-top: 2px; color: var(--tone); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { position: absolute; font: 800 14px/1 var(--display); letter-spacing: .03em; padding: 4px 6px 3px; }
.badge.up { top: 0; left: 0; background: var(--cyan); color: var(--sheet); border-bottom-right-radius: 3px; }
.badge.count { top: 0; right: 0; background: var(--ink); color: var(--paper); border-bottom-left-radius: 3px; }
.badge.no { left: 0; bottom: 0; background: var(--ink); color: var(--paper); border-top-right-radius: 3px; font-size: 15px; }

.resume { display: flex; width: 264px; background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.resume-img { width: 76px; aspect-ratio: 2 / 3; flex: none; background: var(--line); }
.resume-body { flex: 1; min-width: 0; padding: 10px 12px; display: flex; flex-direction: column; }
.resume-series { font-weight: 650; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.resume-chapter { color: var(--tone); font-size: 13px; margin-top: 2px; }
.resume-state { color: var(--tone); font-size: 12.5px; margin-top: 5px; }
.meter { margin-top: auto; height: 6px; background: var(--line); position: relative; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 18px 12px; padding: 4px var(--pad) 8px; }
.grid-more { display: grid; place-items: center; min-height: 72px; padding: 8px var(--pad); }
h2.sub { padding: 18px var(--pad) 8px; }

/* ── Filtres ── */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px var(--pad) 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; min-height: 36px; padding: 0 14px; display: inline-flex; align-items: center;
  border: 1.5px solid var(--line); border-radius: 18px; background: transparent; color: var(--ink);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chips.static { padding-top: 0; }
.chips.static .chip { min-height: 30px; padding: 0 11px; font-size: 13px; color: var(--tone); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 0 var(--pad) 12px; scrollbar-width: none; }
.select select {
  appearance: none; -webkit-appearance: none; min-height: 36px; padding: 0 30px 0 12px; max-width: 46vw;
  border: 1.5px solid var(--line); border-radius: 4px; background-color: var(--sheet); font-size: 14px; font-weight: 600; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, var(--tone) 50%), linear-gradient(135deg, var(--tone) 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat;
}
.block { padding: 8px 0 14px; }
.block h2 { padding: 0 var(--pad) 8px; }

/* ── États ── */
.empty { padding: 56px 28px; text-align: center; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--tone); }
.empty-title { font: 800 28px/1.05 var(--display); color: var(--ink); text-wrap: balance; }
.empty .btn { margin-top: 8px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.note { color: var(--tone); font-size: 14px; }
.spinner { width: 28px; height: 28px; margin: 48px auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#offline-banner {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; justify-content: center;
  padding: calc(6px + var(--safe-t)) 12px 6px; background: var(--cyan); color: var(--sheet); font-size: 13px; font-weight: 600;
}
body.reading #offline-banner { display: none; }

#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
body.reading #toasts { bottom: calc(84px + var(--safe-b)); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; max-width: 460px; padding: 11px 14px; background: var(--ink); color: var(--paper); border-radius: 4px; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .28); }
.toast button { border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; padding: 4px; }

/* ── Feuilles ── */
.sheet-wrap { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; background: rgba(8, 7, 14, .55); }
.sheet { width: 100%; max-width: 520px; max-height: 86vh; overflow-y: auto; background: var(--sheet); color: var(--ink); border-radius: 10px 10px 0 0; padding-bottom: calc(12px + var(--safe-b)); animation: rise .18s ease-out; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 6px 4px 18px; }
.sheet-head h2 { font: 700 22px/1.15 var(--display); letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { padding: 4px 8px 4px; }
.action { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 0 10px; border: 0; border-radius: 4px; background: none; text-align: left; font-size: 15.5px; }
.action:active { background: var(--paper); }
.action > span:not(.ico) { flex: 1; }
.action small { color: var(--tone); font-size: 14px; }
.action.danger { color: var(--accent); }
.field { display: block; padding: 10px 10px 12px; }
.field legend, .field-label { display: flex; justify-content: space-between; width: 100%; padding: 0; margin-bottom: 8px; font-weight: 650; font-size: 14px; }
.field output { color: var(--tone); font-weight: 500; }
.field input[type="range"] { width: 100%; accent-color: var(--accent); margin: 0; height: 28px; }
.seg { display: flex; border: 1.5px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: grid; place-items: center; min-height: 40px; padding: 0 8px; font-size: 14px; font-weight: 600; text-align: center; }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: -3px; }
.check { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; }
.check input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--accent); }
.field .btn { margin-top: 12px; }

/* ── Fiche série ── */
.shero { position: relative; overflow: hidden; isolation: isolate; background: var(--block); color: var(--block-ink); padding-bottom: 20px; }
.shero-bg { position: absolute; inset: -30px; z-index: -2; }
.shero-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(26px) saturate(1.2) brightness(.42); }
.shero-tone { position: absolute; inset: 0; z-index: -1; color: #fff; opacity: .16; background: var(--dots) 0 0 / 8px 8px; -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%); mask-image: linear-gradient(180deg, #000, transparent 75%); }
.shero-bar { display: flex; justify-content: space-between; padding: calc(8px + var(--safe-t)) 8px 10px; }
.shero-main { display: flex; gap: 16px; align-items: flex-end; padding: 6px var(--pad) 0; }
.shero-cover { width: 34%; max-width: 168px; aspect-ratio: 2 / 3; flex: none; border-radius: 3px; overflow: hidden; background: #2a2836; box-shadow: 8px 10px 0 rgba(0, 0, 0, .4); }
.shero-text { min-width: 0; padding-bottom: 4px; }
.shero h1 { font: 800 34px/1 var(--display); letter-spacing: .005em; text-wrap: balance; overflow-wrap: anywhere; }
.shero-authors { margin-top: 8px; font-size: 14px; color: rgba(244, 243, 248, .86); }
.facts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 13px; color: rgba(244, 243, 248, .74); }
.sactions { display: flex; gap: 10px; padding: 16px var(--pad) 12px; }
.sactions .btn { flex: 1; padding: 0 10px; }
.summary { padding: 4px var(--pad) 8px; color: var(--tone); max-width: 68ch; white-space: pre-line; cursor: pointer; }
.summary.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.eps-head { display: flex; align-items: center; justify-content: space-between; padding: 18px var(--pad) 4px; }

.eps { padding-bottom: 96px; }
.ep { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.ep-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 0 10px var(--pad); }
.ep-img { position: relative; width: 52px; height: 70px; flex: none; border-radius: 2px; overflow: hidden; background: var(--line); }
.ep-bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--accent); }
.ep-body { flex: 1; min-width: 0; }
.ep-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-sub { display: flex; gap: 12px; color: var(--tone); font-size: 13px; margin-top: 2px; }
.ep-no { font: 700 26px/1 var(--display); color: var(--tone); font-variant-numeric: tabular-nums; padding-left: 4px; }
.ep.read .ep-title, .ep.read .ep-no { color: var(--tone); font-weight: 500; }
.ep.read .ep-img { opacity: .45; }
.ep-more { color: var(--tone); }
.dl { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 12.5px; font-weight: 600; color: var(--tone); }
.dl.done { color: var(--cyan); }
.dl.err { color: var(--accent); }

.cta { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 20; padding: 10px var(--pad); background: linear-gradient(180deg, transparent, var(--paper) 42%); pointer-events: none; }
.cta .btn { pointer-events: auto; max-width: 520px; margin: 0 auto; display: flex; min-height: 50px; box-shadow: 0 6px 18px rgba(0, 0, 0, .22); }
body:has(.cta) #tabbar { display: none; }
body:has(.cta) .cta { bottom: var(--safe-b); }
body:has(.cta) { padding-bottom: var(--safe-b); }

/* ── Ma liste ── */
.lines { padding: 0 var(--pad); }
.line { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.line-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.line-img { width: 52px; height: 70px; flex: none; border-radius: 2px; overflow: hidden; background: var(--line); }
.line-body { min-width: 0; }
.line-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-sub { font-size: 13.5px; color: var(--tone); }
.line-meta { font-size: 12.5px; color: var(--tone); }
.my-body > .note { padding: 4px var(--pad) 10px; }
.dlgroup { margin: 6px var(--pad) 18px; background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; }
.dlgroup-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 8px 10px; }
.dlgroup-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dlgroup-title .line-img { width: 36px; height: 48px; }
.dlgroup-title h2 { font: 700 20px/1.1 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dls li { display: flex; align-items: center; border-top: 1px solid var(--line); padding-left: 12px; }
.dls a { flex: 1; min-width: 0; display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; }
.dls-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dls-state { color: var(--tone); font-size: 13px; flex: none; }

/* ── Réglages ── */
.panel { margin: 0 var(--pad) 14px; padding: 16px; background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.panel h2 { font: 700 22px/1.1 var(--display); letter-spacing: .01em; }
.panel .field { padding: 0; width: 100%; }
.panel .seg { width: 100%; }

/* ── Connexion ── */
.login { position: relative; isolation: isolate; min-height: 100vh; min-height: 100dvh; padding: calc(72px + var(--safe-t)) 24px 40px; max-width: 420px; margin: 0 auto; }
.login-tone { position: fixed; inset: 0 0 auto 0; height: 46vh; z-index: -1; color: var(--accent); opacity: .5; background: var(--dots) 0 0 / 9px 9px; -webkit-mask-image: linear-gradient(160deg, #000, transparent 62%); mask-image: linear-gradient(160deg, #000, transparent 62%); }
.login .wordmark { font-size: 56px; }
.login-lead { margin: 10px 0 28px; color: var(--tone); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label span { display: block; font-size: 14px; font-weight: 650; margin-bottom: 6px; }
.login-form input { width: 100%; min-height: 48px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 4px; background: var(--sheet); font-size: 16px; }
.login-form input:focus { border-color: var(--ink); outline: none; }
.form-error { color: var(--accent); font-weight: 600; font-size: 14px; }
body:has(.login) { padding-bottom: 0; }

.servers { display: flex; flex-direction: column; gap: 18px; }
.server { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; }
.server h2 { font: 700 24px/1.1 var(--display); letter-spacing: .01em; }
.server .login-form { width: 100%; }
.server-state { display: flex; align-items: center; gap: 8px; color: var(--cyan); font-weight: 600; }
.server-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.login-foot { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.server-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.server-row .check span { display: flex; flex-direction: column; }
.server-row { flex-wrap: wrap; }
.server-row .check { flex: 1 1 180px; }
.server-row .btn { white-space: nowrap; flex: none; }
.tasks { width: 100%; display: flex; flex-direction: column; }
.task { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; padding-top: 0; }
.task-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.task-title { font-weight: 600; overflow-wrap: anywhere; color: inherit; text-decoration: none; }
.task-meta, .task-error { color: var(--tone); font-size: 13px; }
.task[data-state="failed"] .task-meta, .task-error { color: var(--danger, #c0392b); }
.task progress { width: 100%; height: 4px; accent-color: var(--accent); }
.task .btn { flex: none; }
.server-row small { color: var(--tone); font-size: 13px; }
.panel .field .select select { max-width: 100%; width: 100%; }

/* ── Profils ── */
.avatar { display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 800 26px/1 var(--display); }
.avatar.small { width: 34px; height: 34px; font-size: 19px; margin: 5px 6px 5px 4px; }
.who { max-width: 460px; margin: 0 auto; padding: calc(20px + var(--safe-t)) var(--pad) 40px; display: flex; flex-direction: column; gap: 16px; }
.who-head { display: flex; align-items: center; gap: 4px; margin-left: -10px; }
.who-head h1 { font: 800 40px/1 var(--display); margin-left: 10px; }
.profiles { display: flex; flex-direction: column; gap: 10px; }
.profile { display: flex; align-items: center; background: var(--sheet); border: 1.5px solid var(--line); border-radius: 4px; }
.profile.on { border-color: var(--ink); }
.profile-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 12px; border: 0; background: none; text-align: left; }
.profile-text { display: flex; flex-direction: column; min-width: 0; }
.profile-text strong { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-text small { color: var(--tone); font-size: 13px; }
.profile-text .profile-on { color: var(--cyan); font-weight: 600; }
.sheet-form { padding: 6px 10px 10px; }
body:has(.who) { padding-bottom: 0; }

/* ── Recherche ── */
.searchbar { gap: 4px; padding-right: var(--pad); }
.searchfield { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; background: var(--sheet); border: 1.5px solid var(--line); border-radius: 22px; color: var(--tone); }
.searchfield:focus-within { border-color: var(--ink); }
.searchfield input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; color: var(--ink); }
.search-out { padding-top: 6px; }

/* ── Barre d'onglets ── */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: center;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--sheet); border-top: 1px solid var(--line);
}
.tab { position: relative; flex: 1; max-width: 168px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--tone); font-size: 11.5px; font-weight: 600; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 26%; right: 26%; height: 3px; background: var(--accent); }
.tab .dot { position: absolute; top: 9px; left: calc(50% + 9px); width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); border: 2px solid var(--sheet); }

/* ── Lecteur ── */
body.reading { background: #000; padding-bottom: 0; overflow-anchor: none; }
body.reading .page { max-width: none; }
.reader { --gap: 0px; --maxw: 760px; --rb: #000; --rf: #F0EFF5; min-height: 100vh; min-height: 100dvh; background: var(--rb); color: var(--rf); padding-top: calc(52px + var(--safe-t)); }
.reader[data-bg="white"] { --rb: #FFFFFF; --rf: #15141C; }
body.reading:has(.reader[data-bg="white"]) { background: #fff; }
.strip { max-width: var(--maxw); margin: 0 auto; display: flex; flex-direction: column; gap: var(--gap); cursor: pointer; }
.pg { position: relative; width: 100%; display: grid; place-items: center; background: color-mix(in srgb, var(--rf) 7%, var(--rb)); contain: layout paint; }
.pg.guess { aspect-ratio: 2 / 3; }
.pg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; opacity: 0; -webkit-user-drag: none; user-select: none; }
.pg.ok img { opacity: 1; }
.pg .btn { color: var(--rf); border-color: var(--rf); }
.r-resume { text-align: center; font-size: 13px; padding: 6px 12px 10px; color: color-mix(in srgb, var(--rf) 62%, transparent); }

.rbar { position: fixed; left: 0; right: 0; z-index: 50; display: flex; align-items: center; gap: 4px; background: rgba(17, 16, 23, .94); color: #F0EFF5; transition: transform .2s ease; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.rbar.top { top: 0; padding: calc(4px + var(--safe-t)) 6px 4px; }
.rbar.bottom { bottom: 0; padding: 6px 8px calc(6px + var(--safe-b)); }
.bars-off .rbar.top { transform: translateY(-105%); }
.bars-off .rbar.bottom { transform: translateY(105%); }
.r-title { flex: 1; min-width: 0; padding: 0 4px; }
.r-series { font-size: 12.5px; color: rgba(240, 239, 245, .68); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-chapter { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-seek { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.r-slider { flex: 1; min-width: 0; height: 32px; margin: 0; accent-color: #FF4D97; }
.r-count { font: 700 18px/1 var(--display); font-variant-numeric: tabular-nums; min-width: 62px; text-align: right; letter-spacing: .02em; }

.end { max-width: 520px; margin: 0 auto; padding: 56px 20px calc(120px + var(--safe-b)); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.end-kicker { font-size: 14px; color: color-mix(in srgb, var(--rf) 62%, transparent); }
.end h2 { font: 800 34px/1 var(--display); text-wrap: balance; }
.end-next { width: 100%; margin: 10px 0 4px; min-height: 96px; display: grid; }
.end-note { align-self: center; color: color-mix(in srgb, var(--rf) 72%, transparent); }
.nextcard { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 14px 10px 10px; border: 0; border-radius: 4px; background: #FF4D97; color: #1C0010; text-align: left; }
.nextcard-img { width: 54px; height: 76px; flex: none; border-radius: 2px; overflow: hidden; background: rgba(0, 0, 0, .2); }
.nextcard > div:nth-child(2) { flex: 1; min-width: 0; }
.nextcard-kicker { font-size: 13px; font-weight: 600; opacity: .8; }
.nextcard-title { font: 800 24px/1.05 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.end-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.end .btn { color: var(--rf); border-color: color-mix(in srgb, var(--rf) 55%, transparent); }

/* ── Écrans larges ── */
@media (min-width: 700px) {
  :root { --pad: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 24px 18px; }
  .scroller .card { width: 148px; }
  .hero { min-height: 300px; }
  .hero-text { min-height: 300px; padding: 30px 28px 26px; }
  .hero h2 { font-size: 56px; }
  .hero-cover { right: 30px; max-width: 200px; top: 26px; }
  .hero-no { font-size: 300px; right: 24%; }
  .shero h1 { font-size: 52px; }
  .shero-main { gap: 26px; padding-bottom: 10px; }
  .sactions .btn { flex: 0 1 220px; }
  .sheet { border-radius: 10px; margin-bottom: 8vh; }
  .sheet-wrap { align-items: center; }
  .eps, .lines { max-width: 760px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .spinner { animation: none; border-top-color: var(--line); border-right-color: var(--accent); }
}
