/* ============================================================
   CRISALIDA — plateforme : comptes, e-learning, lecteur, assistant IA,
   quiz, paiement, espace apprenant, back-office. S'appuie sur base.css.
   ============================================================ */

:root {
  /* Séries de graphiques (palette validée : écart CVD, contraste) */
  --c1: #2a78d6;
  --c2: #eb6834;
  --c3: #1baf7a;
  --seq1: #86b6ef;
  --seq2: #5598e7;
  --seq3: #256abf;
  --seq4: #104281;
  --grid: #eceef3;
  --axis: #7b8294;
  --side-bg: #15171d;
  --side-ink: #c9cdd6;
  --side-muted: #7f8594;
  --side-hover: rgba(255, 255, 255, .06);
  --side-line: rgba(255, 255, 255, .08);
}
@media screen {
  :root[data-theme="dark"] {
    --c1: #3987e5;
    --c2: #d95926;
    --c3: #199e70;
    --seq1: #1c5cab;
    --seq2: #3987e5;
    --seq3: #6da7ec;
    --seq4: #9ec5f4;
    --grid: #252831;
    --axis: #858b99;
    --side-bg: #0c0d11;
  }
}

/* ============================================================ EN-TÊTE : thème, compte */
.theme-btn .ic-sun { display: none; }
[data-theme="dark"] .theme-btn .ic-sun { display: inline-block; }
[data-theme="dark"] .theme-btn .ic-moon { display: none; }
.theme-btn svg { transition: transform .45s var(--ease); }
.theme-btn:hover svg { transform: rotate(-24deg); }

.nav-new { display: inline-flex; align-items: center; height: 17px; padding: 0 6px; border-radius: var(--r-pill); background: var(--crimson-50); color: var(--crimson); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.drop-wide { min-width: 360px; }
.drop-feature { margin-top: 4px; background: var(--crimson-50); border: 1px solid color-mix(in srgb, var(--crimson) 18%, transparent); }
.drop-feature:hover { background: var(--crimson-100); }
.drop-feature .dl-ic { background: var(--grad-solid); color: #fff; }
.drop-feature .nav-new { margin-left: 4px; background: var(--crimson); color: #fff; vertical-align: 1px; }
.drop-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; padding: 12px 12px 4px; border-top: 1px solid var(--line-soft); }

.acct { position: relative; }
.acct-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 10px 0 5px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--surface); color: var(--text-strong); transition: border-color .15s, box-shadow .15s; }
.acct-btn:hover, .acct.is-open .acct-btn { border-color: var(--crimson); }
.acct-name { font-family: var(--font-head); font-weight: 700; font-size: 14px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-chev { width: 13px; height: 13px; opacity: .6; transition: transform .2s; }
.acct.is-open .acct-chev { transform: rotate(180deg); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: 0 0 auto; background: var(--grad-solid); color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 12.5px; letter-spacing: .02em; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }
.avatar.muted { background: var(--mist-2); color: var(--slate); }
.avatar svg { width: 52%; height: 52%; }
.tl-session svg { width: 14px; height: 14px; }
.panel-body h3 > svg { width: 16px; height: 16px; color: var(--slate-light); }
.acct-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-xl); padding: 8px; z-index: 80; animation: pop .18s var(--ease); }
.acct-head { display: flex; gap: 12px; align-items: center; padding: 10px 10px 14px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.acct-id { min-width: 0; display: grid; gap: 1px; }
.acct-id b { font-family: var(--font-head); font-size: 14.5px; color: var(--ink); }
.acct-id small { font-size: 12.5px; color: var(--slate-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-pill { justify-self: start; margin-top: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: var(--r-pill); background: var(--info-bg); color: var(--info); }
.role-pill.role-admin { background: var(--crimson-50); color: var(--crimson); }
.role-pill.role-instructeur { background: var(--success-bg); color: var(--success); }
.acct-links { display: grid; gap: 1px; }
.acct-links a, .acct-logout button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; color: var(--text-strong); text-align: left; }
.acct-links a:hover, .acct-logout button:hover { background: var(--mist); color: var(--crimson); }
.acct-links svg, .acct-logout svg { width: 17px; height: 17px; color: var(--slate-light); }
.acct-links a:hover svg, .acct-logout button:hover svg { color: var(--crimson); }
.acct-theme { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0; padding: 10px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); font-size: 13px; font-weight: 700; color: var(--slate); }
.theme-seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: var(--r-pill); background: var(--mist); }
.theme-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 32px; height: 28px; padding: 0 8px; border-radius: var(--r-pill); color: var(--slate); font-size: 12.5px; font-weight: 700; transition: background .15s, color .15s; }
.theme-seg button svg { width: 15px; height: 15px; }
.theme-seg button[aria-pressed="true"] { background: var(--raised); color: var(--ink); box-shadow: var(--sh-sm); }
.theme-seg-wide { display: flex; }
.theme-seg-wide button { flex: 1; height: 34px; }
.acct-login { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--text-strong); transition: border-color .15s, color .15s; }
.acct-login:hover { border-color: var(--crimson); color: var(--crimson); }
.acct-login svg { width: 18px; height: 18px; }

.drawer-user { display: flex; align-items: center; gap: 12px; padding: 4px 2px 12px; }
.drawer-user b { display: block; font-family: var(--font-head); font-size: 15px; color: var(--ink); }
.drawer-user small { font-size: 12.5px; color: var(--slate-light); }
.drawer-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.drawer-quick a { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-radius: var(--r-md); background: var(--mist); font-family: var(--font-head); font-weight: 700; font-size: 13.5px; color: var(--text-strong); }
.drawer-quick svg { width: 17px; height: 17px; color: var(--crimson); }

.header .wrap { max-width: 1600px; }
@media (max-width: 1640px) { .nav-opt { display: none; } }
@media (max-width: 1500px) {
  .nav-link { padding: 0 10px; }
  .nav-link::after { left: 10px; right: 10px; }
  .header-actions .hide-lg { display: none; }
}
@media (max-width: 1400px) { .header-actions .hide-md { display: none; } }
@media (max-width: 1240px) { .acct-name { display: none; } .acct-btn { padding-right: 8px; } }
@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .acct-login span { display: none; }
  .acct-login { padding: 0; width: 42px; justify-content: center; }
}
@media (max-width: 480px) {
  .brand img { height: 34px; }
  .header-inner { gap: 10px; }
  .header-actions { gap: 6px; }
  .acct-chev { display: none; }
  .acct-btn { padding: 0; width: 40px; height: 40px; justify-content: center; border-radius: 50%; }
  .acct-btn .avatar { width: 30px; height: 30px; font-size: 11px; }
  .acct-login { width: 38px; height: 38px; }
  .acct-menu { position: fixed; left: 12px; right: 12px; top: calc(var(--header-h) + 6px); width: auto; }
}

/* ============================================================ TOASTS & CONSENTEMENT */
.toast.info .t-ic { background: var(--info); }
.toast .t-close { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: rgba(255, 255, 255, .7); flex: 0 0 auto; }
.toast .t-close:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.toast .t-close svg { width: 14px; height: 14px; }

.consent { position: fixed; left: 22px; bottom: 22px; z-index: 140; width: min(440px, calc(100vw - 32px)); display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 18px 18px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-xl); opacity: 0; transform: translateY(16px); transition: opacity .3s ease, transform .35s var(--ease); }
.consent.is-in { opacity: 1; transform: none; }
.consent-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--crimson-50); color: var(--crimson); }
.consent-ic svg { width: 21px; height: 21px; }
.consent h2 { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.consent p { font-size: 13.5px; color: var(--slate); line-height: 1.5; margin-bottom: 4px; }
.consent .text-link { font-size: 13px; }
.consent-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ============================================================ ÉLÉMENTS COMMUNS DE L'APPLICATION */
.app-page { padding-top: 34px; padding-bottom: 80px; }
.app-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.app-head h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.02em; }
.app-head p { color: var(--slate); margin-top: 6px; }
.app-head .crumbs { margin-bottom: 12px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.5; background: var(--mist-2); color: var(--text-strong); }
.pill svg { width: 12px; height: 12px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.no-dot::before { display: none; }
.pill.ok { background: var(--success-bg); color: var(--success); }
.pill.warn { background: var(--warning-bg); color: var(--warning); }
.pill.err { background: var(--danger-bg); color: var(--danger); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.brand { background: var(--crimson-50); color: var(--crimson); }

.progress { position: relative; height: 8px; border-radius: var(--r-pill); background: var(--mist-2); overflow: hidden; }
.progress > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--grad-solid); transition: width .8s var(--ease); }
.progress.ok > span { background: var(--success); }
.progress.sm { height: 6px; }
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-row .progress { flex: 1; }
.progress-row b { font-family: var(--font-head); font-size: 13.5px; min-width: 40px; text-align: right; }

.ring { --p: 0; --size: 64px; --thick: 7px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; position: relative; flex: 0 0 auto;
  background: conic-gradient(var(--ring-color, var(--crimson)) calc(var(--p) * 1%), var(--mist-2) 0); }
.ring::before { content: ""; position: absolute; inset: var(--thick); border-radius: 50%; background: var(--surface); }
.ring > * { position: relative; font-family: var(--font-head); font-weight: 800; font-size: calc(var(--size) / 4.2); color: var(--ink); }
.ring.ok { --ring-color: var(--success); }


.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px 0; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { font-size: 16.5px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.panel-head h2 svg, .panel-head h3 svg { width: 18px; height: 18px; color: var(--crimson); }
.panel-head p { font-size: 13px; color: var(--slate-light); width: 100%; margin-top: -8px; }
.panel-body { padding: 16px 20px 20px; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--slate); }
.panel.pad { padding: 22px; }

