/* ================================================================== */
/* Polices                                                             */
/* ================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/Fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("assets/fonts/Outfit.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ================================================================== */
/* Jetons                                                              */
/* ================================================================== */

:root {
  --bg: oklch(13.5% 0.03 340);
  --bg-2: oklch(17% 0.04 342);
  --surface: oklch(18.5% 0.035 345);
  --surface-2: oklch(22% 0.045 345);
  --ink: oklch(95.5% 0.015 75);
  --muted: oklch(77% 0.03 335);
  --faint: oklch(62% 0.035 335);
  --gold: oklch(83% 0.095 82);
  --gold-2: oklch(90% 0.07 85);
  --gold-ink: oklch(27% 0.05 60);
  --rose: oklch(72% 0.19 2);
  --neon: oklch(64% 0.24 4);
  --wine: oklch(40% 0.13 355);
  --plum: oklch(27% 0.08 345);
  --warn-ink: oklch(86% 0.08 0);
  --line: oklch(83% 0.095 82 / 0.24);
  --line-soft: oklch(100% 0 0 / 0.08);
  --glass: oklch(14% 0.03 340 / 0.72);
  --shadow: 0 24px 48px -28px oklch(0% 0 0 / 0.9);
  --radius: 18px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

/* ================================================================== */
/* Base                                                                */
/* ================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 140px;
}
html.locked { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1100px 520px at 8% -12%, oklch(40% 0.13 355 / 0.5), transparent 62%),
    radial-gradient(800px 460px at 105% 4%, oklch(64% 0.24 4 / 0.16), transparent 58%),
    radial-gradient(900px 600px at 50% 120%, oklch(30% 0.09 320 / 0.35), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }
a { color: var(--gold-2); text-underline-offset: 3px; }
code {
  font-size: 0.9em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--gold-2);
}
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--gold-2);
  background: var(--surface);
}
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::selection { background: var(--wine); color: white; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 650;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.noscript {
  margin: 40px auto;
  max-width: 40ch;
  text-align: center;
  color: var(--muted);
}

/* Grain tactile */
/* Couvre juste l'écran : le motif se répète, rien ne change à l'œil, mais le
   calque mélangé à chaque image (mix-blend-mode) est 4 fois plus petit qu'avec
   l'ancien « inset: -50% » (deux fois l'écran en largeur et en hauteur).
   Hauteur 100lvh : l'écran entier même quand la barre d'adresse de Safari se replie. */
.grain {
  position: fixed;
  inset: 0 0 auto;
  height: 100vh;
  height: 100lvh;
  z-index: 200;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.eyebrow {
  display: block;
  margin: 0 0 10px;
  color: var(--gold);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  text-wrap: balance;
}
p { text-wrap: pretty; }

/* ================================================================== */
/* Typographie cinétique                                               */
/* ================================================================== */

.kinetic .w { display: inline-block; white-space: nowrap; }
.kinetic .ch {
  display: inline-block;
  font-weight: 560;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  animation: type-in 1.1s var(--ease) both;
  animation-delay: calc(var(--i) * 45ms + 80ms);
  transition: font-weight 0.45s var(--ease), font-variation-settings 0.45s var(--ease), color 0.45s var(--ease), translate 0.45s var(--ease);
}
@media (hover: hover) {
  .kinetic .ch:hover {
    font-weight: 900;
    font-variation-settings: "SOFT" 100, "WONK" 1;
    color: var(--gold-2);
    translate: 0 -0.04em;
  }
}
@keyframes type-in {
  from {
    opacity: 0;
    font-weight: 150;
    font-variation-settings: "SOFT" 100, "WONK" 0;
    translate: 0 0.35em;
    filter: blur(6px);
  }
  to {
    opacity: 1;
    font-weight: 560;
    font-variation-settings: "SOFT" 40, "WONK" 1;
    translate: 0 0;
    filter: blur(0);
  }
}

/* ================================================================== */
/* Boutons                                                             */
/* ================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--plum);
  font-weight: 560;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.gold {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--gold-ink);
  font-weight: 650;
  box-shadow: 0 10px 30px -12px oklch(83% 0.095 82 / 0.7), inset 0 1px 0 oklch(100% 0 0 / 0.5);
}
.btn.gold:hover { box-shadow: 0 14px 36px -10px oklch(83% 0.095 82 / 0.85), inset 0 1px 0 oklch(100% 0 0 / 0.5); }
.btn.ghost { background: oklch(100% 0 0 / 0.02); border: 1px solid var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--gold); background: oklch(83% 0.095 82 / 0.06); }
.btn:disabled { opacity: 0.45; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s, opacity 0.2s;
}
.icon-btn:hover:not(:disabled) { border-color: var(--gold); }
.icon-btn:disabled { opacity: 0.3; }

/* ================================================================== */
/* Porte d’âge                                                         */
/* ================================================================== */

.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}
html.age-ok .gate { display: none; }
#app { display: none; }
html.age-ok #app { display: block; }

.gate-card {
  position: relative;
  width: min(560px, 100%);
  padding: clamp(28px, 6vw, 48px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    radial-gradient(120% 80% at 0% 0%, oklch(64% 0.24 4 / 0.14), transparent 55%),
    oklch(16% 0.035 342 / 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow), inset 0 1px 0 oklch(100% 0 0 / 0.06);
  animation: rise 0.9s var(--ease) both;
}
.gate-card h1 {
  margin: 0;
  font-size: clamp(44px, 10vw, 76px);
  line-height: 0.95;
}
.gate-lead { color: var(--muted); margin: 18px 0 26px; font-size: 17px; }
.gate-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.gate-card.refused .gate-actions { display: none; }

/* Écran du code, neutre : noir et or, façon accès VIP (rien de rose ni de 18+). */
html:not(.age-ok):has(.gate-vip) body {
  background:
    radial-gradient(900px 520px at 50% -10%, oklch(78% 0.09 82 / 0.10), transparent 60%),
    radial-gradient(700px 500px at 50% 115%, oklch(60% 0.06 75 / 0.08), transparent 60%),
    oklch(11% 0.006 80);
}
.gate-vip .gate-card {
  border-color: oklch(83% 0.095 82 / 0.28);
  background:
    linear-gradient(160deg, oklch(83% 0.095 82 / 0.07), transparent 40%),
    oklch(14.5% 0.008 80 / 0.92);
  text-align: center;
  box-shadow: 0 30px 80px oklch(0% 0 0 / 0.55), inset 0 1px 0 oklch(90% 0.07 85 / 0.12);
}
.gate-vip .gate-card h1 { font-size: clamp(40px, 9vw, 64px); letter-spacing: -0.01em; }
.gate-vip .gate-lead { color: oklch(78% 0.015 80); }
.gate-vip .gate-small { color: oklch(62% 0.015 80); }
.gate-vip .gate-small a { color: var(--gold); }
.gate-vip .gate-actions { justify-content: center; }
.gate-vip .code-field input { background: oklch(9% 0.005 80 / 0.9); border-color: oklch(83% 0.095 82 / 0.3); }
.gate-vip .code-field input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px oklch(83% 0.095 82 / 0.16); }
.gate-key svg { width: 30px; height: 30px; }
.gate-key {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border: 1px solid oklch(83% 0.095 82 / 0.45);
  border-radius: 50%;
  color: var(--gold);
  background: radial-gradient(circle at 50% 30%, oklch(83% 0.095 82 / 0.16), transparent 70%);
  box-shadow: 0 0 40px oklch(83% 0.095 82 / 0.18);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ================================================================== */
/* Navigation                                                          */
/* ================================================================== */

.nav {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px var(--gutter) 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.4s var(--ease);
}
.brand:hover { transform: rotate(-1.5deg) scale(1.02); }
.brand-logo {
  display: block;
  width: auto;
  height: 36px;
}
.gate-logo {
  display: block;
  width: 58px;
  height: auto;
  margin: 0 auto 18px;
  filter: drop-shadow(0 10px 24px oklch(64% 0.24 4 / 0.45));
}
.dock {
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
  transition: color 0.2s, background 0.25s var(--ease);
}
.nav-link:hover { color: var(--ink); background: oklch(100% 0 0 / 0.04); }
.nav-link[aria-current="page"] {
  color: white;
  background: var(--neon);
  box-shadow: 0 8px 22px -10px oklch(64% 0.24 4 / 0.9);
}
.nav-n { font-size: 11px; font-weight: 500; opacity: 0.7; font-variant-numeric: tabular-nums; }
.nav-n:empty { display: none; }

/* Bascule Bibli ⇄ Spicy (membres du cercle seulement, voir js/switch.js).
   Couleurs fixes des deux sites : bleu de Bibli, rose de Spicy (en hexadécimal
   pour que tools/public-css.mjs ne le change pas en bleu). */
.site-switch {
  --sw-bibli: oklch(64% 0.204 255);
  --sw-spicy: #ec3d7c;
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  margin-right: auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
}
.sw-side {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.25s;
}
.sw-side[aria-current] { color: white; }
.sw-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.55; }
.sw-bibli .sw-dot { background: var(--sw-bibli); opacity: 1; }
.sw-spicy .sw-dot { background: var(--sw-spicy); opacity: 1; }
.sw-side[aria-current] .sw-dot { background: white; }
.sw-knob {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: var(--sw-bibli);
  box-shadow: 0 6px 18px -8px var(--sw-bibli);
  transition: transform 0.22s var(--ease), background 0.22s;
}
.site-switch.on-spicy .sw-knob { transform: translateX(100%); background: var(--sw-spicy); box-shadow: 0 6px 18px -8px var(--sw-spicy); }
.site-switch.switching .sw-knob { transform: translateX(100%); background: var(--sw-spicy); }
.site-switch.on-spicy.switching .sw-knob { transform: none; background: var(--sw-bibli); }
.site-switch.switching .sw-side[aria-current] { color: var(--muted); }
.site-switch.switching .sw-side:not([aria-current]) { color: white; }
.site-switch:hover .sw-side:not([aria-current]) { color: var(--ink); }
.site-switch:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ================================================================== */
/* En-tête d’accueil                                                   */
/* ================================================================== */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: 32px;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) var(--gutter) clamp(20px, 3vw, 36px);
}
.hero h1 {
  margin: 0;
  font-size: clamp(52px, 8vw, 124px);
  line-height: 0.88;
  letter-spacing: -0.045em;
}
.lede { max-width: 54ch; color: var(--muted); margin: 20px 0 0; font-size: clamp(16px, 1.6vw, 18px); }
.watermark {
  position: absolute;
  right: -10px;
  top: -40px;
  z-index: -1;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(160px, 26vw, 340px);
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  color: oklch(64% 0.24 4 / 0.07);
  pointer-events: none;
  user-select: none;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  margin: 28px 0 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  background: oklch(100% 0 0 / 0.02);
}
.stats div {
  display: flex;
  flex-direction: column-reverse;
  padding: 10px 18px;
  border-right: 1px solid var(--line-soft);
}
.stats div:last-child { border-right: 0; }
.stats dt { font-size: 12px; color: var(--faint); letter-spacing: 0.04em; }
.stats dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.1;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

