/* =========================================================
   Plume — feuille de style
   ========================================================= */

:root {
  color-scheme: light;
  --bg: #fbf7f1;
  --bg-soft: #f4ede2;
  --surface: #fffdf9;
  --surface-2: #f4ece1;
  --surface-3: #ece2d4;
  --text: #241d16;
  --text-soft: #55493d;
  --muted: #8a7b6b;
  --border: #e8ddcf;
  --border-strong: #d6c8b5;
  --accent: #d9551f;
  --accent-hover: #bf4515;
  --accent-soft: #fbe8dd;
  --accent-ink: #7a2c0d;
  --gold: #b9822a;
  --success: #2f7d5b;
  --success-soft: #e3f3ea;
  --danger: #bf3a2b;
  --danger-soft: #fbe7e3;
  --header-bg: rgba(251, 247, 241, 0.86);
  --shadow-sm: 0 1px 2px rgba(52, 36, 18, 0.06);
  --shadow-md: 0 14px 34px -18px rgba(52, 36, 18, 0.28);
  --shadow-lg: 0 36px 70px -32px rgba(52, 36, 18, 0.4);
  --radius: 18px;
  --radius-sm: 11px;
  --radius-lg: 26px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --header-h: 70px;
  --reader-bg: #fffdf9;
  --reader-text: #2b241c;
  --reader-muted: #87796a;
  --reader-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14110e;
  --bg-soft: #1a1612;
  --surface: #1d1915;
  --surface-2: #262019;
  --surface-3: #31291f;
  --text: #f3eadc;
  --text-soft: #cfc1ae;
  --muted: #a08f7c;
  --border: #332b22;
  --border-strong: #4a3e31;
  --accent: #ff7a45;
  --accent-hover: #ff9063;
  --accent-soft: #33200f;
  --accent-ink: #ffc3a4;
  --gold: #e0b25c;
  --success: #63b98c;
  --success-soft: #1d3328;
  --danger: #ef7b6c;
  --danger-soft: #3a1f1b;
  --header-bg: rgba(20, 17, 14, 0.86);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 16px 40px -20px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 80px -35px rgba(0, 0, 0, 0.85);
  --reader-bg: #14110e;
  --reader-text: #eee4d5;
  --reader-muted: #a2917d;
}

/* ---------- reset ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(217, 85, 31, 0.07), transparent 70%),
    radial-gradient(700px 500px at 0% 30%, rgba(185, 130, 42, 0.05), transparent 70%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
hr { border: none; border-top: 1px solid var(--border); margin: 0; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: 0 0 12px 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.skip-link:focus { top: 0; }

/* ---------- typography ---------- */

h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); line-height: 1.05; }
h2 { font-size: clamp(1.45rem, 2.4vw, 2rem); line-height: 1.15; }
h3 { font-size: 1.15rem; line-height: 1.3; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.muted { color: var(--muted); }
.soft { color: var(--text-soft); }
.small { font-size: 0.84rem; }
.tiny { font-size: 0.75rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.page {
  max-width: var(--page-max, 1240px);
  margin: 0 auto;
  padding: 36px 24px 90px;
}
.page-narrow { max-width: 860px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.page-head p { max-width: 560px; margin-top: 8px; color: var(--muted); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 52px 0 22px;
}
.section-head .section-sub { color: var(--muted); font-size: 0.92rem; margin-top: 6px; }
.section-head a {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.section-head a:hover { color: var(--accent-hover); }

/* ---------- buttons ---------- */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--btn-border);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary {
  --btn-bg: var(--accent);
  --btn-fg: #fff;
  --btn-border: var(--accent);
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { --btn-bg: var(--accent-hover); --btn-border: var(--accent-hover); }

.btn-outline {
  --btn-bg: var(--surface);
  --btn-border: var(--border-strong);
  --btn-fg: var(--text);
}
.btn-outline:hover { --btn-bg: var(--surface-2); }

.btn-ghost { --btn-fg: var(--text-soft); }
.btn-ghost:hover { --btn-bg: var(--surface-2); --btn-fg: var(--text); }

.btn-danger {
  --btn-bg: transparent;
  --btn-border: color-mix(in srgb, var(--danger) 45%, transparent);
  --btn-fg: var(--danger);
}
.btn-danger:hover { --btn-bg: var(--danger-soft); }

.btn.is-disabled {
  --btn-bg: transparent;
  --btn-fg: var(--muted);
  --btn-border: var(--border);
  cursor: default;
  opacity: 0.75;
}

.btn-sm { padding: 7px 13px; font-size: 0.81rem; gap: 6px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }
.btn-icon {
  width: 40px; height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid transparent;
}
.btn-icon.btn-outline { border-color: var(--border); }
.btn-icon:hover { background: var(--surface-2); }

.link {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.link:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

.icon-text { display: inline-flex; align-items: center; gap: 7px; }
.icon-text svg { width: 17px; height: 17px; }

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.01em;
}
.field .hint { font-size: 0.76rem; color: var(--muted); font-weight: 400; }

/* Bouton œil : afficher / masquer un mot de passe. */
.password-field { position: relative; display: flex; }
.password-field .input { padding-right: 46px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.password-toggle:hover { color: var(--text); background: var(--surface-2); }
.password-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.password-toggle svg { width: 18px; height: 18px; }

.input, .textarea, .select {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 0.8; }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}
.textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a7b6b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

.form-grid { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.search-box .input { padding-left: 42px; border-radius: 999px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--page-max, 1240px);
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  flex: none;
}
.brand svg { width: 30px; height: 30px; }
.brand span { position: relative; top: 1px; }
.brand .dot { color: var(--accent); }
.brand-emoji { font-size: 1.55rem; line-height: 1; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  transition: background 0.15s ease, color 0.15s ease;
}
.main-nav a:hover { background: var(--surface-2); color: var(--text); }
.main-nav a.active { background: var(--accent-soft); color: var(--accent-ink); }

.header-search { flex: 1; max-width: 360px; margin-left: auto; }
.header-search .input {
  padding-top: 9px;
  padding-bottom: 9px;
  background: var(--surface-2);
  border-color: transparent;
  font-size: 0.88rem;
}
.header-search .input:focus { background: var(--surface); border-color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.header-actions .btn-ghost { font-size: 0.88rem; }
.header-actions .btn-primary { font-size: 0.88rem; padding: 9px 17px; }

.locale-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-soft);
}
.locale-switcher svg { width: 15px; height: 15px; flex: none; }
.locale-switcher select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  padding: 7px 1px;
  max-width: 110px;
  cursor: pointer;
}
.locale-switcher select:focus { outline: none; }
.locale-switcher:focus-within { border-color: var(--accent); }

.theme-toggle svg { width: 19px; height: 19px; }

.user-menu { position: relative; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.86rem;
  font-weight: 650;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.user-chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.user-chip > svg { width: 14px; height: 14px; color: var(--muted); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 230px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 80;
}
.user-dropdown[hidden] { display: none; }
.user-dropdown .drop-head {
  padding: 9px 12px 11px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.user-dropdown .drop-head > strong { display: block; font-size: 0.92rem; }
.user-dropdown a, .user-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.87rem;
  font-weight: 550;
  text-align: left;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--surface-2); color: var(--text); }
.user-dropdown a svg, .user-dropdown button svg { width: 16px; height: 16px; color: var(--muted); }
.user-dropdown hr { margin: 6px 0; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  line-height: 1;
  flex: none;
  overflow: hidden;
  user-select: none;
}
.avatar-sm { width: 30px; height: 30px; font-size: 0.95rem; }
.avatar-md { width: 40px; height: 40px; font-size: 1.25rem; }
.avatar-lg { width: 76px; height: 76px; font-size: 2.4rem; }
.avatar-xl { width: 116px; height: 116px; font-size: 3.6rem; }

/* ---------- mobile nav ---------- */

.mobile-nav { display: none; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 44px 24px 36px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-brand p { margin-top: 10px; max-width: 300px; font-size: 0.86rem; color: var(--muted); }
.footer-col h4 {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.footer-col a {
  display: block;
  padding: 4px 0;
  font-size: 0.87rem;
  color: var(--text-soft);
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 24px 26px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(720px 420px at 78% 20%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%),
    radial-gradient(600px 400px at 15% 90%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 70%),
    var(--bg-soft);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 14%, transparent) 0.7px, transparent 0.7px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 68px 24px 78px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  align-items: center;
  gap: 48px;
}
.hero-copy h1 { margin: 16px 0 20px; }
.hero-copy h1 em { color: var(--accent); font-style: italic; }
.hero-copy > p {
  max-width: 510px;
  font-size: 1.06rem;
  color: var(--text-soft);
}
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero-proof {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  font-size: 0.83rem;
  color: var(--muted);
}
.hero-proof .faces { display: flex; }
.hero-proof .faces .avatar { margin-left: -8px; border: 2px solid var(--bg-soft); }
.hero-proof .faces .avatar:first-child { margin-left: 0; }

.hero-art {
  position: relative;
  height: 440px;
  perspective: 1200px;
}
.hero-book {
  position: absolute;
  width: 196px;
  aspect-ratio: 2 / 3;
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 40px 60px -30px rgba(30, 18, 8, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition: transform 0.4s ease;
}
.hero-book .cover { border-radius: 0; height: 100%; }
.hero-book.hb-1 {
  left: 4%;
  top: 56px;
  transform: rotate(-9deg);
  z-index: 2;
}
.hero-book.hb-2 {
  left: 34%;
  top: 12px;
  transform: rotate(2deg) scale(1.06);
  z-index: 3;
}
.hero-book.hb-3 {
  left: 65%;
  top: 70px;
  transform: rotate(10deg);
  z-index: 1;
}
.hero-art:hover .hb-1 { transform: rotate(-11deg) translateY(-6px); }
.hero-art:hover .hb-2 { transform: rotate(2deg) scale(1.09) translateY(-6px); }
.hero-art:hover .hb-3 { transform: rotate(12deg) translateY(-6px); }

.hero-spark {
  position: absolute;
  color: var(--gold);
  opacity: 0.8;
  z-index: 4;
}
.hero-spark svg { width: 100%; height: 100%; }
.hero-spark.s1 { width: 30px; height: 30px; top: 12px; left: 2%; }
.hero-spark.s2 { width: 20px; height: 20px; bottom: 40px; right: 2%; }
.hero-spark.s3 { width: 16px; height: 16px; top: 130px; right: 12%; }

/* ---------- covers ---------- */

.cover {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--surface-3);
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover-art {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px;
  isolation: isolate;
}
.cover-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.26), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(0, 0, 0, 0.32), transparent 55%);
}
.cover-art::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  pointer-events: none;
}
.cover-emoji {
  font-size: 2.4rem;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}