.dt-wrap { overflow-x: auto; }
.dt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dt th { text-align: left; font-family: var(--font-head); font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--slate-light); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 700; }
.dt td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; color: var(--text-strong); }
.dt tr:last-child td { border-bottom: none; }
.dt tbody tr { transition: background .12s; }
.dt tbody tr:hover td { background: var(--surface-hover); }
.dt .num, .dt th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt .mono { font-size: 12.5px; }
.dt a.row-link { font-weight: 700; color: var(--ink); }
.dt a.row-link:hover { color: var(--crimson); }
.dt .sub { display: block; font-size: 12px; color: var(--slate-light); font-weight: 500; }
.dt .who { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.dt .who .avatar { width: 30px; height: 30px; font-size: 11px; }
.dt-empty { padding: 34px 16px; text-align: center; color: var(--slate); font-size: 14px; }

.kv-list { display: grid; grid-template-columns: max-content 1fr; gap: 10px 22px; font-size: 14px; }
.kv-list dt { color: var(--slate); font-weight: 600; }
.kv-list dd { margin: 0; color: var(--ink); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

.empty { text-align: center; padding: 40px 20px; }
.empty .es-ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--mist); color: var(--slate-light); display: grid; place-items: center; }
.empty .es-ic svg { width: 24px; height: 24px; }
.empty h3 { font-size: 17px; margin-bottom: 6px; }
.empty p { color: var(--slate); font-size: 14px; max-width: 420px; margin: 0 auto 16px; }

