/* ─────────────────────────────────────────────
   Misi School — charte « Scopes »
   Noir d'écran de contrôle, panneaux sobres,
   les canaux R, V, B comme seule couleur.
   ───────────────────────────────────────────── */
:root {
  --ecran: #08090B;
  --panneau: #111419;
  --panneau-2: #161A21;
  --trait: #1F242C;
  --trait-fort: #2C333D;
  --texte: #E6E9EE;
  --texte-2: #A9B0BA;
  --gris: #7D8590;
  --r: #FF5F57;
  --v: #3DDC84;
  --b: #4C8DFF;
  --fort: #fff;          /* texte « plus clair que le texte » au survol */
  --chan-w: #E6E9EE;     /* canal blanc (enseignants, téléchargements) */
  --ombre: rgba(0, 0, 0, .5);
  --radius: 12px;
  --radius-s: 8px;
  --titre: 'Sora', system-ui, sans-serif;
  --corps: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--ecran);
  color: var(--texte);
  font-family: var(--corps);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--b); color: #fff; }
a { color: inherit; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 2px solid var(--b); outline-offset: 2px; border-radius: 4px; }

main {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 40px 96px;
}

/* ── En-tête ── */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 40px;
  border-bottom: 1px solid var(--trait);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.rgb { display: inline-flex; gap: 3px; }
.rgb i { width: 4px; height: 20px; border-radius: 2px; }
.rgb i:nth-child(1) { background: var(--r); }
.rgb i:nth-child(2) { background: var(--v); }
.rgb i:nth-child(3) { background: var(--b); }
.brand-name { font-family: var(--titre); font-weight: 700; font-size: 19px; letter-spacing: -.02em; }

.top-nav { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.top-nav a { font-size: 14px; color: var(--gris); text-decoration: none; transition: color .2s; }
.top-nav a:hover, .top-nav a.is-on { color: var(--texte); }
.top-nav .nav-user {
  display: inline-flex; align-items: center; gap: 10px; color: var(--texte);
}
.avatar {
  width: 32px; height: 32px; border-radius: var(--radius-s); background: var(--panneau);
  border: 1px solid var(--trait); display: grid; place-items: center;
  font-family: var(--titre); font-weight: 600; font-size: 13px;
}
.top-nav .nav-cta {
  color: var(--ecran); background: var(--texte); padding: 8px 14px; border-radius: var(--radius-s); font-weight: 600;
}
.top-nav .nav-cta:hover { color: var(--ecran); background: var(--fort); }

/* ── Pied de page ── */
.foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 28px 40px; border-top: 1px solid var(--trait);
  font-size: 13px; color: var(--gris);
}

/* ── Typographie ── */
h1, .h1 {
  font-family: var(--titre); font-weight: 600;
  font-size: clamp(36px, 5vw, 58px); line-height: 1.04; letter-spacing: -.035em;
  margin-bottom: 18px;
}
h2 { font-family: var(--titre); font-weight: 600; font-size: 22px; letter-spacing: -.02em; line-height: 1.25; margin-bottom: 12px; }
.lead { color: var(--texte-2); font-size: 17px; max-width: 560px; }
.muted { color: var(--gris); }
.small { font-size: 13px; }

/* Petite ligne de contexte au-dessus d'un titre, avec le trait du canal */
.kicker { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--gris); margin-bottom: 14px; }
.kicker::before { content: ''; width: 24px; height: 3px; border-radius: 2px; background: var(--chan, var(--r)); }

/* Canaux */
.ch-r { --chan: var(--r); }
.ch-v { --chan: var(--v); }
.ch-b { --chan: var(--b); }
.ch-n { --chan: var(--trait-fort); }
.ch-w { --chan: var(--chan-w); }

/* ── Boutons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 20px; border-radius: 10px; border: 1px solid var(--trait);
  background: transparent; color: var(--texte);
  font-family: var(--corps); font-size: 15px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: background .2s, border-color .2s, color .2s;
}
.btn:hover { border-color: var(--trait-fort); background: var(--panneau); }
.btn-primary { background: var(--texte); color: var(--ecran); border-color: var(--texte); }
.btn-primary:hover { background: var(--fort); border-color: var(--fort); color: var(--ecran); }
.btn-danger { color: var(--r); border-color: rgba(255, 95, 87, .35); }
.btn-danger:hover { background: rgba(255, 95, 87, .1); border-color: var(--r); }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: var(--radius-s); }
.btn .play { width: 0; height: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.btn-link {
  background: none; border: 0; padding: 0; color: var(--texte-2); cursor: pointer;
  font-family: var(--corps); font-size: 14px; text-decoration: underline; text-underline-offset: 4px;
}
.btn-link:hover { color: var(--texte); }

/* ── Parade RGB ── */
.scope {
  background: var(--panneau); border: 1px solid var(--trait); border-radius: 14px; padding: 16px 18px 18px;
}
.scope-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--gris); margin-bottom: 8px; }
.scope canvas { width: 100%; height: 280px; display: block; }

/* ── Accueil ── */
.hero {
  display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center;
  padding: 24px 0 72px; border-bottom: 1px solid var(--trait);
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 56px; }
.step { background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--radius); padding: 22px 22px 24px; }
.step .n {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px;
  font-family: var(--titre); font-weight: 600; font-size: 13px; color: var(--ecran); background: var(--chan); margin-bottom: 14px;
}
.step b { display: block; font-family: var(--titre); font-weight: 600; font-size: 17px; margin-bottom: 4px; }
.step p { color: var(--gris); font-size: 14px; }

/* ── Formulaires ── */
.auth-wrap { max-width: 520px; margin: 0 auto; }
.auth-wrap .lead { font-size: 16px; }
.form { display: flex; flex-direction: column; gap: 20px; margin-top: 32px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .field .label { font-size: 14px; font-weight: 500; color: var(--texte-2); }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=url], .field input[type=search], .field textarea, .field select {
  width: 100%; background: var(--panneau); border: 1px solid var(--trait); border-radius: 10px;
  color: var(--texte); font-family: var(--corps); font-size: 15px; padding: 12px 14px; outline: none;
  transition: border-color .2s, background .2s;
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
.field select {
  appearance: none; cursor: pointer; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--gris) 50%), linear-gradient(135deg, var(--gris) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.field select option { background: var(--panneau); }
.field input::placeholder, .field textarea::placeholder { color: var(--gris); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--b); background: var(--panneau-2); }
.field input[type=file] { color: var(--texte-2); font-family: var(--corps); font-size: 14px; }
.field input[type=file]::file-selector-button {
  margin-right: 12px; padding: 8px 12px; border-radius: var(--radius-s); border: 1px solid var(--trait);
  background: var(--panneau-2); color: var(--texte); font-family: var(--corps); font-weight: 600; cursor: pointer;
}
.field .hint { font-size: 13px; color: var(--gris); }

/* Choix étudiant / professionnel */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; cursor: pointer;
  border: 1px solid var(--trait); border-radius: var(--radius); background: var(--panneau);
  font-size: 14px; font-weight: 400; color: var(--gris); transition: border-color .2s, background .2s;
}
.choice label strong { font-family: var(--titre); font-weight: 600; font-size: 17px; color: var(--texte); display: flex; align-items: center; gap: 10px; }
.choice label strong::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--chan); }
.choice input:checked + label { border-color: var(--chan); background: var(--panneau-2); box-shadow: inset 0 0 0 1px var(--chan); }
.choice input:focus-visible + label { outline: 2px solid var(--b); outline-offset: 2px; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--texte-2); line-height: 1.55; font-weight: 400; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--b); flex-shrink: 0; }

.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }

/* ── Messages ── */
.flash {
  margin-bottom: 28px; padding: 14px 16px; border-radius: 10px; font-size: 14px;
  background: rgba(61, 220, 132, .08); border: 1px solid rgba(61, 220, 132, .25); color: #B8F0CF;
}
.flash-error, .errors {
  background: rgba(255, 95, 87, .08); border: 1px solid rgba(255, 95, 87, .3); color: #FFC4C0;
}
.errors { padding: 12px 16px; border-radius: 10px; font-size: 14px; }
.errors li { list-style: none; }
.errors li + li { margin-top: 4px; }

/* ── Espace membre ── */
.space-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap;
  margin-bottom: 36px;
}
.space-head h1 { margin-bottom: 6px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  background: rgba(76, 141, 255, .14); color: var(--b);
}
.badge-student { background: rgba(61, 220, 132, .13); color: var(--v); }
.badge-pro { background: rgba(76, 141, 255, .15); color: var(--b); }
.badge-muted { background: var(--panneau-2); color: var(--texte-2); }
.badge-off { background: rgba(255, 95, 87, .13); color: var(--r); }
.badge-new { background: var(--texte); color: var(--ecran); }

/* Ressource mise en avant */
.feature {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 0; margin-bottom: 48px;
  background: var(--panneau); border: 1px solid var(--trait); border-radius: 16px; overflow: hidden;
}
.feature-media { position: relative; min-height: 340px; background: #000; }
.feature-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature-media canvas { position: absolute; inset: 18px; width: calc(100% - 36px); height: calc(100% - 36px); }
.feature-body { padding: 36px 36px 34px; display: flex; flex-direction: column; justify-content: center; border-left: 3px solid var(--chan); }
.feature-body h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; letter-spacing: -.03em; margin-bottom: 12px; }
.feature-body p { color: var(--texte-2); margin-bottom: 24px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.list-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.list-bar h2 { margin: 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; background: var(--panneau); border: 1px solid var(--trait); padding: 4px; border-radius: 10px; }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 7px;
  font-size: 14px; color: var(--gris); text-decoration: none;
}
.tabs a:hover { color: var(--texte); }
.tabs a.is-active { background: var(--trait); color: var(--texte); }
.tabs a i { width: 8px; height: 8px; border-radius: 2px; background: var(--chan); }