.cover-title {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.14;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cover-author {
  margin-top: 6px;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- novel cards ---------- */

.novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 30px 22px;
}
.novel-grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.novel-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.novel-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.novel-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.novel-card { display: flex; flex-direction: column; gap: 11px; min-width: 0; }
.novel-card-cover { display: block; min-width: 0; color: inherit; }
.cover-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background: var(--surface-2);
}
.novel-card:hover .cover-wrap {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.novel-card .card-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(20, 15, 10, 0.68);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.novel-card .card-badge.draft { background: rgba(185, 130, 42, 0.92); }
.card-body { min-width: 0; }
.card-body h3 {
  font-size: 1rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-body h3 a { color: inherit; text-decoration: none; }
.card-body h3 a:hover,
.card-body h3 a:focus-visible { color: var(--accent); }
.card-body .card-author {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 0.76rem;
  color: var(--muted);
  min-width: 0;
}
.card-body .card-author .avatar { width: 20px; height: 20px; font-size: 0.66rem; }
.card-body .card-author span,
.card-body .card-author a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-body .card-author a { color: inherit; text-decoration: none; }
.card-body .card-author a:hover,
.card-body .card-author a:focus-visible { color: var(--accent); text-decoration: underline; }
.card-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 7px;
  font-size: 0.72rem;
  color: var(--muted);
}
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.card-meta svg { width: 13px; height: 13px; vertical-align: -2px; }

/* ---------- genre cards ---------- */

.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.genre-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.genre-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: var(--shadow-md);
}
.genre-card .genre-emoji {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  font-size: 1.25rem;
  flex: none;
}
.genre-card strong { display: block; font-size: 0.9rem; }
.genre-card span { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 2px; }

/* ---------- CTA banner ---------- */

.cta-banner {
  position: relative;
  overflow: hidden;
  margin-top: 64px;
  padding: 44px 48px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 300px at 88% 0%, rgba(255, 255, 255, 0.18), transparent 70%),
    linear-gradient(135deg, #2b1a10, #7a2c0d 55%, #d9551f);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
}
.cta-banner::after {
  content: "🪶";
  position: absolute;
  right: 34px;
  bottom: -26px;
  font-size: 9rem;
  opacity: 0.12;
  transform: rotate(-14deg);
  pointer-events: none;
}
.cta-banner h2 { max-width: 540px; }
.cta-banner p { max-width: 520px; margin-top: 10px; color: rgba(255, 255, 255, 0.78); }
.cta-banner .btn { background: #fff; color: #7a2c0d; border-color: #fff; }
.cta-banner .btn:hover { background: #ffe9dc; }
.cta-banner .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.cta-banner .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- continue reading ---------- */

.continue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.continue-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  align-items: center;
}
.continue-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  box-shadow: var(--shadow-md);
}
.continue-card .continue-cover {
  width: 62px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  flex: none;
  box-shadow: var(--shadow-sm);
}
.continue-card .continue-info { min-width: 0; flex: 1; }
.continue-card .continue-info h3 {
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.continue-card .continue-info p {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.progress-track {
  height: 5px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 9px;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}
.continue-card .continue-arrow {
  color: var(--accent);
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
}
.continue-card .continue-arrow svg { width: 16px; height: 16px; }

/* ---------- explore ---------- */

.explore-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.explore-toolbar .search-box { flex: 1; min-width: 220px; }
.explore-toolbar .select { width: auto; min-width: 190px; }

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 3px 2px 12px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 24px;
  font-size: 0.84rem;
  color: var(--muted);
}

/* ---------- novel page ---------- */

.novel-hero {
  position: relative;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(700px 400px at 15% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 65%),
    var(--bg-soft);
}
.novel-hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 44px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}
.novel-hero-cover {
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.novel-info .breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.novel-info .breadcrumb svg { width: 14px; height: 14px; }
.novel-info h1 { font-size: clamp(2rem, 3.4vw, 3rem); }
.novel-info .novel-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--text-soft);
}
.novel-author .avatar { width: 34px; height: 34px; font-size: 1.05rem; }
.novel-author a { font-weight: 650; color: var(--text); }
.novel-author a:hover { color: var(--accent); }
.novel-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--text-soft);
}
.tag.genre { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.tag.status { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); background: var(--success-soft); }
.tag.status.ongoing { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 35%, transparent); background: color-mix(in srgb, var(--gold) 12%, transparent); }

.novel-description {
  max-width: 680px;
  margin-top: 20px;
  font-size: 1rem;
  color: var(--text-soft);
  line-height: 1.65;
  white-space: pre-line;
}
.novel-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.novel-stats .stat { display: flex; flex-direction: column; gap: 2px; }
.novel-stats .stat strong { font-size: 1.02rem; font-family: var(--serif); }
.novel-stats .stat span { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.novel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.vote-btn.voted {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}
.library-btn.in-library {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
  color: var(--success);
}

/* ---------- chapters ---------- */

.chapter-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.chapter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.chapter-panel-head h2 { font-size: 1.3rem; }
.chapter-panel-head span { font-size: 0.8rem; color: var(--muted); }
.chapter-list { display: flex; flex-direction: column; }
.chapter-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.chapter-row:last-child { border-bottom: none; }
.chapter-row:hover { background: var(--surface-2); }
.chapter-num {
  width: 32px;
  flex: none;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--muted);
  text-align: center;
}
.chapter-row.read .chapter-num { color: var(--success); }
.chapter-row .chapter-info { flex: 1; min-width: 0; }
.chapter-row .chapter-info strong {
  display: block;
  font-size: 0.94rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chapter-row .chapter-info span { font-size: 0.73rem; color: var(--muted); }
.chapter-row .chapter-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface-3);
  color: var(--muted);
}
.chapter-row .chapter-badge.draft { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.chapter-row .chapter-arrow { color: var(--muted); flex: none; }
.chapter-row:hover .chapter-arrow { color: var(--accent); }
.chapter-row .chapter-arrow svg { width: 18px; height: 18px; }

.reader-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 24px;
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.reader-banner p { font-size: 0.9rem; color: var(--muted); }

/* ---------- reader ---------- */

.reader-page {
  background: var(--reader-bg);
  color: var(--reader-text);
  min-height: calc(100vh - var(--header-h));
  transition: background 0.2s ease, color 0.2s ease;
}
.reader-page[data-reader-theme="sepia"] {
  --reader-bg: #f6ecd9;
  --reader-text: #3b2f21;
  --reader-muted: #8d7a5e;
}
.reader-page[data-reader-theme="dark"] {
  --reader-bg: #12100d;
  --reader-text: #e8dece;
  --reader-muted: #9c8b76;
}
.reader-progress {
  position: fixed;
  top: var(--header-h);
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 70;
  transition: width 0.1s linear;
}
.reader-toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--reader-bg) 90%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--reader-text) 12%, transparent);
}
.reader-toolbar-inner {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}
.reader-toolbar .chapter-select {
  flex: 1;
  min-width: 0;
  padding: 8px 34px 8px 13px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--reader-text) 18%, transparent);
  background: transparent;
  color: var(--reader-text);
  font-size: 0.84rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a7b6b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  text-overflow: ellipsis;
}
.reader-toolbar .btn {
  --btn-fg: var(--reader-text);
  border-color: color-mix(in srgb, var(--reader-text) 16%, transparent);
  background: transparent;
}
.reader-toolbar .btn:hover { background: color-mix(in srgb, var(--reader-text) 8%, transparent); }
.reader-toolbar .btn svg { width: 17px; height: 17px; }
.reader-toolbar .reader-edit-btn {
  height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 650;
}
.reader-toolbar .reader-edit-btn svg { width: 16px; height: 16px; }

.reader-settings {
  position: absolute;
  top: calc(100% + 8px);
  right: 24px;
  z-index: 60;
  width: 270px;
  padding: 18px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
.reader-settings[hidden] { display: none; }
.reader-settings h4 {
  font-family: var(--sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 9px;
}
.reader-settings .row { display: flex; gap: 8px; margin-bottom: 16px; }
.reader-settings .row:last-child { margin-bottom: 0; }
.reader-settings .opt {
  flex: 1;
  padding: 8px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 600;
}
.reader-settings .opt.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

.reader-shell { max-width: 760px; margin: 0 auto; padding: 46px 24px 100px; }
.reader-head { margin-bottom: 34px; }
.reader-head .reader-novel {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--reader-muted);
  margin-bottom: 10px;
}
.reader-head .reader-novel a { color: var(--reader-muted); text-decoration: underline; text-underline-offset: 3px; }
.reader-head .reader-novel a:hover { color: var(--accent); }
.reader-head .reader-novel > svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.reader-chapter-thumb {
  width: 52px;
  height: 52px;
  flex: none;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--reader-text) 16%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--reader-text) 4%, transparent);
}
.reader-head h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  color: var(--reader-text);
}
.reader-head .reader-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 0.76rem;
  color: var(--reader-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.reader-article {
  font-family: var(--reader-serif);
  font-size: var(--reader-size, 19px);
  line-height: var(--reader-leading, 1.85);
  color: var(--reader-text);
}
.reader-article p { margin: 0 0 1.35em; }
.reader-article > p:first-child::first-letter {
  float: left;
  font-size: 3.4em;
  line-height: 0.82;
  padding: 0.08em 0.12em 0 0;
  color: var(--accent);
  font-weight: 600;
}
.reader-article strong { font-weight: 700; }
.reader-article em { font-style: italic; }
.reader-end {
  margin-top: 46px;
  padding-top: 28px;
  border-top: 1px solid color-mix(in srgb, var(--reader-text) 13%, transparent);
}
.reader-nav { display: flex; gap: 12px; justify-content: space-between; }
.reader-nav .btn { border-color: color-mix(in srgb, var(--reader-text) 20%, transparent); color: var(--reader-text); }
.reader-nav .btn:hover { background: color-mix(in srgb, var(--reader-text) 7%, transparent); }
.reader-nav .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.reader-nav .btn-primary:hover { background: var(--accent-hover); }

.reader-vote {
  margin-top: 34px;
  padding: 24px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--reader-text) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--reader-text) 10%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.reader-vote p { font-size: 0.88rem; color: var(--reader-muted); max-width: 360px; }