.form-stack { display: grid; gap: 16px; }
.field .input-wrap { position: relative; }
.field .input-wrap .input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--slate-light); }
.pw-toggle:hover { color: var(--crimson); background: var(--mist); }
.pw-toggle svg { width: 18px; height: 18px; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.pw-meter span { height: 4px; border-radius: 4px; background: var(--mist-2); transition: background .2s; }
.pw-meter[data-score="1"] span:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-score="2"] span:nth-child(-n+2) { background: var(--warning); }
.pw-meter[data-score="3"] span:nth-child(-n+3) { background: #3a9f6a; }
.pw-meter[data-score="4"] span { background: var(--success); }

/* ============================================================ AUTHENTIFICATION */
.auth { min-height: calc(var(--screen-h) - var(--header-h) - var(--utility-h)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-aside { position: relative; overflow: hidden; background: var(--charcoal); color: #fff; padding: 56px clamp(28px, 5vw, 72px); display: flex; flex-direction: column; justify-content: center; isolation: isolate; }
.auth-aside::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(620px 420px at 100% 0%, rgba(192, 32, 58, .55), transparent 62%), radial-gradient(520px 380px at -10% 110%, rgba(232, 83, 106, .2), transparent 60%); }
.auth-aside::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .07; background-image: linear-gradient(rgba(255, 255, 255, .6) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .6) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%); }
.auth-aside h2 { color: #fff; font-size: clamp(28px, 3vw, 40px); font-weight: 800; letter-spacing: -.02em; margin: 16px 0 14px; max-width: 520px; }
.auth-aside > p { color: #c9cdd6; font-size: 16.5px; max-width: 480px; }
.auth-points { display: grid; gap: 14px; margin-top: 30px; max-width: 480px; }
.auth-points li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .09); }
.auth-points .ap-ic { flex: 0 0 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: var(--coral-light); }
.auth-points svg { width: 19px; height: 19px; }
.auth-points b { display: block; font-family: var(--font-head); font-size: 14.5px; color: #fff; }
.auth-points span { font-size: 13px; color: #aab0bd; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px clamp(20px, 5vw, 64px); background: var(--bg); }
.auth-card { width: min(460px, 100%); }
.auth-card h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.auth-card .lead { color: var(--slate); margin-bottom: 26px; }
.auth-card .form-alert { margin-bottom: 18px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.auth-alt { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-soft); font-size: 14.5px; color: var(--slate); text-align: center; }
.auth-success { text-align: center; }
.auth-success .fs-ic { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; background: var(--success-bg); color: var(--success); }
.auth-success .fs-ic svg { width: 30px; height: 30px; }

/* Profil */
.account-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; }
.account-nav { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 2px; padding: 10px; }
.account-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r-sm); font-weight: 700; font-size: 14px; color: var(--text-strong); }
.account-nav a:hover { background: var(--mist); }
.account-nav a.is-active { background: var(--crimson-50); color: var(--crimson); }
.account-nav svg { width: 18px; height: 18px; }
.account-id { display: flex; align-items: center; gap: 14px; padding: 8px 6px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.account-id b { display: block; font-family: var(--font-head); font-size: 15px; }
.account-id small { font-size: 12.5px; color: var(--slate-light); }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.danger-zone .panel-head h2 svg { color: var(--danger); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ============================================================ E-LEARNING — VITRINE */
.el-hero { position: relative; overflow: hidden; background: var(--charcoal); color: #fff; isolation: isolate; }
.el-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(760px 420px at 85% -10%, rgba(192, 32, 58, .55), transparent 62%), radial-gradient(540px 380px at 0% 120%, rgba(57, 135, 229, .18), transparent 62%); }
.el-hero-inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; padding: 40px 0 64px; }
.el-hero h1 { color: #fff; font-size: clamp(32px, 4.2vw, 52px); font-weight: 800; letter-spacing: -.025em; margin: 16px 0; }
.el-hero h1 em { font-style: normal; background: linear-gradient(90deg, #ff8fa2, #f3697e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.el-hero .lead { color: #c9cdd6; font-size: 17.5px; max-width: 560px; }
.el-hero .crumbs, .el-hero .crumbs a { color: #aab0bd; }
.el-hero .crumbs a:hover { color: #fff; }
.el-hero .crumbs [aria-current] { color: #fff; }
.el-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.el-stats { display: flex; flex-wrap: wrap; gap: 14px 34px; margin-top: 34px; }
.el-stats div { display: flex; flex-direction: column; }
.el-stats b { font-family: var(--font-head); font-size: 28px; font-weight: 800; color: #fff; line-height: 1.1; }
.el-stats span { font-size: 13px; color: #aab0bd; }
.el-demo { position: relative; padding: 18px; border-radius: var(--r-xl); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
.el-demo-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 12.5px; color: #aab0bd; }
.el-demo-bar .dots { display: flex; gap: 5px; margin-right: 6px; }
.el-demo-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.el-demo-msg { display: flex; gap: 10px; margin-bottom: 12px; font-size: 13.5px; line-height: 1.5; }
.el-demo-msg .who { flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); }
.el-demo-msg .who svg { width: 16px; height: 16px; }
.el-demo-msg.ai .who { background: var(--grad-solid); }
.el-demo-msg .bubble { padding: 10px 13px; border-radius: 12px; background: rgba(255, 255, 255, .07); color: #e6e8ee; }
.el-demo-msg.ai .bubble { background: rgba(255, 255, 255, .11); }
.el-demo-msg .src { display: inline-flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.el-demo-msg .src span { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill); background: rgba(243, 105, 126, .18); color: #ffb3bf; }
.el-demo-modes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.el-demo-modes span { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: var(--r-pill); border: 1px solid rgba(255, 255, 255, .16); color: #d6d9e0; }
.el-demo-modes span.on { background: #fff; color: #1d1f26; border-color: #fff; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.msg .caret { display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: currentColor; opacity: .55; animation: caretBlink 1s steps(2, start) infinite; }
@keyframes caretBlink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .msg .caret { animation: none; } }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .4; animation: typing 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.pole-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.pole-tab { display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--surface); font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--text-strong); transition: all .15s; }
.pole-tab svg { width: 17px; height: 17px; color: var(--crimson); }
.pole-tab .n { font-size: 12px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--mist-2); color: var(--slate); }
.pole-tab:hover { border-color: var(--crimson); }
.pole-tab.is-active { background: var(--inverse-bg); border-color: var(--inverse-bg); color: var(--inverse-fg); }
.pole-tab.is-active svg { color: inherit; }
.pole-tab.is-active .n { background: rgba(127, 127, 127, .25); color: inherit; }

.pole-tab { cursor: pointer; scroll-margin-top: calc(var(--header-h) + 90px); }
.pole-tagline { margin: -12px 0 22px; font-size: 15px; }
.ecard-slot { display: flex; }
.ecard-slot > .ecard { flex: 1; }
.ecard-slot.is-leaving { animation: slotOut .18s ease forwards; }
.ecard-slot.is-entering { animation: slotIn .35s var(--ease) both; }
@keyframes slotOut { to { opacity: 0; transform: scale(.97); } }
@keyframes slotIn { from { opacity: 0; transform: translateY(10px); } }

.ecards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.ecard { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: transform .28s var(--ease), box-shadow .28s ease, border-color .28s ease; }
.ecard:hover { transform: translateY(-5px); box-shadow: var(--sh-lg); border-color: color-mix(in srgb, var(--crimson) 35%, var(--line)); }
.ecard-cover { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--charcoal); }
.ecard-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .5s var(--ease); }
.ecard:hover .ecard-cover img { transform: scale(1.045); }
.ecard-cover .flag { position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--r-pill); background: rgba(13, 14, 18, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; font-size: 11.5px; font-weight: 700; }
.ecard-cover .flag svg { width: 13px; height: 13px; color: #ff9aac; }
.ecard-cover .owned { left: auto; right: 12px; background: var(--success); }
.ecard-cover .owned svg { color: #fff; }
.ecard-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.ecard-pole { font-family: var(--font-head); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--crimson); margin-bottom: 8px; }
.ecard h3 { font-size: 18px; font-weight: 800; line-height: 1.28; margin-bottom: 8px; }
.ecard h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.ecard:hover h3 { color: var(--crimson); }
.ecard p { font-size: 14px; color: var(--slate); line-height: 1.5; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ecard-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 14px; font-size: 12.5px; font-weight: 600; color: var(--slate); }
.ecard-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ecard-meta svg { width: 14px; height: 14px; color: var(--slate-light); }
.ecard-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ecard-price b { display: block; font-family: var(--font-head); font-size: 19px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.ecard-price small { font-size: 12px; color: var(--slate-light); font-weight: 600; }
.ecard-by { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--slate); position: relative; z-index: 2; }
.ecard-by .avatar { width: 26px; height: 26px; font-size: 10px; }

.feature-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.fb-item { padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.fb-item .f-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--crimson-50); color: var(--crimson); margin-bottom: 14px; }
.fb-item .f-ic svg { width: 21px; height: 21px; }
.fb-item h3 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.fb-item p { font-size: 13.5px; color: var(--slate); line-height: 1.55; }

.teachers { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.teacher { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.teacher:hover { border-color: var(--crimson); box-shadow: var(--sh-md); }
.teacher b { display: block; font-family: var(--font-head); font-size: 16px; color: var(--ink); }
.teacher span { display: block; font-size: 13px; color: var(--slate); margin: 2px 0 8px; }
.teacher small { font-size: 12.5px; font-weight: 700; color: var(--crimson); }

/* ============================================================ E-LEARNING — FICHE COURS */
.ec-hero { position: relative; overflow: hidden; background: var(--charcoal); color: #fff; isolation: isolate; }
.ec-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(640px 400px at 78% -20%, rgba(192, 32, 58, .5), transparent 62%); }
.ec-hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 44px; padding: 30px 0 54px; }
.ec-hero .crumbs { margin-bottom: 24px; }
.ec-hero h1 { color: #fff; font-size: clamp(28px, 3.6vw, 44px); font-weight: 800; letter-spacing: -.02em; line-height: 1.12; margin: 14px 0 12px; }
.ec-hero .sub { color: #d6d9e0; font-size: 17px; max-width: 760px; }
.ec-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.ec-facts span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); font-size: 13px; font-weight: 600; color: #e6e8ee; }
.ec-facts svg { width: 15px; height: 15px; color: var(--coral-light); }
.ec-by { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.ec-by b { display: block; color: #fff; font-family: var(--font-head); }
.ec-by span { font-size: 13px; color: #aab0bd; }
.ec-by a:hover b { text-decoration: underline; text-underline-offset: 3px; }

.ec-aside { position: sticky; top: calc(var(--header-h) + 20px); margin-top: -330px; z-index: 3; align-self: start; }
.ec-buy { position: relative; background: var(--surface); color: var(--ink); border-radius: var(--r-xl); box-shadow: var(--sh-xl); border: 1px solid var(--line); overflow: hidden; }
.ec-buy-cover { aspect-ratio: 16 / 10; background: var(--charcoal); overflow: hidden; }
.ec-buy-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.ec-buy-body { padding: 22px; display: grid; gap: 14px; }
.ec-price b { font-family: var(--font-head); font-size: 32px; font-weight: 800; line-height: 1; color: var(--ink); }
.ec-price span { display: block; margin-top: 4px; font-size: 13px; color: var(--slate-light); }
.ec-buy ul { display: grid; gap: 9px; padding-top: 4px; }
.ec-buy li { display: flex; gap: 10px; font-size: 13.5px; color: var(--text-strong); }
.ec-buy li svg { width: 17px; height: 17px; color: var(--success); flex: 0 0 auto; margin-top: 1px; }
.pay-logos { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.pay-logo { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--line); font-size: 11.5px; font-weight: 800; color: var(--text-strong); }
.pay-logo i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #999); }
.cta-band .pay-logos, .on-dark .pay-logos { border-top: none; padding-top: 0; }
.cta-band .pay-logo, .on-dark .pay-logo { color: #e6e8ee; border-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .04); }

.ec-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 44px; padding: 40px 0 80px; }
.ec-main > section { padding: 30px 0; border-bottom: 1px solid var(--line-soft); }
.ec-main > section:first-child { padding-top: 0; }
.ec-main > section:last-child { border-bottom: none; }
.ec-main h2 { font-size: 24px; font-weight: 800; margin-bottom: 16px; }
.ec-desc { font-size: 16px; line-height: 1.75; color: var(--text-strong); }
.ec-desc p + p { margin-top: 12px; }
.outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.outcomes li { display: flex; gap: 12px; font-size: 15px; color: var(--text-strong); line-height: 1.5; }
.outcomes .ok { flex: 0 0 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-solid); color: #fff; margin-top: 1px; }
.outcomes .ok svg { width: 13px; height: 13px; }
.modules { display: grid; gap: 10px; }
.module { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 18px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.module .m-num { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--inverse-bg); color: var(--inverse-fg); font-family: var(--font-head); font-weight: 800; }
.module b { display: block; font-family: var(--font-head); font-size: 15.5px; color: var(--ink); }
.module span { font-size: 13px; color: var(--slate); }
.module .m-meta { display: flex; gap: 8px; align-items: center; }
.ai-band { display: grid; grid-template-columns: auto 1fr; gap: 18px; padding: 22px; border-radius: var(--r-lg); background: linear-gradient(135deg, color-mix(in srgb, var(--crimson) 9%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--crimson) 25%, var(--line)); }
.ai-band .ai-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--grad-solid); color: #fff; box-shadow: var(--sh-crimson); }
.ai-band .ai-ic svg { width: 25px; height: 25px; }
.ai-band h3 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.ai-band p { color: var(--slate); font-size: 14.5px; }
.ai-band .modes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Aperçu / lecteur public */
.preview-wrap { padding-top: 28px; padding-bottom: 70px; }
.preview-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 18px 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); margin-bottom: 18px; }
.preview-cta b { font-family: var(--font-head); font-size: 17px; }
.preview-cta p { font-size: 13.5px; color: var(--slate); }

/* ============================================================ LECTEUR PDF */
.reader { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--mist); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.reader-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.reader-bar .grow { flex: 1; min-width: 8px; }
.reader-bar .title { flex: 1 1 0; min-width: 0; font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-bar .title ~ .grow { display: none; }
.rb-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: var(--r-sm); color: var(--text-strong); transition: background .15s, color .15s; }
.rb-btn:hover:not([disabled]) { background: var(--mist); color: var(--crimson); }
.rb-btn[disabled] { opacity: .35; cursor: default; }
.rb-btn svg { width: 18px; height: 18px; }
.rb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.rb-page { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--slate); font-variant-numeric: tabular-nums; }
.rb-page input { width: 52px; height: 32px; text-align: center; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--field-bg); font-weight: 700; color: var(--ink); -moz-appearance: textfield; }
.rb-page input::-webkit-outer-spin-button, .rb-page input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rb-zoom { font-size: 12.5px; font-weight: 700; color: var(--slate); min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.reader-progress { height: 3px; background: var(--line-soft); }
.reader-progress span { display: block; height: 100%; width: 0; background: var(--grad-solid); transition: width .3s var(--ease); }
.reader-stage { position: relative; flex: 1; overflow: auto; padding: 24px; display: flex; justify-content: center; align-items: flex-start; outline: none; }
.reader-page { position: relative; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 14px 34px rgba(0, 0, 0, .14); border-radius: 3px; transition: opacity .2s; }
.reader-page canvas { display: block; border-radius: 3px; }
.reader-page.is-loading { opacity: .55; }
.reader-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--slate); font-size: 14px; }
.reader-loading .spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--crimson); animation: spin .8s linear infinite; margin: 0 auto 12px; }
.reader-end { position: absolute; inset: auto 0 0; padding: 26px; text-align: center; background: linear-gradient(180deg, transparent, var(--mist) 45%); }
.reader-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; font-size: 12.5px; color: var(--slate-light); background: var(--surface); border-top: 1px solid var(--line); flex-wrap: wrap; }
.reader-foot .wm { display: inline-flex; align-items: center; gap: 6px; }
.reader-foot svg { width: 14px; height: 14px; }
.reader:fullscreen { border-radius: 0; border: none; }
/* Plein écran sans l'API du navigateur (iPhone) : le lecteur couvre la fenêtre, hors encoche et barre d'accueil */
.reader.is-pseudo-full, .player .reader.is-pseudo-full, .st-layout .reader.is-pseudo-full {
  position: fixed; inset: 0; z-index: 400; height: var(--screen-dh); min-height: 0; border-radius: 0; border: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.reader [data-r="fullscreen"][aria-pressed="true"] { color: var(--crimson); background: var(--crimson-50); }
.reader.is-preview .reader-stage { height: 76vh; min-height: 460px; }
.reader .dim-btn { display: none; }
[data-theme="dark"] .reader .dim-btn { display: inline-grid; }
.reader .dim-btn[aria-pressed="true"] { color: var(--crimson); background: var(--crimson-50); }
[data-theme="dark"] .reader-page { box-shadow: 0 2px 6px rgba(0, 0, 0, .4), 0 18px 40px rgba(0, 0, 0, .55); }
[data-theme="dark"] .reader.dim-pages .reader-page canvas { filter: invert(.88) hue-rotate(180deg) contrast(.95); }

/* ============================================================ ESPACE DE COURS (lecteur + assistant) */
.player-page { padding-top: 18px; padding-bottom: 40px; }
.player-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.player-head .crumbs { margin-bottom: 6px; }
.player-head h1 { font-size: clamp(20px, 2.2vw, 26px); font-weight: 800; letter-spacing: -.01em; }
.player-head .ph-progress { display: flex; align-items: center; gap: 14px; }
.player-head .ph-progress small { display: block; font-size: 12px; color: var(--slate-light); }
.player-head .ph-progress b { font-family: var(--font-head); font-size: 14px; }
.player { display: grid; grid-template-columns: 270px minmax(0, 1fr) 380px; gap: 16px; align-items: stretch; height: calc(var(--screen-h) - var(--header-h) - 120px); min-height: 620px; }
.player .reader { height: 100%; }
.p-side { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.p-side-head { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); font-family: var(--font-head); font-weight: 800; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.p-side-body { flex: 1; overflow-y: auto; padding: 8px; }
.p-mod { display: block; padding: 11px 12px; border-radius: var(--r-md); border: 1px solid transparent; transition: background .15s, border-color .15s; }
.p-mod:hover { background: var(--mist); }
.p-mod.is-current { background: var(--crimson-50); border-color: color-mix(in srgb, var(--crimson) 30%, transparent); }
.p-mod-top { display: flex; align-items: center; gap: 10px; }
.p-mod-num { flex: 0 0 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 12px; background: var(--mist-2); color: var(--text-strong); }
.p-mod.is-read .p-mod-num { background: var(--success); color: #fff; }
.p-mod.is-current .p-mod-num { background: var(--crimson); color: #fff; }
.p-mod-num svg { width: 13px; height: 13px; }
.p-mod b { font-family: var(--font-head); font-size: 13.5px; line-height: 1.3; color: var(--ink); }
.p-mod .progress { margin: 9px 0 0 36px; }
.p-mod-sub { margin: 6px 0 0 36px; display: grid; gap: 4px; }
.p-quiz { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 700; color: var(--slate); }
.p-quiz:hover { background: var(--mist); color: var(--crimson); }
.p-quiz svg { width: 14px; height: 14px; }
.p-quiz .score { margin-left: auto; font-variant-numeric: tabular-nums; }
.p-quiz.ok { color: var(--success); }
.p-side-foot { padding: 12px; border-top: 1px solid var(--line-soft); display: grid; gap: 8px; }
.p-side-foot > p svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; }
.cert-ready { padding: 14px; border-radius: var(--r-md); background: var(--success-bg); color: var(--success); font-size: 13px; font-weight: 600; display: grid; gap: 10px; }
.cert-ready b { font-family: var(--font-head); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.cert-ready svg { width: 18px; height: 18px; }

/* Assistant */
.chat { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.chat-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line-soft); display: grid; gap: 10px; }
.chat-title { display: flex; align-items: center; gap: 10px; }
.chat-title .ai-dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-solid); color: #fff; flex: 0 0 auto; }
.chat-title .ai-dot svg { width: 18px; height: 18px; }
.chat-title b { display: block; font-family: var(--font-head); font-size: 14.5px; color: var(--ink); }
.chat-title small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--slate-light); }
.chat-title small i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.chat-title small i.demo { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-bg); }
.chat-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 3px; border-radius: var(--r-md); background: var(--mist); }
.chat-modes button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; border-radius: 8px; font-size: 11.5px; font-weight: 700; color: var(--slate); transition: background .15s, color .15s; }
.chat-modes button svg { width: 16px; height: 16px; }
.chat-modes button:hover { color: var(--ink); }
.chat-modes button[aria-pressed="true"] { background: var(--raised); color: var(--crimson); box-shadow: var(--sh-sm); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.chat-welcome { text-align: center; padding: 10px 6px; color: var(--slate); font-size: 13.5px; }
.chat-welcome .ai-big { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin: 4px auto 12px; background: var(--crimson-50); color: var(--crimson); }
.chat-welcome .ai-big svg { width: 26px; height: 26px; }
.chat-welcome b { display: block; font-family: var(--font-head); font-size: 15.5px; color: var(--ink); margin-bottom: 4px; }
.chat-suggest { display: grid; gap: 6px; margin-top: 14px; text-align: left; }
.chat-suggest button { padding: 9px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--text-strong); text-align: left; transition: border-color .15s, background .15s; }
.chat-suggest button:hover { border-color: var(--crimson); background: var(--crimson-50); }
.msg { display: flex; gap: 10px; max-width: 100%; animation: msgIn .3s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg .bubble { min-width: 0; padding: 11px 14px; border-radius: 14px; font-size: 14px; line-height: 1.6; color: var(--text-strong); overflow-wrap: anywhere; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--inverse-bg); color: var(--inverse-fg); border-bottom-right-radius: 4px; max-width: 86%; }
.msg.ai .bubble { background: var(--mist); border-bottom-left-radius: 4px; flex: 1; }
.msg.ai .who { flex: 0 0 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--grad-solid); color: #fff; margin-top: 2px; }
.msg.ai .who svg { width: 15px; height: 15px; }
.msg .mode-tag { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 6px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--crimson); }
.msg .mode-tag svg { width: 12px; height: 12px; }
.msg .bubble p + p, .msg .bubble p + ul, .msg .bubble ul + p, .msg .bubble p + ol, .msg .bubble ol + p { margin-top: 8px; }
.msg .bubble ul, .msg .bubble ol { display: grid; gap: 4px; padding-left: 18px; margin: 6px 0; }
.msg .bubble ul { list-style: disc; }
.msg .bubble ol { list-style: decimal; }
.msg .bubble h4 { font-size: 14px; font-weight: 800; margin: 10px 0 4px; color: var(--ink); }
.msg .bubble strong { color: var(--ink); }
.msg .bubble code { font-family: var(--font-mono); font-size: 12.5px; padding: 1px 5px; border-radius: 4px; background: var(--mist-2); }
.msg .bubble .cite { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 5px; margin: 0 1px; border-radius: 5px; background: var(--crimson-50); color: var(--crimson); font-size: 11px; font-weight: 800; vertical-align: 1px; cursor: pointer; }
.msg .bubble .cite:hover { background: var(--crimson); color: #fff; }
.spoiler { display: block; margin-top: 6px; padding: 8px 11px; border-radius: 9px; border: 1px dashed var(--line-strong); background: var(--surface); font-size: 13.5px; cursor: pointer; transition: background .15s; }
.spoiler:not(.is-open) { color: transparent; text-shadow: 0 0 8px rgba(127, 127, 127, .7); user-select: none; }
.spoiler:not(.is-open)::before { content: "Afficher la réponse"; position: absolute; color: var(--crimson); text-shadow: none; font-weight: 700; font-size: 12.5px; }
.spoiler { position: relative; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.sources .lbl { width: 100%; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--slate-light); }
.src-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 9px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 700; color: var(--text-strong); transition: border-color .15s, color .15s; }
.src-chip:hover { border-color: var(--crimson); color: var(--crimson); }
.src-chip .n { color: var(--crimson); }
.src-chip svg { width: 12px; height: 12px; }
.src-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .engine { margin-top: 8px; font-size: 11px; color: var(--slate-light); display: flex; align-items: center; gap: 5px; }
.msg .engine svg { width: 12px; height: 12px; }
.msg.err .bubble { background: var(--danger-bg); color: var(--danger); }
.chat-input { border-top: 1px solid var(--line-soft); padding: 12px; display: grid; gap: 8px; }
.chat-box { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 12px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--field-bg); transition: border-color .15s, box-shadow .15s; }
.chat-box:focus-within { border-color: var(--crimson); box-shadow: 0 0 0 4px rgba(192, 32, 58, .1); }
.chat-box textarea { flex: 1; border: none; outline: none; resize: none; background: transparent; font-size: 14px; line-height: 1.45; padding: 7px 0; max-height: 140px; min-height: 22px; color: var(--ink); }
.chat-box textarea::placeholder { color: var(--placeholder); }
.chat-send { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-solid); color: #fff; flex: 0 0 auto; transition: transform .15s, opacity .15s; }
.chat-send:hover { transform: translateY(-1px); }
.chat-send[disabled] { opacity: .45; transform: none; cursor: default; }
.chat-send svg { width: 17px; height: 17px; }
.chat-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--slate-light); }
.chat-meta .quota b { color: var(--text-strong); }