.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.res-card {
  display: flex; flex-direction: column; background: var(--panneau); border: 1px solid var(--trait);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; transition: border-color .2s, transform .2s;
}
.res-card:hover { border-color: var(--trait-fort); }
.res-thumb { position: relative; aspect-ratio: 16 / 9; background: #000; border-bottom: 3px solid var(--chan); }
.res-thumb img { width: 100%; height: 100%; object-fit: cover; }
.res-thumb .tag { position: absolute; left: 8px; top: 8px; }
.res-thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .75); font-size: 12px; font-weight: 500; padding: 2px 7px; border-radius: 5px; }
.res-thumb.is-file, .res-thumb.is-link, .res-thumb.is-empty {
  display: flex; flex-direction: column; justify-content: flex-end; padding: 16px;
  background: linear-gradient(180deg, var(--panneau-2), var(--panneau));
}
.res-thumb .ext { font-family: var(--titre); font-weight: 700; font-size: 28px; letter-spacing: -.02em; line-height: 1; }
.res-thumb .size { font-size: 13px; color: var(--gris); margin-top: 4px; }
.res-thumb.is-empty .ext { color: var(--trait-fort); }
.res-body { padding: 14px 16px 18px; }
.res-card h3 { font-family: var(--corps); font-weight: 600; font-size: 15px; line-height: 1.4; margin-bottom: 4px; color: var(--texte); }
.res-card .res-meta { font-size: 13px; color: var(--gris); }

.empty {
  border: 1px dashed var(--trait-fort); border-radius: var(--radius); padding: 56px 32px; text-align: center; color: var(--texte-2);
}
.empty h2 { margin-bottom: 6px; }

/* ── Page ressource ── */
.back { font-size: 14px; color: var(--gris); text-decoration: none; display: inline-flex; gap: 8px; margin-bottom: 28px; }
.back:hover { color: var(--texte); }
.player {
  position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--trait);
  border-radius: 14px; overflow: hidden; margin: 28px 0;
}
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.res-text { color: var(--texte-2); max-width: 720px; font-size: 16px; line-height: 1.75; white-space: pre-line; }
.res-actions { display: flex; gap: 12px; margin: 28px 0; flex-wrap: wrap; }
.file-box {
  display: flex; align-items: center; gap: 18px; padding: 18px 20px; margin-top: 28px; max-width: 720px;
  background: var(--panneau); border: 1px solid var(--trait); border-left: 3px solid var(--chan); border-radius: var(--radius);
}
.file-box .ext { font-family: var(--titre); font-weight: 700; font-size: 22px; min-width: 64px; }
.file-box .name { flex: 1; min-width: 0; }
.file-box .name b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.file-box .name span { font-size: 13px; color: var(--gris); }

/* ── Administration ── */
.admin-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-bar form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.admin-bar .field { min-width: 220px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 36px; }
.stats > div { background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--radius); padding: 18px 20px; border-top: 3px solid var(--chan, var(--trait-fort)); }
.stats .n { font-family: var(--titre); font-weight: 600; font-size: 34px; letter-spacing: -.03em; line-height: 1.1; }
.stats .l { font-size: 14px; color: var(--gris); margin-top: 2px; }

.table-wrap { overflow-x: auto; background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 13px; color: var(--gris); padding: 13px 16px; border-bottom: 1px solid var(--trait); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--trait); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panneau-2); }
td a { text-decoration: none; }
td a:hover { color: var(--b); }
td .name { font-weight: 600; }
.actions-cell { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--chan); margin-right: 8px; vertical-align: 1px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.panel { background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--radius); padding: 24px; }
.panel + .panel { margin-top: 24px; }
.two-col > .panel + .panel { margin-top: 0; }
.panel h2 { font-size: 19px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--gris); }

.check-list { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; border: 1px solid var(--trait); border-radius: 10px; background: var(--ecran); }
.check-list label {
  display: flex; gap: 12px; align-items: center; padding: 11px 14px; cursor: pointer;
  border-bottom: 1px solid var(--trait); font-size: 14px; font-weight: 400; color: var(--texte);
}
.check-list label:last-child { border-bottom: 0; }
.check-list label:hover { background: var(--panneau-2); }
.check-list input { accent-color: var(--b); width: 15px; height: 15px; }
.check-list .sub { margin-left: auto; font-size: 13px; color: var(--gris); white-space: nowrap; }
.list-tools { display: flex; gap: 16px; margin: 8px 0; flex-wrap: wrap; align-items: center; }

.type-tabs { display: inline-flex; gap: 4px; background: var(--ecran); border: 1px solid var(--trait); padding: 4px; border-radius: 10px; width: fit-content; }
.type-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.type-tabs label { padding: 8px 16px; border-radius: 7px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--gris); transition: background .2s, color .2s; }
.type-tabs input:checked + label { background: var(--trait-fort); color: var(--texte); }
.type-tabs input:focus-visible + label { outline: 2px solid var(--b); }

/* ── Mobile ── */
@media (max-width: 900px) {
  main { padding: 32px 20px 72px; }
  .top { padding: 14px 20px; }
  .top-nav { gap: 16px; }
  .foot { padding: 24px 20px; }
  .hero, .feature, .two-col { grid-template-columns: 1fr; }
  .hero { gap: 32px; padding-bottom: 48px; }
  .scope canvas { height: 200px; }
  .feature-media { min-height: 0; aspect-ratio: 16 / 9; }
  .feature-body { padding: 24px; border-left: 0; border-top: 3px solid var(--chan); }
  .steps { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
}
@media (max-width: 520px) {
  .choice, .choice-3 { grid-template-columns: 1fr; }
  .top-nav a:not(.nav-user):not(.nav-cta) { font-size: 13px; }
  .res-grid { grid-template-columns: 1fr; }
  .res-thumb.is-file, .res-thumb.is-link { aspect-ratio: auto; height: 92px; padding-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ─────────── Outils interactifs ─────────── */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; margin-bottom: 24px; }
.viz { background: var(--panneau); border: 1px solid var(--trait); border-radius: 14px; padding: 16px; }
.viz-canvas { position: relative; }
.viz-canvas canvas { display: block; width: 100%; cursor: crosshair; touch-action: none; }
.viz-note { font-size: 13px; color: var(--gris); margin-top: 10px; }
.readout {
  position: absolute; left: 56px; top: 12px; max-width: 70%;
  display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 9px;
  background: rgba(8, 9, 11, .88); border: 1px solid var(--trait-fort); font-size: 13px; color: var(--texte-2); pointer-events: none;
}
.readout b { color: var(--texte); font-weight: 600; font-variant-numeric: tabular-nums; }
.readout .warn { color: var(--r); }

.ctrl { background: var(--panneau); border: 1px solid var(--trait); border-radius: 14px; padding: 20px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.ctrl h2 { font-size: 17px; margin-bottom: 12px; }
.ctrl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ctrl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ctrl .field select { padding: 10px 34px 10px 12px; font-size: 14px; }
.ctrl-sep { height: 1px; background: var(--trait); margin: 18px 0; }
.ctrl-sub { font-family: var(--corps); font-size: 13px; font-weight: 500; color: var(--gris); margin: 16px 0 6px; }
.cam-info { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--ecran); border: 1px solid var(--trait); font-size: 14px; color: var(--texte-2); display: flex; flex-direction: column; gap: 6px; }
.cam-info b { color: var(--texte); }
.cam-info a { color: var(--b); font-weight: 500; }

.space-list { list-style: none; }
.space-list label { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--texte); }
.space-list label:hover { background: var(--panneau-2); }
.space-list input { accent-color: var(--b); width: 15px; height: 15px; flex-shrink: 0; }
.space-list .nm { flex: 1; min-width: 0; }
.tag { font-size: 12px; color: var(--gris); border: 1px solid var(--trait); border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.sw { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--c); border-radius: 2px; flex-shrink: 0; vertical-align: middle; margin-right: 2px; }
.sw[data-dash="dash"] { border-top-style: dashed; }
.sw[data-dash="dot"] { border-top-style: dotted; }
.data-table td .sw { margin-right: 10px; }

.switch { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 14px; cursor: pointer; flex-wrap: wrap; }
.switch small { color: var(--gris); font-size: 12px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .knob { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--trait-fort); transition: background .2s; flex-shrink: 0; }
.switch .knob::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--texte-2); transition: transform .2s, background .2s; }
.switch input:checked + .knob { background: var(--b); }
.switch input:checked + .knob::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .knob { outline: 2px solid var(--b); outline-offset: 2px; }

.cct { margin: 6px 0 4px 48px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--gris); }
.cct input[type=range] { width: 100%; accent-color: var(--b); }
.cct output { color: var(--texte); font-variant-numeric: tabular-nums; }

.table-panel h2 { margin-bottom: 4px; }
.table-panel .table-wrap { margin-top: 14px; background: var(--ecran); }
.data-table td { font-variant-numeric: tabular-nums; white-space: nowrap; }

.seg { display: inline-flex; gap: 4px; background: var(--ecran); border: 1px solid var(--trait); padding: 4px; border-radius: 10px; flex-wrap: wrap; }
.seg button {
  font-family: var(--corps); font-size: 14px; font-weight: 500; color: var(--gris); background: none; border: 0;
  padding: 7px 13px; border-radius: 7px; cursor: pointer; text-align: left; line-height: 1.3;
}
.seg button small { display: block; font-weight: 400; font-size: 12px; color: var(--gris); }
.seg button.is-on { background: var(--trait-fort); color: var(--texte); }
.seg-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; font-size: 14px; color: var(--gris); }
.curve-info { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.curve-card { background: var(--ecran); border: 1px solid var(--trait); border-left: 3px solid var(--c); border-radius: 10px; padding: 14px 16px; font-size: 14px; }
.curve-card h3 { font-family: var(--titre); font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.curve-card p { color: var(--texte-2); margin-bottom: 8px; }
.curve-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 13px; }
.curve-card dt { color: var(--gris); }
.curve-card dd { font-variant-numeric: tabular-nums; }
.tool-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 48px; }
.tool-card { display: block; text-decoration: none; background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--radius); padding: 20px; transition: border-color .2s; }
.tool-card:hover { border-color: var(--trait-fort); }
.tool-card b { display: block; font-family: var(--titre); font-weight: 600; font-size: 17px; margin: 10px 0 4px; }
.tool-card span { color: var(--gris); font-size: 14px; }