.reader-vote .btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.reader-vote .btn.voted { background: transparent; border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent); }

.comments-section { margin-top: 52px; }
.comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.comments-head h2 { font-size: 1.35rem; color: var(--reader-text); }
.comments-head span { font-size: 0.8rem; color: var(--reader-muted); }
.comment-form { display: flex; gap: 12px; margin-bottom: 28px; }
.comment-form .avatar { margin-top: 2px; }
.comment-form .comment-field { flex: 1; }
.comment-form textarea {
  width: 100%;
  min-height: 74px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--reader-text) 18%, transparent);
  background: transparent;
  color: var(--reader-text);
  resize: vertical;
}
.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}
.comment-form .comment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.comment-mood { margin-top: 10px; }
.comment-mood-label {
  display: block;
  font-size: 0.76rem;
  color: var(--reader-muted);
  margin-bottom: 6px;
}
.comment-mood-hint { font-size: 0.72rem; opacity: 0.8; }
.comment-mood-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mood-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--reader-text) 16%, transparent);
  background: transparent;
  color: var(--reader-muted);
  font-size: 0.76rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.mood-chip:hover {
  background: color-mix(in srgb, var(--reader-text) 6%, transparent);
  color: var(--reader-text);
}
.mood-chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
}
.mood-chip-emoji { font-size: 0.95rem; line-height: 1; }
.comment-reply-form {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--reader-text) 4%, transparent);
}
.comment-reply-form textarea { min-height: 58px; }
.comment-reply-form .comment-actions { margin-top: 6px; }
.comment-login {
  padding: 18px 20px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--reader-text) 5%, transparent);
  font-size: 0.9rem;
  color: var(--reader-muted);
  margin-bottom: 28px;
}
.comment-blocked {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--reader-text) 5%, transparent);
  font-size: 0.9rem;
  color: var(--reader-muted);
  margin-bottom: 28px;
}
.comment-blocked svg { width: 18px; height: 18px; flex: none; }
.comment-list { display: flex; flex-direction: column; gap: 22px; }
.comment-thread { display: flex; flex-direction: column; gap: 12px; }
.comment {
  display: flex;
  gap: 12px;
}
.comment-body { flex: 1; min-width: 0; }
.comment-top {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
}
.comment-author {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--reader-text);
  text-decoration: none;
}
.comment-author:hover,
.comment-author:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.comment-top span { font-size: 0.73rem; color: var(--reader-muted); }
.comment-delete span,
.comment-reply span,
.comment-report span { font-size: inherit; color: inherit; }
.comment-top .comment-time { font-size: 0.73rem; color: var(--reader-muted); }
.comment-top .comment-author-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.01em;
}
.comment-author-badge svg { width: 11px; height: 11px; }
.comment-top .comment-mood-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--reader-text) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--reader-text) 13%, transparent);
  font-size: 0.7rem;
  color: var(--reader-text);
}
.comment-body p {
  margin-top: 4px;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.comment-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.comment-delete,
.comment-reply,
.comment-report {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--reader-muted);
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.15s, color 0.15s, background 0.15s, border-color 0.15s;
}
.comment-delete svg,
.comment-reply svg,
.comment-report svg { width: 12px; height: 12px; }
.comment-delete:hover,
.comment-delete:focus-visible {
  opacity: 1;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
.comment-reply:hover,
.comment-reply:focus-visible {
  opacity: 1;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.comment-report:hover,
.comment-report:focus-visible {
  opacity: 1;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

/* ---------- signalements ---------- */

.report-reasons {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}
.report-reason {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.report-reason:hover { background: var(--surface-2); }
.report-reason:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.report-reason input { accent-color: var(--accent); }
.hint-inline { font-weight: 400; color: var(--muted); }
.comment-delete:disabled { opacity: 0.4; cursor: default; }
.comment-replies {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-left: 52px;
  padding-left: 14px;
  border-left: 2px solid color-mix(in srgb, var(--accent) 18%, transparent);
}
.comment-replies:empty { display: none; }
.comment-replies .avatar { width: 32px; height: 32px; font-size: 0.92rem; }
.comment-by-author {
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-left: 3px solid var(--accent);
}
.comment-by-author .comment-author { color: var(--accent-ink); }
[data-reader-theme="dark"] .comment-by-author .comment-author { color: var(--accent); }

/* ---------- library ---------- */

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.library-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.library-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  box-shadow: var(--shadow-md);
}
.library-cover {
  width: 92px;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  flex: none;
  box-shadow: var(--shadow-sm);
}
.library-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.library-info h3 {
  font-size: 1.02rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.library-info .library-author { font-size: 0.76rem; color: var(--muted); margin-top: 4px; }
.library-info .library-author a { color: inherit; text-decoration: none; }
.library-info .library-author a:hover,
.library-info .library-author a:focus-visible { color: var(--accent); text-decoration: underline; }
.library-info .library-progress { margin-top: auto; padding-top: 12px; }
.library-info .library-progress span { font-size: 0.73rem; color: var(--muted); }
.library-info .library-progress .progress-track { margin-top: 6px; }
.library-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- writer dashboard ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}
.stat-card {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.stat-card .stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.stat-card .stat-label svg { width: 15px; height: 15px; }
.stat-card strong {
  display: block;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 1.9rem;
  line-height: 1;
}
.stat-card small { display: block; margin-top: 4px; font-size: 0.73rem; color: var(--muted); }

.writer-list { display: flex; flex-direction: column; gap: 12px; }
.writer-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.writer-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.writer-cover {
  width: 62px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  flex: none;
  box-shadow: var(--shadow-sm);
}
.writer-main { flex: 1; min-width: 0; }
.writer-main h3 {
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.writer-main .writer-sub {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: 0.75rem;
  color: var(--muted);
}
.writer-main .writer-sub svg { width: 13px; height: 13px; vertical-align: -2px; }
.writer-actions { display: flex; align-items: center; gap: 7px; flex: none; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--success-soft);
  color: var(--success);
}
.status-pill.ongoing { background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold); }
.status-pill.draft { background: var(--surface-3); color: var(--muted); }

/* ---------- editor / forms ---------- */

.panel {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.panel + .panel { margin-top: 18px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.panel-head h2 { font-size: 1.25rem; }
.panel-head p { font-size: 0.82rem; color: var(--muted); margin-top: 3px; }

.novel-form-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}
.cover-editor { position: sticky; top: calc(var(--header-h) + 24px); }
.cover-preview {
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--surface-2);
  margin-bottom: 14px;
}
.cover-editor-actions { display: flex; flex-direction: column; gap: 8px; }
.cover-editor-actions .btn { width: 100%; }
.cover-editor-actions .link { font-size: 0.8rem; text-align: center; }

.style-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.swatch:hover { transform: scale(1.08); }
.swatch.active { border-color: var(--text); transform: scale(1.06); }

.emoji-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.emoji-option {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 1.15rem;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.emoji-option:hover { transform: scale(1.08); background: var(--surface-2); }
.emoji-option.active { border-color: var(--accent); background: var(--accent-soft); }

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.form-actions .spacer { flex: 1; }

.manage-head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.manage-head .manage-cover {
  width: 74px;
  aspect-ratio: 2 / 3;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  flex: none;
}
.manage-head h1 { font-size: 1.8rem; }
.manage-head p { color: var(--muted); font-size: 0.84rem; margin-top: 5px; }
.manage-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.chapter-manage-list { display: flex; flex-direction: column; gap: 8px; }
.chapter-manage-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.chapter-manage-row .drag {
  color: var(--muted);
  display: grid;
  place-items: center;
  width: 26px;
  flex: none;
}
.chapter-manage-row .drag svg { width: 16px; height: 16px; }
.chapter-manage-row .cm-info { flex: 1; min-width: 0; }
.chapter-manage-row .cm-info strong {
  display: block;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chapter-manage-row .cm-info span { font-size: 0.72rem; color: var(--muted); }
.chapter-manage-row .cm-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.chapter-manage-row .cm-actions .btn-icon { width: 32px; height: 32px; }
.chapter-manage-row .cm-actions svg { width: 15px; height: 15px; }

.editor-page { max-width: 900px; margin: 0 auto; padding: 34px 24px 100px; }
.editor-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.editor-top .editor-meta { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 0.78rem; color: var(--muted); }
.editor-title {
  width: 100%;
  padding: 6px 0 14px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.editor-title:focus { outline: none; border-color: var(--accent); }
.editor-title::placeholder { color: var(--muted); opacity: 0.55; }
.chapter-image-editor {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}
.chapter-image-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chapter-image-label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 700; }
.chapter-image-label svg { width: 16px; height: 16px; color: var(--accent); }
.chapter-image-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.chapter-image-actions .btn[hidden] { display: none; }
.chapter-image-preview {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.chapter-image-preview[hidden] { display: none; }
.chapter-image-preview img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.chapter-image-hint { margin: 10px 0 0; font-size: 0.72rem; color: var(--muted); }
.editor-content {
  width: 100%;
  min-height: 58vh;
  margin-top: 18px;
  padding: 4px 0;
  border: none;
  background: transparent;
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.8;
  resize: none;
  overflow: hidden;
}
.editor-content:focus { outline: none; }
.editor-content::placeholder { color: var(--muted); opacity: 0.55; }
.editor-footer {
  position: sticky;
  bottom: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.editor-footer .editor-count { font-size: 0.78rem; color: var(--muted); }
.editor-footer .spacer { flex: 1; }

/* ---------- profile ---------- */

.profile-banner {
  height: 190px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(500px 240px at 20% 10%, rgba(255, 255, 255, 0.22), transparent 70%),
    linear-gradient(135deg, #7a2c0d, #d9551f 55%, #e0a45c);
}
.profile-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black, transparent);
}
.profile-head {
  max-width: 1240px;
  margin: -58px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}
.profile-card {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 5px solid var(--bg);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 3.4rem;
  box-shadow: var(--shadow-md);
  flex: none;
}
.profile-id { flex: 1; min-width: 220px; padding-bottom: 4px; }
.profile-id h1 { font-size: 2rem; }
.profile-id .profile-handle { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.profile-id .profile-bio { margin-top: 10px; color: var(--text-soft); font-size: 0.94rem; max-width: 620px; white-space: pre-line; }
.profile-actions { display: flex; gap: 8px; padding-bottom: 6px; flex-wrap: wrap; }
.profile-block-note {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-basis: 100%;
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.profile-block-note svg { width: 14px; height: 14px; flex: none; }
.profile-stats {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.profile-stats .pstat strong { display: block; font-family: var(--serif); font-size: 1.35rem; }
.profile-stats .pstat span { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- auth ---------- */

.auth-page {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-art {
  position: relative;
  overflow: hidden;
  padding: 60px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(700px 500px at 80% 10%, rgba(255, 200, 150, 0.22), transparent 65%),
    linear-gradient(145deg, #2a170d, #7a2c0d 52%, #c9511c);
}
.auth-art::after {
  content: "🪶";
  position: absolute;
  right: -30px;
  bottom: -50px;
  font-size: 17rem;
  opacity: 0.1;
  transform: rotate(-16deg);
  pointer-events: none;
}
.auth-art .auth-quote {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.15;
  max-width: 460px;
  position: relative;
  z-index: 1;
}
.auth-art .auth-quote em { color: #ffd3b5; font-style: italic; }
.auth-art .auth-foot { position: relative; z-index: 1; font-size: 0.82rem; color: rgba(255, 255, 255, 0.68); }
.auth-art .auth-brand { position: relative; z-index: 1; }
.auth-art .auth-brand .brand { color: #fff; font-size: 1.7rem; }
.auth-art .auth-brand .brand svg { width: 32px; height: 32px; }

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.auth-card { width: 100%; max-width: 410px; }
.auth-card h1 { font-size: 2.1rem; margin-bottom: 8px; }
.auth-card > p { color: var(--muted); margin-bottom: 28px; font-size: 0.92rem; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .btn { width: 100%; margin-top: 4px; }
.auth-switch { margin-top: 22px; font-size: 0.88rem; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--accent); font-weight: 650; }
.auth-forgot { margin-top: -4px; text-align: right; font-size: 0.84rem; }
.auth-forgot a { color: var(--accent); font-weight: 650; }
.auth-confirm {
  margin-top: 4px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--success-soft);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
  font-size: 0.9rem;
  line-height: 1.5;
}
.auth-confirm p { color: var(--muted); margin: 6px 0 0; }
.auth-confirm .hint { font-size: 0.8rem; word-break: break-all; }
.auth-error {
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.83rem;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
}
.auth-error[hidden] { display: none; }
/* ---------- empty states / skeleton ---------- */

.empty {
  padding: 60px 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.empty .empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--accent-soft);
  font-size: 1.8rem;
}
.empty h3 { font-size: 1.25rem; margin-bottom: 7px; }
.empty p { max-width: 430px; margin: 0 auto 20px; color: var(--muted); font-size: 0.9rem; }

.skeleton { animation: shimmer 1.4s infinite linear; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; border-radius: 10px; }
.skeleton-card .skeleton-cover { aspect-ratio: 2 / 3; border-radius: 12px; margin-bottom: 10px; }
.skeleton-line { height: 12px; border-radius: 6px; margin-top: 8px; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }

.loading-block { padding: 60px 0; display: grid; place-items: center; gap: 14px; color: var(--muted); font-size: 0.88rem; }
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(25, 15, 8, 0.55);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.15s ease;
}
.modal {
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: auto;
  padding: 28px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: pop 0.18s ease;
}
.modal h2 { font-size: 1.45rem; margin-bottom: 8px; }
.modal > p { color: var(--muted); font-size: 0.9rem; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.modal .field { margin-top: 18px; }
.modal-close {
  float: right;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  margin: -8px -8px 0 8px;
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-close svg { width: 16px; height: 16px; }

/* ---------- toasts ---------- */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 360px;
  padding: 13px 16px;
  border-radius: 13px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.86rem;
  font-weight: 550;
  box-shadow: var(--shadow-lg);
  animation: pop 0.2s ease;
  pointer-events: auto;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--success); color: #fff; }
.toast svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }

/* ---------- misc ---------- */

.divider { height: 1px; background: var(--border); margin: 26px 0; }
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}
.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: start; }
.sticky-side { position: sticky; top: calc(var(--header-h) + 24px); }
.not-found { padding: 90px 24px; text-align: center; }
.not-found .big { font-family: var(--serif); font-size: 7rem; line-height: 1; color: var(--accent); opacity: 0.3; }

/* ---------- éditeur enrichi ---------- */

.editor-toolbar {
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 25;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 16px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}
.toolbar-group { display: flex; gap: 2px; }
.toolbar-sep { width: 1px; height: 22px; background: var(--border); margin: 0 5px; }
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.tool-btn:hover { background: var(--surface-2); color: var(--text); }
.tool-btn.active { background: var(--accent-soft); color: var(--accent-ink); }
.tool-btn svg { width: 17px; height: 17px; }
.tool-text { font-size: 0.75rem; font-weight: 800; letter-spacing: -0.03em; }
.toolbar-secure {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: 0.67rem;
  color: var(--muted);
  white-space: nowrap;
}
.toolbar-secure svg { width: 13px; height: 13px; }

.rich-editor {
  min-height: 58vh;
  padding: 10px 2px 26px;
  outline: none;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  opacity: 0.55;
  pointer-events: none;
}
.rich-editor p { margin: 0 0 1em; }
.rich-editor h2, .rich-editor h3 {
  font-family: var(--serif);
  line-height: 1.25;
  margin: 1.3em 0 0.5em;
}
.rich-editor h2 { font-size: 1.6rem; }
.rich-editor h3 { font-size: 1.28rem; }
.rich-editor blockquote {
  margin: 1.2em 0;
  padding: 0.15em 0 0.15em 1em;
  border-left: 3px solid var(--accent);
  color: var(--text-soft);
  font-style: italic;
}
.rich-editor ul, .rich-editor ol { margin: 0.8em 0 1em; padding-left: 1.6em; }
.rich-editor li { margin: 0.25em 0; }
.rich-editor a { color: inherit; }

.reader-article h2, .reader-article h3 {
  font-family: var(--reader-serif);
  line-height: 1.25;
  margin: 1.6em 0 0.6em;
}
.reader-article h2 { font-size: 1.5em; }
.reader-article h3 { font-size: 1.22em; }
.reader-article blockquote {
  margin: 1.5em 0;
  padding: 0.1em 0 0.1em 1.1em;
  border-left: 3px solid var(--accent);
  color: var(--reader-muted);
  font-style: italic;
}
.reader-article blockquote p { margin: 0 0 0.6em; }
.reader-article ul, .reader-article ol { margin: 0 0 1.35em; padding-left: 1.5em; }
.reader-article li { margin: 0.3em 0; }
.reader-article u { text-decoration: underline; text-underline-offset: 2px; }
.reader-article s { text-decoration: line-through; opacity: 0.8; }

/* ---------- badges de messages ---------- */

.header-messages { position: relative; }
.header-messages.active { color: var(--accent); background: var(--accent-soft); }
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}
.unread-badge[hidden] { display: none; }
.header-messages .unread-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  box-shadow: 0 0 0 2px var(--header-bg);
}
.user-dropdown .unread-badge { margin-left: auto; }

/* ---------- notifications ---------- */

.header-notifications { position: relative; }
.header-notifications.active { color: var(--accent); background: var(--accent-soft); }
.notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}
.notif-badge[hidden] { display: none; }
.header-notifications .notif-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  box-shadow: 0 0 0 2px var(--header-bg);
}
.user-dropdown .notif-badge { margin-left: auto; }

.notifications-page { max-width: 860px; margin: 0 auto; }
.notifications-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.notifications-head .eyebrow { margin-bottom: 6px; }
.notifications-head h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.notifications-sub { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }
.notifications-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }

.notifications-list { display: flex; flex-direction: column; gap: 12px; }

.notification-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.notification-item.is-unread {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface));
}
.notification-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--accent);
}
.notification-kind svg { width: 18px; height: 18px; }
.notification-main { flex: 1; min-width: 0; }
.notification-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.notification-kind-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.notification-time { font-size: 0.72rem; color: var(--muted); margin-left: auto; }
.notification-title {
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.35;
  margin-bottom: 4px;
}
.notification-title-link { color: inherit; }
.notification-title-link:hover { color: var(--accent); }
.notification-body {
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 8px;
}
.notification-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.notification-actor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}
.notification-actor:hover { color: var(--accent); }
.notification-actor .avatar { width: 20px; height: 20px; font-size: 0.7rem; }
.notification-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--accent);
}
.notification-open svg { width: 12px; height: 12px; }
.notification-open:hover { color: var(--accent-hover); }
.notification-delete {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  flex: none;
  align-self: flex-start;
}
.notification-delete:hover { background: var(--danger-soft); color: var(--danger); }
.notification-delete svg { width: 14px; height: 14px; }

