/* ═══════════════════════════════════════════════════════════
   APP — liseuse, bibliothèque, comptes, paywall
   ═══════════════════════════════════════════════════════════ */

.app-body { padding-top: 60px; }

/* ═══ EN-TÊTE ═══ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-nav); height: 60px;
  background: rgba(8, 10, 14, .84);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border-bottom: 1px solid var(--hairline);
}
[data-theme="light"] .topbar { background: rgba(255,255,255,.88); }
[data-theme="sepia"] .topbar { background: rgba(26,22,17,.9); }

.topbar__inner {
  height: 100%; max-width: 1180px; margin-inline: auto;
  padding-inline: var(--s4);
  display: flex; align-items: center; gap: var(--s3);
}
.topbar__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar__title { font-size: var(--t-sm); font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }
@media (max-width: 620px) { .topbar__title { display: none; } }
/* En lecture, le titre central remplace celui de gauche pour éviter tout chevauchement. */
@media (max-width: 1180px) {
  .topbar__inner:has(.topbar__center:not([hidden])) .topbar__title { display: none; }
}

.topbar__center {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 0; padding-inline: var(--s3);
}
.topbar__center[hidden] { display: none; }
.topbar__mod {
  font-size: var(--t-xs); font-weight: 650; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.topbar__seg { display: flex; gap: 3px; width: min(240px, 42vw); }
.topbar__seg i {
  flex: 1; height: 3px; border-radius: 2px; background: var(--glass-3);
  transition: background var(--d-mid) var(--e-out);
}
.topbar__seg i.is-done { background: var(--grad-gold-h); }
.topbar__count { font-size: 10px; color: var(--ink-faint); font-family: var(--f-num); }

.topbar__actions { display: flex; align-items: center; gap: 5px; margin-left: auto; }

.icobtn {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: grid; place-items: center; flex-shrink: 0;
  color: var(--ink-soft); border: 1px solid transparent;
  transition: background var(--d-fast), color var(--d-fast), border-color var(--d-fast), transform var(--d-fast) var(--e-spring);
}
.icobtn:hover { background: var(--glass-2); color: var(--ink); }
.icobtn:active { transform: scale(.92); }
.icobtn[aria-expanded="true"] { background: var(--gold-veil); color: var(--gold-hi); border-color: rgba(212,175,55,.3); }
.icobtn.is-on { color: var(--gold); }
.icobtn.is-on svg { fill: currentColor; }
.icobtn--avatar {
  background: var(--grad-gold); color: #0A0C11;
  font-weight: 800; font-size: 12.5px; border-radius: 50%;
  width: 34px; height: 34px;
}
.icobtn--avatar:hover { color: #0A0C11; }

/* ═══ TIROIR SOMMAIRE ═══ */
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: var(--z-drawer);
  width: min(340px, 88vw);
  background: linear-gradient(180deg, var(--raise), var(--deep));
  border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column;
  transform: translateX(-102%);
  transition: transform var(--d-mid) var(--e-out);
  box-shadow: var(--sh-lg);
}
.drawer[hidden] { display: flex; }
.drawer.is-open { transform: none; }
.drawer__veil {
  position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1);
  background: rgba(4,5,8,.66); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity var(--d-mid);
}
.drawer__veil[hidden] { display: block; pointer-events: none; }
.drawer__veil.is-open { opacity: 1; pointer-events: auto; }

.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s4) var(--s4) var(--s3);
  border-bottom: 1px solid var(--hairline);
}
.drawer__head h2 { font-size: var(--t-md); font-weight: 750; }

.drawer__progress {
  display: flex; align-items: center; gap: var(--s4);
  padding: var(--s4);
  border-bottom: 1px solid var(--hairline);
}
.drawer__progress strong { display: block; font-size: var(--t-sm); font-weight: 700; }
.drawer__progress small { display: block; font-size: var(--t-xs); color: var(--gold-hi); margin-top: 2px; }

.ring { position: relative; width: 46px; height: 46px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.4; }
.ring__bg { stroke: var(--glass-3); }
.ring__fg {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 119.4;
  stroke-dashoffset: calc(119.4 - (119.4 * var(--p)) / 100);
  transition: stroke-dashoffset var(--d-slow) var(--e-out);
}
.ring b {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 800; font-family: var(--f-num); color: var(--gold-hi);
}

.drawer__list { flex: 1; overflow-y: auto; padding: var(--s3) var(--s3) var(--s5); }