@media (max-width: 1000px) {
  .tool-grid { grid-template-columns: 1fr; }
  .ctrl { position: static; max-height: none; }
}
@media (max-width: 520px) {
  .viz { padding: 8px; }
  .readout { left: 8px; top: 8px; max-width: calc(100% - 16px); }
}

/* LUT Cube Analyzer */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; cursor: pointer;
  padding: 26px 20px; border: 1.5px dashed var(--trait-fort); border-radius: 14px; background: var(--panneau);
  transition: border-color .2s, background .2s;
}
.drop b { font-family: var(--titre); font-weight: 600; font-size: 17px; }
.drop span { color: var(--gris); font-size: 14px; }
.drop:hover, .drop.is-over { border-color: var(--b); background: var(--panneau-2); }
.drop:focus-within { outline: 2px solid var(--b); outline-offset: 2px; }
#lut-error { margin-top: 12px; }
.kv-tight { grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 14px; }
.kv-tight dd { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.views { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.views button {
  aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--trait); background: var(--ecran); color: var(--texte);
  font-family: var(--titre); font-weight: 600; font-size: 13px; cursor: pointer; box-shadow: inset 0 -3px 0 var(--c);
}
.views button:hover { border-color: var(--trait-fort); background: var(--panneau-2); }

/* Profil */
img.avatar { object-fit: cover; padding: 0; }
.avatar-xl {
  width: 88px; height: 88px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
  display: grid; place-items: center; background: var(--panneau-2); border: 1px solid var(--trait-fort);
  font-family: var(--titre); font-weight: 600; font-size: 34px; color: var(--texte-2);
}
.profile-head { display: flex; align-items: center; gap: 22px; margin-bottom: 36px; }
.profile-head h1 { margin-bottom: 4px; }
.form-sub { font-family: var(--titre); font-weight: 600; font-size: 15px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--trait); }
.photo-row { display: flex; align-items: center; gap: 18px; margin-top: 14px; }
.photo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.photo-actions label.btn { cursor: pointer; }
.photo-form .form-foot:has(button[hidden]) { display: none; }
td .member { display: flex; align-items: center; gap: 12px; }
td .member .avatar { width: 36px; height: 36px; border-radius: 50%; }
td .member > span:not(.avatar) { display: flex; flex-direction: column; line-height: 1.35; }
td .member small { color: var(--gris); font-size: 13px; }
.profile-nudge {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 28px; border-radius: var(--radius);
  background: var(--panneau); border: 1px solid var(--trait); border-left: 3px solid var(--b); font-size: 14px; color: var(--texte-2);
}
@media (max-width: 520px) { .profile-head { flex-direction: column; align-items: flex-start; gap: 14px; } }

/* Menus déroulants de l'en-tête */
.menu { position: relative; }
.menu summary {
  list-style: none; cursor: pointer; font-size: 14px; color: var(--gris); display: inline-flex; align-items: center; gap: 6px;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.menu summary:hover, .menu summary.is-on, .menu[open] summary { color: var(--texte); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 50; min-width: 220px;
  display: flex; flex-direction: column; padding: 6px; border-radius: 12px;
  background: var(--panneau); border: 1px solid var(--trait-fort); box-shadow: 0 18px 40px var(--ombre);
}
.top-nav .menu-pop a { padding: 9px 12px; border-radius: 8px; color: var(--texte-2); }
.top-nav .menu-pop a:hover, .top-nav .menu-pop a.is-on { background: var(--panneau-2); color: var(--texte); }

/* Forum */
.forum-search .field { min-width: 280px; }
.forum-block { margin-bottom: 40px; }
.forum-block > h2 { margin-bottom: 14px; }
.cat-list, .topic-list { background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--radius); overflow: hidden; }
.cat-row, .topic-row {
  display: grid; align-items: center; gap: 20px; padding: 16px 20px; text-decoration: none;
  border-bottom: 1px solid var(--trait); border-left: 3px solid var(--chan); transition: background .2s;
}
.cat-row { grid-template-columns: minmax(0, 1fr) 110px minmax(0, 260px); }
.topic-row { grid-template-columns: minmax(0, 1fr) 110px 170px; }
.cat-row:last-child, .topic-row:last-child { border-bottom: 0; }
.cat-row:hover, .topic-row:hover { background: var(--panneau-2); }
.c-main, .t-main, .c-last, .t-last, .t-num { display: flex; flex-direction: column; min-width: 0; }
.c-main b, .t-main b { font-weight: 600; font-size: 15px; color: var(--texte); }
.c-main small, .t-main small, .c-last small, .t-last small, .t-num small { font-size: 13px; color: var(--gris); }
.c-num, .t-num { font-size: 13px; color: var(--gris); line-height: 1.5; }
.c-num b { color: var(--texte); font-weight: 600; }
.c-last b { font-weight: 500; font-size: 14px; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-last { font-size: 14px; color: var(--texte-2); }
.t-main .badge { vertical-align: 1px; margin-right: 4px; font-size: 11px; padding: 2px 7px; }

.pager { display: flex; gap: 6px; margin: 20px 0; flex-wrap: wrap; }
.pager a { min-width: 36px; padding: 7px 10px; text-align: center; border-radius: 8px; border: 1px solid var(--trait); text-decoration: none; font-size: 14px; color: var(--gris); }
.pager a.is-active { background: var(--trait-fort); color: var(--texte); }

.topic-title { font-size: clamp(28px, 3.6vw, 42px); }
.mod-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mod-bar .move select { padding: 8px 32px 8px 10px; font-size: 13px; }
.posts { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.post { background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--radius); padding: 18px 22px 16px; scroll-margin-top: 16px; }
.post.is-first { border-left: 3px solid var(--b); }
.post.is-staff { border-color: rgba(76, 141, 255, .35); }
.post:target { box-shadow: 0 0 0 2px var(--b); }
.post-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.author { display: flex; align-items: center; gap: 12px; }
.author .avatar { width: 40px; height: 40px; border-radius: 50%; }
.author b { font-weight: 600; }
.author small { display: block; color: var(--gris); font-size: 13px; }
.author .badge { font-size: 11px; padding: 2px 7px; margin-left: 4px; }
.post-time { font-size: 13px; color: var(--gris); text-decoration: none; white-space: nowrap; }
.post-time:hover { color: var(--texte); }
.post-body { color: var(--texte); font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.post-body p + p { margin-top: 10px; }
.post-body a { color: var(--b); }
.post-image { display: block; margin-top: 14px; max-width: 720px; }
.post-image img { border-radius: 10px; border: 1px solid var(--trait); max-height: 520px; width: auto; }
.post-tools { display: flex; gap: 18px; align-items: flex-start; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--trait); font-size: 13px; }
.post-tools details { flex: 1; }
.post-tools summary { cursor: pointer; color: var(--gris); width: fit-content; }
.post-tools summary:hover { color: var(--texte); }
.post-tools .form { margin-top: 12px; gap: 12px; }
.btn-link.danger { color: var(--r); font-size: 13px; }
.reply-box h2 { font-size: 19px; }
.reply-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

.forum-recent { margin-top: 48px; }
.forum-recent .list-bar a { font-size: 14px; color: var(--b); }

@media (max-width: 760px) {
  .cat-row, .topic-row { grid-template-columns: 1fr; gap: 6px; }
  .c-num { display: none; }
  .t-num { flex-direction: row; gap: 10px; }
  .c-last, .t-last { flex-direction: row; gap: 8px; flex-wrap: wrap; }
  .forum-search .field { min-width: 0; width: 100%; }
  .forum-search { width: 100%; }
  .post { padding: 14px 16px; }
  .post-head { flex-direction: column; gap: 6px; }
}
.forum-actions { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.smtp-log { margin-top: 14px; padding: 14px 16px; border-radius: 10px; background: var(--ecran); border: 1px solid var(--trait); font-size: 12.5px; line-height: 1.6; color: var(--texte-2); white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ─────────── Abonnement ─────────── */
.sub-wrap { max-width: 920px; }
.sub-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; margin-top: 32px; align-items: start; }
.sub-card { background: var(--panneau); border: 1px solid var(--trait); border-radius: 16px; padding: 28px; }
.sub-pay { border-top: 3px solid var(--r); position: relative; overflow: hidden; }
.sub-pay::before {
  content: ''; position: absolute; inset: -40% -20% auto auto; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 95, 87, .16), transparent 70%); pointer-events: none;
}
.sub-price { display: flex; align-items: baseline; gap: 8px; font-family: var(--titre); }
.sub-price span { font-size: 64px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.sub-price small { font-size: 18px; color: var(--gris); font-weight: 600; }
.sub-why { color: var(--texte-2); margin: 14px 0 16px; }
.sub-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; font-size: 14px; }
.sub-list li { display: flex; gap: 10px; align-items: baseline; }
.sub-list li::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--v); flex-shrink: 0; transform: translateY(-1px); }
.btn-paypal { width: 100%; padding: 15px 20px; font-size: 16px; margin-bottom: 12px; }
.sub-code h2 { font-size: 18px; margin-bottom: 4px; }
.code-field input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }
#code, .code-input input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }
.code-input { display: flex; gap: 8px; }
.code-input input { flex: 1; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.code-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; letter-spacing: .05em; cursor: copy;
  background: var(--ecran); color: var(--texte); border: 1px dashed var(--trait-fort); border-radius: 7px; padding: 5px 9px; margin-right: 6px;
}
.code-chip:hover { border-color: var(--b); color: var(--fort); }
.code-chip.is-copied { border-style: solid; border-color: var(--v); color: var(--v); }
tr.is-off td { opacity: .55; }
details.used summary { cursor: pointer; color: var(--b); }
details.used ul { list-style: none; margin-top: 6px; font-size: 13px; }
.pay-list { list-style: none; margin: 12px 0 4px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.access-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--trait); }
.until-form { display: flex; gap: 8px; align-items: center; }
.until-form input { padding: 7px 10px; font-size: 13px; }
@media (max-width: 860px) { .sub-grid, .form-row-3 { grid-template-columns: 1fr; } .sub-price span { font-size: 52px; } }