/* ---------- surlignages / annotations de lecture ---------- */

.reader-annotations-toggle { position: relative; }
.reader-annotations-toggle.is-active { color: var(--accent); background: var(--accent-soft); }

.annotation-mark {
  border-radius: 3px;
  padding: 0 1px;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.annotation-yellow { background: color-mix(in srgb, #facc15 55%, transparent); }
.annotation-pink { background: color-mix(in srgb, #f472b6 50%, transparent); }
.annotation-green { background: color-mix(in srgb, #4ade80 50%, transparent); }
.annotation-blue { background: color-mix(in srgb, #60a5fa 50%, transparent); }

.reader-article.annotations-hidden .annotation-mark {
  background: transparent !important;
  box-shadow: none;
}

.annotation-flash { outline: 2px solid var(--accent); border-radius: 3px; }

.annotation-popup {
  position: absolute;
  z-index: 120;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}
.annotation-popup[hidden] { display: none; }
.annotation-popup button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 650;
}
.annotation-popup button:hover { background: var(--surface-2); color: var(--text); }
.annotation-popup svg { width: 14px; height: 14px; color: var(--accent); }

.reader-annotations {
  margin-top: 28px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.reader-annotations[hidden] { display: none; }
.reader-annotations-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.reader-annotations-head h2 { font-size: 1.1rem; }
.reader-annotations-count {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}
.reader-annotations-list { display: flex; flex-direction: column; gap: 12px; }
.annotation-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.annotation-quote {
  font-style: italic;
  color: var(--text-soft);
  margin-bottom: 6px;
  line-height: 1.4;
}
.annotation-comment {
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 8px;
  line-height: 1.45;
}
.annotation-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--muted);
}
.annotation-author { color: var(--text-soft); font-weight: 650; }
.annotation-author:hover { color: var(--accent); }
.annotation-time { margin-left: auto; }
.annotation-delete {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 4px 6px;
  border-radius: 6px;
}
.annotation-delete:hover { background: var(--danger-soft); color: var(--danger); }
.annotation-delete svg { width: 13px; height: 13px; }
.annotation-goto {
  border: none;
  background: transparent;
  color: var(--accent);
  font-weight: 650;
  padding: 4px 6px;
  border-radius: 6px;
}
.annotation-goto:hover { background: var(--accent-soft); }
.mobile-nav a { position: relative; }
.nav-dot {
  position: absolute;
  top: 3px;
  right: calc(50% - 17px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--header-bg);
}
.nav-dot[hidden] { display: none; }

/* ---------- messagerie ---------- */

.messages-page { max-width: 1180px; }
.messages-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  height: calc(100vh - var(--header-h) - 90px);
  min-height: 540px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.messages-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-soft);
}
.messages-side-head { padding: 18px 18px 12px; }
.messages-side-head h1 { font-size: 1.35rem; }
.messages-count { font-size: 0.72rem; color: var(--muted); }
.compose-start { display: flex; gap: 6px; padding: 0 14px 12px; }
.compose-start .input { padding: 8px 10px; font-size: 0.82rem; }
.compose-start .btn { flex: none; padding: 0 11px; }
.conversation-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 10px; }
.conversation {
  display: flex;
  gap: 11px;
  padding: 11px 10px;
  border-radius: 12px;
  color: inherit;
}
.conversation:hover { background: var(--surface-2); }
.conversation.active { background: var(--accent-soft); }
.conversation-body { flex: 1; min-width: 0; }
.conversation-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.conversation-top strong { font-size: 0.87rem; }
.conversation-top span { font-size: 0.67rem; color: var(--muted); white-space: nowrap; }
.conversation-side { display: inline-flex; align-items: center; gap: 6px; }
.conversation-lock { display: inline-flex; align-items: center; color: var(--muted); }
.conversation-lock svg { width: 12px; height: 12px; }
.conversation-bottom { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.conversation-preview {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.76rem;
  color: var(--muted);
}
.conversation-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
}
.conversations-empty { padding: 26px 16px; text-align: center; font-size: 0.82rem; color: var(--muted); }
.conversations-empty p { margin: 0 0 4px; }

.messages-thread { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.thread-back { display: none; color: var(--text-soft); }
.thread-back svg { width: 20px; height: 20px; }
.thread-head-id { display: flex; flex-direction: column; }
.thread-head-id strong { font-size: 0.95rem; }
.thread-head-id a { font-size: 0.72rem; font-weight: 600; color: var(--accent); }
.thread-head-id a.thread-name { font-size: 0.95rem; color: var(--text); text-decoration: none; }
.thread-head-id a.thread-name:hover,
.thread-head-id a.thread-name:focus-visible { color: var(--accent); text-decoration: underline; }
.thread-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.thread-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
}
.thread-action:hover { background: var(--surface-2); color: var(--text); }
.thread-action.danger:hover {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}
.thread-action:disabled { opacity: 0.5; cursor: default; }
.thread-action svg { width: 16px; height: 16px; }
.thread-feed {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 22px 22px 12px;
  scroll-behavior: smooth;
}
.message-row { display: flex; align-items: flex-end; gap: 9px; max-width: 82%; }
.message-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.message-bubble {
  padding: 9px 13px 7px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}
.message-row.mine .message-bubble {
  border-color: var(--accent);
  border-bottom-right-radius: 5px;
  background: var(--accent);
  color: #fff;
}
.message-row.theirs .message-bubble { border-bottom-left-radius: 5px; }
.message-bubble p { margin: 0; font-size: 0.9rem; line-height: 1.5; overflow-wrap: anywhere; }
.message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 3px;
  font-size: 0.63rem;
  line-height: 1;
}
.message-time { opacity: 0.65; white-space: nowrap; }
.message-report {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.message-report:hover,
.message-report:focus-visible {
  opacity: 1;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.message-report svg { width: 11px; height: 11px; }
.message-status {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0.78;
}
.message-status.is-delivered { opacity: 0.9; }
.message-status.is-read { opacity: 1; }

.thread-typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
}
.thread-typing[hidden] { display: none; }
.typing-dots { display: inline-flex; align-items: center; gap: 2px; }
.typing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-3px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .typing-dots span { animation: none; opacity: 0.8; }
}
.thread-empty, .thread-placeholder { max-width: 380px; margin: auto; padding: 30px; text-align: center; color: var(--muted); }
.thread-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.thread-empty-icon svg { width: 24px; height: 24px; }
.thread-placeholder h2 { margin-bottom: 6px; font-size: 1.25rem; color: var(--text); }
.thread-placeholder p { font-size: 0.86rem; }
.thread-blocked {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
}
.thread-blocked svg { width: 18px; height: 18px; flex: none; color: var(--danger); }
.message-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.message-input {
  flex: 1;
  min-height: 44px;
  max-height: 150px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.88rem;
  line-height: 1.45;
  resize: none;
}
.message-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.message-send { flex: none; }

@media (max-width: 900px) {
  .messages-shell { grid-template-columns: 280px minmax(0, 1fr); }
  .toolbar-secure { display: none; }
}

@media (max-width: 760px) {
  .messages-shell {
    grid-template-columns: 1fr;
    height: calc(100dvh - var(--header-h) - 150px);
    min-height: 430px;
  }
  .messages-shell.has-thread .messages-side { display: none; }
  .messages-shell:not(.has-thread) .messages-thread { display: none; }
  .thread-back { display: inline-flex; }
  .thread-head { padding: 12px 14px; }
  .thread-feed { padding: 16px 14px 10px; }
  .message-row { max-width: 90%; }
  .message-form { padding: 10px 12px 12px; }
  .message-send span { display: none; }
  .message-send { width: 44px; padding: 0; }
  .editor-toolbar { top: calc(var(--header-h) + 6px); padding: 6px; gap: 2px; }
  .toolbar-sep { margin: 0 2px; }
  .tool-btn { width: 32px; height: 30px; }
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .novel-grid.cols-6 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .header-search { max-width: 280px; }
  .hero-inner { gap: 28px; }
  .hero-book { width: 168px; }
  .hero-art { height: 390px; }
  .footer-inner { grid-template-columns: 1.2fr 1fr 1fr; }
  .footer-col:nth-child(3) { display: none; }
}

@media (max-width: 900px) {
  .main-nav { display: none; }
  .header-search { max-width: none; }
  .hero-inner { grid-template-columns: 1fr; padding: 54px 24px 60px; }
  .hero-copy { max-width: 620px; }
  .hero-art { display: none; }
  .novel-hero-inner { grid-template-columns: 180px 1fr; gap: 28px; }
  .novel-grid.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .novel-form-layout { grid-template-columns: 190px 1fr; gap: 24px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .sticky-side { position: static; }
}

@media (max-width: 760px) {
  :root { --header-h: 62px; }
  body { padding-bottom: 68px; }
  .header-inner { padding: 0 16px; gap: 12px; }
  .header-search { display: none; }
  .header-actions .btn-ghost, .header-actions .btn-primary { display: none; }
  .header-messages { display: none; }
  .brand { font-size: 1.45rem; }
  .brand svg { width: 27px; height: 27px; }
  .page { padding: 26px 16px 60px; }
  .section-head { margin-top: 40px; }
  .novel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 12px; }
  .novel-grid.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-body h3 { font-size: 0.88rem; }
  .card-meta { font-size: 0.66rem; gap: 6px; }
  .cover-art { padding: 11px; }
  .cover-emoji { font-size: 1.8rem; }
  .cover-title { font-size: 0.9rem; }
  .cover-author { font-size: 0.54rem; }
  .novel-hero-inner {
    grid-template-columns: 132px 1fr;
    padding: 26px 16px 32px;
    gap: 20px;
  }
  .novel-hero-cover { position: static; }
  .novel-info h1 { font-size: 1.65rem; }
  .novel-stats { gap: 14px; }
  .novel-stats .stat strong { font-size: 0.9rem; }
  .novel-actions .btn { flex: 1; }
  .novel-actions .btn-icon { flex: none; }
  .chapter-panel-head, .chapter-row { padding-left: 16px; padding-right: 16px; }
  .reader-toolbar { padding: 9px 12px; }
  .reader-toolbar .chapter-select { font-size: 0.78rem; }
  .reader-shell { padding: 30px 18px 80px; }
  .reader-settings { right: 12px; width: calc(100% - 24px); }
  .reader-article { font-size: var(--reader-size, 18px); }
  .reader-nav { flex-direction: column-reverse; }
  .reader-nav .btn { width: 100%; }
  .footer-inner { grid-template-columns: 1fr 1fr; padding: 34px 16px 26px; gap: 24px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-col:last-child { display: block; }
  .footer-bottom { padding: 16px 16px 22px; }
  .cta-banner { padding: 30px 24px; }
  .library-grid { grid-template-columns: 1fr; }
  .writer-row { flex-wrap: wrap; }
  .writer-actions { width: 100%; justify-content: flex-end; }
  .novel-form-layout { grid-template-columns: 1fr; }
  .cover-editor { position: static; display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: start; }
  .cover-preview { margin-bottom: 0; }
  .cover-editor-actions { justify-content: center; }
  .form-row { grid-template-columns: 1fr; }
  .stat-grid { gap: 10px; }
  .stat-card { padding: 14px 16px; }
  .stat-card strong { font-size: 1.55rem; }
  .profile-banner { height: 130px; }
  .profile-head { margin-top: -44px; padding: 0 16px; }
  .profile-avatar { width: 88px; height: 88px; font-size: 2.6rem; border-width: 4px; }
  .profile-id h1 { font-size: 1.6rem; }
  .profile-stats { gap: 18px; }
  .auth-main { padding: 32px 16px 48px; }
  .editor-page { padding: 24px 16px 80px; }
  .editor-footer { bottom: 78px; }
  .editor-footer .editor-count { width: 100%; }
  .toasts { right: 12px; left: 12px; bottom: 78px; }
  .toast { max-width: none; }
  .modal { padding: 22px; }

  .mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
  }
  .mobile-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 4px;
    border-radius: 10px;
    font-size: 0.62rem;
    font-weight: 650;
    color: var(--muted);
  }
  .mobile-nav a svg { width: 21px; height: 21px; }
  .mobile-nav a.active { color: var(--accent); }
  .mobile-nav a.active svg { filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--accent) 40%, transparent)); }
}