/* Éventail de couvertures */
.spotlight {
  position: relative;
  height: clamp(300px, 34vw, 420px);
  isolation: isolate;
}
.fan {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(150px, 15vw, 210px);
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 30px 60px -24px oklch(0% 0 0 / 0.9);
  transition: transform 0.6s var(--ease), box-shadow 0.4s, border-color 0.3s;
  animation: fan-in 1s var(--ease) both;
}
.fan img, .fan .art { width: 100%; height: 100%; object-fit: cover; }
.fan .art-title { display: none; }
.fan.f0 { z-index: 3; transform: translate(-50%, -50%) rotate(-1deg); animation-delay: 0.35s; }
.fan.f1 { z-index: 2; transform: translate(-108%, -46%) rotate(-11deg); animation-delay: 0.2s; }
.fan.f2 { z-index: 1; transform: translate(8%, -44%) rotate(10deg); animation-delay: 0.27s; }
.spotlight:hover .fan.f1 { transform: translate(-120%, -48%) rotate(-14deg); }
.spotlight:hover .fan.f2 { transform: translate(20%, -46%) rotate(13deg); }
.fan:hover { border-color: var(--rose); z-index: 4; box-shadow: 0 30px 70px -20px oklch(64% 0.24 4 / 0.45); }
.fan-cap {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  gap: 2px;
  padding: 40px 12px 12px;
  text-align: left;
  background: linear-gradient(transparent, oklch(10% 0.03 340 / 0.94));
}
.fan-cap b { font-family: var(--serif); font-weight: 560; font-size: 15px; line-height: 1.15; }
.fan-cap small { font-size: 11px; color: var(--gold-2); }
@keyframes fan-in {
  from { opacity: 0; translate: 0 40px; }
  to { opacity: 1; translate: 0 0; }
}

/* ================================================================== */
/* Sections de l’accueil                                               */
/* ================================================================== */

.sec-h {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.sec-h h2 { margin: 0; font-size: clamp(34px, 5vw, 60px); line-height: 0.95; letter-spacing: -0.035em; }
.sec-note { margin: 10px 0 0; color: var(--muted); font-size: 14px; max-width: 56ch; }

/* Top 10 */
.top { margin-top: clamp(20px, 4vw, 40px); }
.top-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 34px 18px;
}
.top-item {
  --pad: 38px;
  position: relative;
  padding-left: var(--pad);
  container-type: inline-size;
  animation: rise 0.6s var(--ease) both;
  animation-delay: calc(var(--d) * 40ms);
}
.top-n {
  position: absolute;
  left: -4px;
  top: calc((100cqi - var(--pad)) * 4 / 3 - 0.8em);
  z-index: 2;
  font-family: var(--serif);
  font-size: clamp(84px, 9vw, 128px);
  font-weight: 800;
  font-variation-settings: "SOFT" 0, "WONK" 0;
  line-height: 0.8;
  letter-spacing: -0.08em;
  color: oklch(12% 0.03 340 / 0.55);
  -webkit-text-stroke: 1.5px var(--gold);
  paint-order: stroke fill;
  text-shadow: 0 10px 30px oklch(0% 0 0 / 0.6);
  pointer-events: none;
  user-select: none;
}
.top-item:first-child .top-n {
  color: oklch(83% 0.095 82 / 0.9);
  -webkit-text-stroke: 0;
  text-shadow: 0 10px 40px oklch(83% 0.095 82 / 0.45);
}
.more-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--gold-2);
  transition: border-color 0.2s, background 0.2s, gap 0.3s var(--ease);
}
.more-link:hover { border-color: var(--gold); background: oklch(83% 0.095 82 / 0.06); gap: 14px; }

/* Portes vers les catalogues */
.portals { margin-top: clamp(56px, 8vw, 96px); }
.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.portal {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  min-height: 340px;
  padding: clamp(22px, 3vw, 34px);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: 30px;
  color: var(--ink);
  text-decoration: none;
  background:
    radial-gradient(120% 90% at 100% 0%, var(--p1), transparent 60%),
    linear-gradient(160deg, var(--p2), oklch(12% 0.03 340) 70%);
  box-shadow: var(--shadow);
  transition: border-color 0.3s, transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.portal-pornhwa { --p1: oklch(64% 0.24 4 / 0.38); --p2: oklch(28% 0.1 355); }
.portal-hentai { --p1: oklch(83% 0.095 82 / 0.28); --p2: oklch(24% 0.08 315); }
.portal-manhwa { --p1: oklch(64% 0.24 4 / 0.38); --p2: oklch(28% 0.1 355); }
.portal-manga { --p1: oklch(83% 0.095 82 / 0.28); --p2: oklch(24% 0.08 315); }
.portal-art {
  position: relative;
  order: 2;
  align-self: stretch;
  min-height: 240px;
}
.portal-art img {
  position: absolute;
  top: 50%;
  margin-top: calc(clamp(96px, 9vw, 124px) * -0.66);
  width: clamp(96px, 9vw, 124px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid oklch(100% 0 0 / 0.12);
  box-shadow: 0 24px 50px -20px oklch(0% 0 0 / 0.9);
  transition: transform 0.7s var(--ease);
}
.portal-art .pc0 { left: 50%; z-index: 3; translate: -50% 0; transform: rotate(-3deg); }
.portal-art .pc1 { left: 50%; z-index: 2; translate: -96% 0; transform: rotate(-12deg) translateY(18px); filter: brightness(0.75); }
.portal-art .pc2 { left: 50%; z-index: 1; translate: -4% 0; transform: rotate(10deg) translateY(22px); filter: brightness(0.75); }
.portal-body { position: relative; order: 1; display: grid; gap: 8px; }
.portal-body .eyebrow { margin: 0; }
.portal-title {
  font-family: var(--serif);
  font-size: clamp(40px, 4.4vw, 60px);
  font-weight: 600;
  font-variation-settings: "SOFT" 60, "WONK" 1;
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-shadow: 0 4px 30px oklch(0% 0 0 / 0.6);
}
.portal-text { color: var(--muted); font-size: 15px; }
.portal-meta { color: var(--muted); font-size: 13px; }
.portal-meta b { color: var(--gold-2); font-weight: 600; }
.portal-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin-top: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--gold-ink);
  font-weight: 650;
  box-shadow: 0 10px 30px -12px oklch(83% 0.095 82 / 0.7), inset 0 1px 0 oklch(100% 0 0 / 0.5);
  transition: gap 0.3s var(--ease);
}
@media (hover: hover) {
  .portal:hover { border-color: oklch(72% 0.19 2 / 0.6); transform: translateY(-4px); box-shadow: 0 40px 70px -34px oklch(64% 0.24 4 / 0.5); }
  .portal:hover .pc0 { transform: rotate(-1deg) translateY(-8px); }
  .portal:hover .pc1 { transform: rotate(-16deg) translate(-12px, 14px); }
  .portal:hover .pc2 { transform: rotate(14deg) translate(12px, 18px); }
  .portal:hover .portal-cta { gap: 16px; }
}

/* ================================================================== */
/* En-tête des pages catalogue                                         */
/* ================================================================== */

.page-head {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) var(--gutter) clamp(18px, 3vw, 28px);
}
.page-head h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 116px);
  line-height: 0.9;
  letter-spacing: -0.045em;
}
.page-head .lede { margin-top: 16px; }
.page-meta { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.page-meta:empty::before { content: "\00a0"; } /* une ligne réservée avant les chiffres */
.page-meta b { color: var(--gold-2); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ================================================================== */
/* Barre d’outils (verre)                                              */
/* ================================================================== */

.bar-sentinel { height: 1px; }
.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 12px var(--gutter) 0;
  background: linear-gradient(var(--glass), oklch(14% 0.03 340 / 0.6));
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.35s var(--ease);
}
.bar.stuck {
  border-bottom-color: var(--line-soft);
  box-shadow: 0 18px 40px -30px oklch(0% 0 0 / 0.9);
}
html.chrome-hidden .bar.stuck:not(:focus-within) { transform: translateY(-100%); box-shadow: none; }
.bar-in, .quick { max-width: var(--max); margin: 0 auto; }
.bar-in { display: flex; gap: 8px; align-items: center; }

.search-wrap {
  position: relative;
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  align-items: center;
}
.search-ico { position: absolute; left: 15px; color: var(--faint); pointer-events: none; }
.search {
  width: 100%;
  min-height: 44px;
  padding: 10px 44px 10px 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(11% 0.025 340 / 0.75);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search::placeholder { color: var(--faint); }
.search:focus { border-color: var(--rose); box-shadow: 0 0 0 4px oklch(64% 0.24 4 / 0.16); }
.search:focus-visible { outline: none; }
.search::-webkit-search-cancel-button { filter: invert(0.8) sepia(1) hue-rotate(300deg); cursor: pointer; }
.search-wrap .kbd { position: absolute; right: 12px; pointer-events: none; transition: opacity 0.2s; }
.search:focus ~ .kbd, .search:not(:placeholder-shown) ~ .kbd { opacity: 0; }

/* Contrôle segmenté */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(11% 0.025 340 / 0.75);
}
.seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.2s;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] {
  background: var(--neon);
  color: white;
  box-shadow: 0 8px 22px -10px oklch(64% 0.24 4 / 0.9);
}
.seg .n { font-size: 11px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.seg .n:empty { display: none; }
.seg.wide { display: flex; width: 100%; }
.seg.wide button { flex: 1 1 0; min-width: 0; padding-inline: 6px; }
.seg.small { flex: none; }
.seg.small button { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.seg.small .n { display: none; }
.seg.icons button { width: 38px; min-height: 34px; padding: 0; }
.seg.icons svg { width: 17px; height: 17px; }

.filters-btn { position: relative; flex: none; gap: 8px; }
.filters-btn.on { border-color: var(--rose); color: var(--ink); }
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--neon);
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.sort-wrap { position: relative; flex: none; }
.ctrl {
  appearance: none;
  min-height: 44px;
  padding: 10px 38px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e4c27a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center / 16px,
    oklch(11% 0.025 340 / 0.75);
  outline: none;
}
.ctrl:focus { border-color: var(--rose); }
.ctrl option { background: var(--bg-2); color: var(--ink); }

/* Thèmes rapides */
.quick {
  display: flex;
  gap: 6px;
  padding: 10px 2px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 40px), transparent);
  overscroll-behavior-x: contain;
}
.quick::-webkit-scrollbar { display: none; }
/* Avant l'arrivée des thèmes : la place d'une rangée de pastilles est déjà
   prise (sinon toute la liste descend d'un coup, ~58 px). */