/* ─────────── Finition : reflets et survols ─────────── */
/* Reflet qui suit le pointeur (position donnée par assets/fx.js) */
.res-card, .tool-card, .cat-row, .topic-row, .step, .feature, .sub-card, .panel, .post, .stats > div, .scope {
  background-repeat: no-repeat;
  transition: border-color .25s ease, box-shadow .3s ease, transform .3s cubic-bezier(.2, .7, .2, 1), background-color .25s ease;
}
.is-lit:not(.btn) {
  background-image: radial-gradient(460px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .055), transparent 42%);
}
/* Les cartes cliquables se soulèvent et prennent la couleur de leur canal */
.res-card:hover, .tool-card:hover, .step:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--chan, var(--b)) 45%, var(--trait));
  box-shadow: 0 14px 34px var(--ombre), 0 0 0 1px color-mix(in srgb, var(--chan, var(--b)) 18%, transparent);
}
.cat-row:hover, .topic-row:hover { box-shadow: inset 3px 0 0 var(--chan), inset 0 0 0 1px color-mix(in srgb, var(--chan, var(--b)) 14%, transparent); }
.res-thumb { overflow: hidden; }
.res-thumb img, .feature-media img { transition: transform .6s cubic-bezier(.2, .7, .2, 1), filter .4s ease; }
.res-card:hover .res-thumb img, .feature:hover .feature-media img { transform: scale(1.045); filter: brightness(1.08) saturate(1.06); }
.res-card:hover h3 { color: var(--fort); }
.tool-card:hover .rgb i { animation: rgb-wave .9s ease-in-out; }
.tool-card:hover .rgb i:nth-child(2) { animation-delay: .08s; }
.tool-card:hover .rgb i:nth-child(3) { animation-delay: .16s; }

/* Boutons : un éclat traverse le bouton au survol */
.btn { position: relative; overflow: hidden; isolation: isolate; transition: background .2s, border-color .2s, color .2s, transform .15s ease, box-shadow .25s ease; }
.btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .16) 48%, rgba(255, 255, 255, .03) 56%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}
.btn:hover::after { transform: translateX(120%); }
.btn-primary::after { background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .9) 48%, rgba(255, 255, 255, .2) 56%, transparent 70%); }
.btn:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.btn-primary:hover { box-shadow: 0 6px 22px rgba(230, 233, 238, .14), 0 0 0 1px rgba(255, 255, 255, .5); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-paypal:hover { box-shadow: 0 8px 26px rgba(255, 95, 87, .18), 0 0 0 1px rgba(255, 255, 255, .5); }

/* Liens du texte : soulignement qui se dessine */
.post-body a, .res-text a, .lead a, .muted a, .kv a, .cam-info a, .sub-wrap a:not(.btn), .flash a, .empty a:not(.btn), .auth-wrap p a, td a:not(.btn):not(.member), .forum-recent .list-bar a, .back {
  text-decoration: none;
  background-image: linear-gradient(90deg, var(--r), var(--v), var(--b));
  background-size: 0 1.5px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size .35s cubic-bezier(.2, .7, .2, 1), color .2s;
  padding-bottom: 1px;
}
.post-body a:hover, .res-text a:hover, .lead a:hover, .muted a:hover, .kv a:hover, .cam-info a:hover, .sub-wrap a:not(.btn):hover,
.flash a:hover, .empty a:not(.btn):hover, .auth-wrap p a:hover, td a:not(.btn):not(.member):hover, .forum-recent .list-bar a:hover, .back:hover {
  background-size: 100% 1.5px; color: var(--fort);
}
.post-body a, .kv a, .cam-info a { background-size: 100% 1px; background-image: linear-gradient(90deg, rgba(76, 141, 255, .5), rgba(76, 141, 255, .5)); }
.post-body a:hover, .kv a:hover, .cam-info a:hover { background-image: linear-gradient(90deg, var(--r), var(--v), var(--b)); background-size: 100% 1.5px; }
.back span { display: inline-block; transition: transform .25s ease; }
.back:hover span { transform: translateX(-4px); }

/* Navigation : trait RVB sous le lien survolé ou actif */
.top-nav > a:not(.nav-cta):not(.nav-user), .menu summary { position: relative; }
.top-nav > a:not(.nav-cta):not(.nav-user)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--r), var(--v), var(--b));
  transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.top-nav > a:not(.nav-cta):not(.nav-user):hover::after, .top-nav > a.is-on::after { transform: scaleX(1); }
.top-nav .nav-user .avatar { transition: box-shadow .25s ease; }
.top-nav .nav-user:hover .avatar { box-shadow: 0 0 0 2px var(--ecran), 0 0 0 3px var(--b); }
.menu-pop { animation: pop-in .18s ease-out; transform-origin: top right; }
.top-nav .menu-pop a { transition: background .15s, color .15s, padding-left .2s; }
.top-nav .menu-pop a:hover { padding-left: 16px; }

/* Logo : les trois canaux ondulent au survol */
.brand .rgb i { transition: transform .3s; transform-origin: bottom; }
.brand:hover .rgb i { animation: rgb-wave .9s ease-in-out; }
.brand:hover .rgb i:nth-child(2) { animation-delay: .08s; }
.brand:hover .rgb i:nth-child(3) { animation-delay: .16s; }
@keyframes rgb-wave { 0%, 100% { transform: scaleY(1); } 35% { transform: scaleY(.45); } 70% { transform: scaleY(1.12); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* Onglets, filtres et commandes */
.tabs a, .seg button, .type-tabs label, .pager a, .views button { transition: background .2s, color .2s, box-shadow .2s; }
.tabs a:hover, .seg button:hover, .pager a:hover { background: var(--panneau-2); color: var(--texte); }
.tabs a.is-active { box-shadow: inset 0 -2px 0 var(--chan, var(--texte)); }
.views button:hover { transform: translateY(-1px); box-shadow: inset 0 -3px 0 var(--c), 0 6px 14px rgba(0, 0, 0, .35); }
.field input:focus, .field textarea:focus, .field select:focus { box-shadow: 0 0 0 3px rgba(76, 141, 255, .18); }
.choice label { transition: border-color .2s, background .2s, transform .2s, box-shadow .2s; }
.choice label:hover { transform: translateY(-1px); border-color: var(--trait-fort); }
.switch:hover .knob { box-shadow: 0 0 0 4px rgba(76, 141, 255, .12); }
.space-list label, .check-list label { transition: background .15s; }
.code-chip { transition: border-color .2s, color .2s, background .2s; }

@media (prefers-reduced-motion: reduce) {
  .res-card:hover, .tool-card:hover, .step:hover, .views button:hover, .choice label:hover { transform: none; }
  .btn::after { display: none; }
  .brand:hover .rgb i, .tool-card:hover .rgb i { animation: none; }
  .res-card:hover .res-thumb img, .feature:hover .feature-media img { transform: none; }
}
:root { color-scheme: dark; }
.field input[type=date], .until-form input[type=date] {
  width: 100%; background: var(--panneau); border: 1px solid var(--trait); border-radius: 10px;
  color: var(--texte); font-family: var(--corps); font-size: 15px; padding: 11px 14px; outline: none;
}
.until-form input[type=date] { width: auto; padding: 7px 10px; font-size: 13px; }
.field input[type=date]:focus { border-color: var(--b); box-shadow: 0 0 0 3px rgba(76, 141, 255, .18); }

/* ─────────── Annuaire des membres ─────────── */
.tab-n { font-size: 12px; color: var(--gris); margin-left: 2px; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.member-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--panneau); border: 1px solid var(--trait); border-top: 3px solid var(--chan); border-radius: var(--radius); padding: 20px;
  background-repeat: no-repeat; transition: border-color .25s ease, box-shadow .3s ease, transform .3s cubic-bezier(.2, .7, .2, 1);
}
.member-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--chan) 45%, var(--trait)); border-top-color: var(--chan);
  box-shadow: 0 14px 34px var(--ombre), 0 0 0 1px color-mix(in srgb, var(--chan) 18%, transparent);
}
.member-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.member-card .btn, .member-card a:not(.member-link) { position: relative; z-index: 2; }
.member-top { display: flex; align-items: center; gap: 14px; }
.avatar-lg {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
  display: grid; place-items: center; background: var(--panneau-2); border: 1px solid var(--trait-fort);
  font-family: var(--titre); font-weight: 600; font-size: 21px; color: var(--texte-2);
}
.member-id { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.member-id h3 { font-family: var(--titre); font-weight: 600; font-size: 16px; letter-spacing: -.01em; line-height: 1.25; }
.member-id .badge { font-size: 11px; padding: 2px 7px; }
.member-sum { font-size: 14px; color: var(--texte); line-height: 1.45; }
.member-city { font-size: 13px; color: var(--gris); margin-top: -6px; }
.member-bio { font-size: 13.5px; color: var(--texte-2); line-height: 1.55; }
.member-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--trait); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.member-card:hover .avatar-lg { box-shadow: 0 0 0 2px var(--panneau), 0 0 0 3px var(--chan); }
.avatar-lg { transition: box-shadow .25s ease; }