@media (max-width: 520px) {
  .novel-grid, .novel-grid.cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .hero-copy h1 { font-size: 2.2rem; }
  .hero-actions .btn { flex: 1; }
  .hero-proof { display: none; }
  .novel-hero-inner { grid-template-columns: 110px 1fr; gap: 16px; }
  .novel-info h1 { font-size: 1.4rem; }
  .novel-description { font-size: 0.9rem; }
  .tag { font-size: 0.68rem; }
  .section-head { flex-wrap: wrap; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .writer-main h3 { font-size: 0.95rem; }
  .writer-cover { width: 50px; }
  .profile-card { gap: 14px; }
  .profile-actions { width: 100%; }
  .profile-actions .btn { flex: 1; }
  .reader-toolbar .reader-edit-btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
  .reader-toolbar .reader-edit-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   Progression : XP, niveaux et badges
   ========================================================= */

.level-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.level-pill[hidden] { display: none; }

.xp-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.xp-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.45s ease;
}
.xp-bar-sm { height: 6px; }
.xp-bar-lg { height: 10px; }

.user-dropdown .drop-level { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.user-dropdown .drop-level-head { display: flex; align-items: center; gap: 8px; }
.user-dropdown .drop-level-head strong {
  display: inline;
  font-size: 0.76rem;
  font-weight: 650;
  color: var(--text-soft);
}
.user-dropdown .drop-level-meta { font-size: 0.68rem; color: var(--muted); }

.toast.xp { background: linear-gradient(135deg, var(--accent), #e39a34); color: #fff; }
.toast.badge { background: linear-gradient(135deg, #7b4bb8, var(--gold)); color: #fff; }

/* ---------- page récompenses ---------- */

.rewards-page { max-width: 1180px; }

.rewards-hero {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 300px at 92% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(420px 240px at 0% 100%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.rewards-hero-top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.rewards-medal {
  width: 92px;
  height: 92px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--gold));
  color: #fff;
  box-shadow: 0 18px 34px -18px color-mix(in srgb, var(--accent) 70%, transparent);
}
.rewards-medal span { font-family: var(--serif); font-size: 2.1rem; line-height: 1; font-weight: 700; }
.rewards-medal small { margin-top: 2px; font-size: 0.56rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.9; }
.rewards-identity { flex: 1; min-width: 200px; }
.rewards-identity h1 { margin-top: 4px; font-size: clamp(1.7rem, 3vw, 2.5rem); }
.rewards-sub { margin-top: 7px; color: var(--muted); font-size: 0.92rem; }

.xp-panel {
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}
.xp-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: var(--text-soft);
}
.xp-panel-head strong { font-size: 0.86rem; }
.xp-panel-note { margin-top: 10px; font-size: 0.8rem; color: var(--muted); }

.rewards-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.reward-stat {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.reward-stat-icon { display: block; margin-bottom: 6px; font-size: 1.1rem; }
.reward-stat strong { display: block; font-family: var(--serif); font-size: 1.5rem; line-height: 1.1; }
.reward-stat > span:last-child {
  display: block;
  margin-top: 4px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.rewards-hint { display: flex; gap: 8px; margin-top: 18px; font-size: 0.8rem; color: var(--muted); }
.rewards-hint svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }

.rewards-section { margin-top: 44px; }

.level-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.level-step {
  padding: 14px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
  opacity: 0.58;
}
.level-step.reached { opacity: 1; }
.level-step.current {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 12px 26px -18px color-mix(in srgb, var(--accent) 70%, transparent);
}
.level-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 0.8rem;
  font-weight: 750;
}
.level-step.reached .level-dot { background: var(--accent); color: #fff; }
.level-step strong { display: block; margin-top: 8px; font-size: 0.72rem; line-height: 1.25; }
.level-xp { display: block; margin-top: 4px; font-size: 0.66rem; color: var(--muted); }

.badge-group { margin-top: 26px; }
.badge-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.badge-group-head h3 { font-size: 1rem; }
.badge-group-head span { font-size: 0.74rem; color: var(--muted); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.badge-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.badge-card.earned {
  border-color: color-mix(in srgb, var(--gold) 42%, var(--border));
  background: linear-gradient(150deg, color-mix(in srgb, var(--gold) 9%, var(--surface)), var(--surface));
}
.badge-card.locked { opacity: 0.62; }
.badge-emoji {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 1.6rem;
}
.badge-card.earned .badge-emoji { background: color-mix(in srgb, var(--gold) 17%, transparent); }
.badge-card.locked .badge-emoji { filter: grayscale(1); }
.badge-body { min-width: 0; }
.badge-body strong { display: block; font-size: 0.9rem; }
.badge-body p { margin: 4px 0 6px; font-size: 0.78rem; line-height: 1.4; color: var(--muted); }
.badge-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 0.68rem; color: var(--muted); }
.badge-meta svg { width: 12px; height: 12px; }

.rewards-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 44px; }
.rewards-panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.rewards-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.rewards-panel-head h2 { font-size: 1.2rem; }
.panel-sub { font-size: 0.75rem; color: var(--muted); }
.panel-empty { color: var(--muted); font-size: 0.86rem; }

.leaderboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; }
.lb-row.me { background: var(--accent-soft); }
.lb-rank { width: 22px; flex: none; text-align: center; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.lb-row:first-child .lb-rank { color: var(--gold); }
.lb-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
}
.lb-name a { color: inherit; text-decoration: none; }
.lb-name a:hover,
.lb-name a:focus-visible { color: var(--accent); text-decoration: underline; }
.lb-name small { color: var(--muted); font-weight: 500; }
.lb-xp { flex: none; font-size: 0.78rem; color: var(--text-soft); white-space: nowrap; }

.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.activity-row:last-child { border-bottom: none; }
.activity-icon {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--accent);
}
.activity-icon svg { width: 16px; height: 16px; }
.activity-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.activity-body strong { font-size: 0.84rem; font-weight: 600; }
.activity-body span { font-size: 0.72rem; color: var(--muted); }
.activity-xp { flex: none; font-size: 0.78rem; font-weight: 700; color: var(--success); white-space: nowrap; }

/* ---------- récompenses sur le profil ---------- */

.profile-rewards {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.profile-reward-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.profile-level { display: flex; align-items: center; gap: 12px; min-width: 0; }
.profile-level-num {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--gold));
  color: #fff;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
}
.profile-level div { min-width: 0; }
.profile-level div strong { display: block; font-size: 0.95rem; }
.profile-level div span { display: block; margin-top: 2px; font-size: 0.76rem; color: var(--muted); }
.profile-reward-note { margin-top: 8px; font-size: 0.76rem; color: var(--muted); }
.profile-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.72rem;
  color: var(--text-soft);
}

@media (max-width: 1080px) {
  .rewards-columns { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .rewards-hero { padding: 22px 18px; }
  .rewards-medal { width: 74px; height: 74px; }
  .rewards-medal span { font-size: 1.65rem; }
  .rewards-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .level-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .badge-grid { grid-template-columns: 1fr; }
  .rewards-panel { padding: 18px; }
  .user-chip .level-pill { display: none; }
}

@media (max-width: 520px) {
  .rewards-hero-top { align-items: flex-start; }
  .rewards-hero-top > .btn { width: 100%; justify-content: center; }
  .rewards-stats { gap: 8px; }
  .reward-stat { padding: 12px; }
  .reward-stat strong { font-size: 1.25rem; }
  .profile-rewards { padding: 16px; }
  .profile-reward-top > .btn { width: 100%; justify-content: center; }
}

/* =========================================================
   Pastilles, maintenance et pages éditoriales
   ========================================================= */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--text-soft);
  white-space: nowrap;
}
.pill svg { width: 12px; height: 12px; }
.pill-admin {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
  color: var(--accent-ink);
}
.pill-success {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 28%, transparent);
  color: var(--success);
}
.pill-danger {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 28%, transparent);
  color: var(--danger);
}
.profile-admin-pill { vertical-align: middle; font-size: 0.66rem; margin-left: 4px; }