.quick:empty { min-height: 58px; }
.quick .chip.zero { display: none; }

/* Pastilles */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: oklch(100% 0 0 / 0.035);
  color: var(--muted);
  white-space: nowrap;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s;
}
.chip:hover { color: var(--ink); border-color: var(--line); }
.chip .n { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.chip .n:empty { display: none; }
.chip.on {
  background: oklch(64% 0.24 4 / 0.18);
  border-color: var(--rose);
  color: var(--ink);
}
.chip.on .n { color: var(--warn-ink); }
.chip.zero { opacity: 0.4; }
.chip.warn.on {
  background: transparent;
  border-color: var(--rose);
  color: var(--rose);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.chip.removable svg { width: 14px; height: 14px; opacity: 0.8; }
.chip.mode-toggle { border-style: dashed; border-color: var(--line); color: var(--gold-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.center { justify-content: center; margin-top: 16px; }

/* ================================================================== */
/* Contenu                                                             */
/* ================================================================== */

.main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px var(--gutter) 64px;
  outline: none;
}
/* Accueil et catalogues : toujours plus hauts que l'écran une fois remplis.
   Pendant le chargement, le pied de page reste donc sous l'écran au lieu
   d'apparaître puis d'être repoussé (gros « saut » mesuré par Lighthouse). */
body:is([data-page="home"], [data-page="manhwa"], [data-page="manga"], [data-page="pornhwa"], [data-page="hentai"]) .main {
  min-height: 100vh;
  min-height: 100svh;
}
.status {
  text-align: center;
  color: var(--muted);
  padding: 64px 12px;
}

/* Résultats */
.results { margin-top: 24px; }
.results-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.results-h h2 { margin: 0; font-size: clamp(28px, 4vw, 44px); line-height: 1; }
.results-h h2 small {
  margin-left: 12px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--faint);
  white-space: nowrap;
}
.results-count { color: var(--gold-2); font-variant-numeric: tabular-nums; }
.active {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 14px 0 0;
}
.link {
  min-height: 34px;
  padding: 6px 8px;
  border: 0;
  background: none;
  color: var(--gold-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 14px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(176px, 100%), 1fr));
  gap: 24px 16px;
  margin-top: 22px;
}
.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr));
  gap: 10px 16px;
  margin-top: 22px;
}

.empty {
  max-width: 46ch;
  margin: 32px auto;
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 24px;
}
.empty p { margin: 6px 0; }
.empty strong { color: var(--ink); font-family: var(--serif); font-weight: 560; font-size: 22px; }
.empty-mark {
  display: block;
  width: 50px;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 8px 20px oklch(64% 0.24 4 / 0.35));
}

/* ================================================================== */
/* Cartes                                                              */
/* ================================================================== */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--radius);
  cursor: pointer;
  container-type: inline-size;
}
.cover {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.3s;
}
.cover > img, .cover > .art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease), filter 0.5s;
}
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, oklch(10% 0.03 340 / 0.5), transparent 26%, transparent 72%, oklch(10% 0.03 340 / 0.35)),
    linear-gradient(115deg, transparent 40%, oklch(100% 0 0 / 0.1) 50%, transparent 60%) no-repeat;
  background-size: 100% 100%, 250% 100%;
  background-position: 0 0, 150% 0;
  pointer-events: none;
  transition: background-position 0.9s var(--ease);
}
@media (hover: hover) {
  .card:hover .cover {
    transform: translateY(-6px);
    border-color: oklch(72% 0.19 2 / 0.6);
    box-shadow: 0 30px 50px -26px oklch(64% 0.24 4 / 0.55);
  }
  .card:hover .cover > img, .card:hover .cover > .art { transform: scale(1.05); }
  .card:hover .cover::after { background-position: 0 0, -50% 0; }
  .card:hover h3 { color: var(--gold-2); }
}
.card:has(.card-link:focus-visible) .cover { outline: 2px solid var(--gold); outline-offset: 3px; }