.profile-card {
  margin-top: 20px; padding: 26px 28px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  background: var(--panneau); border: 1px solid var(--trait); border-left: 3px solid var(--chan); border-radius: var(--radius);
}
.profile-name { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 8px; }
.profile-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--texte-2); }
.profile-actions { display: flex; gap: 10px; }
.stats-mini { grid-template-columns: repeat(2, 1fr); margin: 12px 0 0; }
.stats-mini .n { font-size: 26px; }
.topic-row-sm { grid-template-columns: 1fr; padding: 12px 16px; }

/* ─────────── Messagerie ─────────── */
.nav-msg { display: inline-flex; align-items: center; gap: 7px; }
.nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--r); color: #fff;
  font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; line-height: 1;
  box-shadow: 0 0 10px rgba(255, 95, 87, .45);
}
.dm-head { margin-bottom: 24px; }
.dm-wrap {
  display: grid; grid-template-columns: 330px minmax(0, 1fr); height: min(72vh, 760px); min-height: 460px;
  background: var(--panneau); border: 1px solid var(--trait); border-radius: 16px; overflow: hidden;
}
.dm-list { border-right: 1px solid var(--trait); overflow-y: auto; background: var(--ecran); }
.dm-item {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 14px 16px; text-decoration: none; border-bottom: 1px solid var(--trait); border-left: 3px solid transparent;
  transition: background .15s, border-color .2s;
}
.dm-item .avatar { width: 40px; height: 40px; border-radius: 50%; }
.dm-item:hover { background: var(--panneau); }
.dm-item.is-active { background: var(--panneau-2); border-left-color: var(--chan); }
.dm-item-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dm-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.dm-item-top b { font-weight: 500; font-size: 14.5px; color: var(--texte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-item-top time { font-size: 12px; color: var(--gris); white-space: nowrap; }
.dm-item-prev { font-size: 13px; color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-item.is-unread b { font-weight: 700; color: var(--fort); }
.dm-item.is-unread .dm-item-prev { color: var(--texte-2); }
.dm-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--b); color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }
.dm-none { padding: 26px 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.dm-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dm-placeholder { margin: auto; text-align: center; color: var(--gris); display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px; max-width: 320px; }
.dm-placeholder .rgb i { height: 28px; width: 5px; }
.dm-thread-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--trait); box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--chan) 25%, transparent); }
.dm-back { display: none; font-size: 20px; color: var(--texte-2); text-decoration: none; padding: 0 6px 0 0; }
.dm-who { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; flex: 1; }
.dm-who .avatar { width: 40px; height: 40px; border-radius: 50%; }
.dm-who b { font-weight: 600; }
.dm-who .badge { font-size: 11px; padding: 2px 7px; margin-left: 4px; }
.dm-who small { display: block; color: var(--gris); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-who:hover b { color: var(--fort); }
.dm-menu .menu-pop { min-width: 250px; }
.dm-menu .menu-pop a, .dm-menu .menu-pop button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--texte-2);
  background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none;
}
.dm-menu .menu-pop a:hover, .dm-menu .menu-pop button:hover { background: var(--panneau-2); color: var(--texte); }
.dm-report { border-top: 1px solid var(--trait); margin-top: 4px; padding-top: 6px; }
.dm-report input { width: calc(100% - 12px); margin: 4px 6px; padding: 8px 10px; border-radius: 8px; background: var(--ecran); border: 1px solid var(--trait); color: var(--texte); font: inherit; font-size: 13px; }
.dm-report button { color: var(--r) !important; }

.dm-messages { flex: 1; overflow-y: auto; padding: 22px 22px 10px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.dm-older { align-self: center; font-size: 13px; color: var(--b); margin-bottom: 6px; }
.dm-start { align-self: center; text-align: center; color: var(--gris); font-size: 14px; margin: auto; max-width: 340px; }
.dm-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: min(78%, 620px); animation: dm-in .22s ease-out; }
.dm-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.dm-bubble {
  padding: 10px 14px; border-radius: 16px 16px 16px 5px; background: var(--panneau-2); border: 1px solid var(--trait-fort);
  font-size: 14.5px; line-height: 1.55; color: var(--texte); overflow-wrap: anywhere;
}
.dm-bubble p + p { margin-top: 8px; }
.dm-bubble a { color: var(--b); }
.dm-msg.is-mine .dm-bubble { border-radius: 16px 16px 5px 16px; background: rgba(76, 141, 255, .16); border-color: rgba(76, 141, 255, .32); }
.dm-msg time { font-size: 11.5px; color: var(--gris); margin: 4px 6px 0; }
@keyframes dm-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.dm-compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; padding: 14px 20px 12px; border-top: 1px solid var(--trait); background: var(--panneau); }
.dm-compose textarea {
  width: 100%; resize: none; min-height: 46px; max-height: 200px; padding: 12px 14px; border-radius: 12px;
  background: var(--ecran); border: 1px solid var(--trait); color: var(--texte); font: inherit; font-size: 15px; line-height: 1.45; outline: none;
}
.dm-compose textarea:focus { border-color: var(--b); box-shadow: 0 0 0 3px rgba(76, 141, 255, .18); }
.dm-compose .btn { height: 46px; }
.dm-hint { grid-column: 1 / -1; margin-top: -2px; }
.dm-compose .errors { grid-column: 1 / -1; }
.dm-locked { padding: 18px 20px; border-top: 1px solid var(--trait); color: var(--gris); font-size: 14px; text-align: center; }

@media (max-width: 820px) {
  .dm-wrap { grid-template-columns: 1fr; height: calc(100vh - 220px); min-height: 420px; }
  .dm-wrap.is-open .dm-list { display: none; }
  .dm-wrap:not(.is-open) .dm-thread { display: none; }
  .dm-list { border-right: 0; }
  .dm-back { display: inline-block; }
  .dm-msg { max-width: 88%; }
  .dm-hint { display: none; }
  .profile-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { .dm-msg { animation: none; } .member-card:hover { transform: none; } }
.author-name { text-decoration: none; color: var(--texte); }
.author-name:hover b { color: var(--fort); box-shadow: 0 1.5px 0 var(--b); }
.author-av { display: block; border-radius: 50%; }
.author-av:hover .avatar { box-shadow: 0 0 0 2px var(--panneau), 0 0 0 3px var(--b); }
.dm-bubble, .dm-bubble p { color: var(--texte); }
.stats-mini .n, .stats-mini .l { display: block; }
.dm-who .avatar { flex-shrink: 0; }
.dm-who > span { min-width: 0; }
.dm-menu summary { letter-spacing: 2px; font-size: 13px; padding: 6px 8px; border-radius: 8px; }
.dm-menu summary::after { display: none; }
.dm-menu summary:hover, .dm-menu[open] summary { background: var(--panneau-2); }
.dm-menu .menu-pop { right: 0; left: auto; }
@media (max-width: 820px) {
  .dm-thread-head { padding: 12px 14px; gap: 8px; }
  .dm-who .badge { display: none; }
  .dm-messages { padding: 16px 14px 8px; }
  .dm-compose { padding: 12px 14px; }
  .dm-head .lead { display: none; }
}

/* Zone d'écriture des messages : grande, encadrée, barre d'actions intégrée */
.dm-compose { display: block; padding: 14px 20px 18px; }
.dm-box {
  background: var(--ecran); border: 1px solid var(--trait-fort); border-radius: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.dm-box:focus-within { border-color: var(--b); box-shadow: 0 0 0 3px rgba(76, 141, 255, .18); }
.dm-compose .dm-box textarea {
  display: block; width: 100%; min-height: 84px; max-height: 260px; resize: none;
  padding: 14px 16px 6px; border: 0; border-radius: 14px 14px 0 0; background: transparent; box-shadow: none;
  color: var(--texte); font: inherit; font-size: 15px; line-height: 1.55; outline: none;
}
.dm-compose .dm-box textarea:focus { box-shadow: none; border: 0; }
.dm-compose .dm-box textarea::placeholder { color: var(--gris); }
.dm-bar { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-top: 1px solid var(--trait); }
.dm-hint { flex: 1; margin: 0; font-size: 12.5px; color: var(--gris); }
.dm-hint kbd { font-family: var(--corps); font-size: 11.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--trait-fort); background: var(--panneau); color: var(--texte-2); }
.dm-chars { font-size: 12px; color: var(--gris); font-variant-numeric: tabular-nums; }
.dm-compose .dm-send { height: 40px; padding: 0 18px; gap: 8px; }
.dm-send span { font-weight: 700; }
.dm-compose .errors { margin-top: 10px; }

.dm-start {
  margin: auto; max-width: 380px; text-align: center; color: var(--gris); font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.dm-start .avatar-xl { width: 72px; height: 72px; font-size: 28px; margin-bottom: 6px; }
.dm-start b { color: var(--texte); font-family: var(--titre); font-weight: 600; font-size: 17px; }
.dm-start p { margin-top: 8px; line-height: 1.55; }
@media (max-width: 820px) {
  .dm-compose { padding: 10px 12px 12px; }
  .dm-hint { display: none; }
  .dm-bar { justify-content: flex-end; }
}
/* La conversation tient dans l'écran : la zone d'écriture reste visible sans défiler */
.page-dm main { padding-top: 32px; padding-bottom: 32px; }
.dm-head { margin-bottom: 18px; }
.dm-head h1 { font-size: clamp(30px, 3.4vw, 40px); }
.dm-head .lead { font-size: 15px; }
.dm-wrap { height: calc(100vh - 260px); height: calc(100dvh - 260px); min-height: 480px; max-height: 860px; }
@media (max-width: 820px) {
  .page-dm main { padding: 16px 12px 16px; }
  .page-dm main:has(.dm-wrap.is-open) .dm-head { display: none; }
  .dm-wrap { height: calc(100vh - 186px); height: calc(100dvh - 186px); min-height: 400px; }
}

/* ─────────── Notifications ─────────── */
.notif-menu summary { padding: 6px; margin: -6px; border-radius: 10px; position: relative; color: var(--texte-2); }
.notif-menu summary::after { display: none; }
.notif-menu summary:hover, .notif-menu[open] summary { background: var(--panneau); color: var(--texte); }
.notif-menu .bell { width: 21px; height: 21px; display: block; }
.notif-menu summary:hover .bell { animation: bell-ring .6s ease-in-out; transform-origin: 50% 10%; }
.notif-badge { position: absolute; top: -3px; right: -7px; box-shadow: 0 0 0 2px var(--ecran), 0 0 10px rgba(255, 95, 87, .45); }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 45% { transform: rotate(-11deg); } 70% { transform: rotate(6deg); } }
.notif-pop { width: min(380px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px; border-bottom: 1px solid var(--trait); }
.notif-head b { font-family: var(--titre); font-weight: 600; font-size: 15px; }
.notif-head .btn-link { font-size: 12.5px; color: var(--b); }
.notif-list { max-height: min(60vh, 440px); overflow-y: auto; }
.top-nav .notif-pop a { padding: 0; border-radius: 0; }
.top-nav .notif-pop a:hover { padding-left: 0; }
.notif-item, .notif-dm {
  display: grid !important; grid-template-columns: 34px minmax(0, 1fr) 10px; gap: 12px; align-items: start;
  padding: 12px 16px !important; text-decoration: none; color: var(--texte-2) !important; border-bottom: 1px solid var(--trait);
  font-size: 13.5px; line-height: 1.45; transition: background .15s;
}
.notif-item:hover, .notif-dm:hover { background: var(--panneau-2); }
.notif-item.is-unread { background: rgba(76, 141, 255, .06); }
.notif-item b, .notif-dm b { color: var(--texte); font-weight: 600; }
.notif-txt time { display: block; font-size: 12px; color: var(--gris); margin-top: 3px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--b); margin-top: 6px; box-shadow: 0 0 8px rgba(76, 141, 255, .6); }
.notif-dm { grid-template-columns: 34px 1fr; background: rgba(76, 141, 255, .08); }
.notif-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--chan) 14%, var(--panneau-2)); color: var(--chan); }
.notif-ic svg { width: 17px; height: 17px; }
.notif-empty { padding: 22px 16px; color: var(--gris); font-size: 13.5px; }
.notif-all { display: block !important; text-align: center; padding: 11px !important; font-size: 13px; color: var(--b) !important; text-decoration: none; }
.notif-all:hover { background: var(--panneau-2); }
.notif-page { background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--radius); overflow: hidden; }
.notif-page .notif-item { padding: 16px 20px !important; font-size: 14.5px; }
.notif-page .notif-item:last-child { border-bottom: 0; }
@media (max-width: 760px) { .notif-pop { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; } }