.maintenance-page {
  min-height: calc(100dvh - var(--header-h));
  display: grid;
  place-items: center;
  padding: 40px 20px 100px;
}
.maintenance-card {
  max-width: 580px;
  width: 100%;
  text-align: center;
  padding: 46px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.maintenance-logo { font-size: 3.2rem; line-height: 1; margin-bottom: 14px; }
.maintenance-card h1 { margin: 14px 0 10px; font-size: clamp(1.7rem, 4vw, 2.3rem); }
.maintenance-card p { color: var(--muted); margin-bottom: 24px; line-height: 1.7; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  font-size: 0.8rem;
  color: var(--muted);
}
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-weight: 600;
}
.breadcrumb svg { width: 14px; height: 14px; }

.editorial {
  padding: 42px 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.editorial-head h1 { margin: 10px 0 6px; font-size: clamp(1.85rem, 4vw, 2.7rem); }
.editorial-meta { color: var(--muted); font-size: 0.8rem; }
.editorial-body {
  margin-top: 28px;
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 1.8;
  color: var(--text-soft);
}
.editorial-body p { margin: 0 0 1.25em; }
.editorial-body h2,
.editorial-body h3 {
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.25;
  margin: 1.6em 0 0.6em;
}
.editorial-body h2 { font-size: 1.5rem; }
.editorial-body h3 { font-size: 1.22rem; }
.editorial-body blockquote {
  margin: 1.4em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--surface-2);
  color: var(--text);
}
.editorial-body blockquote p { margin: 0 0 0.5em; }
.editorial-body blockquote p:last-child { margin-bottom: 0; }
.editorial-body ul,
.editorial-body ol { margin: 0 0 1.3em; padding-left: 1.5em; }
.editorial-body li { margin: 0.3em 0; }
.editorial-body strong { color: var(--text); }
.editorial-more { margin-top: 26px; }
.editorial-more h2 { font-size: 1.15rem; margin-bottom: 12px; }
.editorial-links { display: flex; flex-wrap: wrap; gap: 10px; }
.editorial-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
}
.editorial-links a:hover { border-color: var(--accent); color: var(--accent); }
.editorial-links svg { width: 14px; height: 14px; }