/* ============================================================ QUIZ */
.quiz-page { padding-top: 30px; padding-bottom: 80px; }
.quiz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.quiz-head { margin-bottom: 22px; }
.quiz-head h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.02em; margin: 8px 0 8px; }
.quiz-head p { color: var(--slate); }
.qcard { padding: 22px 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 20px); transition: border-color .2s, box-shadow .2s; }
.qcard + .qcard { margin-top: 14px; }
.qcard.is-answered { border-color: color-mix(in srgb, var(--crimson) 30%, var(--line)); }
fieldset.qcard { margin: 0; min-width: 0; }
.qcard > legend { float: left; width: 100%; padding: 0; }
.qcard > legend + * { clear: both; }
.q-num { font-family: var(--font-head); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--crimson); margin-bottom: 6px; display: block; }
.q-text { font-family: var(--font-head); font-size: 17px; font-weight: 700; line-height: 1.4; color: var(--ink); display: block; margin-bottom: 14px; }
.q-choices { display: grid; gap: 8px; }
.q-choice { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14.5px; line-height: 1.45; color: var(--text-strong); transition: border-color .15s, background .15s, transform .1s; }
.q-choice:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.q-choice input { position: absolute; opacity: 0; pointer-events: none; }
.q-letter { flex: 0 0 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--mist-2); font-family: var(--font-head); font-weight: 800; font-size: 12.5px; color: var(--slate); transition: background .15s, color .15s; }
.q-choice:has(input:checked) { border-color: var(--crimson); background: var(--crimson-50); }
.q-choice:has(input:checked) .q-letter { background: var(--crimson); color: #fff; }
.q-choice:has(input:focus-visible) { outline: 3px solid rgba(192, 32, 58, .35); outline-offset: 2px; }
.q-choice:active { transform: scale(.995); }
.quiz-side { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 14px; }
.quiz-nav { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.quiz-nav a { aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; border: 1.5px solid var(--line); font-family: var(--font-head); font-weight: 800; font-size: 13px; color: var(--slate); transition: all .15s; }
.quiz-nav a.is-done { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.quiz-nav a:hover { border-color: var(--crimson); }
.attempts { display: grid; gap: 6px; }
.attempts li { display: flex; justify-content: space-between; font-size: 13px; color: var(--slate); }
.attempts b { font-variant-numeric: tabular-nums; }

.result-hero { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; padding: 28px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); margin-bottom: 22px; }
.result-hero.pass { background: linear-gradient(135deg, color-mix(in srgb, var(--success) 10%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--success) 35%, var(--line)); }
.result-hero.fail { background: linear-gradient(135deg, color-mix(in srgb, var(--warning) 10%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--warning) 35%, var(--line)); }
.result-hero h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.result-hero p { color: var(--slate); }
.result-hero .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.qcard.ok { border-color: color-mix(in srgb, var(--success) 40%, var(--line)); }
.qcard.ko { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.q-choice.static { cursor: default; }
.q-choice.static:hover { background: var(--surface); border-color: var(--line); }
.q-choice.is-right { border-color: var(--success); background: var(--success-bg); }
.q-choice.is-right .q-letter { background: var(--success); color: #fff; }
.q-choice.is-wrong { border-color: var(--danger); background: var(--danger-bg); }
.q-choice.is-wrong .q-letter { background: var(--danger); color: #fff; }
.q-choice .tag { margin-left: auto; font-size: 11.5px; font-weight: 800; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.q-choice .tag svg { width: 13px; height: 13px; }
.q-choice.is-right .tag { color: var(--success); }
.q-choice.is-wrong .tag { color: var(--danger); }
.q-explain { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--mist); font-size: 14px; color: var(--text-strong); display: flex; gap: 10px; }
.q-explain svg { width: 18px; height: 18px; color: var(--info); flex: 0 0 auto; margin-top: 2px; }
.q-explain a { color: var(--crimson); font-weight: 700; white-space: nowrap; }

/* ============================================================ ESPACE APPRENANT */
.dash-hero { position: relative; overflow: hidden; background: var(--charcoal); color: #fff; isolation: isolate; }
.dash-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(600px 360px at 92% -20%, rgba(192, 32, 58, .5), transparent 62%); }
.dash-hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; padding-top: 34px; padding-bottom: 86px; }
.dash-hero h1 { color: #fff; font-size: clamp(26px, 3.2vw, 38px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.dash-hero p { color: #c9cdd6; }
.dash-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: -56px; position: relative; z-index: 2; }
.dtile { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-md); }
.dtile .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--crimson-50); color: var(--crimson); flex: 0 0 auto; }
.dtile .ic svg { width: 22px; height: 22px; }
.dtile b { display: block; font-family: var(--font-head); font-size: 24px; font-weight: 800; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.dtile span { font-size: 13px; color: var(--slate); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; align-items: start; margin-top: 30px; }
.dash-section + .dash-section { margin-top: 30px; }
.dash-section > h2 { font-size: 20px; font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mycourse { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: box-shadow .2s, border-color .2s; }
.mycourse + .mycourse { margin-top: 14px; }
.mycourse:hover { box-shadow: var(--sh-md); }
.mycourse-cover { border-radius: var(--r-md); overflow: hidden; aspect-ratio: 3 / 2; background: var(--charcoal); }
.mycourse-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.mycourse h3 { font-size: 17px; font-weight: 800; margin: 4px 0 8px; line-height: 1.3; }
.mycourse .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--slate); margin-bottom: 12px; }
.mycourse .meta span { display: inline-flex; align-items: center; gap: 6px; }
.mycourse .meta svg { width: 14px; height: 14px; color: var(--slate-light); }
.mycourse .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.side-card { padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.side-card + .side-card { margin-top: 14px; }
.side-card h3 { font-size: 15.5px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
.side-card h3 svg { width: 18px; height: 18px; color: var(--crimson); }
.side-studio { position: relative; overflow: hidden; background: var(--grad-dark); border-color: transparent; color: #c9cdd6; }
.side-studio::before { content: ""; position: absolute; inset: 0; background: radial-gradient(260px 160px at 100% 0%, rgba(192, 32, 58, .5), transparent 62%); pointer-events: none; }
.side-studio > * { position: relative; }
.side-studio h3 { color: #fff; }
.side-studio h3 svg { color: #f3697e; }
.side-studio .nav-new { background: var(--crimson); color: #fff; }
.side-studio p { font-size: 13.5px; line-height: 1.55; margin-bottom: 12px; }
.side-studio .side-studio-meta { color: #fff; font-weight: 700; font-size: 12.5px; }
.side-studio .btn-dark { background: #fff; color: #1d1f26; }
.side-studio .btn-dark:hover { background: #f3f4f7; }
.cert-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.cert-line:first-of-type { border-top: none; padding-top: 0; }
.cert-line .c-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--success-bg); color: var(--success); flex: 0 0 auto; }
.cert-line .c-ic svg { width: 18px; height: 18px; }
.cert-line b { display: block; font-size: 13.5px; line-height: 1.3; color: var(--ink); }
.cert-line small { font-family: var(--font-mono); font-size: 11.5px; color: var(--slate-light); }
.cert-line .c-act { margin-left: auto; display: flex; gap: 4px; }
.quota-meter { display: grid; gap: 8px; }
.quota-meter p { font-size: 13px; color: var(--slate); }

/* ============================================================ PAIEMENT */
.pay-page { padding-top: 30px; padding-bottom: 80px; }
.pay-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 30px; align-items: start; }
.pay-steps { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; font-family: var(--font-head); font-weight: 700; font-size: 13.5px; color: var(--slate-light); }
.pay-steps li { display: flex; align-items: center; gap: 8px; }
.pay-steps .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-strong); font-size: 12px; }
.pay-steps .is-done { color: var(--success); }
.pay-steps .is-done .n { background: var(--success); border-color: var(--success); color: #fff; }
.pay-steps .is-current { color: var(--ink); }
.pay-steps .is-current .n { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.pay-steps .bar { width: 34px; height: 2px; border-radius: 2px; background: var(--line); }
.methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.method { position: relative; cursor: pointer; }
.method input { position: absolute; opacity: 0; pointer-events: none; }
.method-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); transition: border-color .15s, box-shadow .15s, background .15s; height: 100%; }
.method-card:hover { border-color: var(--line-strong); }
.method input:checked + .method-card { border-color: var(--crimson); background: var(--crimson-50); box-shadow: 0 0 0 3px rgba(192, 32, 58, .12); }
.method input:focus-visible + .method-card { outline: 3px solid rgba(192, 32, 58, .35); outline-offset: 2px; }
.m-logo { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; background: var(--brand, #333); color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 11px; letter-spacing: .02em; text-align: center; line-height: 1.05; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.m-logo.light-ink { color: #1d1f26; }
.m-logo svg { width: 22px; height: 22px; }
.method-card b { display: block; font-family: var(--font-head); font-size: 14px; color: var(--ink); }
.method-card small { font-size: 12px; color: var(--slate); }
.method-card .check-dot { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: 0 0 auto; transition: all .15s; }
.method input:checked + .method-card .check-dot { border: 6px solid var(--crimson); }
.phone-field { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--field-bg); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.phone-field:focus-within { border-color: var(--crimson); box-shadow: 0 0 0 4px rgba(192, 32, 58, .1); }
.phone-field .cc { display: flex; align-items: center; gap: 6px; padding: 0 12px; background: var(--mist); border-right: 1px solid var(--line); font-weight: 700; font-size: 14px; color: var(--text-strong); white-space: nowrap; }
.phone-field input { flex: 1; border: none; outline: none; background: transparent; padding: 12px 14px; font-size: 16px; letter-spacing: .04em; color: var(--ink); min-width: 0; }
.pay-secure { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--slate); }
.pay-secure svg { width: 18px; height: 18px; color: var(--success); }
.order-card { position: sticky; top: calc(var(--header-h) + 20px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-md); }
.order-card .oc-cover { aspect-ratio: 16 / 8; overflow: hidden; background: var(--charcoal); }
.order-card .oc-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.order-card .oc-body { padding: 18px 20px; display: grid; gap: 10px; }
.order-card h2 { font-size: 16.5px; font-weight: 800; line-height: 1.3; }
.oc-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--slate); }
.oc-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.oc-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 20px; border-top: 1px solid var(--line-soft); background: var(--mist); }
.oc-total span { font-family: var(--font-head); font-weight: 700; }
.oc-total b { font-family: var(--font-head); font-size: 22px; font-weight: 800; color: var(--ink); }
.demo-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: var(--warning-bg); color: var(--warning-ink); font-size: 13.5px; margin-bottom: 18px; }
.demo-banner svg { width: 19px; height: 19px; color: var(--warning); flex: 0 0 auto; margin-top: 1px; }

/* Écran de l'agrégateur simulé */
.psp { max-width: 460px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--sh-xl); overflow: hidden; }
.psp-head { padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #fff; background: var(--brand, #333); }
.psp-head.light-ink { color: #1d1f26; }
.psp-head b { font-family: var(--font-head); font-size: 17px; }
.psp-head small { display: block; font-size: 12px; opacity: .85; }
.psp-body { padding: 24px 22px; display: grid; gap: 16px; text-align: center; }
.psp-amount { font-family: var(--font-head); font-size: 34px; font-weight: 800; color: var(--ink); line-height: 1; }
.psp-merchant { font-size: 13.5px; color: var(--slate); }
.psp-phone { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 0 auto; padding: 8px 14px; border-radius: var(--r-pill); background: var(--mist); font-weight: 700; font-family: var(--font-mono); font-size: 14px; }
.psp-phone svg { width: 16px; height: 16px; color: var(--slate); }
.psp-wait { display: grid; gap: 10px; justify-items: center; padding: 6px 0; color: var(--slate); font-size: 13.5px; }
.psp-pulse { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--mist); color: var(--brand-ink, var(--crimson)); position: relative; }
.psp-pulse::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid currentColor; opacity: .5; animation: ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; }
.psp-pulse svg { width: 28px; height: 28px; }
@keyframes ping { 75%, 100% { transform: scale(1.35); opacity: 0; } }
.psp-actions { display: grid; gap: 8px; }
.psp-foot { padding: 12px 22px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--slate-light); display: flex; justify-content: center; align-items: center; gap: 6px; }
.psp-foot svg { width: 14px; height: 14px; }