/* ─────────── Ressources : rubriques, image, j'aime, commentaires ─────────── */
.res-section { margin-bottom: 40px; }
.res-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.res-section-head h3 { font-family: var(--titre); font-weight: 600; font-size: 20px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.sec-bar { width: 4px; height: 20px; border-radius: 2px; background: var(--chan); box-shadow: 0 0 12px color-mix(in srgb, var(--chan) 50%, transparent); }
.res-section-head .btn-link { font-size: 14px; color: var(--b); }
.res-soc { display: inline-flex; gap: 10px; margin-left: 10px; color: var(--gris); }
.res-soc span { display: inline-flex; align-items: center; gap: 4px; }
.res-soc svg { width: 13px; height: 13px; }
.res-cover { margin: 8px 0 26px; border-radius: 16px; overflow: hidden; border: 1px solid var(--trait); max-width: 1100px; }
.res-cover img { width: 100%; max-height: 560px; object-fit: cover; }

.cover-field { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cover-preview { width: 192px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--panneau-2); border: 1px dashed var(--trait-fort); display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--gris); padding: 0; }
.cover-preview span { padding: 8px; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-actions { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }

.reactions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 30px 0 8px; padding: 14px 0; border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); }
.like-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  background: var(--panneau); border: 1px solid var(--trait-fort); color: var(--texte-2); font: inherit; font-size: 14px; font-weight: 500;
  transition: background .2s, border-color .2s, color .2s, transform .15s, box-shadow .25s;
}
.like-btn svg { width: 18px; height: 18px; transition: transform .25s cubic-bezier(.2, .7, .2, 1); }
.like-btn:hover { border-color: var(--b); color: var(--texte); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.like-btn:hover svg { transform: rotate(-12deg) scale(1.08); }
.like-btn:active { transform: scale(.96); }
.like-btn.is-on { background: rgba(76, 141, 255, .16); border-color: rgba(76, 141, 255, .55); color: var(--fort); }
.like-btn.is-on svg { fill: var(--b); stroke: var(--b); }
.like-btn.pop svg { animation: like-pop .45s cubic-bezier(.2, .7, .2, 1.4); }
.like-count { font-variant-numeric: tabular-nums; color: var(--texte); }
.like-count:empty { display: none; }
@keyframes like-pop { 0% { transform: scale(1); } 40% { transform: scale(1.45) rotate(-14deg); } 100% { transform: scale(1); } }
.react-link { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; font-size: 14px; color: var(--texte-2); text-decoration: none; }
.react-link svg { width: 17px; height: 17px; }
.react-link:hover { color: var(--texte); }
.comments { margin-top: 26px; max-width: 900px; scroll-margin-top: 16px; }
.comments h2 { margin-bottom: 16px; }
.comment { padding: 14px 18px 12px; }
.comment .post-body { font-size: 14.5px; }
.comment-form { margin-top: 18px; }
.comment-form .dm-box textarea {
  display: block; width: 100%; min-height: 84px; resize: none; padding: 14px 16px 6px; border: 0; background: transparent;
  color: var(--texte); font: inherit; font-size: 15px; line-height: 1.55; outline: none; border-radius: 14px 14px 0 0;
}
.comment-form .dm-send { height: 40px; padding: 0 18px; }
@media (prefers-reduced-motion: reduce) { .like-btn.pop svg, .notif-menu summary:hover .bell { animation: none; } }

/* ─────────── Mailing list ─────────── */
.mail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.mail-grid .panel + .panel { margin-top: 0; }
.mail-preview {
  white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 10px; padding: 16px 18px; border-radius: 10px;
  background: var(--ecran); border: 1px solid var(--trait); font-family: var(--corps); font-size: 14px; line-height: 1.6; color: var(--texte-2); max-height: 420px; overflow-y: auto;
}
.aud-list { display: flex; flex-direction: column; gap: 6px; }
.aud { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--trait); background: var(--ecran); cursor: pointer; font-size: 14px; color: var(--texte-2); transition: border-color .2s, background .2s; }
.aud:hover { border-color: var(--trait-fort); }
.aud:has(input:checked) { border-color: var(--b); background: rgba(76, 141, 255, .08); color: var(--texte); }
.aud input { accent-color: var(--b); }
.aud-n { font-family: var(--titre); font-weight: 600; color: var(--texte); font-variant-numeric: tabular-nums; }
.check-list label.is-off { opacity: .5; }
.mail-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.mail-progress { max-width: 760px; }
.mail-bar { height: 10px; border-radius: 6px; background: var(--ecran); border: 1px solid var(--trait); overflow: hidden; margin-bottom: 14px; }
.mail-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--r), var(--v), var(--b)); transition: width .4s ease; }
.mail-state { font-size: 15px; margin-bottom: 8px; }
.mail-state .err { color: var(--r); }
.mail-failed { list-style: none; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 900px) { .mail-grid { grid-template-columns: 1fr; } }
.foot-link { color: var(--texte-2); text-decoration: none; background-image: linear-gradient(90deg, var(--r), var(--v), var(--b)); background-size: 0 1.5px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .35s cubic-bezier(.2, .7, .2, 1), color .2s; padding-bottom: 1px; }
.foot-link:hover { color: var(--fort); background-size: 100% 1.5px; }
.author-av { text-decoration: none; }
.res-cover { max-width: 960px; }
.res-cover img { max-height: 480px; }

/* ─────────── Modération ─────────── */
.mod-panel { border-top: 3px solid var(--r); }
.mod-state { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; margin: 8px 0 14px; border-radius: 10px; background: rgba(255, 95, 87, .07); border: 1px solid rgba(255, 95, 87, .25); font-size: 14px; }
.mod-state p { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.mod-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mod-box { border: 1px solid var(--trait); border-left: 3px solid var(--chan); border-radius: 10px; background: var(--ecran); }
.mod-box summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.mod-box summary::-webkit-details-marker { display: none; }
.mod-box summary b { font-weight: 600; font-size: 14.5px; display: flex; justify-content: space-between; }
.mod-box summary b::after { content: '+'; color: var(--gris); font-weight: 400; }
.mod-box[open] summary b::after { content: '–'; }
.mod-box summary span { font-size: 12.5px; color: var(--gris); }
.mod-box summary:hover { background: var(--panneau-2); border-radius: 10px; }
.mod-box > .form, .mod-box > .mod-other { padding: 4px 14px 14px; gap: 12px; }
.mod-other { display: flex; gap: 8px; flex-wrap: wrap; }
.mod-delete { margin: 6px 14px 14px; padding: 12px 0 0 !important; border-top: 1px dashed var(--trait-fort); }
.mod-log { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; font-size: 14px; }
.mod-log .muted { margin-left: 6px; }
.mod-link { font-size: 11.5px; color: var(--gris); text-decoration: none; margin-left: 6px; border: 1px solid var(--trait-fort); border-radius: 6px; padding: 1px 6px; }
.mod-link:hover { color: var(--r); border-color: var(--r); }

/* ─────────── Google Drive ─────────── */
.storage-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.storage-pick .aud span { display: flex; flex-direction: column; }
.storage-pick .aud small { font-size: 12px; color: var(--gris); }
.storage-pick .aud:has(input:disabled) { opacity: .55; cursor: default; }
.up-progress { margin-top: 10px; }
.up-progress .mail-bar { margin-bottom: 8px; }
.setup-steps { margin: 12px 0 14px 20px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; color: var(--texte-2); }
.setup-steps b { color: var(--texte); }
.setup-steps .smtp-log { margin-top: 8px; }
code.copy { display: inline-block; margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--ecran); border: 1px solid var(--trait-fort); cursor: pointer; font-size: 13px; color: var(--texte); word-break: break-all; }
code.copy:hover { border-color: var(--b); }
code.copy.is-copied { border-color: var(--v); color: var(--v); }
@media (max-width: 640px) { .storage-pick { grid-template-columns: 1fr; } }
.drive-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texte-2); margin: 2px 0 8px; }
.drive-note.is-off { color: var(--r); }
.drive-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--v); box-shadow: 0 0 8px var(--v); flex: none; }