/* =========================================================
   Panneau d'administration
   ========================================================= */

.admin-shell {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  max-width: var(--page-max, 1240px);
  margin: 0 auto;
  padding: 28px 24px 100px;
}
.admin-side {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--border);
}
.admin-brand-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.admin-brand-icon svg { width: 20px; height: 20px; }
.admin-brand strong { display: block; font-size: 0.9rem; }
.admin-brand span { display: block; font-size: 0.72rem; color: var(--muted); }
.admin-nav { display: flex; flex-direction: column; gap: 3px; }
.admin-nav-group {
  display: block;
  padding: 12px 11px 4px;
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
}
.admin-nav a svg { width: 17px; height: 17px; flex: none; }
.admin-nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-nav a.active { background: var(--accent-soft); color: var(--accent-ink); }
.admin-side-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.73rem;
  color: var(--muted);
}
.admin-side-foot a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-soft);
}
.admin-side-foot svg { width: 14px; height: 14px; }

.admin-main { min-width: 0; }
.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.admin-head h1 { margin-top: 6px; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.admin-head p { max-width: 640px; margin-top: 6px; color: var(--muted); font-size: 0.9rem; }
.admin-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-body { display: flex; flex-direction: column; gap: 20px; }
.admin-loading { padding: 40px 0; }

.admin-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.admin-card-head h2 { font-size: 1.12rem; }
.admin-card-head p { margin-top: 4px; font-size: 0.82rem; color: var(--muted); }
.admin-card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.admin-card-link svg { width: 14px; height: 14px; }

.admin-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.55;
}
.admin-callout svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; color: var(--accent); }
.admin-callout strong { color: var(--text); }
.admin-callout code {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.admin-callout-warn {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  color: var(--danger);
}
.admin-callout-warn svg { color: var(--danger); }
.admin-callout-warn strong { color: var(--danger); }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.admin-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.admin-stat-icon {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.admin-stat-icon svg { width: 19px; height: 19px; }
.admin-stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.1;
}
.admin-stat span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-stat small { display: block; margin-top: 3px; font-size: 0.72rem; color: var(--muted); }

.admin-two-col { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 20px; }
.admin-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 200px;
  padding-top: 18px;
}
.admin-bar-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.admin-bar-value { font-size: 0.68rem; color: var(--muted); }
.admin-bar {
  width: 100%;
  max-width: 44px;
  min-height: 4px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 42%, transparent));
}
.admin-bar-label { font-size: 0.7rem; color: var(--muted); text-transform: capitalize; }
.admin-week { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-week div { padding: 14px; border-radius: 12px; background: var(--surface-2); }
.admin-week strong { display: block; font-family: var(--serif); font-size: 1.4rem; }
.admin-week span { font-size: 0.74rem; color: var(--muted); }

.admin-people { display: flex; flex-direction: column; gap: 2px; }
.admin-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 10px;
  color: inherit;
}
.admin-person:hover { background: var(--surface-2); }
.admin-person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-person-main strong { font-size: 0.85rem; }
.admin-person-main small { font-size: 0.72rem; color: var(--muted); }
.admin-person-date { font-size: 0.7rem; color: var(--muted); white-space: nowrap; }
.admin-rank { width: 22px; text-align: center; font-size: 0.8rem; font-weight: 800; color: var(--accent); }

.admin-log { display: flex; flex-direction: column; gap: 12px; }
.admin-log-row { display: flex; align-items: flex-start; gap: 10px; }
.admin-log-dot {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
}
.admin-log-dot svg { width: 14px; height: 14px; }
.admin-log-row strong { font-size: 0.84rem; }
.admin-log-row p { margin-top: 2px; font-size: 0.8rem; color: var(--text-soft); }
.admin-log-row small { font-size: 0.7rem; color: var(--muted); }

.admin-form { display: flex; flex-direction: column; gap: 20px; }
.admin-grid { display: grid; gap: 14px; margin-bottom: 16px; }
.admin-grid:last-child { margin-bottom: 0; }
.admin-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.admin-form-actions-inline { justify-content: flex-start; margin-top: 16px; }

.color-field { display: flex; align-items: center; gap: 10px; }
.color-input {
  width: 46px;
  height: 38px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.color-field code { font-size: 0.76rem; color: var(--muted); }

.admin-switch-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.switch-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
}
.switch-field:hover { background: var(--surface-2); }
.switch { position: relative; display: inline-flex; flex: none; margin-top: 2px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch-track {
  position: relative;
  width: 40px;
  height: 23px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-3);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease;
}
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(17px); }
.switch input:focus-visible + .switch-track {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.switch-text strong { display: block; font-size: 0.87rem; }
.switch-text small { display: block; margin-top: 2px; font-size: 0.76rem; color: var(--muted); }

.admin-checks { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; }
.check-field { display: inline-flex; align-items: center; gap: 7px; font-size: 0.84rem; color: var(--text-soft); }
.check-field input { accent-color: var(--accent); }

.admin-radio-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.admin-radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.admin-radio:hover { background: var(--surface-2); }
.admin-radio input { margin-top: 3px; accent-color: var(--accent); }
.admin-radio strong { display: block; font-size: 0.88rem; }
.admin-radio small { display: block; margin-top: 2px; font-size: 0.76rem; color: var(--muted); }

.admin-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-toolbar .select { width: auto; min-width: 150px; }
.admin-search { flex: 1; min-width: 220px; max-width: none; }
.admin-search .input { border-radius: 999px; }
.admin-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}
.admin-list-meta a { color: var(--accent); font-weight: 600; }

.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.admin-table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
  white-space: nowrap;
}
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--surface-2); }
.admin-user-cell { display: flex; align-items: center; gap: 9px; min-width: 160px; }
.admin-user-cell strong { display: block; font-size: 0.85rem; }
.admin-user-cell span { display: block; font-size: 0.72rem; color: var(--muted); }
.admin-cell-stack { display: flex; flex-direction: column; gap: 2px; }
.admin-cell-stack span { font-size: 0.72rem; color: var(--muted); }
.admin-reason { display: block; max-width: 190px; margin-top: 3px; font-size: 0.7rem; color: var(--danger); }
.admin-row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.btn-icon.danger:hover { background: var(--danger-soft); color: var(--danger); }