.tocitem {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%; padding: 11px var(--s3); border-radius: var(--r-sm);
  text-align: left; color: var(--ink-soft);
  transition: background var(--d-fast), color var(--d-fast);
}
.tocitem:hover { background: var(--glass-2); color: var(--ink); }
.tocitem.is-current { background: var(--gold-veil); color: var(--gold-hi); }
.tocitem.is-locked { opacity: .55; }
.tocitem__n {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--f-num); font-size: 11px; font-weight: 700;
  background: var(--glass-2); border: 1px solid var(--hairline);
}
.tocitem.is-done .tocitem__n { background: var(--jade-veil); color: var(--jade); border-color: rgba(52,216,160,.3); }
.tocitem.is-current .tocitem__n { background: var(--gold); color: #0A0C11; border-color: transparent; }
.tocitem__label { flex: 1; min-width: 0; font-size: var(--t-sm); font-weight: 600; }
.tocitem__label small { display: block; font-weight: 400; font-size: var(--t-xs); color: var(--ink-faint); margin-top: 1px; }
.tocitem__state { flex-shrink: 0; font-size: 12px; color: var(--ink-faint); }

.drawer__foot { padding: var(--s4); border-top: 1px solid var(--hairline); }

/* ═══ POPOVER ═══ */
.popover {
  position: fixed; top: 66px; right: var(--s4); z-index: var(--z-modal);
  width: min(310px, calc(100vw - 32px));
  padding: var(--s5);
  background: linear-gradient(165deg, var(--elevate), var(--deep));
  border: 1px solid var(--hairline-lit);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  animation: pop-in .26s var(--e-spring);
}
.popover[hidden] { display: none; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
.popover h3 { font-size: var(--t-sm); font-weight: 750; margin-bottom: var(--s4); }
.popover__row { display: flex; flex-direction: column; gap: 9px; margin-bottom: var(--s4); }
.popover__row > span { font-size: var(--t-xs); color: var(--ink-mute); font-weight: 600; }
.popover__hint { font-size: var(--t-tiny); color: var(--ink-faint); line-height: 1.5; }

.segmented { display: flex; gap: 3px; padding: 3px; background: var(--glass-1); border: 1px solid var(--hairline); border-radius: var(--r-sm); }
.segmented button {
  flex: 1; padding: 8px 6px; border-radius: 8px;
  font-size: var(--t-xs); font-weight: 650; color: var(--ink-mute);
  transition: background var(--d-fast), color var(--d-fast);
}
.segmented button[aria-checked="true"] { background: var(--gold-veil); color: var(--gold-hi); }
.segmented button:hover { color: var(--ink); }
.segmented [data-font-set="s"]  { font-size: 11px; }
.segmented [data-font-set="m"]  { font-size: 13px; }
.segmented [data-font-set="l"]  { font-size: 15px; }
.segmented [data-font-set="xl"] { font-size: 17px; }

/* Compte */
.acct__head { display: flex; align-items: center; gap: var(--s3); padding-bottom: var(--s4); border-bottom: 1px solid var(--hairline); margin-bottom: var(--s4); }
.acct__av { width: 40px; height: 40px; border-radius: 50%; background: var(--grad-gold); color: #0A0C11; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.acct__id { min-width: 0; }
.acct__id b { display: block; font-size: var(--t-sm); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct__id span { display: block; font-size: var(--t-xs); color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct__badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--t-tiny); font-weight: 700; padding: 4px 10px; border-radius: var(--r-full);
  margin-bottom: var(--s4);
}
.acct__badge--premium { background: var(--gold-veil); color: var(--gold-hi); }
.acct__badge--free { background: var(--cyan-veil); color: var(--cyan); }
.acct__badge--guest { background: var(--glass-2); color: var(--ink-mute); }
.acct__menu { display: flex; flex-direction: column; gap: 2px; }
.acct__menu button, .acct__menu a {
  display: flex; align-items: center; gap: var(--s3); width: 100%;
  padding: 10px var(--s3); border-radius: var(--r-sm);
  font-size: var(--t-sm); color: var(--ink-soft); text-align: left;
  transition: background var(--d-fast), color var(--d-fast);
}
.acct__menu button:hover, .acct__menu a:hover { background: var(--glass-2); color: var(--ink); }
.acct__menu .is-danger:hover { color: var(--crimson); }

/* ═══ VUES ═══ */
.view { min-height: calc(100vh - 60px); }

/* ═══ BIBLIOTHÈQUE ═══ */
.lib { max-width: 1180px; margin-inline: auto; padding: var(--s7) var(--s5) var(--s10); }

.lib__hero { margin-bottom: var(--s7); }
.lib__eyebrow { font-size: var(--t-xs); color: var(--gold); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.lib__title { font-size: var(--t-xxl); font-weight: 850; letter-spacing: -.028em; line-height: 1.1; margin: var(--s3) 0; }
.lib__sub { color: var(--ink-mute); font-size: var(--t-md); max-width: 56ch; line-height: 1.62; }

/* Carte de reprise */
.resume {
  display: grid; gap: var(--s5); align-items: center;
  grid-template-columns: 1fr; margin-bottom: var(--s7);
  padding: var(--s6); border-radius: var(--r-xl);
  background: linear-gradient(140deg, rgba(212,175,55,.13), rgba(139,107,255,.07));
  border: 1px solid rgba(212,175,55,.3);
}
@media (min-width: 760px) { .resume { grid-template-columns: 1fr auto; } }
.resume__label { font-size: var(--t-xs); color: var(--gold-hi); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.resume__title { font-size: var(--t-lg); font-weight: 780; margin: 7px 0 5px; letter-spacing: -.018em; }
.resume__meta { font-size: var(--t-sm); color: var(--ink-mute); }
.resume__bar { height: 4px; border-radius: 2px; background: var(--glass-3); margin-top: var(--s3); overflow: hidden; max-width: 320px; }
.resume__bar i { display: block; height: 100%; background: var(--grad-gold-h); border-radius: 2px; transition: width var(--d-slow) var(--e-out); }

/* Statistiques */
.libstats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); margin-bottom: var(--s7); }
@media (min-width: 700px) { .libstats { grid-template-columns: repeat(4, 1fr); } }
.libstat { padding: var(--s5); border-radius: var(--r-lg); background: var(--glass-1); border: 1px solid var(--hairline); }
.libstat b {
  display: block; font-family: var(--f-num); font-size: 1.6rem; font-weight: 800;
  color: var(--gold-hi); line-height: 1; white-space: nowrap;
}
/* « > » indispensable : sans lui, la règle attrape aussi le chiffre
   animé placé dans le <b> et le réduit à la taille du libellé. */
.libstat > span { display: block; font-size: var(--t-xs); color: var(--ink-mute); margin-top: 7px; }

/* Grille des modules */
.lib__section { margin-bottom: var(--s7); }
.lib__sectitle {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  font-size: var(--t-md); font-weight: 750; margin-bottom: var(--s4);
}
.lib__sectitle span { font-size: var(--t-xs); color: var(--ink-faint); font-weight: 400; }

.cards { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
@media (min-width: 680px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cards { grid-template-columns: repeat(3, 1fr); } }

.card {
  position: relative; display: flex; flex-direction: column;
  padding: var(--s5); border-radius: var(--r-lg); text-align: left;
  background: var(--glass-1); border: 1px solid var(--hairline);
  overflow: hidden;
  transition: transform var(--d-mid) var(--e-out), border-color var(--d-mid), background var(--d-mid);
}
@media (hover: hover) { .card:hover { transform: translateY(-4px); border-color: rgba(212,175,55,.4); background: var(--glass-2); } }
.card--locked { opacity: .78; }
.card--locked:hover { border-color: rgba(212,175,55,.28); }
.card--done { border-color: rgba(52,216,160,.3); }
.card--bonus { background: linear-gradient(150deg, rgba(255,107,74,.08), var(--glass-1)); border-color: rgba(255,107,74,.28); }

.card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.card__n {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--f-num); font-size: 15px; font-weight: 700;
  background: var(--glass-2); border: 1px solid var(--hairline); color: var(--ink-soft);
}
.card--done .card__n { background: var(--jade-veil); color: var(--jade); border-color: rgba(52,216,160,.3); }
.card--bonus .card__n { background: var(--ember-veil); color: var(--ember); border-color: rgba(255,107,74,.3); }
.card__flag { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.card__pill {
  font-size: var(--t-tiny); font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 9px; border-radius: var(--r-full); white-space: nowrap;
}
.card__pill--free { background: var(--jade-veil); color: var(--jade); }
.card__pill--lock { background: var(--glass-2); color: var(--ink-faint); }
.card__pill--done { background: var(--jade-veil); color: var(--jade); }

.card__title { font-size: var(--t-md); font-weight: 750; letter-spacing: -.014em; margin-bottom: 5px; }
.card__sub { font-size: var(--t-sm); color: var(--ink-mute); line-height: 1.52; margin-bottom: var(--s4); flex: 1; }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.card__time { font-size: var(--t-xs); color: var(--ink-faint); }
.card__go { font-size: var(--t-xs); font-weight: 700; color: var(--gold-hi); display: inline-flex; align-items: center; gap: 5px; }
.card__prog { height: 3px; background: var(--glass-3); border-radius: 2px; margin-top: var(--s3); overflow: hidden; }
.card__prog i { display: block; height: 100%; background: var(--grad-gold-h); }

/* Bandeau de conversion */
.upsell {
  padding: var(--s6); border-radius: var(--r-xl); margin-bottom: var(--s7);
  background: linear-gradient(135deg, rgba(212,175,55,.14), rgba(139,107,255,.08));
  border: 1px solid rgba(212,175,55,.34);
  display: grid; gap: var(--s5); grid-template-columns: 1fr; align-items: center;
}
@media (min-width: 800px) { .upsell { grid-template-columns: 1fr auto; } }
.upsell h3 { font-size: var(--t-lg); font-weight: 800; letter-spacing: -.02em; margin-bottom: 9px; }
.upsell p { font-size: var(--t-sm); color: var(--ink-soft); line-height: 1.6; max-width: 58ch; }
.upsell__price { display: flex; align-items: baseline; gap: 9px; margin-top: var(--s3); }
.upsell__price b { font-family: var(--f-num); font-size: 1.7rem; font-weight: 800; color: var(--gold-hi); }
.upsell__price s { font-size: var(--t-sm); color: var(--ink-faint); }
.upsell__price em { font-size: var(--t-tiny); color: var(--jade); font-style: normal; font-weight: 700; }

/* ═══ LISEUSE ═══ */
.reader { max-width: 100%; }
.reader__stage {
  max-width: calc(var(--reading-width) + 4rem);
  margin-inline: auto;
  padding: var(--s7) var(--s5) calc(var(--s10) + 60px);
  min-height: calc(100vh - 60px);
}
@media (min-width: 700px) { .reader__stage { padding-top: var(--s8); } }

.screen { animation: screen-in .42s var(--e-out); }
.screen.is-leaving { opacity: 0; transform: translateX(-16px); transition: opacity .16s var(--e-soft), transform .16s var(--e-soft); }
.screen.is-leaving-back { opacity: 0; transform: translateX(16px); transition: opacity .16s, transform .16s; }
.screen.is-entering { animation: screen-in .38s var(--e-out); }
.screen.is-entering-back { animation: screen-in-back .38s var(--e-out); }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes screen-in-back { from { opacity: 0; transform: translateX(-14px); } }

.rd-eyebrow {
  display: inline-flex; align-items: center;
  font-size: var(--t-tiny); font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
  padding: 7px 14px; border-radius: var(--r-full);
  background: var(--gold-veil); color: var(--gold-hi);
  border: 1px solid rgba(212,175,55,.22);
  margin-bottom: var(--s4);
}
.rd-h1 {
  font-family: var(--f-read);
  font-size: calc(clamp(1.6rem, 5.2vw, 2.1rem) * var(--reading-scale));
  font-weight: 700; line-height: 1.2; letter-spacing: -.02em;
  margin-bottom: var(--s5);
}
.rd-h1 em { font-style: normal; color: var(--gold-hi); }

.rd-lead {
  font-family: var(--f-read);
  font-size: calc(var(--t-md) * var(--reading-scale));
  line-height: var(--lh-read);
  color: var(--ink-soft);
  margin-bottom: var(--s5);
}
.rd-lead strong { color: var(--ink); font-weight: 700; }

.rd-quote {
  position: relative;
  font-family: var(--f-read);
  font-size: calc(var(--t-base) * var(--reading-scale));
  line-height: 1.68; color: var(--gold-hi);
  padding: var(--s5) var(--s5) var(--s5) calc(var(--s5) + 6px);
  border-radius: var(--r-md);
  background: var(--gold-mist);
  border-left: 3px solid var(--gold);
  margin-bottom: var(--s5);
}
.rd-quote strong { color: var(--gold-lum); }

.rd-explain {
  padding: var(--s5); border-radius: var(--r-md);
  background: rgba(22, 28, 31, .7);
  border: 1px solid rgba(82,229,250,.24);
  margin-bottom: var(--s5);
}
[data-theme="light"] .rd-explain { background: rgba(82,229,250,.06); }
.rd-explain__tag {
  display: flex; align-items: center; gap: 7px;
  font-size: var(--t-tiny); font-weight: 800; color: var(--cyan);
  letter-spacing: .07em; text-transform: uppercase; margin-bottom: 9px;
}
.rd-explain p {
  font-size: calc(var(--t-sm) * var(--reading-scale));
  color: var(--ink-soft); line-height: 1.66;
}
.rd-explain p + p { margin-top: 10px; }
.rd-explain strong { color: var(--cyan); }

.rd-check { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--s5); }
.rd-check__item {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s4); border-radius: var(--r-md);
  background: var(--glass-1); border: 1px solid var(--hairline);
  transition: border-color var(--d-fast), background var(--d-fast);
}
.rd-check__item:hover { border-color: rgba(212,175,55,.26); background: var(--glass-2); }
.rd-check__ico {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-size: 14px; font-weight: 800;
  background: var(--gold-veil); color: var(--gold);
}
.rd-check__item h4 { font-size: calc(var(--t-sm) * var(--reading-scale)); font-weight: 700; margin-bottom: 3px; }
.rd-check__item p { font-size: calc(var(--t-xs) * var(--reading-scale)); color: var(--ink-mute); line-height: 1.58; }

.rd-steps { display: flex; flex-direction: column; margin-bottom: var(--s5); }
.rd-steps__item { display: flex; gap: var(--s4); position: relative; padding-bottom: var(--s6); }
.rd-steps__item:last-child { padding-bottom: 0; }
.rd-steps__item:not(:last-child)::before {
  content: ''; position: absolute; left: 6px; top: 20px; bottom: 0;
  width: 2px; background: linear-gradient(var(--gold-mid), transparent);
}
.rd-steps__dot {
  flex-shrink: 0; width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); margin-top: 4px; position: relative; z-index: 1;
  box-shadow: 0 0 0 4px var(--gold-mist);
}
.rd-steps__tag { font-size: var(--t-tiny); color: var(--gold); text-transform: uppercase; font-weight: 700; letter-spacing: .07em; margin-bottom: 3px; }
.rd-steps__item h4 { font-size: calc(var(--t-sm) * var(--reading-scale)); font-weight: 700; margin-bottom: 4px; }
.rd-steps__item p { font-size: calc(var(--t-xs) * var(--reading-scale)); color: var(--ink-mute); line-height: 1.6; }

.rd-duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-bottom: var(--s5); }
.rd-duo__box { padding: var(--s5) var(--s4); border-radius: var(--r-md); text-align: center; background: var(--glass-1); border: 1px solid var(--hairline); }
.rd-duo__box--bad { border-color: rgba(242,86,77,.3); }
.rd-duo__box--good { border-color: rgba(212,175,55,.34); background: var(--gold-mist); }
.rd-duo__emoji { font-size: 30px; margin-bottom: 9px; }
.rd-duo__label { font-size: var(--t-xs); font-weight: 700; }
.rd-duo__box--bad .rd-duo__label { color: #E58C80; }
.rd-duo__box--good .rd-duo__label { color: var(--gold-hi); }

.rd-table { display: flex; flex-direction: column; gap: 7px; margin-bottom: var(--s5); font-size: calc(var(--t-xs) * var(--reading-scale)); }
.rd-table__head, .rd-table__row { display: flex; gap: 9px; }
.rd-table__head {
  padding: 0 var(--s4); font-size: var(--t-tiny);
  color: var(--ink-faint); text-transform: uppercase; letter-spacing: .07em; font-weight: 700;
}
.rd-table__row { padding: var(--s4); border-radius: var(--r-sm); background: var(--glass-1); border: 1px solid var(--hairline); }
.rd-table__head span, .rd-table__row span { flex: 1; min-width: 0; }
.rd-table__row .rd-table__c0 { color: var(--ink-mute); flex: 1.05; }
.rd-table__row .rd-table__c1 { color: #E58C80; }
.rd-table__row .rd-table__c2 { color: var(--gold-hi); font-weight: 600; }

.rd-breakdown { display: flex; flex-direction: column; gap: var(--s4); margin-bottom: var(--s4); }
.rd-bd__label { display: flex; justify-content: space-between; gap: var(--s3); margin-bottom: 6px; font-size: calc(var(--t-xs) * var(--reading-scale)); }
.rd-bd__name { color: var(--ink-mute); }
.rd-bd__amt { color: var(--ink); font-weight: 700; font-family: var(--f-num); white-space: nowrap; }
.rd-bd__track { height: 9px; border-radius: 5px; background: var(--glass-3); overflow: hidden; }
.rd-bd__fill {
  display: block; height: 100%; border-radius: 5px; width: 0;
  transition: width .95s var(--e-out) var(--delay, 0ms);
}
.rd-bd__fill.is-grown { width: var(--w); }
.rd-bd__fill--net { background: var(--grad-gold-h); }
.rd-bd__fill--cost { background: linear-gradient(90deg, #C0392B, #E58C80); }

.rd-result {
  padding: var(--s6); border-radius: var(--r-lg); text-align: center;
  background: linear-gradient(160deg, rgba(212,175,55,.12), transparent);
  border: 1.5px solid rgba(212,175,55,.4);
  margin-bottom: var(--s5);
}
.rd-result__label { font-size: var(--t-tiny); color: var(--ink-mute); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; margin-bottom: 8px; }
.rd-result__value {
  font-family: var(--f-num); font-size: clamp(1.9rem, 7vw, 2.5rem); font-weight: 800;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rd-result__suffix { font-size: .38em; color: var(--ink-mute); -webkit-text-fill-color: var(--ink-mute); margin-left: 7px; }

.rd-chart { display: flex; align-items: flex-end; gap: var(--s4); height: 180px; margin-bottom: var(--s3); padding-inline: var(--s2); }
.rd-chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.rd-chart__val { font-size: var(--t-xs); font-weight: 800; font-family: var(--f-num); margin-bottom: 7px; }
.rd-chart__bar {
  width: 100%; max-width: 58px; border-radius: 10px 10px 3px 3px;
  height: 0; transition: height 1.05s var(--e-out) var(--delay, 0ms);
}
.rd-chart__bar.is-grown { height: var(--h); }
.rd-chart__bar--gold  { background: linear-gradient(180deg, var(--gold-hi), var(--gold-mid)); }
.rd-chart__bar--steel { background: linear-gradient(180deg, #7A8BA0, #46566B); }
.rd-chart__bar--dim   { background: linear-gradient(180deg, #6B7280, #3F4448); }
.rd-chart__name { font-size: 10.5px; color: var(--ink-mute); margin-top: 9px; text-align: center; line-height: 1.3; }
.rd-note { font-size: var(--t-tiny); color: var(--ink-faint); text-align: center; font-style: italic; margin-bottom: var(--s5); }

.rd-ba { padding: var(--s5); border-radius: var(--r-md); margin-bottom: var(--s3); border-left: 4px solid; background: var(--glass-1); }
.rd-ba--before { border-color: var(--crimson); }
.rd-ba--after { border-color: var(--jade); margin-bottom: var(--s5); }
.rd-ba__tag { font-size: var(--t-tiny); font-weight: 800; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 7px; }
.rd-ba--before .rd-ba__tag { color: #E58C80; }
.rd-ba--after .rd-ba__tag { color: #6FE0A8; }
.rd-ba p { font-size: calc(var(--t-sm) * var(--reading-scale)); line-height: 1.62; }

.rd-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--s5); }
.rd-cards__item {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s4); border-radius: var(--r-md);
  background: var(--glass-1); border: 1px solid var(--hairline);
}
.rd-cards__item.is-flagship { background: linear-gradient(145deg, rgba(212,175,55,.14), transparent); border-color: rgba(212,175,55,.44); }
.rd-cards__n {
  flex-shrink: 0; width: 25px; height: 25px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold); color: #0A0C11;
  font-family: var(--f-num); font-size: 11.5px; font-weight: 800;
}
.rd-cards__item p { font-size: calc(var(--t-sm) * var(--reading-scale)); line-height: 1.58; }
.rd-cards__item strong { color: var(--gold-hi); }

.rd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-bottom: var(--s5); }
.rd-stats__box { padding: var(--s5) var(--s2); border-radius: var(--r-md); text-align: center; background: var(--glass-1); border: 1px solid var(--hairline); }
.rd-stats__num { font-family: var(--f-num); font-size: 1.55rem; font-weight: 800; color: var(--gold-hi); line-height: 1; }
.rd-stats__label { font-size: 10px; color: var(--ink-mute); margin-top: 7px; text-transform: uppercase; letter-spacing: .05em; line-height: 1.35; }

.rd-face { padding: var(--s6); border-radius: var(--r-lg); background: var(--glass-1); border: 1px solid var(--hairline); margin-bottom: var(--s5); }
.rd-face__emoji { font-size: 30px; margin-bottom: var(--s3); }
.rd-face__tag {
  display: inline-block; font-size: var(--t-tiny); font-weight: 800;
  padding: 5px 12px; border-radius: var(--r-full);
  background: var(--gold-veil); color: var(--gold-hi);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: var(--s3);
}
.rd-face h3 { font-size: calc(var(--t-lg) * var(--reading-scale)); font-weight: 750; margin-bottom: 9px; letter-spacing: -.015em; }
.rd-face p { font-size: calc(var(--t-sm) * var(--reading-scale)); color: var(--ink-mute); line-height: 1.64; }
.rd-face strong { color: var(--cyan); }

.rd-std { padding: var(--s6); border-radius: var(--r-lg); background: var(--glass-1); border: 1px solid var(--hairline); margin-bottom: var(--s5); }
.rd-std--hot { background: linear-gradient(150deg, rgba(255,107,74,.1), transparent); border-color: rgba(255,107,74,.4); }
.rd-std__tag {
  display: inline-block; font-size: var(--t-tiny); font-weight: 800;
  padding: 5px 12px; border-radius: var(--r-full);
  background: var(--gold-veil); color: var(--gold-hi);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: var(--s3);
}
.rd-std--hot .rd-std__tag { background: var(--ember-veil); color: var(--ember); }
.rd-std h3 { font-size: calc(var(--t-lg) * var(--reading-scale)); font-weight: 750; margin-bottom: 9px; }
.rd-std > p { font-size: calc(var(--t-sm) * var(--reading-scale)); color: var(--ink-mute); line-height: 1.64; margin-bottom: var(--s3); }
.rd-std__meta { display: flex; flex-wrap: wrap; gap: 7px; }
.rd-std__meta span { font-size: var(--t-tiny); background: var(--glass-2); padding: 5px 10px; border-radius: 9px; color: var(--ink-soft); }
.rd-std__sec { font-size: var(--t-tiny); font-weight: 800; text-transform: uppercase; letter-spacing: .09em; margin: var(--s4) 0 9px; }
.rd-std__sec--adv { color: var(--gold-hi); }
.rd-std__sec--lim { color: #E58C80; }
.rd-list { display: flex; flex-direction: column; gap: 7px; }
.rd-list li { font-size: calc(var(--t-xs) * var(--reading-scale)); line-height: 1.55; padding-left: 20px; position: relative; color: var(--ink-soft); }
.rd-list--adv li::before { content: '✓'; position: absolute; left: 0; color: var(--gold); font-weight: 800; }
.rd-list--lim li::before { content: '✕'; position: absolute; left: 0; color: var(--crimson); font-weight: 800; }

.rd-versus { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-bottom: var(--s5); }
.rd-versus__col { padding: var(--s5) var(--s4); border-radius: var(--r-md); text-align: center; background: var(--glass-1); border: 1px solid var(--hairline); }
.rd-versus__col--good { border-color: rgba(212,175,55,.4); }
.rd-versus__col--bad { border-color: rgba(242,86,77,.36); }
.rd-versus__label { font-size: var(--t-tiny); color: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: 9px; }
.rd-versus__line { font-size: var(--t-xs); color: var(--ink-mute); line-height: 1.45; margin-bottom: 3px; }
.rd-versus__net { font-family: var(--f-num); font-size: calc(var(--t-md) * var(--reading-scale)); font-weight: 800; margin-top: 10px; }
.rd-versus__col--good .rd-versus__net { color: var(--gold-hi); }
.rd-versus__col--bad .rd-versus__net { color: #E58C80; }
.rd-versus__col--neutral .rd-versus__net { color: var(--ink-soft); }

.rd-gauge { display: flex; flex-direction: column; gap: var(--s5); margin-bottom: var(--s5); }
.rd-gauge__label { font-size: var(--t-xs); color: var(--ink-mute); margin-bottom: 8px; }
.rd-gauge__track { display: flex; gap: 5px; }
.rd-gauge__seg {
  flex: 1; padding: 9px 4px; border-radius: 8px; text-align: center;
  font-size: 10.5px; font-weight: 700; background: var(--glass-2); color: var(--ink-faint);
}
.rd-gauge__seg.is-high { background: rgba(242,86,77,.16); color: #E58C80; }
.rd-gauge__seg.is-mid  { background: var(--gold-veil); color: var(--gold-hi); }
.rd-gauge__seg.is-low  { background: var(--jade-veil); color: var(--jade); }

.rd-profiles { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s5); }
.rd-profile { padding: var(--s4) var(--s5); border-radius: var(--r-md); background: var(--glass-1); border-left: 4px solid var(--gold); }
.rd-profile__tag { font-size: var(--t-xs); font-weight: 800; color: var(--gold-hi); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.rd-profile p { font-size: calc(var(--t-sm) * var(--reading-scale)); line-height: 1.6; }

.rd-addresses { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s5); }
.rd-address { padding: var(--s5); border-radius: var(--r-md); background: var(--glass-1); border: 1px solid var(--hairline); }
.rd-address__city { font-size: var(--t-md); font-weight: 800; color: var(--gold-hi); margin-bottom: 6px; }
.rd-address p { font-size: calc(var(--t-sm) * var(--reading-scale)); color: var(--ink-mute); }

.rd-cta {
  padding: var(--s6); border-radius: var(--r-lg); text-align: center; margin-bottom: var(--s5);
  background: linear-gradient(160deg, var(--elevate), var(--deep));
  border: 1.5px solid rgba(212,175,55,.4);
}
.rd-cta h3 { font-size: var(--t-md); font-weight: 780; color: var(--gold-hi); margin-bottom: 9px; }
.rd-cta p { font-size: var(--t-sm); color: var(--ink-mute); margin-bottom: var(--s5); line-height: 1.6; }

.rd-trophy { text-align: center; padding: var(--s6) 0; }
.rd-trophy__ico { font-size: 58px; margin-bottom: var(--s3); animation: trophy-pop .7s var(--e-spring); }
@keyframes trophy-pop { from { transform: scale(.5) rotate(-14deg); opacity: 0; } }
.rd-trophy__pill {
  display: inline-block; padding: 9px 22px; border-radius: var(--r-full);
  background: var(--gold-veil); color: var(--gold-hi); font-weight: 800; font-size: var(--t-sm);
  margin-bottom: var(--s4);
}
.rd-trophy p { font-size: var(--t-sm); color: var(--ink-mute); line-height: 1.6; }

/* ═══ QUIZ ═══ */
.rd-quiz { padding: var(--s6); border-radius: var(--r-lg); background: var(--glass-1); border: 1px solid var(--hairline); margin-bottom: var(--s5); }
.rd-quiz__q { font-size: calc(var(--t-md) * var(--reading-scale)); font-weight: 700; margin-bottom: var(--s5); line-height: 1.42; }
.rd-quiz__opts { display: flex; flex-direction: column; gap: 10px; }
.rd-quiz__opt {
  display: flex; align-items: flex-start; gap: var(--s3);
  padding: var(--s4); border-radius: var(--r-md);
  background: var(--glass-2); border: 1.5px solid var(--hairline);
  text-align: left; font-size: calc(var(--t-sm) * var(--reading-scale));
  color: var(--ink); line-height: 1.5;
  transition: border-color var(--d-fast), background var(--d-fast), transform var(--d-fast) var(--e-spring);
}
.rd-quiz__opt:hover:not(:disabled) { border-color: rgba(212,175,55,.44); background: var(--glass-3); }
.rd-quiz__opt:active:not(:disabled) { transform: scale(.985); }
.rd-quiz__bullet {
  flex-shrink: 0; width: 19px; height: 19px; border-radius: 50%; margin-top: 1px;
  border: 2px solid var(--hairline-lit);
  transition: border-color var(--d-fast), background var(--d-fast);
}
.rd-quiz__opt.is-ok { border-color: var(--jade); background: var(--jade-veil); }
.rd-quiz__opt.is-ok .rd-quiz__bullet { border-color: var(--jade); background: var(--jade); box-shadow: inset 0 0 0 3px var(--deep); }
.rd-quiz__opt.is-ko { border-color: var(--crimson); background: var(--crimson-veil); }
.rd-quiz__opt.is-ko .rd-quiz__bullet { border-color: var(--crimson); background: var(--crimson); box-shadow: inset 0 0 0 3px var(--deep); }
.rd-quiz__opt:disabled { cursor: default; }
.rd-quiz__feedback { font-size: var(--t-sm); margin-top: var(--s4); min-height: 1.4em; font-weight: 600; }
.rd-quiz__feedback.is-ok { color: #6FE0A8; }
.rd-quiz__feedback.is-ko { color: #E58C80; }

/* ═══ NAVIGATION LISEUSE ═══ */
.rdnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: var(--z-sticky);
  padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
  background: rgba(8,10,14,.9);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--hairline);
}
[data-theme="light"] .rdnav { background: rgba(255,255,255,.92); }
[data-theme="sepia"] .rdnav { background: rgba(26,22,17,.93); }
.rdnav__inner { max-width: calc(var(--reading-width) + 4rem); margin-inline: auto; display: flex; gap: var(--s3); align-items: center; }
.rdnav .btn { flex: 1; }
.rdnav .btn--ghost { flex: 0 0 auto; min-width: 96px; }

/* ═══ ÉCRAN DE FIN DE MODULE ═══ */
.finish { text-align: center; padding: var(--s6) 0; }
.finish__ico { font-size: 62px; margin-bottom: var(--s4); animation: trophy-pop .7s var(--e-spring); }
.finish__title { font-size: var(--t-xl); font-weight: 850; letter-spacing: -.02em; margin-bottom: var(--s3); }
.finish__pill {
  display: inline-block; padding: 9px 20px; border-radius: var(--r-full);
  background: var(--gold-veil); color: var(--gold-hi); font-weight: 800; font-size: var(--t-sm);
  margin-bottom: var(--s5);
}
.finish__text { color: var(--ink-mute); font-size: var(--t-base); line-height: 1.62; margin-bottom: var(--s6); max-width: 42ch; margin-inline: auto; }
.finish__actions { display: flex; flex-direction: column; gap: var(--s3); max-width: 340px; margin-inline: auto; }

/* ═══ PAYWALL ═══ */
.gate { max-width: 680px; margin-inline: auto; padding: var(--s8) var(--s5) var(--s10); text-align: center; }
.gate__ico {
  width: 68px; height: 68px; border-radius: 20px; margin: 0 auto var(--s5);
  display: grid; place-items: center; font-size: 30px;
  background: var(--gold-veil); border: 1px solid rgba(212,175,55,.3);
}
.gate__title { font-size: var(--t-xl); font-weight: 850; letter-spacing: -.022em; margin-bottom: var(--s3); }
.gate__text { color: var(--ink-mute); font-size: var(--t-base); line-height: 1.64; margin-bottom: var(--s6); }
.gate__box {
  padding: var(--s6); border-radius: var(--r-xl); text-align: left; margin-bottom: var(--s5);
  background: linear-gradient(160deg, rgba(212,175,55,.11), transparent);
  border: 1.5px solid rgba(212,175,55,.36);
}
.gate__price { display: flex; align-items: baseline; gap: 11px; margin-bottom: var(--s4); }
.gate__price b { font-family: var(--f-num); font-size: 2.3rem; font-weight: 800; color: var(--gold-hi); line-height: 1; }
.gate__price s { color: var(--ink-faint); font-size: var(--t-md); }
.gate__price em { font-size: var(--t-xs); color: var(--jade); font-style: normal; font-weight: 700; }
.gate__list { display: flex; flex-direction: column; gap: 9px; margin-bottom: var(--s5); }
.gate__list li { font-size: var(--t-sm); color: var(--ink-soft); padding-left: 24px; position: relative; }
.gate__list li::before { content: '✓'; position: absolute; left: 0; color: var(--gold); font-weight: 800; }
.gate__alt { font-size: var(--t-xs); color: var(--ink-faint); margin-top: var(--s4); }
.gate__alt a { color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px; }

/* ═══ FORMULAIRES ═══ */
.form { display: flex; flex-direction: column; gap: var(--s4); }
.form__row { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
@media (min-width: 520px) { .form__row--2 { grid-template-columns: 1fr 1fr; } }
.form__foot { font-size: var(--t-xs); color: var(--ink-faint); text-align: center; line-height: 1.55; }
.form__foot a, .form__link { color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px; }
.form__sep { display: flex; align-items: center; gap: var(--s3); color: var(--ink-faint); font-size: var(--t-xs); }
.form__sep::before, .form__sep::after { content: ''; flex: 1; height: 1px; background: var(--hairline); }

.pwmeter { display: flex; gap: 4px; margin-top: 6px; }
.pwmeter i { flex: 1; height: 3px; border-radius: 2px; background: var(--glass-3); transition: background var(--d-fast); }
.pwmeter[data-score="1"] i:nth-child(-n+1) { background: var(--crimson); }
.pwmeter[data-score="2"] i:nth-child(-n+2) { background: var(--ember); }
.pwmeter[data-score="3"] i:nth-child(-n+3) { background: var(--gold); }
.pwmeter[data-score="4"] i { background: var(--jade); }

/* ═══ CAISSE ═══ */
.pay { display: flex; flex-direction: column; gap: var(--s4); }
.pay__methods { display: grid; gap: var(--s3); grid-template-columns: 1fr 1fr; }
.paym {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: var(--s4); border-radius: var(--r-md); text-align: left;
  background: var(--glass-1); border: 1.5px solid var(--hairline);
  transition: border-color var(--d-fast), background var(--d-fast);
  position: relative;
}
.paym:hover { border-color: rgba(212,175,55,.4); background: var(--glass-2); }
.paym.is-sel { border-color: var(--gold); background: var(--gold-mist); }
.paym__ico { font-size: 20px; }
.paym__label { font-size: var(--t-sm); font-weight: 700; }
.paym__hint { font-size: var(--t-tiny); color: var(--ink-faint); }
.paym__star { position: absolute; top: 8px; right: 9px; font-size: 9px; color: var(--gold); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }

.pay__total {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s4) var(--s5); border-radius: var(--r-md);
  background: var(--gold-mist); border: 1px solid rgba(212,175,55,.3);
}
.pay__total span { font-size: var(--t-sm); color: var(--ink-soft); }
.pay__total b { font-family: var(--f-num); font-size: var(--t-lg); font-weight: 800; color: var(--gold-hi); }
.pay__note { font-size: var(--t-xs); color: var(--ink-faint); line-height: 1.55; }
.pay__secure { display: flex; align-items: center; gap: 7px; font-size: var(--t-tiny); color: var(--ink-faint); justify-content: center; }

/* ═══ CERTIFICAT ═══ */
.cert { max-width: 720px; margin-inline: auto; padding: var(--s7) var(--s5) var(--s10); }
.cert__paper {
  padding: var(--s8) var(--s6); border-radius: var(--r-xl); text-align: center;
  background: linear-gradient(155deg, #14171F, #0B0D12);
  border: 2px solid rgba(212,175,55,.42);
  box-shadow: var(--sh-lg);
  position: relative; overflow: hidden;
}
.cert__paper::before {
  content: ''; position: absolute; inset: 10px; border: 1px solid rgba(212,175,55,.18); border-radius: var(--r-lg); pointer-events: none;
}
/* Le logo est fourni sur fond clair : le cartouche blanc arrondi l'assume
   au lieu de le laisser flotter en rectangle sur le papier sombre. */
.cert__logo {
  display: block; width: 108px; height: auto; margin: 0 auto var(--s4);
  border-radius: var(--r-md); background: #fff; padding: 9px;
  box-shadow: 0 6px 22px rgba(0,0,0,.34);
}
.cert__label { font-size: var(--t-tiny); letter-spacing: .22em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: var(--s4); }
.cert__name { font-family: var(--f-read); font-size: clamp(1.6rem, 6vw, 2.3rem); font-weight: 700; color: var(--gold-hi); margin-bottom: var(--s4); }
.cert__body { font-size: var(--t-sm); color: var(--ink-soft); line-height: 1.7; max-width: 44ch; margin: 0 auto var(--s6); }
.cert__meta { display: flex; flex-wrap: wrap; gap: var(--s5); justify-content: center; font-size: var(--t-xs); color: var(--ink-faint); }
.cert__actions { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: center; margin-top: var(--s6); }

/* ═══ ÉTATS VIDES / CHARGEMENT ═══ */
.empty { text-align: center; padding: var(--s9) var(--s5); }
.empty__ico { font-size: 42px; margin-bottom: var(--s4); opacity: .6; }
.empty h2 { font-size: var(--t-lg); font-weight: 750; margin-bottom: var(--s3); }
.empty p { color: var(--ink-mute); font-size: var(--t-sm); max-width: 40ch; margin: 0 auto var(--s5); line-height: 1.6; }

/* ═══ EFFETS ═══ */
.fx-layer { position: fixed; inset: 0; z-index: var(--z-toast); pointer-events: none; overflow: hidden; }
.fx-dot {
  position: absolute; width: var(--s); height: var(--s); border-radius: 50%;
  background: var(--c);
  animation: fx-burst 1.25s var(--e-out) var(--d) forwards;
}
@keyframes fx-burst {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  22%  { transform: translate(calc(-50% + var(--x) * .5), calc(-50% + var(--y) * .5)) scale(1.15); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) + 90px)) scale(.25); opacity: 0; }
}

/* ═══ IMPRESSION (certificat) ═══ */
@media print {
  .topbar, .rdnav, .drawer, .drawer__veil, .popover, .cert__actions, .atmosphere, .grain { display: none !important; }
  body { padding: 0; background: #fff; }
  .cert__paper { border-color: #B8912A; box-shadow: none; background: #fff; }
  .cert__name { color: #8A6A16; }
  .cert__body, .cert__label, .cert__meta { color: #333; }
  /* Sans ceci, le navigateur omet le fond du cartouche à l'impression. */
  .cert__logo { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ═══════════════════════════════════════════════════════════
   TABLEAU DE BORD ADMINISTRATEUR
   ═══════════════════════════════════════════════════════════ */

.dash { max-width: 1080px; margin-inline: auto; padding: var(--s6) var(--s5) var(--s10); }

.dash__head {
  display: flex; flex-wrap: wrap; gap: var(--s4);
  align-items: flex-end; justify-content: space-between;
  margin-bottom: var(--s6);
}
.dash__head h1 { font-size: var(--t-xl); font-weight: 800; margin-top: var(--s2); line-height: 1.1; }
.dash__sub { font-size: var(--t-sm); color: var(--ink-mute); margin-top: 4px; }
.dash__acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.dash__muted { font-size: var(--t-xs); color: var(--ink-faint); }
.dash__empty { padding: var(--s6); text-align: center; color: var(--ink-mute); font-size: var(--t-sm); }

.dash__warn {
  display: block; padding: var(--s4) var(--s5); margin-bottom: var(--s6);
  border: 1px solid rgba(232,164,60,.34); border-left-width: 3px;
  border-radius: var(--r-md); background: rgba(232,164,60,.07);
  font-size: var(--t-sm); color: var(--ink-soft); line-height: 1.62;
}
.dash__warn b { color: var(--gold-hi); }

/* ── Indicateurs ── */
.kpis {
  display: grid; gap: var(--s3); margin-bottom: var(--s5);
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
}
.kpi {
  padding: var(--s5); border-radius: var(--r-lg);
  border: 1px solid var(--hairline); background: var(--glass-1);
}
.kpi--gold { border-color: rgba(212,175,55,.34); background: rgba(212,175,55,.06); }
.kpi__label { display: block; font-size: var(--t-tiny); text-transform: uppercase; letter-spacing: .09em; color: var(--ink-mute); }
.kpi__value { display: block; font-size: clamp(1.35rem, 3.4vw, 1.85rem); overflow-wrap: anywhere; font-weight: 800; line-height: 1.1; margin: 9px 0 6px; color: var(--ink); }
.kpi--gold .kpi__value { color: var(--gold-hi); }
.kpi__hint { display: block; font-size: var(--t-xs); color: var(--ink-faint); line-height: 1.45; }

/* ── Panneaux ── */
.panel {
  padding: var(--s5); margin-bottom: var(--s5);
  border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--glass-1);
}
.panel__head {
  display: flex; flex-wrap: wrap; gap: var(--s3);
  align-items: center; justify-content: space-between; margin-bottom: var(--s4);
}
.panel__head h2 { font-size: var(--t-md); font-weight: 750; }
.panel__foot {
  display: flex; flex-wrap: wrap; gap: var(--s5);
  margin-top: var(--s4); padding-top: var(--s4);
  border-top: 1px solid var(--hairline);
  font-size: var(--t-xs); color: var(--ink-mute);
}
.panel__foot b { color: var(--ink); font-size: var(--t-sm); }

/* ── Sélecteurs segmentés ── */
.seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: var(--r-full); background: var(--glass-2); border: 1px solid var(--hairline); }
.seg--metric { margin-bottom: var(--s4); }
.seg button {
  padding: 7px 15px; border-radius: var(--r-full); border: none; background: transparent;
  font-size: var(--t-xs); font-weight: 700; color: var(--ink-mute); cursor: pointer;
  transition: background var(--d-fast) var(--e-out), color var(--d-fast) var(--e-out);
}
.seg button:hover { color: var(--ink); }
.seg button.is-on { background: var(--grad-gold-h); color: #0A0C11; }

/* ── Courbe ── */
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart__grid { stroke: var(--hairline); stroke-width: 1; }
.chart__ytick, .chart__xtick { fill: var(--ink-faint); font-size: 11px; font-family: var(--f-ui); }
.chart__line { fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart__dot { fill: var(--gold-hi); opacity: 0; transition: opacity var(--d-fast) var(--e-out); }
.chart:hover .chart__dot { opacity: 1; }
/* Le tracé se dessine à l'ouverture ; désactivé si l'utilisateur limite les animations. */
.chart__line { stroke-dasharray: 2400; stroke-dashoffset: 0; animation: chart-draw 1.1s var(--e-out); }
@keyframes chart-draw { from { stroke-dashoffset: 2400; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .chart__line { animation: none; } }

/* ── Répartition ── */
.mrow { display: grid; grid-template-columns: 1fr 2fr auto; gap: var(--s3); align-items: center; padding: 9px 0; }
.mrow__label { font-size: var(--t-sm); color: var(--ink-soft); }
.mrow__track { height: 8px; border-radius: var(--r-full); background: var(--glass-2); overflow: hidden; }
.mrow__track i { display: block; height: 100%; border-radius: var(--r-full); background: var(--grad-gold-h); }
.mrow__val { font-size: var(--t-xs); color: var(--ink-mute); font-variant-numeric: tabular-nums; }

/* ── Tableaux ── */
.dash__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dtable { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.dtable th {
  text-align: left; padding: 10px 12px; white-space: nowrap;
  font-size: var(--t-tiny); text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-mute); border-bottom: 1px solid var(--hairline);
}
.dtable td { padding: 11px 12px; border-bottom: 1px solid var(--hairline); color: var(--ink-soft); white-space: nowrap; }
.dtable tr:last-child td { border-bottom: none; }
.dtable .num { text-align: right; }
.dtable .mono { font-family: var(--f-num); font-size: var(--t-xs); }

.pill { display: inline-block; padding: 3px 10px; border-radius: var(--r-full); font-size: var(--t-tiny); font-weight: 700; }
.pill--paid      { background: rgba(52,199,124,.14); color: #6FE3A8; }
.pill--pending   { background: rgba(232,164,60,.14); color: #F0C57A; }
.pill--draft     { background: var(--glass-2);        color: var(--ink-mute); }
.pill--failed,
.pill--cancelled { background: rgba(232,84,84,.14);   color: #F09090; }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 6px; vertical-align: middle; }
.dot--live { background: #34C77C; box-shadow: 0 0 0 3px rgba(52,199,124,.18); }

/* ── Rôles et accès ── */
.rolechip {
  display: inline-block; margin-left: 9px; padding: 2px 10px;
  border-radius: var(--r-full); font-size: var(--t-tiny); font-weight: 700;
  background: var(--gold-veil); color: var(--gold-hi);
  border: 1px solid rgba(212,175,55,.3);
}
.dash__note { font-size: var(--t-sm); color: var(--ink-mute); line-height: 1.62; margin-bottom: var(--s4); }
.dash__note--warn { margin: var(--s4) 0 0; font-size: var(--t-xs); color: var(--ink-faint); }

.rolelegend {
  display: grid; gap: var(--s2); margin-bottom: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.rolelegend div { padding: 11px 13px; border: 1px solid var(--hairline); border-radius: var(--r-sm); background: var(--glass-1); }
.rolelegend b { display: block; font-size: var(--t-xs); color: var(--gold-hi); margin-bottom: 3px; }
.rolelegend span { display: block; font-size: var(--t-tiny); color: var(--ink-mute); line-height: 1.5; }

.roleadd { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.roleadd .field__input { flex: 1 1 220px; min-width: 0; }

/* Le <select> natif ignore la plupart des styles : on habille ce qu'on peut
   et on laisse le système dessiner la liste déroulante. */
.roleset {
  padding: 9px 13px; border-radius: var(--r-sm);
  background: var(--glass-2); color: var(--ink);
  border: 1px solid var(--hairline-lit);
  font-size: var(--t-sm); font-family: inherit; cursor: pointer;
}
.roleset:disabled { opacity: .5; cursor: not-allowed; }
.roleset:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.rolehint { font-size: var(--t-xs); color: var(--ink-faint); white-space: normal; min-width: 200px; }