/* Statut « Enseignant » : le blanc, somme des trois canaux */
.badge-teacher { background: rgba(230, 233, 238, .1); color: var(--texte); box-shadow: inset 0 0 0 1px rgba(230, 233, 238, .25); }
.choice:has(> input:nth-of-type(3)) { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .choice:has(> input:nth-of-type(3)) { grid-template-columns: 1fr; } }


/* ─────────────────────────────────────────────
   Thème clair (choisi par le membre)
   ───────────────────────────────────────────── */
html[data-theme="light"] {
  --ecran: #F4F5F7;
  --panneau: #FFFFFF;
  --panneau-2: #F0F2F5;
  --trait: #E2E5EA;
  --trait-fort: #CBD1D9;
  --texte: #0B0D10;
  --texte-2: #4A515C;
  --gris: #6F7782;
  --r: #E5483F;
  --v: #17A456;
  --b: #2F6FE6;
  --fort: #000;
  --chan-w: #8B939E;
  --ombre: rgba(16, 24, 40, .12);
  color-scheme: light;
}
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] .flash { color: #0E6B39; }
html[data-theme="light"] .flash-error, html[data-theme="light"] .errors { color: #A8251E; }
html[data-theme="light"] .btn:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .1); }
html[data-theme="light"] .btn-primary:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .18); }
html[data-theme="light"] .btn-primary::after { background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 48%, rgba(255, 255, 255, .08) 56%, transparent 70%); }
html[data-theme="light"] .res-card:hover,
html[data-theme="light"] .like-btn:hover,
html[data-theme="light"] .views button:hover { box-shadow: 0 10px 26px rgba(16, 24, 40, .1); }
html[data-theme="light"] .badge-teacher { background: rgba(11, 13, 16, .06); box-shadow: inset 0 0 0 1px rgba(11, 13, 16, .18); }
html[data-theme="light"] .switch input:checked + .knob::after { background: #fff; }
html[data-theme="light"] .readout { background: rgba(255, 255, 255, .94); }
html[data-theme="light"] .is-lit:not(.btn) { background-image: radial-gradient(460px circle at var(--mx, 50%) var(--my, 50%), rgba(47, 111, 230, .045), transparent 42%); }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .3s ease, border-color .3s ease, color .3s ease !important;
}