.admin-content-list { display: flex; flex-direction: column; gap: 10px; }
.admin-content-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.admin-content-cover { width: 46px; flex: none; }
.admin-content-cover .cover { aspect-ratio: 2 / 3; border-radius: 6px; box-shadow: none; }
.admin-content-cover .cover-title,
.admin-content-cover .cover-author { display: none; }
.admin-content-cover .cover-emoji { font-size: 1rem; }
.admin-content-main { flex: 1; min-width: 0; }
.admin-content-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-content-title strong { font-size: 0.88rem; }
.admin-content-title a { color: inherit; text-decoration: none; }
.admin-content-title a:hover,
.admin-content-title a:focus-visible { color: var(--accent); text-decoration: underline; }
.admin-content-date { font-size: 0.72rem; color: var(--muted); }
.admin-content-main > span { display: block; margin-top: 2px; font-size: 0.75rem; color: var(--muted); }
.admin-content-main small { display: block; margin-top: 2px; font-size: 0.72rem; color: var(--muted); }
.admin-content-text {
  margin-top: 6px;
  font-size: 0.84rem;
  color: var(--text-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.admin-comment-avatar { flex: none; }
.admin-arrow { color: var(--accent); }

.admin-report-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.admin-report-icon svg { width: 18px; height: 18px; }
.admin-report-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.admin-report-status.open {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.admin-report-status.resolved {
  background: color-mix(in srgb, #1a9c68 14%, transparent);
  color: #1a9c68;
}
.admin-report-status.dismissed {
  background: var(--surface-2);
  color: var(--muted);
}
.admin-report-type {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.66rem;
  color: var(--muted);
}
.admin-report-missing { color: var(--danger); font-size: 0.78rem; }

.admin-page-list { display: flex; flex-direction: column; gap: 10px; }
.admin-page-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.admin-page-main { min-width: 0; }
.admin-page-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-page-title strong { font-size: 0.9rem; }
.admin-page-main code { display: inline-block; margin-top: 5px; font-size: 0.72rem; color: var(--muted); }
.admin-page-date { display: block; margin-top: 3px; font-size: 0.7rem; color: var(--muted); }
.admin-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--muted);
}
.admin-note svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.admin-note code { padding: 1px 5px; border-radius: 5px; background: var(--surface-2); }

.admin-levels { display: flex; flex-direction: column; gap: 10px; }
.admin-level-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 74px;
  gap: 10px;
  align-items: center;
  font-size: 0.8rem;
}
.admin-level-name { min-width: 0; }
.admin-level-name strong { margin-right: 4px; }
.admin-level-bar { height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.admin-level-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.admin-level-count { text-align: right; font-size: 0.72rem; color: var(--muted); }

.admin-badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.admin-badge-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.admin-badge-emoji { font-size: 1.3rem; line-height: 1; }
.admin-badge-row div { flex: 1; min-width: 0; }
.admin-badge-row strong { display: block; font-size: 0.84rem; }
.admin-badge-row span { display: block; font-size: 0.72rem; color: var(--muted); }
.admin-badge-row small { display: block; margin-top: 3px; font-size: 0.72rem; color: var(--muted); }
.admin-badge-count { font-size: 0.7rem; color: var(--muted); white-space: nowrap; }

.admin-empty { padding: 26px 16px; text-align: center; font-size: 0.86rem; color: var(--muted); }
.admin-password {
  display: block;
  margin: 16px 0;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--surface-2);
  text-align: center;
  font-size: 1.3rem;
  letter-spacing: 0.1em;
}
.hint-inline { font-weight: 400; font-size: 0.76rem; color: var(--muted); }
.admin-page-content { min-height: 260px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86rem; }

@media (max-width: 1080px) {
  .admin-shell { grid-template-columns: 1fr; padding-top: 20px; }
  .admin-side { position: static; }
  .admin-nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .admin-nav a { white-space: nowrap; }
  .admin-nav-group { display: none; }
  .admin-side-foot { display: none; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-two-col { grid-template-columns: 1fr; }
  .novel-grid.cols-6,
  .novel-grid.cols-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .admin-shell { padding: 16px 16px 84px; }
  .admin-grid-2,
  .admin-grid-3 { grid-template-columns: 1fr; }
  .admin-table th:nth-child(4),
  .admin-table td:nth-child(4),
  .admin-table th:nth-child(5),
  .admin-table td:nth-child(5) { display: none; }
  .admin-badges { grid-template-columns: 1fr; }
  .admin-level-row { grid-template-columns: minmax(0, 1fr) 70px; }
  .admin-level-count { grid-column: 2; text-align: right; }
  .admin-content-cover { display: none; }
  .admin-page-row { flex-direction: column; align-items: flex-start; }
  .admin-page-row .admin-row-actions { width: 100%; }
  .novel-grid.cols-6,
  .novel-grid.cols-5,
  .novel-grid.cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .editorial { padding: 26px 20px; }
}

@media (max-width: 520px) {
  .admin-stats { grid-template-columns: 1fr; }
  .admin-toolbar .select { width: 100%; }
  .admin-form-actions .btn { width: 100%; justify-content: center; }
  .admin-week { grid-template-columns: 1fr; }
  .novel-grid.cols-6,
  .novel-grid.cols-5,
  .novel-grid.cols-4,
  .novel-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editorial-links { flex-direction: column; }
  .editorial-links a { width: 100%; }
}

/* ---------- paramètres du compte ---------- */

.settings-form { display: flex; flex-direction: column; gap: 16px; }
.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.settings-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.settings-danger .panel-head h2 { color: var(--danger); }
.settings-danger-text {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 640px;
  margin-bottom: 18px;
}

@media (max-width: 640px) {
  .settings-actions { justify-content: stretch; }
  .settings-actions .btn { width: 100%; justify-content: center; }
}

/* ---------- thèmes saisonniers ---------- */

.plume-snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}

.plume-snowflake {
  position: absolute;
  top: -2em;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(15, 23, 42, 0.35);
  animation: plume-snow-fall linear infinite;
  will-change: transform;
}

@keyframes plume-snow-fall {
  0% { transform: translateY(-10vh) translateX(0); }
  50% { transform: translateY(50vh) translateX(12px); }
  100% { transform: translateY(110vh) translateX(-8px); }
}

html[data-season="halloween"] body {
  background-image: radial-gradient(circle at 20% 10%, rgba(249, 115, 22, 0.08), transparent 40%),
                    radial-gradient(circle at 80% 5%, rgba(139, 92, 246, 0.06), transparent 45%);
}

html[data-season="autumn"] body {
  background-image: radial-gradient(circle at 15% 5%, rgba(234, 88, 12, 0.06), transparent 40%);
}

/* ---------- badges verrouillés sur le profil ---------- */
.profile-badges-muted .profile-badge {
  opacity: 0.45;
  filter: grayscale(0.6);
}
.profile-badges-locked summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 10px;
}

/* ---------- badge Premium ---------- */
.premium-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  font-size: 0.9em;
}
.pill-premium {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #1f2937;
}

/* ---------- widget membres Premium ---------- */
.premium-members-widget {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.premium-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
}
.premium-member .avatar {
  box-shadow: 0 0 0 2px #fbbf24;
}

/* ---------- couverture de profil ---------- */
.profile-banner {
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
}
.cover-preview {
  width: 100%;
  height: 120px;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
  border: 1px dashed var(--border);
}

/* ---------- avatar photo ---------- */
.avatar-image {
  overflow: hidden;
  padding: 0;
}
.avatar-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- entraide ---------- */

.help-page { max-width: 1080px; }

.help-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  padding: 30px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(1100px 260px at 100% -30%, var(--accent-soft), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.help-hero-text { max-width: 640px; }
.help-hero-text h1 { font-size: clamp(2rem, 4vw, 2.9rem); margin: 8px 0 10px; }
.help-hero-text > p:last-child { color: var(--muted); font-size: 0.95rem; line-height: 1.65; }
.help-hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.help-hero-count {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
}

.help-create { margin-top: 22px; }
.help-create[hidden] { display: none; }
.help-create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.help-create .field + .field { margin-top: 14px; }
.help-create-grid .field + .field { margin-top: 0; }
.help-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.help-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin: 28px 0 0;
}
.help-filters .chip-row { margin: 0; padding-bottom: 6px; }

.help-results { margin-top: 4px; }
.help-list {
  display: grid;
  gap: 14px;
}

.help-ticket {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.help-ticket:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.help-ticket.is-resolved { opacity: 0.82; }
.help-ticket.is-resolved .help-ticket-title a { color: var(--text-soft); }

.help-ticket-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.help-ticket-time { margin-left: auto; font-size: 0.74rem; color: var(--muted); }

.help-ticket-title { font-size: 1.18rem; line-height: 1.3; margin: 0; }
.help-ticket-title a { color: var(--text); }
.help-ticket-title a:hover { color: var(--accent); }
.help-ticket-excerpt { margin: 0; color: var(--text-soft); font-size: 0.9rem; line-height: 1.6; }
.help-ticket-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 4px;
  font-size: 0.8rem;
}
.help-ticket-replies {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-weight: 650;
}
.help-ticket-replies svg { width: 15px; height: 15px; }
.help-ticket-hint {
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px dashed var(--border);
  padding-top: 9px;
}

.help-type,
.help-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.help-type {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
}
.help-type-relecture { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.help-type-correction { background: var(--success-soft); border-color: transparent; color: var(--success); }
.help-type-idees { background: color-mix(in srgb, var(--gold) 14%, transparent); border-color: transparent; color: var(--gold); }

.help-status.is-open { background: var(--success-soft); color: var(--success); }
.help-status.is-resolved { background: var(--surface-2); color: var(--muted); }

.help-author {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 650;
}
.help-author a { color: var(--text-soft); }
.help-author a:hover { color: var(--accent); }

.help-novel {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--accent);
}
.help-novel:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
.help-novel svg { width: 14px; height: 14px; }

.help-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--muted);
}
.help-back:hover { color: var(--accent); }
.help-back svg { width: 16px; height: 16px; }

.help-detail { padding: 30px 32px; }
.help-detail-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.help-detail h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.25; margin-bottom: 14px; }
.help-detail-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.help-detail-content { font-size: 1rem; line-height: 1.75; color: var(--text-soft); }
.help-detail-content p { margin: 0 0 12px; }
.help-detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.help-replies { display: grid; gap: 12px; }
.help-reply {
  display: flex;
  gap: 13px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.help-reply-body { flex: 1; min-width: 0; }
.help-reply-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.help-reply-time { font-size: 0.72rem; color: var(--muted); }
.help-reply-content { font-size: 0.92rem; line-height: 1.65; color: var(--text-soft); }
.help-reply-content p { margin: 0 0 8px; }
.help-reply-content p:last-child { margin-bottom: 0; }

.help-reply-form { margin-top: 20px; }
.help-reply-form-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.help-reply-form-head p { margin-top: 3px; }
.help-reply-form .textarea { min-height: 110px; }

.help-login-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.88rem;
}
.help-login-note a { color: var(--accent); font-weight: 650; }

@media (max-width: 720px) {
  .help-hero { padding: 24px 20px; }
  .help-hero-actions { align-items: stretch; width: 100%; }
  .help-hero-actions .btn { justify-content: center; }
  .help-hero-count { text-align: center; }
  .help-create-grid { grid-template-columns: 1fr; }
  .help-detail { padding: 22px 20px; }
  .help-ticket { padding: 17px 16px; }
  .help-ticket-time { width: 100%; margin-left: 0; }
  .help-reply { padding: 15px 14px; }
  .help-create-actions { justify-content: stretch; }
  .help-create-actions .btn { flex: 1; justify-content: center; }
}

/* ---------- administration : changelog ---------- */

.admin-side-version {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.admin-version-card {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
  background:
    radial-gradient(700px 200px at 0% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
}
.admin-version-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 160px;
  padding: 18px 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface));
  color: var(--accent-ink);
  text-align: center;
}
.admin-version-label {
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  opacity: 0.85;
}
.admin-version-badge strong { font-size: 2rem; line-height: 1.15; }
.admin-version-date { font-size: 0.76rem; color: var(--muted); }
.admin-version-info { flex: 1; min-width: 240px; }
.admin-version-info h2 { font-size: 1.35rem; margin-bottom: 4px; }
.admin-version-info p { color: var(--text-soft); font-size: 0.92rem; }
.admin-version-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}
.admin-version-note svg { width: 15px; height: 15px; }
.admin-version-note code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.76rem;
}

.admin-changelog { display: flex; flex-direction: column; }
.admin-release {
  padding: 18px 0;
  border-top: 1px solid var(--border);
}
.admin-release:first-child { border-top: none; padding-top: 0; }
.admin-release:last-child { padding-bottom: 0; }
.admin-release-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.admin-release-version {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.74rem;
  font-weight: 750;
}
.admin-release-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  color: var(--muted);
}
.admin-release-date svg { width: 14px; height: 14px; }
.admin-release h3 { font-size: 1rem; margin-bottom: 8px; }
.admin-release-changes {
  margin: 0;
  padding-left: 20px;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.65;
}
.admin-release-changes li { margin-bottom: 4px; }
.admin-release-changes li::marker { color: var(--accent); }

@media (max-width: 720px) {
  .admin-version-card { gap: 16px; }
  .admin-version-badge { width: 100%; }
}
