/* ─────────────────────────────────────────────
   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;
  --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: #fff; }

/* ── 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); }

/* ── 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: #fff; border-color: #fff; 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 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 { 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; }
}
@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 rgba(0, 0, 0, .45);
}
.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; }
  .menu-pop { right: auto; left: 0; }
}
.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; }