/* Bouton soleil / lune */
.theme-form { display: inline-flex; }
.theme-toggle {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: var(--radius-s);
  background: transparent; border: 1px solid transparent; color: var(--texte-2); cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.theme-toggle:hover { color: var(--texte); border-color: var(--trait); background: var(--panneau); }
.theme-toggle svg { width: 19px; height: 19px; grid-area: 1 / 1; transition: transform .35s ease, opacity .25s ease; }
.theme-toggle .ico-sun { opacity: 0; transform: rotate(-60deg) scale(.6); }
html[data-theme="light"] .theme-toggle .ico-sun { opacity: 1; transform: none; }
html[data-theme="light"] .theme-toggle .ico-moon { opacity: 0; transform: rotate(60deg) scale(.6); }

/* Choix du thème dans Mon compte */
.theme-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-choice input { position: absolute; opacity: 0; pointer-events: none; }
.theme-choice label {
  display: flex; flex-direction: column; gap: 10px; padding: 10px; border: 1px solid var(--trait); border-radius: var(--radius);
  background: var(--panneau); cursor: pointer; font-size: 14px; font-weight: 600; color: var(--texte-2); transition: border-color .2s, color .2s;
}
.theme-choice label:hover { border-color: var(--trait-fort); color: var(--texte); }
.theme-choice input:checked + label { border-color: var(--b); color: var(--texte); box-shadow: 0 0 0 3px rgba(76, 141, 255, .15); }
.theme-choice input:focus-visible + label { outline: 2px solid var(--b); outline-offset: 2px; }
.theme-prev { height: 58px; border-radius: 8px; border: 1px solid rgba(128, 128, 128, .25); position: relative; overflow: hidden; }
.theme-prev::before { content: ''; position: absolute; left: 9px; top: 9px; width: 18px; height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, #FF5F57 0 30%, transparent 30% 35%, #3DDC84 35% 65%, transparent 65% 70%, #4C8DFF 70%); }
.theme-prev::after { content: ''; position: absolute; left: 9px; right: 9px; top: 22px; bottom: 9px; border-radius: 5px; }
.theme-prev.is-dark { background: #08090B; } .theme-prev.is-dark::after { background: #161A21; }
.theme-prev.is-light { background: #F4F5F7; } .theme-prev.is-light::after { background: #fff; box-shadow: 0 0 0 1px #E2E5EA; }
.theme-prev.is-auto { background: linear-gradient(135deg, #08090B 50%, #F4F5F7 50%); }
.theme-prev.is-auto::after { background: linear-gradient(135deg, #161A21 50%, #fff 50%); }
@media (max-width: 520px) { .theme-choice { grid-template-columns: 1fr 1fr 1fr; } .theme-choice label { font-size: 13px; } }

/* Les instruments (scopes, courbes, diagrammes, cube LUT) restent noirs, comme un écran de mesure */
html[data-theme="light"] .viz, html[data-theme="light"] .scope {
  --ecran: #08090B; --panneau: #111419; --panneau-2: #161A21; --trait: #1F242C; --trait-fort: #2C333D;
  --texte: #E6E9EE; --texte-2: #A9B0BA; --gris: #7D8590; --r: #FF5F57; --v: #3DDC84; --b: #4C8DFF;
  --fort: #fff; --chan-w: #E6E9EE; color: var(--texte); color-scheme: dark;
}
html[data-theme="light"] .viz .readout { background: rgba(8, 9, 11, .88); }

/* Administration › PayPal */
.steps-list { padding-left: 18px; display: flex; flex-direction: column; gap: 10px; color: var(--texte-2); line-height: 1.55; }
.steps-list b { color: var(--texte); font-weight: 600; }

/* En-tête : sur écran moyen, le nom s'efface (l'avatar reste) pour garder la navigation sur une ligne */
@media (max-width: 1440px) and (min-width: 901px) {
  .top-nav { gap: 22px; }
  .top-nav .nav-name { display: none; }
}

/* Générateur de LUT */
.lg-io { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.lg-side h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 14px; }
.lg-side .field + .field { margin-top: 12px; }
.lg-side select { width: 100%; }
.lg-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--chan); display: inline-block; }
.lg-swap { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--panneau); border: 1px solid var(--trait-fort); color: var(--texte-2); cursor: pointer; transition: color .2s, border-color .2s, transform .3s; }
.lg-swap:hover { color: var(--texte); border-color: var(--b); transform: rotate(180deg); }
.lg-swap svg { width: 18px; height: 18px; }
.lg-facts { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 14px; margin-top: 16px; font-size: 13px; }
.lg-facts dt { color: var(--gris); margin-bottom: 4px; }
.lg-facts dd { color: var(--texte); }
.lg-facts pre { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11.5px; color: var(--texte-2); line-height: 1.5; margin: 0; white-space: pre; }
.lutgen .viz-canvas canvas { width: 100%; display: block; border-radius: 8px; }
@media (max-width: 760px) {
  .lg-io { grid-template-columns: 1fr; }
  .lg-swap { justify-self: center; transform: rotate(90deg); }
  .lg-facts { grid-template-columns: 1fr; }
}

/* Menu Outils par familles, page Outils */
.menu-pop.tools-pop { min-width: 0; width: 560px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; padding: 10px; }
.tools-pop .tools-all { grid-column: 1 / -1; font-weight: 600; color: var(--texte) !important; border-bottom: 1px solid var(--trait); border-radius: 8px 8px 0 0 !important; margin-bottom: 4px; }
.tools-grp { display: flex; flex-direction: column; }
.tools-grp:first-of-type { grid-row: span 2; }
.tools-h { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gris); padding: 8px 12px 4px; }
.tools-sec { margin-top: 36px; }
.tools-sec h2 { display: flex; align-items: center; gap: 10px; }
.tools-home { margin-top: 48px; }
@media (max-width: 900px) { .menu-pop.tools-pop { width: min(560px, calc(100vw - 32px)); grid-template-columns: 1fr; } .tools-grp:first-of-type { grid-row: auto; } }
.school-h { font-size: 22px; margin: 34px 0 4px; padding-top: 18px; border-top: 1px solid var(--trait); }
.school-h:first-of-type { border-top: 0; padding-top: 0; }

/* Menus Communauté et compte */
.user-menu summary::after { display: none; }
.user-menu summary { gap: 10px; }
.menu summary .nav-badge { margin-left: 2px; }
.top-nav .menu-pop .nav-badge { margin-left: 6px; }
@media (max-width: 1180px) and (min-width: 901px) {
  .top-nav { gap: 13px; }
  .brand-name { font-size: 15px; }
  .top-nav a, .top-nav .menu summary { font-size: 13px; }
}


/* ── Corrections d'affichage (revue avant mise en ligne) ── */
/* Menus déroulants : toujours dans l'écran sur tablette et téléphone */
@media (max-width: 900px) {
  .top { position: relative; }
  .top-nav .menu, .top-nav .sr-nav { position: static; }
  .top-nav .menu-pop, .top-nav .menu-pop.tools-pop, .top-nav .notif-pop, .top-nav .sr-pop {
    position: absolute; left: 16px; right: 16px; top: calc(100% - 6px); width: auto;
    max-height: calc(100vh - 120px); overflow-y: auto;
  }
}
/* En-tête sur une ligne en ordinateur */
@media (min-width: 901px) {
  .top { flex-wrap: nowrap; gap: 20px; }
  .top-nav { justify-content: flex-end; row-gap: 8px; min-width: 0; }
  .brand { flex: none; }
}
@media (max-width: 520px) {
  .top-nav { gap: 10px 14px; }
  .top-nav .nav-name { display: none; }
  .res-thumb.is-file, .res-thumb.is-link { height: auto; min-height: 92px; padding-top: 40px; }
}
/* Débordements sur mobile */
.table-wrap { position: relative; }
.two-col > * { min-width: 0; }
.feature { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
@media (max-width: 900px) { .feature { grid-template-columns: minmax(0, 1fr); } }
.feature-body { min-width: 0; }
.feature-body h2, .feature-body p, .res-text { overflow-wrap: anywhere; }
@media (max-width: 760px) { .table-wrap > table { min-width: 640px; } }
/* Lisibilité */
.badge-new.tag { color: var(--ecran); border-color: transparent; }
.nav-badge { background: #D1362D; }
.seg button.is-on > small { color: var(--texte-2); }
.fd-field textarea:focus-visible { border-color: var(--b); }
html[data-theme="light"] { --gris: #5F6772; }
html[data-theme="light"] .badge-student, html[data-theme="light"] .ev-pct.ch-v, html[data-theme="light"] .evx-onair,
html[data-theme="light"] .evx-sub b.ch-v, html[data-theme="light"] .pg-state.is-done, html[data-theme="light"] .pg-toggle.is-done .pg-label,
html[data-theme="light"] .evx-q-opts li.is-right em { color: #0E7A3E; }
html[data-theme="light"] .badge-pro { color: #1D5BD0; }
html[data-theme="light"] .badge-off, html[data-theme="light"] .btn-danger, html[data-theme="light"] .btn-link.danger { color: #B8261E; }
li.is-right .ev-key { color: #08090B; }
html[data-theme="light"] li.is-right .ev-key { color: #fff; background: #0E7A3E; }
html:not([data-theme="light"]) .dm-count { background: #2563D9; }
@media (max-width: 1440px) and (min-width: 1181px) {
  .top-nav { gap: 16px; }
  .top-nav a, .top-nav .menu summary { font-size: 13.5px; }
}

/* ── Choix d'affichage des listes : vignettes ou liste compacte ── */
.view-row { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.view-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--ecran); border: 1px solid var(--trait); }
.view-switch a {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 7px;
  font-size: 13px; font-weight: 500; color: var(--gris); text-decoration: none; transition: background .2s, color .2s;
}
.view-switch a:hover { color: var(--texte); }
.view-switch a.is-on { background: var(--trait-fort); color: var(--texte); }
.view-switch svg { width: 16px; height: 16px; flex: none; }

.res-lists.is-list .res-grid { grid-template-columns: 1fr; gap: 8px; }
.res-lists.is-list .res-section { margin-bottom: 26px; }
.res-lists.is-list .res-card { flex-direction: row; align-items: stretch; }
.res-lists.is-list .res-card:hover { transform: none; }
.res-lists.is-list .res-thumb {
  flex: none; width: 128px; aspect-ratio: 16 / 9; height: auto; min-height: 0;
  border-bottom: 0; border-left: 3px solid var(--chan);
}
.res-lists.is-list .res-thumb.is-file, .res-lists.is-list .res-thumb.is-link, .res-lists.is-list .res-thumb.is-empty {
  padding: 8px 10px; justify-content: center; aspect-ratio: 16 / 9; height: auto; min-height: 0;
}
.res-lists.is-list .res-thumb .ext { font-size: 17px; }
.res-lists.is-list .res-thumb .size { font-size: 11px; margin-top: 2px; }
.res-lists.is-list .res-thumb .tag { left: 4px; top: 4px; font-size: 10px; padding: 1px 6px; }
.res-lists.is-list .res-thumb .dur { right: 4px; bottom: 4px; font-size: 10.5px; padding: 1px 5px; }
.res-lists.is-list .res-thumb.is-file .tag, .res-lists.is-list .res-thumb.is-link .tag { display: none; }
.res-lists.is-list .res-body { flex: 1; min-width: 0; padding: 10px 52px 10px 16px; display: flex; flex-direction: column; justify-content: center; }
.res-lists.is-list .res-card h3 { font-size: 14.5px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-lists.is-list .res-meta { font-size: 12.5px; }
.res-lists.is-list .pg-mark { top: 50%; right: 14px; transform: translateY(-50%); }
.res-lists.is-list .pg-mark.is-open { top: 50%; right: 21px; }
@media (max-width: 520px) {
  .view-switch a span { display: none; }
  .view-switch a { padding: 6px 10px; }
  .res-lists.is-list .res-thumb { width: 96px; }
  .res-lists.is-list .res-thumb .dur, .res-lists.is-list .res-thumb .size { display: none; }
  .res-lists.is-list .res-body { padding: 8px 40px 8px 12px; }
  .res-lists.is-list .res-card h3 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .res-lists.is-list .res-soc { margin-left: 6px; }
}

/* Annuaire en liste compacte */
.member-grid.is-list { grid-template-columns: 1fr; gap: 8px; }
.member-grid.is-list .member-card {
  flex-direction: row; align-items: center; gap: 18px; padding: 10px 16px;
  border-top: 1px solid var(--trait); border-left: 3px solid var(--chan);
}
.member-grid.is-list .member-card:hover { transform: none; border-top-color: color-mix(in srgb, var(--chan) 45%, var(--trait)); }
.member-grid.is-list .member-top { flex: 0 0 300px; min-width: 0; gap: 12px; }
.member-grid.is-list .member-id { flex-wrap: nowrap; }
.member-grid.is-list .member-id h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.member-grid.is-list .avatar-lg { width: 40px; height: 40px; font-size: 15px; }
.member-grid.is-list .member-id { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
.member-grid.is-list .member-id h3 { font-size: 15px; }
.member-grid.is-list .member-sum { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-grid.is-list .member-city { flex: 0 0 auto; max-width: 150px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-grid.is-list .member-bio { display: none; }
.member-grid.is-list .member-foot { margin: 0 0 0 auto; padding: 0; border: 0; flex: none; }
.member-grid.is-list .member-foot .muted { display: none; }
@media (max-width: 900px) {
  .member-grid.is-list .member-city { display: none; }
  .member-grid.is-list .member-top { flex-basis: 260px; }
}
@media (max-width: 600px) {
  .member-grid.is-list .member-card { flex-wrap: wrap; gap: 4px 12px; }
  .member-grid.is-list .member-top { flex: 1 1 0; }
  .member-grid.is-list .member-id { flex-direction: column; align-items: flex-start; gap: 3px; }
  .member-grid.is-list .member-sum { order: 3; flex-basis: 100%; padding-left: 52px; white-space: normal; }
}

/* Œil afficher / masquer sur les mots de passe */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 46px !important; }
.pw-eye {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 34px; height: 34px;
  display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent;
  color: var(--gris); cursor: pointer; transition: color .2s, background .2s;
}
.pw-eye:hover { color: var(--texte); background: var(--panneau-2); }
.pw-eye:focus-visible { outline: 2px solid var(--b); outline-offset: 1px; }
.pw-eye svg { width: 19px; height: 19px; }
.pw-wrap input::-ms-reveal { display: none; }

/* Présence : point vert « en ligne » sur l'avatar */
.av-on { position: relative; display: inline-flex; flex-shrink: 0; vertical-align: middle; line-height: 0; }
.on-dot {
  position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--v); box-shadow: 0 0 0 2px var(--panneau);
}
.av-on.is-lg .on-dot { width: 14px; height: 14px; right: 0; bottom: 0; }
.av-on.is-xl .on-dot { width: 18px; height: 18px; right: 3px; bottom: 3px; box-shadow: 0 0 0 3px var(--panneau); }
.on-txt { display: inline-flex; align-items: center; gap: 6px; color: var(--v); font-size: 13px; font-weight: 500; }
.on-txt::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--v); }
html[data-theme="light"] .on-txt { color: #13814A; }

/* Cours : année puis rubriques */
.year-h { font-family: var(--titre); font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--texte-2); margin: 26px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--trait); display: flex; align-items: baseline; gap: 8px; }
.school-h + .year-h { margin-top: 12px; }
.year-h + .res-section .res-section-head h3 { font-size: 17px; }
.cours-cats { margin-top: -6px; }
.foot-version { font-size: 12px; color: var(--gris); font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* Noms très longs sans espace : ils passent à la ligne au lieu d'élargir la page */
.member-id h3, .profile-name, .member-sum, .fd-name, .author-name, .dm-who b { overflow-wrap: anywhere; }
.member-card, .member-top, .member-id { min-width: 0; }
.member-grid > * { min-width: 0; }
.sub-grid-one { grid-template-columns: minmax(0, 560px); }