.pill, .score {
  position: absolute;
  z-index: 1;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.pill {
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  background: oklch(12% 0.03 340 / 0.6);
  border: 1px solid oklch(100% 0 0 / 0.1);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.score {
  top: 10px;
  right: 10px;
  min-width: 46px;
  padding: 6px 8px 5px;
  text-align: center;
  line-height: 1;
  border: 1px solid var(--line);
}
.score:not(.hot) { background: oklch(12% 0.03 340 / 0.66); }
.score b { display: block; font-family: var(--serif); font-weight: 600; font-size: 17px; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.score small { display: block; margin-top: 3px; font-size: 9px; letter-spacing: 0.08em; color: var(--muted); }
.score.hot {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-color: transparent;
  box-shadow: 0 8px 20px -8px oklch(83% 0.095 82 / 0.8);
}
.score.hot b, .score.hot small { color: var(--gold-ink); }
.score.none b { color: var(--faint); }

.body { display: flex; flex-direction: column; gap: 5px; padding: 12px 2px 0; flex: 1; }
.body h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
  transition: color 0.2s;
}
.card-link {
  all: unset;
  cursor: pointer;
}
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.fr { margin: 0; color: var(--gold); font-size: 13px; font-style: italic; }
.syn {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: oklch(83% 0.095 82 / 0.1);
  color: var(--gold-2);
  white-space: nowrap;
}
.tag.gold { background: oklch(83% 0.095 82 / 0.2); }
.tag.warn { background: oklch(64% 0.24 4 / 0.16); color: var(--warn-ink); }
.tag.quiet { color: var(--muted); background: oklch(100% 0 0 / 0.05); }
.tag.fresh { color: var(--ink); background: oklch(100% 0 0 / 0.1); font-variant-numeric: tabular-nums; }

@container (max-width: 160px) {
  .body h3 { font-size: 16px; }
  .syn { display: none; }
}

/* Vue liste compacte */
.card.line {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: oklch(100% 0 0 / 0.025);
  transition: border-color 0.2s, background 0.2s, transform 0.3s var(--ease);
}
@media (hover: hover) {
  .card.line:hover { border-color: oklch(72% 0.19 2 / 0.55); background: oklch(64% 0.24 4 / 0.06); transform: translateX(3px); }
}
.card.line:has(.card-link:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.line-cover {
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.line-cover > img, .line-cover > .art { width: 100%; height: 100%; object-fit: cover; }
.line-cover .art { padding: 10%; }
.line-cover .art-type, .line-cover .art-mark { display: none; }
.line-cover .art-title { font-size: 9px; }
.line-body { display: grid; gap: 3px; min-width: 0; }
.line-body h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.line-body .fr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-body .tags { margin-top: 2px; flex-wrap: nowrap; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.line-score { display: grid; justify-items: end; gap: 2px; text-align: right; }
.line-score b {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}
.line-score b.hot {
  padding: 4px 8px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--gold-ink);
  font-size: 20px;
}
.line-score b.none { color: var(--faint); }
.line-score small { font-size: 10px; letter-spacing: 0.06em; color: var(--faint); white-space: nowrap; }

/* Couvertures générées */
.art {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  padding: 14% 12% 12%;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 20% 0%, var(--a1), transparent 60%),
    radial-gradient(90% 60% at 100% 100%, var(--a2), transparent 65%),
    linear-gradient(165deg, var(--a3), oklch(12% 0.03 340) 75%);
  container-type: inline-size;
}
.art::before {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px solid oklch(83% 0.095 82 / 0.35);
  border-radius: 10px;
  pointer-events: none;
}
.art-type {
  position: relative;
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 12%;
}
.art-title {
  position: relative;
  align-self: end;
  font-family: var(--serif);
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: clamp(16px, 13cqi, 30px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.art-mark {
  position: absolute;
  right: -6%;
  top: 6%;
  font-family: var(--serif);
  font-size: 70cqi;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  color: oklch(100% 0 0 / 0.06);
}
.cover .art-type { visibility: hidden; }
.art.p0 { --a1: oklch(45% 0.17 0 / 0.75); --a2: oklch(70% 0.12 80 / 0.35); --a3: oklch(26% 0.09 350); }
.art.p1 { --a1: oklch(42% 0.16 320 / 0.75); --a2: oklch(60% 0.2 10 / 0.35); --a3: oklch(22% 0.08 310); }
.art.p2 { --a1: oklch(48% 0.14 40 / 0.7); --a2: oklch(55% 0.18 355 / 0.4); --a3: oklch(24% 0.07 30); }
.art.p3 { --a1: oklch(40% 0.1 270 / 0.75); --a2: oklch(62% 0.2 0 / 0.35); --a3: oklch(20% 0.06 280); }
.art.p4 { --a1: oklch(44% 0.1 170 / 0.55); --a2: oklch(72% 0.12 85 / 0.3); --a3: oklch(21% 0.05 200); }
.art.p5 { --a1: oklch(52% 0.2 15 / 0.7); --a2: oklch(40% 0.12 300 / 0.5); --a3: oklch(24% 0.1 5); }

/* ================================================================== */
/* Fenêtres (filtres, fiche)                                           */
/* ================================================================== */

dialog {
  padding: 0;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--bg-2);
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: oklch(6% 0.02 340 / 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Tiroir de filtres */
.drawer {
  margin: 0 0 0 auto;
  width: min(440px, 100vw);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  border-width: 0 0 0 1px;
  border-radius: 28px 0 0 28px;
}
.drawer-in { display: flex; flex-direction: column; height: 100%; }
.drawer-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 12px;
}
.drawer-h h2 { margin: 0; font-size: 32px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 22px 24px; overscroll-behavior: contain; }
.fgroup { padding: 18px 0; border-top: 1px solid var(--line-soft); }
.fgroup:first-child { border-top: 0; }
.fgroup h3 {
  margin: 0 0 12px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.fgroup h3 small { margin-left: 6px; text-transform: none; letter-spacing: 0; color: var(--faint); font-weight: 400; }
.fgroup-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.fgroup-h h3 { margin: 0; }
.hint { margin: -4px 0 12px; font-size: 13px; color: var(--faint); }
.drawer-f {
  display: flex;
  gap: 10px;
  padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  background: oklch(15% 0.035 342);
}
.drawer-f .btn.gold { flex: 1; }

/* Fiche */
.detail {
  width: min(1000px, calc(100vw - 32px));
  max-width: none;
  /* Hauteur fixe : sans elle, Safari (iPad, iPhone) donne une hauteur nulle à la
     fenêtre, dont le seul enfant est la zone qui défile — il ne reste qu'une ligne. */
  height: min(900px, calc(100vh - 32px));
  height: min(900px, calc(100dvh - 32px));
  max-height: min(900px, calc(100vh - 32px));
  max-height: min(900px, calc(100dvh - 32px));
  border-radius: 28px;
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 40px 100px -20px oklch(0% 0 0 / 0.8);
}
.detail[open] { display: flex; flex-direction: column; }
.sheet {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  isolation: isolate;
}
.sheet-bg {
  position: absolute;
  inset: 0 0 auto 0;
  height: 420px;
  z-index: -1;
  overflow: hidden;
  opacity: 0.45;
  -webkit-mask-image: linear-gradient(#000, transparent);
  mask-image: linear-gradient(#000, transparent);
}
.sheet-bg img, .sheet-bg .art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(40px) saturate(1.3);
  transform: scale(1.3);
}
.sheet-bg .art > * { display: none; }
.sheet-top {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 14px 0;
  pointer-events: none;
}
.sheet-top > * { pointer-events: auto; }
.sheet-top::before {
  content: "";
  position: absolute;
  inset: 0 0 -18px;
  z-index: -1;
  background: linear-gradient(var(--bg-2) 55%, transparent);
  opacity: 0;
  transition: opacity 0.25s;
}
.sheet.scrolled .sheet-top::before { opacity: 1; }
.sheet-nav { display: flex; align-items: center; gap: 6px; }
.pos {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--glass);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.sheet-grid {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 36px);
  padding: 4px clamp(18px, 3vw, 36px) 36px;
  margin-top: -26px;
}
.sheet-cover { position: sticky; top: 64px; align-self: start; }
.sheet-cover > img, .sheet-cover > .art {
  width: 100%;
  aspect-ratio: 3 / 4;
  height: auto;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -24px oklch(0% 0 0 / 0.9);
}
.credit { margin: 10px 2px 0; color: var(--faint); font-size: 12px; }
.sheet-body { padding-top: 40px; min-width: 0; }
.sheet-body h2 { margin: 0; font-size: clamp(32px, 4.6vw, 56px); line-height: 0.98; letter-spacing: -0.035em; }
.sheet-body h3 {
  margin: 26px 0 8px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.sheet-body p { margin: 0; }
.sheet-body .fr { font-size: 16px; margin-top: 8px; }
.orig { color: var(--muted); margin-top: 6px !important; font-size: 14px; }
.meta { margin-top: 10px !important; color: var(--ink); font-size: 14px; opacity: 0.85; }
.score-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 22px; }
.big-score { display: flex; align-items: baseline; gap: 4px; margin: 0 !important; }
.big-score b { font-family: var(--serif); font-weight: 600; font-size: 46px; line-height: 1; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.big-score span { color: var(--faint); font-size: 16px; }
.big-score small { margin-left: 8px; color: var(--muted); font-size: 13px; }
.big-score.alt b { font-size: 30px; color: var(--ink); }
.big-score.none b { color: var(--faint); }
.note {
  margin-top: 12px !important;
  padding: 10px 14px;
  border-left: 2px solid var(--gold);
  border-radius: 0 12px 12px 0;
  background: oklch(83% 0.095 82 / 0.05);
  color: var(--muted);
  font-size: 14px;
}
.links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.links a { font-weight: 560; }
.related {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 112px;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--plum) transparent;
}
.rel {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  scroll-snap-align: start;
}
.rel-cover {
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  transition: border-color 0.2s, transform 0.3s var(--ease);
}
.rel-cover > img, .rel-cover > .art { width: 100%; height: 100%; object-fit: cover; }
.rel-cover .art { display: flex; align-items: flex-end; padding: 10%; }
.rel-cover .art-type { display: none; }
.rel-cover .art-title { font-size: 13px; }
.rel:hover .rel-cover { border-color: var(--rose); transform: translateY(-3px); }
.rel-t { font-size: 13px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rel-s { font-size: 11px; color: var(--gold); }

/* Animations d’ouverture */
@media (prefers-reduced-motion: no-preference) {
  .detail[open], .drawer[open] {
    transition: opacity 0.35s var(--ease), transform 0.45s var(--ease), overlay 0.45s allow-discrete, display 0.45s allow-discrete;
  }
  .detail[open] { opacity: 1; transform: none; }
  @starting-style {
    .detail[open] { opacity: 0; transform: translateY(24px) scale(0.98); }
  }
  .drawer[open] { transform: none; }
  @starting-style {
    .drawer[open] { transform: translateX(100%); }
  }
  dialog[open]::backdrop { transition: opacity 0.35s; opacity: 1; }
  @starting-style {
    dialog[open]::backdrop { opacity: 0; }
  }

  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
  }

  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.28s; }
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: none; }
}

/* ================================================================== */
/* Pied de page                                                        */
/* ================================================================== */

.site-footer {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px var(--gutter) calc(48px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: 13px;
  text-align: center;
}
.shortcuts { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
@media (hover: none) { .shortcuts, .search-wrap .kbd { display: none; } }

/* ================================================================== */
/* Responsive                                                          */
/* ================================================================== */

@media (max-width: 1100px) {
  .top-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 12px; }
  .spotlight { height: 260px; margin-top: 8px; }
  .fan { width: 150px; }
  .portal-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 120px; }
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

  /* Navigation : la marque disparaît, les sections passent dans un dock flottant. */
  .nav { padding: 0; }
  .brand { display: none; }
  .dock {
    position: fixed;
    left: 50%;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 50;
    transform: translateX(-50%);
    padding: 5px;
    box-shadow: 0 18px 40px -12px oklch(0% 0 0 / 0.85), inset 0 1px 0 oklch(100% 0 0 / 0.06);
    transition: transform 0.35s var(--ease), opacity 0.35s;
  }
  html.chrome-hidden .dock:not(:focus-within) { transform: translate(-50%, calc(100% + 24px)); opacity: 0; }
  .nav-link {
    flex-direction: column;
    gap: 2px;
    min-width: 82px;
    min-height: 50px;
    padding: 6px 12px 5px;
    font-size: 11px;
    letter-spacing: 0.02em;
  }
  .nav-link svg { width: 20px; height: 20px; }
  .nav-n { display: none; }
  /* Bascule Bibli ⇄ Spicy : sur sa propre ligne en haut à droite (elle ne
     passe plus par-dessus le haut de la page), et défile avec la page. Le haut
     de page qui suit perd sa marge d'encoche, déjà prise par cette ligne. */
  .nav.has-switch {
    display: flex;
    justify-content: flex-end;
    padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 0;
  }
  .site-switch {
    margin: 0;
    font-size: 12px;
  }
  .nav.has-switch + .hero,
  .nav.has-switch + .page-head { padding-top: 10px; }
  .sw-side { min-height: 28px; padding: 3px 10px; }

  /* Accueil compact */
  .hero { padding: calc(22px + env(safe-area-inset-top)) var(--gutter) 10px; gap: 0; }
  .hero .eyebrow { margin-bottom: 6px; font-size: 11px; }
  .hero h1 { font-size: clamp(40px, 12.5vw, 60px); }
  .lede { margin-top: 10px; font-size: 14px; line-height: 1.45; }
  .watermark { font-size: 120px; top: -10px; }
  .stats { margin-top: 14px; border-radius: 12px; }
  .stats div { padding: 5px 10px; }
  .stats dt { font-size: 10px; }
  .stats dd { font-size: 17px; }
  .spotlight { display: none; }

  .sec-h { margin-bottom: 16px; gap: 14px; }
  .sec-h > div:first-child { width: 100%; }
  .sec-h h2 { font-size: 36px; }
  .sec-note { font-size: 13px; margin-top: 6px; }
  .sec-h .seg { display: flex; width: 100%; }
  .sec-h .seg button { flex: 1; }

  /* Top 10 : une rangée qui défile au doigt. */
  .top-list {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: 62vw;
    gap: 14px;
    margin: 0 calc(var(--gutter) * -1);
    padding: 4px var(--gutter) 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .top-list::-webkit-scrollbar { display: none; }
  .top-item { --pad: 30px; scroll-snap-align: start; }
  .top-n { font-size: 96px; }

  .portals { margin-top: 44px; }
  .portal { grid-template-columns: 1fr; gap: 14px; min-height: 0; padding-top: 18px; border-radius: 24px; }
  .portal-art { order: 0; min-height: 150px; }
  .portal-art img { width: 100px; margin-top: -66px; }
  .portal-title { font-size: 42px; }
  .portal-text { font-size: 14px; }

  /* En-tête des catalogues compact */
  .page-head { padding: calc(22px + env(safe-area-inset-top)) var(--gutter) 12px; }
  .page-head .eyebrow { margin-bottom: 6px; font-size: 11px; }
  .page-head h1 { font-size: clamp(42px, 13vw, 64px); }
  .page-head .lede { margin-top: 8px; font-size: 14px; line-height: 1.45; }
  .page-meta { margin-top: 8px; font-size: 13px; }
  /* Catalogues : sur téléphone, les couvertures d'abord (le nombre de titres
     est déjà dans l'en-tête des résultats). */
  .catalog-head { padding-bottom: 6px; }
  .catalog-head h1 { font-size: clamp(36px, 11vw, 52px); }
  .catalog-head .lede,
  .catalog-head .page-meta { display: none; }

  /* Barre : une seule ligne de contrôles + une ligne de pastilles. */
  .bar { padding: calc(8px + env(safe-area-inset-top)) var(--gutter) 0; }
  .bar-in { gap: 6px; }
  .search { min-height: 42px; padding-right: 12px; font-size: 16px; }
  .search-wrap .kbd { display: none; }
  .filters-btn { width: 44px; min-height: 42px; padding: 0; }
  .filters-btn > span { display: none; }
  .filters-btn .badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; font-size: 10px; }
  .ctrl {
    width: 44px;
    min-height: 42px;
    padding: 0;
    color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e4c27a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 4v16M4 17l3 3 3-3M17 20V4M14 7l3-3 3 3'/%3E%3C/svg%3E");
    background-position: center;
    background-size: 18px;
  }
  .quick { padding: 8px 2px; }
  .quick .chip { min-height: 32px; padding: 5px 11px; font-size: 13px; }

  .results { margin-top: 16px; }
  .results-h h2 { font-size: 28px; }
  .results-h h2 small { display: block; margin: 6px 0 0; }
  .active { margin-top: 10px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; margin-top: 16px; }
  .list { margin-top: 14px; gap: 8px; }
  .card.line { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 16px; }
  .line-body h3 { font-size: 16px; }
  .line-score b { font-size: 21px; }
  .line-score b.hot { font-size: 18px; }

  .drawer {
    margin: auto 0 0;
    width: 100vw;
    height: auto;
    max-height: 88dvh;
    border-width: 1px 0 0;
    border-radius: 28px 28px 0 0;
  }
  .drawer-in::before {
    content: "";
    display: block;
    width: 44px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: var(--line);
  }
  .drawer-h { padding-top: 8px; }
  .drawer-in { max-height: 88dvh; }
  @media (prefers-reduced-motion: no-preference) {
    @starting-style {
      .drawer[open] { transform: translateY(100%); }
    }
  }

  .detail {
    width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .sheet-grid { grid-template-columns: 1fr; margin-top: -20px; }
  .sheet-cover { position: relative; top: 0; width: min(220px, 60vw); margin: 20px auto 0; }
  .sheet-body { padding-top: 4px; }
  .sheet-body h2 { font-size: 34px; }
  .seg.small button { padding: 4px 8px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .chip.on, .seg button[aria-checked="true"], .nav-link[aria-current="page"] { outline: 2px solid CanvasText; }
  .grain { display: none; }
}

/* ================================================================== */
/* Communauté                                                          */
/* ================================================================== */

/* Connexion par code */
.code-field input {
  width: 100%;
  min-height: 56px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: oklch(11% 0.025 340 / 0.8);
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.code-field input::placeholder { color: var(--faint); opacity: 0.6; }
.code-field input:focus { border-color: var(--rose); box-shadow: 0 0 0 4px oklch(64% 0.24 4 / 0.16); }
.gate-card form, #login-form .gate-actions { margin-top: 16px; }
#login-form .gate-actions .btn { flex: 1; }
.gate-small { margin: 16px 0 0; color: var(--faint); font-size: 12.5px; }
.form-error {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: oklch(64% 0.24 4 / 0.14);
  border: 1px solid oklch(64% 0.24 4 / 0.4);
  color: var(--warn-ink);
  font-size: 14px;
}

/* Avatars */
.avatar {
  --s: 32px;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid oklch(100% 0 0 / 0.12);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  font-size: calc(var(--s) * 0.44);
  line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar svg { width: 55%; height: 55%; }
.avatar.a0 { background: linear-gradient(140deg, oklch(55% 0.2 5), oklch(30% 0.1 345)); }
.avatar.a1 { background: linear-gradient(140deg, oklch(70% 0.11 80), oklch(35% 0.08 40)); color: var(--gold-ink); }
.avatar.a2 { background: linear-gradient(140deg, oklch(50% 0.15 310), oklch(25% 0.08 300)); }
.avatar.a3 { background: linear-gradient(140deg, oklch(52% 0.12 250), oklch(25% 0.06 270)); }
.avatar.a4 { background: linear-gradient(140deg, oklch(55% 0.1 170), oklch(26% 0.05 200)); }
.avatar.a5 { background: linear-gradient(140deg, oklch(60% 0.17 35), oklch(30% 0.09 15)); }
.avatar.new { background: oklch(83% 0.095 82 / 0.16); color: var(--gold-2); border-color: var(--line); }

/* Navigation : 5 entrées, avatar et pastille */
.nav-avatar { display: inline-grid; place-items: center; }
.nav-link .avatar { --s: 22px; font-size: 10px; }
.nav-link { position: relative; }
.nav-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--bg);
}
.nav-proposer { }

/* Messages éphémères */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(20% 0.04 345 / 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px -16px oklch(0% 0 0 / 0.9);
  color: var(--ink);
  font-size: 14px;
  transform: translateX(-50%);
  animation: toast-in 0.35s var(--ease) both;
}
.toast svg { color: var(--gold); }
.toast.error { border-color: var(--rose); border-radius: 18px; }
.toast.error > :first-child { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--neon); color: white; font-weight: 700; flex: none; }
dialog .toast, .toast { }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Sections de l’accueil */
.home-search { position: relative; max-width: 720px; }
.home-search .search { width: 100%; }
.home-results { margin-top: 12px; }
.home-results .list { margin-top: 0; gap: 8px; }
.home-more { margin-top: 12px; }
.fresh-mine { color: var(--gold-2); }
.sec-h.small { margin-bottom: 14px; align-items: center; }
.sec-h.small h2 { font-size: clamp(28px, 3.6vw, 40px); }
.shelf-sec { margin-top: clamp(20px, 3vw, 32px); }
.shelf-sec + .top { margin-top: clamp(40px, 5vw, 64px); }
.top + .top { margin-top: clamp(48px, 6vw, 80px); }
.feed-sec { margin-top: clamp(48px, 6vw, 80px); }
.more-link.small { min-height: 36px; padding: 6px 14px; font-size: 14px; }

.hrow {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(300px, 360px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.hrow::-webkit-scrollbar { display: none; }
/* « Sortis cette semaine » : visible dès le départ (presque toujours rempli),
   avec la hauteur d'une rangée de cartes, pour que la suite ne saute pas.
   S'il n'y a aucune sortie, renderFresh() cache la section. */
#fresh-list:empty { min-height: 150px; }
.mini-card {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background:
    radial-gradient(120% 100% at 0% 0%, oklch(64% 0.24 4 / 0.1), transparent 60%),
    oklch(100% 0 0 / 0.03);
  scroll-snap-align: start;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.3s var(--ease);
}
@media (hover: hover) { .mini-card:hover { border-color: oklch(72% 0.19 2 / 0.55); transform: translateY(-2px); } }
.mini-card:has(.card-link:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.mini-card .card-link::after { border-radius: 20px; }
.mini-cover { aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.mini-cover > img, .mini-cover > .art { width: 100%; height: 100%; object-fit: cover; }
.mini-cover .art { padding: 10%; }
.mini-cover .art-type, .mini-cover .art-mark { display: none; }
.mini-cover .art-title { font-size: 12px; }
.mini-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mini-body h3 { margin: 0; font-size: 18px; line-height: 1.15; }
.mini-who { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; color: var(--muted); }
.mini-who b { color: var(--ink); font-weight: 600; }
.mini-quote { margin: 2px 0 0; color: var(--gold-2); font-size: 13px; font-style: italic; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-chapter { margin: 0; color: var(--muted); font-size: 14px; }
.mini-chapter b { color: var(--gold-2); font-family: var(--serif); font-size: 18px; }
.mini-when { margin: 0; color: var(--faint); font-size: 12px; }
.mini-actions { position: relative; z-index: 1; display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }
.mini-actions .chip svg { width: 15px; height: 15px; }

.top-empty {
  grid-column: 1 / -1;
  padding: 28px 22px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  color: var(--muted);
  text-align: center;
}
.top-empty p { margin: 4px 0; }
.top-empty strong { color: var(--ink); font-family: var(--serif); font-weight: 560; font-size: 20px; }

/* Fil d’activité */
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.feed-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-soft);
}
.feed-item:last-child { border-bottom: 0; }
.feed-text { margin: 0; font-size: 15px; line-height: 1.4; color: var(--muted); }
.feed-text b { color: var(--ink); font-weight: 600; }
.feed-work {
  all: unset;
  cursor: pointer;
  color: var(--gold-2);
  font-family: var(--serif);
  font-weight: 560;
  text-decoration: underline;
  text-decoration-color: oklch(83% 0.095 82 / 0.35);
  text-underline-offset: 3px;
}
.feed-work:hover { text-decoration-color: var(--gold); }
.feed-work:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.feed-score {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: oklch(83% 0.095 82 / 0.16);
  color: var(--gold-2);
  font-size: 13px;
  font-weight: 600;
}
.feed-meta { color: var(--faint); font-size: 13px; }
.feed-quote { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-style: italic; }
.feed-time { display: block; margin-top: 2px; color: var(--faint); font-size: 12px; }
.feed-cover {
  width: 40px;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
}
.feed-cover > img, .feed-cover > .art { width: 100%; height: 100%; object-fit: cover; }
.feed-cover .art { padding: 6%; }
.feed-cover .art > * { display: none; }
.feed-empty { padding: 22px 8px; color: var(--muted); }

/* Étiquettes du cercle */
.tag.circle { background: oklch(64% 0.24 4 / 0.18); color: var(--warn-ink); }
.tag.status { background: oklch(100% 0 0 / 0.07); color: var(--ink); }
.tag.status.s-en_cours { background: oklch(64% 0.24 4 / 0.85); color: white; }
.tag.status.s-termine { background: oklch(83% 0.095 82 / 0.85); color: var(--gold-ink); }
.tag.status.s-a_lire { background: oklch(55% 0.08 250 / 0.5); color: var(--ink); }
.tag.status.s-abandonne { background: oklch(100% 0 0 / 0.06); color: var(--faint); text-decoration: line-through; }
.score.circle { border-color: oklch(72% 0.19 2 / 0.6); }
.score.circle:not(.hot) b { color: var(--warn-ink); }
.score.circle.hot { background: linear-gradient(180deg, oklch(75% 0.17 5), var(--neon)); }
.score.circle.hot b, .score.circle.hot small { color: white; }

/* Fiche : ma lecture, ma note, le cercle */
.mine-box, .circle-box {
  margin-top: 22px;
  padding: 4px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(120% 80% at 100% 0%, oklch(64% 0.24 4 / 0.1), transparent 55%),
    oklch(100% 0 0 / 0.025);
}
.circle-box { border-color: var(--line-soft); }
.mine-box h3, .circle-box h3 { margin-top: 18px !important; }
.status-seg button { min-height: 42px; font-size: 14px; }
.hint-line { margin: 8px 2px 0 !important; color: var(--faint); font-size: 12.5px; }
.chapter { display: flex; align-items: center; gap: 8px; margin-top: 12px; }

/* Suivi des chapitres (js/suivi.js) : statut de la série, chapitres sortis, reste à lire. */
.suivi { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.suivi-status { color: var(--ink); font-weight: 600; }
.suivi-status::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 6px 1px 0; border-radius: 50%; background: currentColor; }
.suivi-status.s-en_cours::before { background: oklch(78% 0.17 150); }
.suivi-status.s-en_pause::before { background: oklch(82% 0.15 85); }
.suivi-status.s-termine::before { background: var(--rose); }
.suivi-status.s-arrete::before { background: var(--faint); }
.suivi-left { margin: 4px 0 0; color: var(--ink); font-size: 14px; font-weight: 500; }
.chapter-label { color: var(--muted); font-size: 14px; margin-right: 4px; }
.chapter input {
  width: 92px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: oklch(11% 0.025 340 / 0.75);
  font-family: var(--serif);
  font-size: 20px;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}
.chapter input::-webkit-outer-spin-button, .chapter input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.chapter input:focus { border-color: var(--rose); }
.icon-btn.small { width: 42px; height: 42px; }
.rate { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.rate button {
  min-height: 42px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: oklch(100% 0 0 / 0.04);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s var(--ease);
}
.rate button:hover { border-color: var(--line); color: var(--ink); }
.rate button:active { transform: scale(0.92); }
.rate button.lit { background: oklch(83% 0.095 82 / 0.22); border-color: oklch(83% 0.095 82 / 0.4); color: var(--gold-2); }
.rate button[aria-checked="true"] { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: transparent; color: var(--gold-ink); }
.rate-extra { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.rate-value { color: var(--muted); font-size: 14px; }
.rate-value b { color: var(--gold-2); font-family: var(--serif); font-size: 24px; }
.chip:disabled { opacity: 0.4; cursor: default; }
.review { display: grid; gap: 8px; margin-top: 12px; }
.review textarea, .reco-panel input, .field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: oklch(11% 0.025 340 / 0.75);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.review textarea:focus, .reco-panel input:focus, .field input:focus, .field textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 4px oklch(64% 0.24 4 / 0.14); }
.review textarea:disabled { opacity: 0.5; }
.review .btn { justify-self: start; }
.btn.small { min-height: 38px; padding: 8px 14px; font-size: 14px; }
.btn.block { width: 100%; }
.link.small { font-size: 13px; min-height: 30px; padding: 4px 6px; }

.reco-box { margin-top: 18px; }
.reco-box > summary { list-style: none; width: fit-content; cursor: pointer; }
.reco-box > summary::-webkit-details-marker { display: none; }
.reco-box[open] > summary { border-color: var(--gold); }
.reco-panel { display: grid; gap: 10px; margin-top: 12px; }
.reco-panel .btn { justify-self: start; }
.chip.person { padding-left: 5px; }
.chip.person .avatar { --s: 24px; font-size: 11px; }

.circle-avg { margin-left: 8px; font-family: var(--sans); font-size: 12px; letter-spacing: 0.02em; text-transform: none; color: var(--warn-ink); }
.circle-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.circle-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.circle-who p { margin: 0 !important; }
.circle-who p:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 34px; }
.circle-review { color: var(--muted); font-size: 14px; font-style: italic; }
.circle-score {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 34px;
  padding: 0 8px;
  border-radius: 12px;
  background: oklch(83% 0.095 82 / 0.16);
  color: var(--gold-2);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}
.muted-line { margin: 4px 0 0 !important; color: var(--faint); font-size: 14px; }

/* Fiche : où lire (sources proposées par le cercle) */
.source-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.source-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.source-row a { font-weight: 560; overflow-wrap: anywhere; }
.source-by { color: var(--faint); font-size: 13px; }
.source-row .link.small { margin-left: auto; }
.source-group { margin: 14px 0 8px !important; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.source-box h3 + .source-group { margin-top: 4px !important; }
/* Un lien par langue (le site le plus fiable), les autres derrière la flèche */
.source-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.source-top .source-list { flex: 0 1 auto; min-width: 0; }
.source-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
  min-height: 28px;
  padding: 2px 6px 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.source-toggle:hover { color: var(--ink); border-color: var(--muted); }
.source-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease; }
.source-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.source-rest { margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--line); }
.source-rest[hidden] { display: none; }

/* Page Proposer */
.main.narrow { max-width: 760px; }
.panel {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(120% 80% at 0% 0%, oklch(64% 0.24 4 / 0.1), transparent 55%),
    oklch(100% 0 0 / 0.025);
  box-shadow: var(--shadow);
}
.propose-form { display: grid; gap: 14px; }
.field { display: grid; gap: 8px; }
.field-label { font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
#propose-title { min-height: 56px; font-family: var(--serif); font-size: 22px; }
.more-fields > summary { cursor: pointer; color: var(--gold-2); font-size: 14px; width: fit-content; }
.more-fields[open] > summary { margin-bottom: 12px; }
.more-fields .field + .field { margin-top: 12px; }
.dupes:empty { display: none; }

/* Suggestions pendant la frappe (Proposer) */
.field:has(> .suggest) { position: relative; }
.suggest {
  position: absolute;
  z-index: 30;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  max-height: min(420px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-2);
  box-shadow: 0 24px 60px -18px oklch(0% 0 0 / 0.75);
}
.suggest[hidden] { display: none; }
.suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}
.suggest-item.active { background: var(--line-soft); }
@media (hover: hover) { .suggest-item:hover { background: var(--line-soft); } }
.suggest-item img, .suggest-noimg {
  flex: none;
  width: 36px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--line-soft);
}
.suggest-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.suggest-name { color: var(--ink); font-weight: 600; font-size: 15px; letter-spacing: 0; text-transform: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-meta { color: var(--faint); font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-here { flex: none; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--gold); }
.suggest-credit { margin: 4px 10px 2px; font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--faint); }
.dupe { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 14px; }
.dupe svg { color: var(--gold); }
.proposals { margin-top: 40px; }
.proposal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.proposal {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: oklch(100% 0 0 / 0.025);
}
.proposal-main { min-width: 0; }
.proposal-title { margin: 0; font-family: var(--serif); font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proposal-meta { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; color: var(--faint); font-size: 13px; }
.proposal-meta .avatar { --s: 18px; font-size: 9px; }
.proposal-note { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.proposal-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.state { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-en_attente { background: oklch(100% 0 0 / 0.07); color: var(--muted); }
.st-ajoute { background: oklch(83% 0.095 82 / 0.85); color: var(--gold-ink); }
.st-refuse { background: oklch(64% 0.24 4 / 0.16); color: var(--warn-ink); }
.private-door { margin: 6px 0 14px; }

/* Proposition directe : chargement animé, puis fiche à valider */
.propose-flow { margin-bottom: 8px; }
.flow-loading { display: grid; justify-items: center; text-align: center; gap: 6px; padding-block: clamp(26px, 5vw, 44px); overflow: hidden; }
.flow-title { margin: 0; font-family: var(--serif); font-size: clamp(26px, 5vw, 34px); font-weight: 600; line-height: 1.1; }
.flow-line { margin: 4px 0 10px; min-height: 1.5em; color: var(--muted); }
.flow-line.in { animation: flow-line-in 0.6s var(--ease) both; }
.flow-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; text-align: left; width: min(100%, 320px); }
.flow-step { display: flex; align-items: center; gap: 12px; color: var(--faint); transition: color 0.3s; }
.flow-step.active { color: var(--ink); }
.flow-step.done { color: var(--muted); }
.flow-dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border: 1.5px solid var(--line);
  border-radius: 50%;
}
.flow-dot svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.flow-step.done .flow-dot { border-color: var(--gold); background: var(--gold); color: var(--gold-ink); animation: flow-pop 0.4s var(--ease); }
.flow-step.active .flow-dot { border-color: var(--neon); }
.flow-step.active .flow-dot::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--rose);
  animation: flow-spin 0.9s linear infinite;
}
.flow-slow { max-width: 420px; margin: 10px 0 0; font-size: 14px; }
.flow-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.flow-actions.center { justify-content: center; }

/* Le livre qui s'ouvre et feuillette */
.flow-stage { position: relative; width: 200px; height: 170px; margin-bottom: 6px; perspective: 900px; }
.flow-glow {
  position: absolute;
  inset: 10px 20px 30px;
  border-radius: 50%;
  background: radial-gradient(closest-side, oklch(64% 0.24 4 / 0.55), oklch(83% 0.095 82 / 0.18) 60%, transparent);
  filter: blur(14px);
  animation: flow-breathe 2.6s ease-in-out infinite;
}
.flow-book {
  position: absolute;
  left: 50%;
  top: 34px;
  width: 156px;
  height: 104px;
  margin-left: -78px;
  transform-style: preserve-3d;
  transform: rotateX(34deg);
  animation: flow-float 3.2s ease-in-out infinite;
}
/* Livre ouvert : couverture rigide dessous, une page fixe de chaque côté. */
.flow-book::before {
  content: "";
  position: absolute;
  inset: -5px -6px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--wine), var(--plum));
  border: 1px solid oklch(83% 0.095 82 / 0.55);
  box-shadow: 0 22px 30px -18px oklch(0% 0 0 / 0.95);
  transform: translateZ(-2px);
}
.flow-half, .flow-page {
  position: absolute;
  top: 0;
  width: 78px;
  height: 100%;
  background:
    repeating-linear-gradient(180deg, transparent 0 9px, oklch(40% 0.05 340 / 0.2) 9px 10px) 12px 16px / 52px 72px no-repeat,
    linear-gradient(90deg, oklch(88% 0.03 75), oklch(96% 0.02 80));
}
.flow-half.left { left: 0; border-radius: 4px 0 0 4px; box-shadow: inset -10px 0 12px -8px oklch(0% 0 0 / 0.4); }
.flow-half.right { left: 78px; border-radius: 0 4px 4px 0; box-shadow: inset 10px 0 12px -8px oklch(0% 0 0 / 0.4); }
.flow-half.left img { position: absolute; left: 50%; top: 50%; width: 26px; height: auto; margin: -15px 0 0 -13px; opacity: 0.35; }
.flow-page {
  left: 78px;
  border-radius: 0 4px 4px 0;
  transform-origin: left center;
  box-shadow: inset 10px 0 12px -8px oklch(0% 0 0 / 0.3);
}
.flow-page.p1 { animation: flow-flip 2.4s var(--ease) infinite; }
.flow-page.p2 { animation: flow-flip 2.4s var(--ease) 0.8s infinite; }
.flow-page.p3 { animation: flow-flip 2.4s var(--ease) 1.6s infinite; }
.flow-spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-2);
  box-shadow: 0 0 10px 2px oklch(83% 0.095 82 / 0.7);
  opacity: 0;
  animation: flow-spark 2.8s ease-out infinite;
}
.flow-spark.s1 { left: 52%; top: 40%; --dx: -60px; --dy: -50px; }
.flow-spark.s2 { left: 58%; top: 45%; --dx: 58px; --dy: -40px; animation-delay: 0.7s; }
.flow-spark.s3 { left: 55%; top: 38%; --dx: -30px; --dy: -70px; animation-delay: 1.4s; width: 4px; height: 4px; }
.flow-spark.s4 { left: 60%; top: 42%; --dx: 40px; --dy: -72px; animation-delay: 2.1s; width: 4px; height: 4px; background: var(--rose); box-shadow: 0 0 10px 2px oklch(64% 0.24 4 / 0.7); }
.flow-shadow {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 120px;
  height: 14px;
  margin-left: -60px;
  border-radius: 50%;
  background: radial-gradient(closest-side, oklch(0% 0 0 / 0.6), transparent);
  animation: flow-shadow 3.2s ease-in-out infinite;
}

@keyframes flow-flip {
  0% { transform: rotateY(0deg); filter: brightness(1); }
  45% { filter: brightness(0.82); }
  70%, 100% { transform: rotateY(-180deg); filter: brightness(1); }
}
@keyframes flow-float {
  0%, 100% { transform: rotateX(34deg) translateY(0); }
  50% { transform: rotateX(34deg) translateY(-8px); }
}
@keyframes flow-shadow { 0%, 100% { transform: scaleX(1); opacity: 0.9; } 50% { transform: scaleX(0.82); opacity: 0.55; } }
@keyframes flow-breathe { 0%, 100% { opacity: 0.65; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes flow-spark {
  0% { opacity: 0; transform: translate(0, 0) scale(0.4); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
}
@keyframes flow-spin { to { transform: rotate(360deg); } }
@keyframes flow-pop { 0% { transform: scale(0.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes flow-line-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes flow-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* La fiche à valider */
.flow-review { display: grid; gap: 10px; animation: flow-rise 0.6s var(--ease) both; }
.flow-help { margin: 0; font-size: 14px; }
.flow-pending { margin: 10px 0 6px; }
.flow-small { margin: 0; font-size: 13px; }
.flow-sheet { display: grid; grid-template-columns: minmax(120px, 170px) 1fr; gap: clamp(16px, 3vw, 26px); margin-top: 10px; align-items: start; }
.flow-cover-pick { display: grid; gap: 10px; }
.flow-cover-main {
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--wine), var(--plum));
  box-shadow: var(--shadow);
}
.flow-cover-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flow-cover-none { display: grid; place-items: center; height: 100%; font-family: var(--serif); font-size: 56px; color: var(--gold-2); }
.flow-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.flow-thumb {
  width: 40px;
  height: 53px;
  padding: 0;
  border: 1.5px solid var(--line-soft);
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
}
.flow-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flow-thumb[aria-checked="true"] { border-color: var(--gold); box-shadow: 0 0 0 2px oklch(83% 0.095 82 / 0.3); }
.flow-info { display: grid; gap: 10px; align-content: start; min-width: 0; }
.flow-name { margin: 0; font-family: var(--serif); font-size: clamp(22px, 4vw, 28px); line-height: 1.15; overflow-wrap: anywhere; }
.flow-type { justify-self: start; }
.flow-meta, .flow-rating, .flow-premise, .flow-tags { margin: 0; }
.flow-meta { color: var(--muted); }
.flow-rating b { color: var(--gold-2); font-size: 18px; }
.flow-premise { color: var(--ink); line-height: 1.55; }
.flow-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.flow-links { margin-top: 12px; display: grid; gap: 8px; }
.flow-links h3 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.flow-link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.flow-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: oklch(100% 0 0 / 0.025);
}
.flow-link.sure .flow-dot { border-color: var(--gold); background: var(--gold); color: var(--gold-ink); }
.flow-check { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.flow-check input { width: 22px; height: 22px; flex: none; accent-color: var(--gold); }
.flow-link-main { display: grid; gap: 2px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.flow-link-main .faint { font-size: 13px; }
.flow-open { flex: none; color: var(--gold-2); font-size: 14px; white-space: nowrap; }
@media (max-width: 560px) {
  .flow-sheet { grid-template-columns: 1fr; }
  .flow-cover-pick { grid-template-columns: 120px 1fr; align-items: start; }
  .flow-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .flow-glow, .flow-book, .flow-page, .flow-spark, .flow-shadow, .flow-line.in, .flow-review, .flow-step.done .flow-dot { animation: none; }
  .flow-page { display: none; }
  .flow-step.active .flow-dot::after { animation-duration: 2.4s; }
}

/* Page Moi */
.me-card { display: flex; align-items: center; gap: clamp(16px, 3vw, 28px); }
.avatar-edit {
  position: relative;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
}
.avatar-edit .avatar { --s: 96px; font-size: 40px; border: 2px solid var(--line); box-shadow: 0 20px 40px -18px oklch(0% 0 0 / 0.9); }
.avatar-cam {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--gold-ink);
  box-shadow: 0 0 0 3px var(--bg);
}
.avatar-cam svg { width: 17px; height: 17px; }
.avatar-edit.busy .avatar { opacity: 0.5; }
.avatar-edit:hover .avatar { border-color: var(--gold); }
.me-text { min-width: 0; }
.me-text .eyebrow { margin-bottom: 4px; }
.me-name {
  margin: 0;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.tabs-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px var(--gutter);
  background: linear-gradient(var(--glass), oklch(14% 0.03 340 / 0.5));
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.seg.tabs { display: flex; width: 100%; max-width: 640px; }
.seg.tabs button { flex: 1; position: relative; }
.seg.tabs button[aria-selected="true"] {
  background: var(--neon);
  color: white;
  box-shadow: 0 8px 22px -10px oklch(64% 0.24 4 / 0.9);
}
.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 2px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-size: 10px;
}
#profile-panel { margin-top: 18px; }
.pile-group { margin-top: 26px; }
.pile-group:first-child { margin-top: 6px; }
.group-h {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 26px;
}
.group-h span { font-family: var(--sans); font-size: 13px; color: var(--gold); font-weight: 500; letter-spacing: 0; }
.list.one { grid-template-columns: 1fr; }
.line-note { margin: 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-score { color: var(--gold-2); font-weight: 600; }
.reco-line { display: grid; gap: 8px; }
.reco-line .chip { justify-self: start; }
.reco-line.unseen .card.line { border-color: var(--gold); }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.member-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: oklch(100% 0 0 / 0.025);
}
.member-card.me { border-color: var(--line); }
.member-card h3 { margin: 0; font-size: 20px; }
.member-card h3 small { font-family: var(--sans); font-size: 12px; color: var(--faint); font-weight: 400; }
.member-card p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.member-now { color: var(--faint) !important; }
.member-open {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}
.member-open:hover, .member-open:focus-visible { text-decoration-color: currentColor; }
.member-card:has(.member-open) { cursor: pointer; }
.member-view { display: grid; gap: 18px; }
.member-back { justify-self: start; }
.member-head h2 { margin: 0; font-size: 26px; }
.logout-wrap { display: flex; justify-content: center; padding: 0 var(--gutter) 24px; }
/* Notifications : bouton de la fiche (js/pwa.js) et réglages du profil. */
.alert-slot:empty { display: none; }
.alert-slot { margin: 10px 0 0; }
.alert-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: oklch(100% 0 0 / 0.03); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.alert-btn:hover { border-color: var(--rose); }
.alert-btn.on { border-color: var(--rose); background: color-mix(in oklch, var(--rose) 16%, transparent); color: var(--rose); }
.alert-btn:disabled { opacity: .6; cursor: progress; }
.alert-btn svg, .notif-open svg, .notif-dialog .btn svg, .notif-note svg { flex: none; }
.notif-open { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; }
.notif-dialog { width: min(480px, calc(100vw - 32px)); max-height: min(640px, calc(100dvh - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); overflow: auto; }
.notif-dialog::backdrop { background: oklch(0% 0 0 / 0.6); backdrop-filter: blur(4px); }
.notif-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 8px 20px; background: var(--surface); }
.notif-head h2 { margin: 0; font-size: 1.25rem; }
#notif-body { padding: 0 20px 20px; }
#notif-body h3 { margin: 18px 0 6px; font-size: 1rem; }
.notif-note { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.notif-note.on { color: var(--rose); font-weight: 600; }
.notif-dialog .btn { display: inline-flex; align-items: center; gap: 8px; }
.notif-prefs, .notif-follow { margin: 8px 0 0; padding: 0; list-style: none; }
.notif-switch { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; cursor: pointer; }
.notif-switch input { appearance: none; flex: none; position: relative; width: 42px; height: 24px; margin: 0; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; transition: background .2s; }
.notif-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: transform .2s; }
.notif-switch input:checked { background: var(--rose); border-color: var(--rose); }
.notif-switch input:checked::after { transform: translateX(18px); }
.notif-switch input:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.notif-follow li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.notif-follow li span { min-width: 0; overflow-wrap: anywhere; }
.notif-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
@media (prefers-reduced-motion: reduce) { .alert-btn, .notif-switch input, .notif-switch input::after { transition: none; } }

/* Fenêtre « Installer Bibli » (js/install.js) : carte en bas, la page reste utilisable. */
.install-popup { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 240; width: min(440px, calc(100vw - 24px)); padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px -18px oklch(0% 0 0 / 0.9); transform: translateX(-50%); animation: toast-in 0.4s var(--ease) both; }
.install-popup.leaving { opacity: 0; transform: translate(-50%, 16px); transition: opacity .25s, transform .25s; }
.install-head { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: start; }
.install-icon { width: 48px; height: 48px; border-radius: 12px; }
.install-title { margin: 2px 0 4px; font-size: 1.05rem; font-weight: 700; }
.install-lead { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.install-close { margin: -4px -4px 0 0; }
.install-steps { margin: 12px 0 0; padding: 0 0 0 22px; font-size: 14px; line-height: 1.5; }
.install-steps li { margin: 6px 0; }
.install-steps svg { display: inline-block; margin: 0 4px -3px 2px; color: var(--rose); }
.install-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.install-actions .btn { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 760px) {
  .install-popup { bottom: calc(84px + env(safe-area-inset-bottom)); }
  html.chrome-hidden .install-popup { bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .install-popup { animation: none; } .install-popup.leaving { transition: none; } }
.mode-note { margin-top: 10px; color: var(--gold); }

@media (max-width: 760px) {
  .code-field input { font-size: 19px; letter-spacing: 0.06em; padding-inline: 10px; }
  .dock.wide { padding: 4px; gap: 0; }
  .dock.wide .nav-link { min-width: 0; width: 66px; padding: 6px 4px 5px; font-size: 10.5px; }
  .dock.wide .nav-link svg { width: 19px; height: 19px; }
  .nav-badge { top: 0; right: 10px; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .hrow { grid-auto-columns: 84vw; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 8px; scroll-padding-inline: var(--gutter); }
  .mini-card { grid-template-columns: 76px minmax(0, 1fr); }
  .feed-text { font-size: 14px; }
  .mine-box, .circle-box { margin-left: -4px; margin-right: -4px; padding: 2px 14px 16px; border-radius: 20px; }
  .rate { gap: 3px; }
  .rate button { min-height: 40px; font-size: 15px; border-radius: 10px; }
  .status-seg button { font-size: 12.5px; padding-inline: 2px; }
  .me-card { gap: 14px; }
  .avatar-edit .avatar { --s: 76px; font-size: 32px; }
  .me-name { font-size: clamp(34px, 10vw, 48px); }
  .tabs-bar { padding: calc(8px + env(safe-area-inset-top)) var(--gutter) 8px; }
  .seg.tabs button { padding-inline: 4px; font-size: 13px; }
  .proposal { flex-direction: column; }
  .proposal-side { flex-direction: row; align-items: center; }
  html.chrome-hidden .tabs-bar:not(:focus-within) { transform: translateY(-100%); }
  .tabs-bar { transition: transform 0.35s var(--ease); }
}

/* ================================================================== */
/* Mode édition (admin)                                                */
/* ================================================================== */

.edit-bar {
  position: fixed;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
}
.edit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(20% 0.04 345 / 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--gold-2);
  font-weight: 600;
  box-shadow: 0 16px 34px -16px oklch(0% 0 0 / 0.9);
}
.edit-toggle[aria-pressed="true"] { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); border-color: transparent; }
.edit-panel {
  padding: 12px 14px;
  border: 1px solid var(--gold);
  border-radius: 16px;
  background: oklch(17% 0.04 342 / 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 13px;
  color: var(--muted);
  box-shadow: 0 16px 34px -16px oklch(0% 0 0 / 0.9);
}
.edit-panel p { margin: 0; }
.edit-panel b { color: var(--gold-2); }
.edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.edit-count { color: var(--faint); font-size: 12px; }

html.editing [data-tx],
html.editing [data-wf],
html.editing [data-txp] {
  outline: 1px dashed oklch(83% 0.095 82 / 0.55);
  outline-offset: 3px;
  border-radius: 4px;
  cursor: text;
}
html.editing [data-tx]:hover,
html.editing [data-wf]:hover,
html.editing .tx-target {
  outline: 2px solid var(--gold);
  background: oklch(83% 0.095 82 / 0.1);
}
html.editing [data-tx]:empty,
html.editing [data-wf]:empty {
  display: inline-block;
  min-width: 80px;
  min-height: 1em;
}
html.editing [data-tx]:empty::before,
html.editing [data-wf]:empty::before {
  content: "＋ texte masqué";
  color: var(--faint);
  font-family: var(--sans);
  font-size: 12px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
html.editing .kinetic .ch { animation: none; }
html.editing .card:hover .cover { transform: none; }
html.show-gate .gate { display: grid !important; }
html.show-gate #app { display: none !important; }

.tx-pop {
  position: fixed;
  z-index: 400;
  width: min(420px, calc(100vw - 24px));
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--gold);
  border-radius: 18px;
  background: oklch(18% 0.04 342 / 0.98);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 60px -20px oklch(0% 0 0 / 0.95);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  animation: rise 0.25s var(--ease) both;
}
.tx-pop.top-mode { top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 12px; width: auto; }
.tx-pop-h { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.tx-mod { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: oklch(64% 0.24 4 / 0.2); color: var(--warn-ink); letter-spacing: 0.04em; }
.tx-pop-note { margin: 0; color: var(--faint); font-size: 12px; }
.tx-pop-note code { font-size: 12px; }
.tx-pop textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: oklch(11% 0.025 340 / 0.85);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}
.tx-pop textarea:focus { border-color: var(--rose); }
.tx-pop-actions { display: flex; align-items: center; gap: 8px; }
.tx-pop-actions .spacer { flex: 1; }
.faint-count { color: var(--faint); }

@media (max-width: 760px) {
  .edit-bar { left: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); flex-direction: row; align-items: center; max-width: calc(100vw - 24px); }
  .edit-panel { order: 2; padding: 6px 8px; border-radius: 999px; }
  .edit-panel p, .edit-count { display: none; }
  .edit-actions { margin: 0; }
  .edit-actions .chip { min-height: 30px; padding: 4px 10px; font-size: 12.5px; }
  .edit-toggle { min-height: 40px; padding: 8px 14px; font-size: 14px; }
}

/* ---------------------------------------------------------------------
   Lire au quotidien (2026-11-19) : bouton « Lire », retour de lecture,
   « Annuler », partage, pile au hasard.
   --------------------------------------------------------------------- */
.toast.has-undo { padding-right: 8px; }
.toast-undo {
  flex: none;
  min-height: 34px;
  margin-left: 4px;
  padding: 4px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(100% 0 0 / 0.06);
  color: var(--gold-2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.toast-undo:hover { background: oklch(100% 0 0 / 0.12); }

.read-chip { color: var(--ink); text-decoration: none; }
.read-chip svg { fill: currentColor; stroke: none; }
.resume-card.stale { opacity: 0.6; }
.resume-card.stale:hover, .resume-card.stale:focus-within { opacity: 1; }
.resume-card .muted-line, #resume-list > .muted-line { margin: 0; color: var(--muted); }
#resume-random:empty, .pile-tools:empty { display: none; }
.chip[data-random-pile] svg { width: 16px; height: 16px; }
.pile-tools { display: flex; justify-content: flex-end; margin-bottom: 14px; }

.sheet-actions { display: flex; gap: 6px; }
.source-last { margin-left: 6px; font-size: 11px; }
/* Prochain chapitre trouvé pour ce lien (« ch. 13 ») */
.source-chapter:not(:empty) { margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.read-chip span { white-space: nowrap; }

.return-bar {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 250;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  width: max-content;
  max-width: min(640px, calc(100vw - 24px));
  padding: 12px 12px 12px 18px;
  border: 1px solid oklch(72% 0.19 2 / 0.5);
  border-radius: 22px;
  background: oklch(20% 0.04 345 / 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 50px -18px oklch(0% 0 0 / 0.95);
  transform: translateX(-50%);
  animation: toast-in 0.35s var(--ease) both;
}
.return-bar[hidden] { display: none; }
.return-text { margin: 0; font-size: 14px; color: var(--muted); }
.return-text b { color: var(--ink); }
.return-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.return-actions .icon-btn { margin-left: 2px; }

@media (max-width: 760px) {
  .return-bar { bottom: calc(84px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); padding: 12px; }
  .return-actions .chip { min-height: 40px; }
  .pile-tools { justify-content: flex-start; }
}

/* Compte de la partie publique (js/compte.js) */
.account-nudge {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 22px;
  padding: 16px 48px 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 0% 0%, oklch(64% 0.24 4 / 0.14), transparent 60%),
    oklch(100% 0 0 / 0.03);
}
.account-nudge p { margin: 0 0 6px; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.account-nudge .nudge-h { color: var(--ink); font-family: var(--serif); font-size: 18px; }
.account-nudge .chips { margin-top: 10px; }
.nudge-close { position: absolute; top: 10px; right: 10px; }
.account-form { display: grid; gap: 14px; }
.account-form .seg { margin-bottom: 4px; }
.account-form .invite-door { margin: -4px 0 0; text-align: center; }
.field-hint { color: var(--faint); font-size: 12.5px; line-height: 1.4; }
.account-dialog .drawer-in { max-width: 460px; margin-inline: auto; }
.account-dialog .lede.small { font-size: 14.5px; margin: 0 0 16px; color: var(--muted); }
.narrow-panel { max-width: 560px; margin: 0 auto 18px; display: grid; gap: 14px; }
.friend-add { margin-bottom: 22px; }
.friend-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.friend-add-row input { flex: 1 1 200px; min-width: 0; }
.request-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.request { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 14px; }
.request .chips { margin-left: auto; }
.notif-list .feed-item.unseen { border-color: var(--line); background: oklch(64% 0.24 4 / 0.08); }
.notif-list .feed-text .chips { display: flex; margin-top: 8px; }
.rate-final { margin: 6px 0 10px; color: var(--muted); }
.rate-final b { color: var(--gold); font-family: var(--serif); font-size: 28px; }
.rate-final span { display: block; font-size: 13px; color: var(--faint); }
.sub-h { margin-top: 14px; font-size: 13px; }
.center-line { text-align: center; margin: 22px 0; }
.link.danger { color: var(--warn-ink); }
.account-danger { justify-items: start; }