.pay-result { max-width: 640px; margin: 0 auto; text-align: center; }
.pr-ic { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 20px; }
.pr-ic svg { width: 38px; height: 38px; }
.pr-ic.ok { background: var(--success-bg); color: var(--success); animation: popIn .5s var(--ease); }
.pr-ic.ko { background: var(--danger-bg); color: var(--danger); }
.pr-ic.wait { background: var(--warning-bg); color: var(--warning); }
@keyframes popIn { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: none; } }
.pay-result h1 { font-size: 28px; font-weight: 800; margin-bottom: 10px; }
.pay-result > p { color: var(--slate); max-width: 520px; margin: 0 auto; }
.pr-card { margin: 26px 0; text-align: left; }
.pr-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; opacity: .9; animation: fall linear forwards; }
@keyframes fall { to { transform: translate3d(var(--dx, 0), 105vh, 0) rotate(var(--rot, 540deg)); opacity: .9; } }

/* ============================================================ VÉRIFICATION DE CERTIFICAT */
.verify-page { padding-top: 50px; padding-bottom: 90px; }
.verify-card { max-width: 720px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-lg); overflow: hidden; }
.verify-band { display: flex; align-items: center; gap: 16px; padding: 22px 26px; color: #fff; }
.verify-band.ok { background: linear-gradient(135deg, #1f8a4d, #15683a); }
.verify-band.ko { background: linear-gradient(135deg, #c0263a, #8f1527); }
.verify-band.revoked { background: linear-gradient(135deg, #8a5a00, #6b4600); }
.verify-band .vb-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); flex: 0 0 auto; }
.verify-band .vb-ic svg { width: 26px; height: 26px; }
.verify-band b { display: block; font-family: var(--font-head); font-size: 20px; }
.verify-band span { font-size: 13.5px; opacity: .9; }
.verify-body { padding: 26px; }
.verify-body .kv-list { font-size: 15px; }
.verify-form { display: flex; gap: 10px; flex-wrap: wrap; }
.verify-form .input { flex: 1; min-width: 220px; font-family: var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }

/* ============================================================ PROFIL FORMATEUR */
.teacher-hero { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; }
.teacher-hero .avatar.xl { width: 104px; height: 104px; font-size: 34px; box-shadow: 0 0 0 5px rgba(255, 255, 255, .1); }
.teacher-bio { font-size: 16px; line-height: 1.75; color: var(--text-strong); }
.teacher-bio p + p { margin-top: 12px; }
.expertise { display: flex; flex-wrap: wrap; gap: 8px; }

/* ============================================================ BACK-OFFICE */
.bo-body { background: var(--section-alt); }
.bo { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: var(--screen-h); }
.bo-side { position: sticky; top: 0; height: var(--screen-h); display: flex; flex-direction: column; background: var(--side-bg); color: var(--side-ink); border-right: 1px solid var(--side-line); z-index: 90; }
.bo-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.bo-brand img { height: 34px; width: auto; }
.bo-space { margin: 0 12px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: rgba(255, 255, 255, .05); }
.bo-space a { text-align: center; padding: 7px 6px; border-radius: 7px; font-size: 12.5px; font-weight: 700; color: var(--side-muted); }
.bo-space a:hover { color: #fff; }
.bo-space a.is-active { background: rgba(255, 255, 255, .1); color: #fff; }
.bo-nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.bo-group { margin-top: 14px; }
.bo-group > span { display: block; padding: 0 10px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--side-muted); }
.bo-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--side-ink); transition: background .15s, color .15s; position: relative; }
.bo-link svg { width: 17px; height: 17px; opacity: .8; }
.bo-link:hover { background: var(--side-hover); color: #fff; }
.bo-link.is-active { background: rgba(236, 77, 104, .14); color: #fff; }
.bo-link.is-active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #ec4d68; }
.bo-link.is-active svg { color: #ff8fa2; opacity: 1; }
.bo-link .badge-n { margin-left: auto; min-width: 20px; height: 19px; padding: 0 6px; border-radius: var(--r-pill); background: #ec4d68; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.bo-user { display: flex; align-items: center; gap: 10px; padding: 14px; border-top: 1px solid var(--side-line); }
.bo-user b { display: block; font-size: 13.5px; color: #fff; }
.bo-user small { font-size: 11.5px; color: var(--side-muted); }
.bo-user .avatar { width: 34px; height: 34px; }
.bo-user form { margin-left: auto; }
.bo-user button, .bo-user a.ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--side-muted); }
.bo-user button:hover, .bo-user a.ico:hover { background: var(--side-hover); color: #fff; }
.bo-user svg { width: 17px; height: 17px; }

.bo-main { min-width: 0; display: flex; flex-direction: column; }
.bo-top { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 28px; background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: saturate(150%) blur(10px); backdrop-filter: saturate(150%) blur(10px); border-bottom: 1px solid var(--line); }
.bo-top .bo-burger { display: none; }
.bo-top h1 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bo-top .crumbs { font-size: 12.5px; }
.bo-top-title { min-width: 0; display: grid; }
.bo-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bo-top-tools { display: flex; align-items: center; gap: 8px; }
.bo-top-title + .bo-top-tools { margin-left: auto; }
.bo-more { display: none; }
.bo-content { padding: 26px 28px 60px; width: 100%; max-width: 1480px; }
.bo-flash { display: grid; gap: 8px; margin-bottom: 18px; }

.period { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-sm); background: var(--mist); border: 1px solid var(--line); }
.period a { padding: 6px 11px; border-radius: 5px; font-size: 12.5px; font-weight: 700; color: var(--slate); white-space: nowrap; }
.period a:hover { color: var(--ink); }
.period a.is-active { background: var(--raised); color: var(--ink); box-shadow: var(--sh-sm); }

.bo-grid { display: grid; gap: 18px; }
.bo-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bo-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bo-grid.cols-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.bo-grid.cols-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
/* Colonnes imbriquées : chaque panneau garde sa hauteur, sans s'étirer pour égaler la colonne voisine */
.bo-grid > .bo-grid { align-content: start; }
.bo-grid.cols-65 { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.bo-grid + .bo-grid, .bo-grid + .panel, .panel + .bo-grid, .panel + .panel, .kpis + .bo-grid, .kpis + .panel { margin-top: 18px; }
.bo-section-title { margin: 30px 0 14px; padding-top: 24px; border-top: 1px solid var(--line); }
.bo-section-title h2 { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bo-section-title h2 > svg { width: 20px; height: 20px; color: var(--crimson); }
.bo-section-title p { font-size: 13px; margin-top: 4px; }
.bo-section-title + .kpis { margin-top: 0; }
.span-2 { grid-column: span 2; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpi { position: relative; padding: 16px 18px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.kpi-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--slate); }
.kpi-top svg { width: 16px; height: 16px; color: var(--slate-light); }
.kpi-val { display: block; margin-top: 8px; font-family: var(--font-head); font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-val small { font-size: 14px; font-weight: 700; color: var(--slate-light); letter-spacing: 0; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; min-height: 22px; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.up { background: var(--success-bg); color: var(--success); }
.delta.down { background: var(--danger-bg); color: var(--danger); }
.delta.flat { background: var(--mist-2); color: var(--slate); }
.delta svg { width: 12px; height: 12px; }
.kpi-note { font-size: 11.5px; color: var(--slate-light); }
.kpi .spark { width: 96px; height: 28px; flex: 0 0 auto; }
.kpi.live .kpi-val::after { content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 10px; vertical-align: middle; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 var(--success); animation: live 2s infinite; }
@keyframes live { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.78); } }

.bo-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.bo-toolbar .grow { flex: 1; }
.bo-toolbar .input, .bo-toolbar .select { width: auto; padding-top: 9px; padding-bottom: 9px; font-size: 14px; }
.bo-search { position: relative; flex: 1 1 260px; max-width: 420px; }
.bo-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--slate-light); pointer-events: none; }
.bo-search .input { width: 100%; padding-left: 38px; }
.chipbar { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbar a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--slate); }
.chipbar a:hover { border-color: var(--crimson); color: var(--crimson); }
.chipbar a.is-active { background: var(--inverse-bg); border-color: var(--inverse-bg); color: var(--inverse-fg); }
.chipbar .n { font-size: 11px; opacity: .75; }

.barlist { display: grid; gap: 10px; }
.bl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; font-size: 13.5px; }
.bl-row .bl-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-strong); font-weight: 600; }
.bl-row .bl-label a:hover { color: var(--crimson); }
.bl-row .bl-val { font-family: var(--font-head); font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.bl-row .bl-val small { font-weight: 600; color: var(--slate-light); font-size: 11.5px; margin-left: 4px; }
.bl-bar { grid-column: 1 / -1; height: 8px; border-radius: 0 4px 4px 0; background: var(--grid); overflow: hidden; }
.bl-bar span { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--c1); transform-origin: left; animation: growX .8s var(--ease) both; }
@keyframes growX { from { transform: scaleX(0); } }

.funnel { display: grid; gap: 10px; }
.fn-step { display: grid; grid-template-columns: 200px minmax(0, 1fr) 120px; gap: 14px; align-items: center; }
.fn-step .fn-label { font-size: 13.5px; font-weight: 700; color: var(--text-strong); }
.fn-step .fn-track { height: 30px; border-radius: 0 6px 6px 0; background: var(--grid); overflow: hidden; }
.fn-step .fn-fill { height: 100%; border-radius: 0 6px 6px 0; background: var(--seq3); animation: growX .9s var(--ease) both; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; }
.fn-step:nth-child(1) .fn-fill { background: var(--seq4); }
.fn-step:nth-child(2) .fn-fill { background: var(--seq3); }
.fn-step:nth-child(3) .fn-fill { background: var(--seq2); }
.fn-step:nth-child(4) .fn-fill { background: var(--seq1); }
.fn-step .fn-num { text-align: right; font-family: var(--font-head); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.fn-step .fn-num small { display: block; font-size: 11.5px; font-weight: 700; color: var(--slate-light); }

.heatmap { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; font-size: 10.5px; color: var(--slate-light); }
.heatmap .hm-cell { aspect-ratio: 1; border-radius: 3px; background: var(--grid); position: relative; }
.heatmap .hm-cell[data-l="1"] { background: var(--seq1); }
.heatmap .hm-cell[data-l="2"] { background: var(--seq2); }
.heatmap .hm-cell[data-l="3"] { background: var(--seq3); }
.heatmap .hm-cell[data-l="4"] { background: var(--seq4); }
.heatmap .hm-cell:hover { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 1; }
.heatmap .hm-day { display: flex; align-items: center; font-weight: 700; }
.heatmap .hm-hour { text-align: center; }
.hm-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 10px; font-size: 11.5px; color: var(--slate-light); }
.hm-legend i { width: 14px; height: 14px; border-radius: 3px; }

.timeline { position: relative; display: grid; gap: 2px; }
.tl-item { position: relative; display: grid; grid-template-columns: 74px 22px minmax(0, 1fr); gap: 10px; align-items: start; padding: 6px 0; }
.tl-time { font-size: 12px; color: var(--slate-light); text-align: right; font-variant-numeric: tabular-nums; padding-top: 2px; }
.tl-dot { position: relative; width: 22px; display: flex; justify-content: center; }
.tl-dot::before { content: ""; position: absolute; top: 18px; bottom: -14px; width: 2px; background: var(--line); }
.tl-item:last-child .tl-dot::before { display: none; }
.tl-dot i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--mist-2); color: var(--slate); position: relative; z-index: 1; }
.tl-dot i svg { width: 12px; height: 12px; }
.tl-dot i.ev { background: var(--crimson-50); color: var(--crimson); }
.tl-dot i.ok { background: var(--success-bg); color: var(--success); }
.tl-body { min-width: 0; font-size: 13.5px; color: var(--text-strong); padding-top: 1px; }
.tl-body b { font-weight: 700; color: var(--ink); }
.tl-body small { display: block; font-size: 12px; color: var(--slate-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-session { margin: 12px 0 6px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--mist); font-size: 12.5px; font-weight: 700; color: var(--slate); display: flex; flex-wrap: wrap; gap: 4px 14px; }

.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.mini-stat { padding: 12px 14px; border-radius: var(--r-md); background: var(--mist); }
.mini-stat b { display: block; font-family: var(--font-head); font-size: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.mini-stat span { font-size: 12px; color: var(--slate); }

.live-list { display: grid; gap: 8px; }
.live-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-md); background: var(--mist); font-size: 13px; }
.live-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: 0 0 auto; }
.live-row b { font-weight: 700; color: var(--ink); }
.live-row span { flex: 1 1 auto; min-width: 0; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-row small { flex: 0 1 auto; min-width: 0; max-width: 45%; margin-left: auto; color: var(--slate-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.question-list { display: grid; gap: 8px; }
.ql-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line-soft); }
.ql-row .rank { font-family: var(--font-head); font-weight: 800; color: var(--slate-light); text-align: center; }
.ql-row p { font-size: 13.5px; color: var(--text-strong); }
.ql-row small { font-size: 12px; color: var(--slate-light); }
.ql-row .n { font-family: var(--font-head); font-weight: 800; color: var(--ink); white-space: nowrap; }
.concepts { display: flex; flex-wrap: wrap; gap: 6px; }
.concepts span { padding: 5px 11px; border-radius: var(--r-pill); background: var(--info-bg); color: var(--info); font-size: 12.5px; font-weight: 700; }
.concepts span small { opacity: .75; margin-left: 4px; }

.user-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.user-head h2 { font-size: 22px; font-weight: 800; }
.user-head p { color: var(--slate); font-size: 14px; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form .select { width: auto; padding-top: 8px; padding-bottom: 8px; font-size: 13.5px; }

.code-block { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; padding: 14px 16px; border-radius: var(--r-md); background: var(--mist); color: var(--text-strong); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 520px; overflow: auto; }
.email-frame { width: 100%; min-height: 560px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }

/* Éditeur de cours / quiz */
.dropzone { position: relative; display: grid; place-items: center; gap: 8px; padding: 30px 20px; border-radius: var(--r-lg); border: 2px dashed var(--line-strong); background: var(--surface-hover); text-align: center; color: var(--slate); transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone:hover, .dropzone.is-over { border-color: var(--crimson); background: var(--crimson-50); }
.dropzone svg { width: 30px; height: 30px; color: var(--crimson); }
.dropzone b { font-family: var(--font-head); color: var(--ink); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .file-name { font-size: 13px; font-weight: 700; color: var(--crimson); }
.doc-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.doc-row + .doc-row { margin-top: 8px; }
.doc-row .d-ic { width: 44px; height: 52px; border-radius: 6px; display: grid; place-items: center; background: var(--crimson-50); color: var(--crimson); font-family: var(--font-head); font-weight: 800; font-size: 11px; }
.doc-row b { display: block; font-family: var(--font-head); font-size: 14.5px; color: var(--ink); }
.doc-row small { font-size: 12.5px; color: var(--slate); }
.doc-row .d-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.doc-row .d-actions form { display: inline; }
.icon-act { width: 34px; height: 34px; border-radius: var(--r-sm); display: inline-grid; place-items: center; color: var(--slate); border: 1px solid transparent; }
.icon-act:hover { background: var(--mist); color: var(--crimson); border-color: var(--line); }
.icon-act.danger:hover { color: var(--danger); }
.icon-act svg { width: 16px; height: 16px; }
.icon-act[disabled] { opacity: .3; pointer-events: none; }
.qedit { padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.qedit + .qedit { margin-top: 12px; }
.qedit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.qedit-head b { font-family: var(--font-head); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--crimson); }
.qedit-choices { display: grid; gap: 8px; margin: 10px 0; }
.qedit-choice { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
.qedit-choice input[type="radio"] { width: 18px; height: 18px; accent-color: var(--success); }
.qedit.is-deleted { opacity: .45; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 14px 0; margin-top: 18px; background: linear-gradient(180deg, transparent, var(--section-alt) 30%); }

/* Graphiques SVG */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis-label { fill: var(--axis); font-size: 11px; font-family: var(--font-body); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .12; }
.chart .bar { transition: opacity .15s; }
.chart .hover-line { stroke: var(--axis); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 140px; padding: 9px 11px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-lg); font-size: 12.5px; color: var(--text-strong); transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; }
.chart-tip b { display: block; font-family: var(--font-head); font-size: 12.5px; color: var(--ink); margin-bottom: 4px; }
.chart-tip .row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.chart-tip .row i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.chart-tip .row span { display: inline-flex; align-items: center; color: var(--slate); }
.chart-tip .row strong { font-variant-numeric: tabular-nums; color: var(--ink); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--slate); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 14px; height: 3px; border-radius: 2px; }
.chart-legend i.sq { width: 10px; height: 10px; border-radius: 3px; }
.view-switch { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-sm); background: var(--mist); }
.view-switch button { padding: 5px 9px; border-radius: 5px; font-size: 12px; font-weight: 700; color: var(--slate); }
.view-switch button[aria-pressed="true"] { background: var(--raised); color: var(--ink); box-shadow: var(--sh-sm); }
.chart-table { max-height: 320px; overflow: auto; }

/* Les colonnes de grille ne s'élargissent jamais au-delà de l'écran (les tableaux défilent dans leur panneau). */
.bo-grid > *, .kpis > *, .dash-grid > *, .pay-layout > *, .quiz-layout > *, .account-layout > *, .ec-layout > *,
.player > *, .el-hero-inner > *, .ec-hero-inner > *, .auth > * { min-width: 0; }

/* ============================================================ RESPONSIVE */
@media (max-width: 1320px) {
  .player { grid-template-columns: 240px minmax(0, 1fr) 340px; }
}
@media (max-width: 1180px) {
  .player { grid-template-columns: minmax(0, 1fr) 360px; height: auto; }
  .player .p-side { grid-column: 1 / -1; grid-row: 2; max-height: none; }
  .player .reader { height: calc(var(--screen-h) - var(--header-h) - 120px); min-height: 560px; }
  .player .chat { height: calc(var(--screen-h) - var(--header-h) - 120px); min-height: 560px; }
  .ecards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bo-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .el-hero-inner, .ec-hero-inner, .ec-layout, .pay-layout, .dash-grid, .quiz-layout, .account-layout { grid-template-columns: 1fr; }
  .ec-aside { position: static; margin-top: 0; order: -1; max-width: 560px; }
  .ec-hero-inner > div[aria-hidden] { display: none; }
  .order-card, .quiz-side, .account-nav { position: static; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { padding: 36px var(--gut); }
  .auth-points { display: none; }
  .bo { grid-template-columns: 1fr; }
  .bo-side { position: fixed; inset: 0 auto 0 0; width: 272px; transform: translateX(-105%); transition: transform .28s var(--ease); box-shadow: var(--sh-xl); }
  .bo.side-open .bo-side { transform: none; }
  .bo-scrim { position: fixed; inset: 0; z-index: 85; background: rgba(5, 6, 8, .5); }
  .bo-top .bo-burger { display: inline-grid; }
  .bo-grid.cols-2, .bo-grid.cols-21, .bo-grid.cols-12, .bo-grid.cols-65 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
@media (max-width: 860px) {
  .player { grid-template-columns: 1fr; }
  .player .chat { grid-row: 3; }
  .fn-step { grid-template-columns: 1fr 90px; }
  .fn-step .fn-track { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 760px) {
  .ecards, .feature-band, .outcomes, .bo-grid.cols-3 { grid-template-columns: 1fr; }
  .mycourse { grid-template-columns: 1fr; }
  .dash-tiles { grid-template-columns: 1fr 1fr; }
  .bo-content { padding: 18px 16px 50px; }
  .bo-top { padding: 0 16px; }
  .bo-top .crumbs { display: none; }
  .result-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .heatmap { grid-template-columns: 26px repeat(24, minmax(0, 1fr)); gap: 2px; }
  .heatmap .hm-hour:nth-child(odd) { visibility: hidden; }
  .reader-bar .title { display: none; }
  .teacher-hero { grid-template-columns: 1fr; }
  .consent { left: 16px; bottom: 16px; }
  .tl-item { grid-template-columns: 54px 22px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .bl-bar span, .fn-step .fn-fill { animation: none; }
  .confetti { display: none; }
}
@media print {
  .consent, .acct, .theme-btn, .bo-side, .bo-top { display: none !important; }
  .bo { display: block; }
}

/* Petits écrans : les lignes « en direct » et les pastilles d'état passent à la ligne au lieu de déborder */
@media (max-width: 640px) {
  .live-row { flex-wrap: wrap; min-width: 0; }
  .live-row > * { min-width: 0; overflow-wrap: anywhere; }
  .bo-content .pill { white-space: normal; text-align: left; }
}


/* ============================================================
   Sessions, émargement, évaluations, bannière, double authentification
   ============================================================ */
.site-banner { background: var(--crimson); color: #fff; font-size: 14px; font-weight: 600; }
.site-banner .wrap { display: flex; align-items: center; gap: 10px; min-height: 40px; padding-top: 6px; padding-bottom: 6px; flex-wrap: wrap; }
.site-banner svg { width: 18px; height: 18px; flex: 0 0 auto; }
.site-banner a { color: #fff; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-weight: 800; }
.site-banner a svg { width: 15px; height: 15px; }
.att-grid th.num small { display: block; font-weight: 600; font-size: 10.5px; color: var(--slate-light); text-transform: none; }
.att-cell { padding: 6px 4px !important; }
.att-cell.is-today { background: var(--crimson-50); }
.att-check { justify-content: center; flex-direction: column; gap: 2px; align-items: center; }
.att-check small { font-size: 10px; color: var(--success); font-weight: 700; }
.eval-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.eval-label { font-weight: 700; color: var(--text-strong); }
.eval-stars { display: flex; gap: 6px; }
.eval-star input { position: absolute; opacity: 0; width: 0; height: 0; }
.eval-star span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line-strong); font-weight: 800; cursor: pointer; transition: all .15s; color: var(--slate); background: var(--surface); }
.eval-star input:checked + span { background: var(--crimson); border-color: var(--crimson); color: #fff; transform: scale(1.06); }
.eval-star input:focus-visible + span { outline: 3px solid rgba(192, 32, 58, .35); outline-offset: 2px; }
.eval-nps { display: flex; gap: 4px; flex-wrap: wrap; }
.eval-nps label input { position: absolute; opacity: 0; width: 0; height: 0; }
.eval-nps label span { display: grid; place-items: center; min-width: 38px; height: 38px; border-radius: 8px; border: 1.5px solid var(--line-strong); font-weight: 700; cursor: pointer; color: var(--slate); background: var(--surface); }
.eval-nps label input:checked + span { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.totp-qr { width: 200px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.totp-qr svg { width: 100%; height: auto; display: block; }
.course-extras { margin-top: 22px; }
tr.is-deleted td { opacity: .5; }
.bo-content .is-late td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.period a { text-decoration: none; }
@media (max-width: 720px) { .eval-star span { width: 36px; height: 36px; } .site-banner a { margin-left: 0; } }

/* Grilles des écrans KYC et Données : l'espacement vient de la grille, pas de la marge .panel + .panel */
.data-groups > .panel + .panel, .kyc-page > .panel + .panel, .kyc-form > .panel + .panel { margin-top: 0; }
.kpis + .data-groups { margin-top: 18px; }
/* ---------------------------------------------------------------- Vérification d'identité (KYC) : espace du titulaire */
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-bg); }
.kyc-page { display: grid; gap: 18px; min-width: 0; }
.kyc-state { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; border-left: 4px solid var(--info); }
.kyc-state.tone-ok { border-left-color: var(--success); }
.kyc-state.tone-warn { border-left-color: var(--warning); }
.kyc-state.tone-err { border-left-color: var(--danger); }
.kyc-state h2 { font-size: 18px; margin: 0 0 4px; }
.kyc-state p { margin: 0; color: var(--slate); }
.kyc-state-ic { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; display: grid; place-items: center; background: var(--info-bg); color: var(--info); }
.kyc-state.tone-ok .kyc-state-ic { background: var(--success-bg); color: var(--success); }
.kyc-state.tone-warn .kyc-state-ic { background: var(--warning-bg); color: var(--warning); }
.kyc-state.tone-err .kyc-state-ic { background: var(--danger-bg); color: var(--danger); }
.kyc-state-ic svg { width: 22px; height: 22px; }
.kyc-problems { margin: 6px 0 0 18px; display: grid; gap: 3px; }
.kyc-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 20px; margin: 0 0 14px; }
.kyc-summary dt { font-size: 12px; color: var(--slate-light); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.kyc-summary dd { margin: 2px 0 0; font-weight: 600; color: var(--ink); }
.kyc-reopen { display: grid; gap: 10px; justify-items: start; }
.kyc-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.kyc-kind { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--r-md); cursor: pointer; transition: border-color .15s, background .15s; }
.kyc-kind:hover { border-color: var(--crimson); }
.kyc-kind:has(input:checked) { border-color: var(--crimson); background: var(--crimson-50); }
.kyc-kind input { margin-top: 3px; accent-color: var(--crimson); }
.kyc-kind small { display: block; color: var(--slate); font-size: 13px; margin-top: 2px; }
/* Particulier : la partie entreprise et ses pièces sont masquées, sans JavaScript */
.kyc-form:has(input[name="kind"][value="particulier"]:checked) .kyc-company,
.kyc-form:has(input[name="kind"][value="particulier"]:checked) .kyc-doc.is-company { display: none; }
.kyc-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.kyc-doc { display: grid; gap: 10px; align-content: start; padding: 14px; border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--surface-hover); }
.kyc-doc.is-done { border-style: solid; border-color: color-mix(in srgb, var(--success) 40%, var(--line)); background: color-mix(in srgb, var(--success-bg) 45%, var(--surface)); }
.kyc-doc-head { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.kyc-doc-head b { font-size: 14px; }
.kyc-doc-head small { flex-basis: 100%; color: var(--slate); font-size: 12.5px; }
.kyc-doc-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; font-size: 13px; }
.kyc-doc-file > svg { width: 16px; height: 16px; color: var(--success); }
.kyc-doc-file a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kyc-doc-file small { grid-column: 2; color: var(--slate-light); }
.kyc-doc-file .icon-act { grid-row: 1 / span 2; grid-column: 3; }
.kyc-doc input[type="file"] { font-size: 13px; padding: 8px; }
.kyc-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.kyc-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.kyc-timeline li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 2px 12px; font-size: 13.5px; padding-left: 12px; border-left: 2px solid var(--line); }
.kyc-timeline time { color: var(--slate-light); font-size: 12.5px; grid-row: span 2; }
.kyc-timeline span { color: var(--slate); grid-column: 2; }

/* ---------------------------------------------------------------- KYC : revue dans l'administration */
.kyc-head .panel-body { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.kyc-head-main { display: grid; gap: 4px; justify-items: start; }
.kyc-head-main h2 { font-size: 22px; margin: 0; }
.kyc-head-facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; }
.kyc-head-facts dt { font-size: 11.5px; color: var(--slate-light); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.kyc-head-facts dd { margin: 2px 0 0; font-weight: 600; }
.kyc-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.kyc-shot { margin: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.kyc-shot > a { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--mist); }
.kyc-shot img { width: 100%; height: 100%; object-fit: contain; }
.kyc-pdf { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; color: var(--crimson); }
.kyc-pdf svg { width: 26px; height: 26px; }
.kyc-shot figcaption { display: grid; gap: 2px; padding: 10px 12px; font-size: 13px; }
.kyc-shot figcaption small { color: var(--slate-light); }
.kyc-checks { display: grid; gap: 8px; }
.kyc-decide { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------------------- Données (explorateur de la base) */
.data-lock { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; padding: 12px 16px; margin-bottom: 18px;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.data-lock.is-open { border-color: color-mix(in srgb, var(--warning) 45%, var(--line)); background: var(--warning-bg); }
.data-lock > div { display: grid; flex: 1 1 260px; }
.data-lock small { color: var(--slate); }
.data-lock-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--mist); color: var(--slate); }
.data-lock.is-open .data-lock-ic { background: var(--surface); color: var(--warning); }
.data-lock-ic svg { width: 17px; height: 17px; }
.data-lock-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.data-lock-form .input { width: 220px; }
.data-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; margin-bottom: 18px; }
.data-tables { display: grid; gap: 2px; padding-top: 4px; }
.data-table-link { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 10px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.data-table-link:hover { background: var(--mist); }
.data-table-link b { display: block; font-size: 14px; }
.data-table-link small { color: var(--slate-light); font-size: 11.5px; }
.data-count { display: flex; gap: 8px; align-items: center; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--slate); white-space: nowrap; }
.data-dt td { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-dt th a.sort-link { color: inherit; text-decoration: none; }
.data-dt th a.sort-link.is-sorted { color: var(--crimson); }
.data-dt .data-val { color: var(--text-strong); text-decoration: none; }
.data-dt a.data-val:hover { color: var(--crimson); text-decoration: underline; }
.data-null { text-decoration: none; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; }
.data-form { gap: 14px; }
.data-field > label { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.data-field > label small { font-weight: 500; color: var(--slate-light); font-size: 12px; }
.data-ro { padding: 9px 12px; border-radius: var(--r-sm); background: var(--mist); font-size: 14px; overflow-wrap: anywhere; }
.data-null-check { font-size: 12.5px; color: var(--slate); }
.data-sub { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--slate-light); margin: 4px 0 8px; }
.data-links { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.data-cols { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.data-maint { display: grid; gap: 4px; justify-items: start; }
.price-input { width: 150px; text-align: right; display: inline-block; }
.price-input.is-changed { border-color: var(--crimson); background: var(--crimson-50); }
@media (max-width: 720px) {
  .kyc-timeline li { grid-template-columns: 1fr; }
  .kyc-timeline time { grid-row: auto; }
  .data-lock-form .input { width: 100%; }
}
