/* CapTok : styles de l'interface (thème violet / bleu / noir). */

:root {
  --ink: #05040b;
  /* noir profond */
  --deck: rgba(18, 16, 36, 0.62);
  /* verre fumé */
  --deck2: rgba(30, 27, 58, 0.72);
  --wire: rgba(140, 130, 255, 0.16);
  --paper: #ecebff;
  --fog: #8e8bb3;
  --violet: #8b5cf6;
  --indigo: #6366f1;
  --blue: #3b82f6;
  --signal: #8c9bff;
  /* avancement */
  --rec: #8b5cf6;
  /* action principale */
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #3b82f6 100%);
  --warn: #f5b341;
  --bad: #f26a8d;
  --good: #5eead4;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --head: "Avenir Next", "Avenir", "Segoe UI", -apple-system, system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.hide {
  display: none !important;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* ---------- structure ---------- */

.app {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 340px;
  min-height: 100vh;
}

.side {
  border-right: 1px solid var(--wire);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(21, 26, 36, 0.85);
}

.side h4 {
  margin: 0 6px;
  font: 500 12px var(--body);
  color: var(--fog);
}

.projects {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: auto;
  flex: 1;
  margin: 0 -4px;
  padding: 0 4px;
}

.proj span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proj small {
  color: var(--fog);
  font-size: 11.5px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fog);
  display: inline-block;
}

.dot.done {
  background: var(--good);
}

.dot.error {
  background: var(--bad);
}

.main {
  padding: 24px 28px 60px;
  min-width: 0;
}

.rail {
  border-left: 1px solid var(--wire);
  padding: 24px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: rgba(21, 26, 36, 0.85);
}

/* ---------- éléments ---------- */

.btn.ghost {
  background: transparent;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn.block {
  width: 100%;
  justify-content: center;
}

textarea {
  resize: vertical;
}

label.f {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--fog);
}

label.f > span.v {
  color: var(--paper);
}

.f-row {
  display: flex;
  justify-content: space-between;
}

.sw {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
}

.sw input {
  appearance: none;
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: var(--wire);
  position: relative;
  cursor: pointer;
  flex: none;
  margin: 0;
  transition: background 0.15s;
}

.sw input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #cfd5e0;
  transition: transform 0.15s;
}

.sw input:checked::after {
  transform: translateX(14px);
  background: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.muted {
  color: var(--fog);
}

/* ---------- en-tête de projet ---------- */

.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.top p {
  margin: 4px 0 0;
  color: var(--fog);
  font-size: 13px;
}

.pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--wire);
  color: var(--fog);
  white-space: nowrap;
}

.pill.error {
  color: var(--bad);
  border-color: rgba(240, 98, 98, 0.4);
}

/* ---------- sections du flux ---------- */

.sec > header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.sec > header h2 {
  margin: 0;
  font: 600 16px var(--head);
}

.sec > header .right {
  margin-left: auto;
}

.dropzone {
  display: flex;
  gap: 10px;
  align-items: center;
}

.dropzone input {
  flex: 1;
}

.filebtn input {
  display: none;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 20px;
  align-items: start;
}

.viewer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 250px));
  gap: 10px;
}

.frame {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--wire);
  display: flex;
  justify-content: center;
  align-self: start;
}

.frame img {
  width: 100%;
  height: auto;
  display: block;
}

.frame .cap {
  position: absolute;
  left: 8px;
  top: 8px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 8px;
  border-radius: 6px;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.seg {
  display: flex;
  background: var(--deck2);
  border: 1px solid var(--wire);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 3px;
}

.seg button {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 5px;
  padding: 6px 4px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--fog);
}

.seg button.on {
  background: var(--ink);
  color: var(--paper);
}

.sub {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--wire);
}

.stylewrap {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  margin-top: 16px;
  align-items: start;
}

.stylepv {
  margin: 0;
  border: 1.5px solid var(--wire);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #1c1d28;
}

.stylepv img {
  width: 100%;
  aspect-ratio: 9/16;
  display: block;
  object-fit: cover;
}

.stylepv figcaption {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--fog);
  line-height: 1.35;
}

.stylepv figcaption b {
  display: block;
  color: var(--paper);
  font-size: 13px;
}

.styles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  align-content: start;
}

@media (max-width: 800px) {
  .stylewrap {
    grid-template-columns: 1fr;
  }
  .stylepv {
    max-width: 240px;
  }
}

.sty img {
  width: 100%;
  display: block;
  aspect-ratio: 1/1;
  object-fit: cover;
}

.sty {
  cursor: pointer;
  border: 1.5px solid var(--wire);
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  font: inherit;
  background: var(--deck2);
}

.sty .lb {
  display: block;
  padding: 6px 7px;
  font-size: 11.5px;
  text-align: center;
  color: var(--paper);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sty .lb small {
  display: block;
  color: var(--fog);
  font-size: 11px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

td,
th {
  padding: 8px 6px;
  border-bottom: 1px solid var(--wire);
  vertical-align: top;
  text-align: left;
  font-size: 13px;
}

th {
  color: var(--fog);
  font-weight: 500;
  font-size: 12px;
}

td.t {
  white-space: nowrap;
  color: var(--fog);
  font-size: 12px;
}

td.o {
  color: var(--fog);
  max-width: 260px;
}

td textarea {
  min-height: 36px;
  padding: 6px 8px;
}

.result {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 20px;
}

video {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: contain;
  border-radius: var(--r-md);
  background: #000;
  max-height: 640px;
  display: block;
}

.scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.score .v {
  font: 600 34px/1 var(--head);
}

.score .l {
  color: var(--fog);
  font-size: 12.5px;
  margin-top: 6px;
}

.meter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.meter div {
  background: var(--deck2);
  border: 1px solid var(--wire);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--fog);
}

.meter b {
  display: block;
  color: var(--paper);
  font: 600 16px var(--head);
}

.chk {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--wire);
  font-size: 13px;
}

.chk .s {
  font-weight: 700;
}

.s.ok {
  color: var(--good);
}

.s.warn {
  color: var(--warn);
}

.s.fail {
  color: var(--bad);
}

.result h4 {
  margin: 16px 0 4px;
  font: 600 13px var(--head);
}

.result ul {
  margin: 0;
  padding-left: 18px;
}

.result li {
  margin: 3px 0;
}

/* ---------- rail : progression (élément signature) ---------- */

.rail h3 {
  margin: 0 0 14px;
  font: 600 15px var(--head);
}

.actions {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.actions .btn {
  justify-content: center;
  text-align: center;
}

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

.step {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 4px 10px;
  align-items: center;
}

.step .ic {
  font-size: 13px;
  color: var(--fog);
  text-align: center;
}

.step .nm {
  font-size: 13px;
}

.step .tm {
  font-size: 11.5px;
  color: var(--fog);
}

.step .vu {
  grid-column: 2/4;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  height: 7px;
}

.step.done .ic {
  color: var(--good);
}

.step.error .ic {
  color: var(--bad);
}

.step.error .vu i.on {
  background: var(--bad);
}

.step.skipped {
  opacity: 0.45;
}

.step.running.indet .vu i {
  animation: scan 1.4s linear infinite;
}

@keyframes scan {
  0%,
  100% {
    background: var(--wire);
  }
  10% {
    background: var(--signal);
  }
}

@media (prefers-reduced-motion: reduce) {
  .step.running.indet .vu i {
    animation: none;
    background: rgba(79, 216, 224, 0.35);
  }
}

.err {
  color: var(--bad);
  font-size: 13px;
  margin-top: 14px;
}

.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--wire);
  font-size: 13px;
  color: var(--fog);
}

.log {
  margin-top: 18px;
}

.log summary {
  cursor: pointer;
  color: var(--fog);
  font-size: 12.5px;
}

.log pre {
  background: var(--ink);
  border: 1px solid var(--wire);
  border-radius: var(--r-sm);
  padding: 10px;
  max-height: 260px;
  overflow: auto;
  font:
    11.5px/1.5 ui-monospace,
    Menlo,
    monospace;
  color: #aab2c3;
  white-space: pre-wrap;
}

/* ---------- repli, relance, légende ---------- */

.sec.collapsed > :not(header) {
  display: none;
}

.sec.collapsed > header {
  margin-bottom: 0;
}

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

.ibtn {
  cursor: pointer;
  border: 1px solid var(--wire);
  background: transparent;
  color: var(--fog);
  border-radius: var(--r-sm);
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
}

.ibtn:hover {
  color: var(--paper);
  border-color: #3d4760;
}

.ibtn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.step .tools {
  display: flex;
  gap: 6px;
  align-items: center;
}

.step .ibtn {
  height: 22px;
  min-width: 22px;
  padding: 0;
  border-color: transparent;
}

.step .ibtn:hover {
  border-color: var(--wire);
}

.player {
  position: relative;
  isolation: isolate;
  align-self: start;
}

.player video {
  position: relative;
  z-index: 0;
}

.caption b {
  display: block;
  font: 600 14px/1.3 var(--head);
  margin-bottom: 4px;
  padding-right: 62px;
}

.caption.off {
  display: none;
}

/* ---------- dossiers, favoris, couleurs, bannière ---------- */

.sidehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 6px;
}

.sidehead .ibtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.folder {
  margin-top: 6px;
}

.fhead {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--fog);
  font-size: 12.5px;
  user-select: none;
}

.fhead:hover {
  background: var(--deck);
}

.fhead b {
  font-weight: 500;
  color: var(--paper);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fhead .cnt {
  font-size: 11px;
}

.fhead .x {
  opacity: 0;
  border: 0;
  background: none;
  color: var(--fog);
  cursor: pointer;
  padding: 0 2px;
}

.fhead:hover .x {
  opacity: 1;
}

.folder.closed .fbody {
  display: none;
}

.fbody {
  padding-left: 10px;
}

.proj .mini {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--wire);
  margin-top: 5px;
  overflow: hidden;
}

.proj.drop,
.fhead.drop {
  outline: 1px dashed var(--signal);
}

.banner b {
  font-weight: 600;
}

.banner .sp {
  flex: 1;
}

.fav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.fav select {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  width: auto;
  max-width: 170px;
}

.fav input {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  width: 140px;
}

.swatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.fonts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.fontbtn {
  background: var(--panel2, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--wire);
  border-radius: 10px;
  color: var(--paper);
  padding: 10px 8px 8px;
  cursor: pointer;
  text-align: center;
  line-height: 1.1;
}

.fontbtn b {
  display: block;
  font-size: 17px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fontbtn small {
  display: block;
  margin-top: 5px;
  font:
    500 11px/1.2 system-ui,
    sans-serif;
  color: var(--muted, #9aa0b4);
}

.fontbtn:hover {
  border-color: var(--signal);
}

.fontopts {
  display: flex;
  gap: 18px;
}

.fontopts .sw {
  font-size: 13px;
}

.fontbtn.on {
  border-color: var(--signal);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--signal) 45%, transparent);
}

.swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--wire);
  cursor: pointer;
  padding: 0;
}

.swatch.on {
  border-color: var(--paper);
  box-shadow: 0 0 0 2px var(--signal);
}

.swatch.none {
  background: conic-gradient(#fff 0 25%, #ffe600 0 50%, #fff 0 75%, #ffe600 0);
}

.swatch.bow {
  background: #fff;
  color: #000;
  font:
    700 11px/20px system-ui,
    sans-serif;
  text-align: center;
}

.sendbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--wire);
}

.titleedit {
  background: transparent;
  border: 1px solid var(--wire);
  border-radius: var(--r-sm);
  color: var(--paper);
  font: 600 26px/1.15 var(--head);
  padding: 2px 6px;
  width: min(60ch, 100%);
}

.topmeta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.topmeta select {
  height: 30px;
  padding: 0 8px;
  font-size: 12.5px;
  width: auto;
}

.leftcol {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: start;
}

#insights .ins {
  background: var(--deck2);
  border: 1px solid var(--wire);
  border-radius: var(--r-md);
  padding: 10px 12px;
}

#insights h4 {
  margin: 0 0 4px;
  font: 600 13px var(--head);
}

#insights ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
}

#insights li {
  margin: 3px 0;
}

.fhead .chev {
  transition: transform 0.15s;
  flex: none;
}

.folder:not(.closed) .fhead .chev {
  transform: rotate(90deg);
}

.proj:active {
  cursor: grabbing;
}

.spkbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0 4px;
  font-size: 12.5px;
}

.spk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--deck2);
  border: 1px solid var(--wire);
  border-radius: var(--r-md);
  padding: 4px 6px 4px 10px;
}

.spk small {
  color: var(--fog);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seg.mini {
  padding: 2px;
}

.seg.mini button {
  padding: 3px 8px;
  font-size: 11.5px;
}

.spksel {
  height: 30px;
  padding: 0 6px;
  font-size: 12px;
  min-width: 120px;
}

/* ---------- parcours en étapes ---------- */

.stepper button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--fog);
  padding: 9px 8px;
  border-radius: var(--r-md);
  font: 500 13px var(--body);
  cursor: pointer;
}

.stepper button .sn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 11.5px var(--head);
  border: 1px solid var(--wire);
}

.stepper button.reached {
  color: var(--paper);
}

.stepper button.locked {
  opacity: 0.38;
  cursor: not-allowed;
}

.stepper button.reached:not(.cur):hover {
  background: var(--deck2);
}

.sec.wiz.off {
  display: none !important;
}

.nextbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--wire);
  font-size: 13px;
}

.waitbox {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 26px;
  border: 1px dashed var(--wire);
  border-radius: var(--r-md);
}

@keyframes sp {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spin {
    animation: none;
  }
}

/* ---------- réglages ---------- */

dialog::backdrop {
  background: rgba(8, 10, 15, 0.6);
  backdrop-filter: blur(3px);
}

.dlg {
  padding: 22px;
}

.dlg h2 {
  margin: 0 0 4px;
  font: 600 18px var(--head);
}

.prov {
  border: 1px solid var(--wire);
  border-radius: var(--r-md);
  padding: 16px;
  margin-top: 16px;
}

.prov header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.prov header b {
  font: 600 14px var(--head);
}

.prov .state {
  margin-left: auto;
  font-size: 12px;
}

.prov .grid {
  grid-template-columns: 1fr 1fr;
}

.prov .full {
  grid-column: 1/-1;
}

.testline {
  font-size: 12.5px;
  margin-top: 10px;
  min-height: 18px;
}

.dlg footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

@media (max-width: 1180px) {
  .app {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .rail {
    grid-column: 1/-1;
    position: static;
    height: auto;
    border-left: 0;
    border-top: 1px solid var(--wire);
  }
}

@media (max-width: 800px) {
  .app {
    grid-template-columns: 1fr;
  }
  .side {
    position: static;
    height: auto;
  }
  .split,
  .result {
    grid-template-columns: 1fr;
  }
}

/* =================== Captok — violet, bleu et noir =================== */

body {
  margin: 0;
  color: var(--paper);
  font: 14px/1.5 var(--body);
  background-size: 22px 22px;
  background: var(--ink);
  background-image: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 18% -8%, rgba(139, 92, 246, 0.34), transparent 62%),
    radial-gradient(800px 520px at 92% 4%, rgba(59, 130, 246, 0.26), transparent 60%),
    radial-gradient(700px 600px at 50% 115%, rgba(99, 102, 241, 0.16), transparent 65%),
    linear-gradient(180deg, #0b0920 0%, #05040b 55%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(140, 130, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 130, 255, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 30%, transparent 75%);
}

.side,
.rail {
  background: linear-gradient(180deg, rgba(14, 12, 32, 0.82), rgba(5, 4, 11, 0.9));
  backdrop-filter: blur(14px);
  border-color: var(--wire);
}

.brand .mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background: var(--grad);
  border: 0;
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.55);
}

.brand .mark i {
  position: absolute;
  bottom: 5px;
  width: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.92);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
}

.brand b {
  font: 700 22px/1 var(--head);
  letter-spacing: 0.2px;
  background: linear-gradient(90deg, #fff 0%, #c4b5fd 55%, #93c5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sec {
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, rgba(24, 21, 50, 0.66), rgba(10, 9, 24, 0.72));
  border: 1px solid transparent;
  background-clip: padding-box;
  position: relative;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.9);
}

.sec::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(
    140deg,
    rgba(139, 92, 246, 0.55),
    rgba(99, 102, 241, 0.12) 35%,
    rgba(59, 130, 246, 0.08) 65%,
    rgba(59, 130, 246, 0.45)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.sec > header .n {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font: 600 12px var(--head);
  background: var(--grad);
  border: 0;
  color: #fff;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.45);
}

.btn {
  cursor: pointer;
  border: 1px solid var(--wire);
  border-radius: var(--r-md);
  padding: 9px 14px;
  font-weight: 500;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--paper);
  background: rgba(30, 27, 58, 0.7);
  border-color: var(--wire);
  transition:
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}

.btn:hover {
  background: rgba(44, 40, 86, 0.85);
  border-color: rgba(140, 130, 255, 0.4);
}

.btn.primary {
  border-color: var(--rec);
  background: var(--grad);
  border: 0;
  color: #fff;
  box-shadow:
    0 8px 26px -10px rgba(124, 92, 255, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn.primary:hover {
  background: var(--grad);
  filter: brightness(1.12);
  box-shadow: 0 10px 32px -8px rgba(124, 92, 255, 1);
}

input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--wire);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  outline: none;
  background: rgba(12, 10, 28, 0.75);
  border-color: var(--wire);
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

input[type="range"] {
  width: 100%;
  height: 18px;
  accent-color: var(--violet);
}

.sw input:checked {
  background: var(--grad);
}

.top h1 {
  margin: 0;
  font: 600 26px/1.15 var(--head);
  letter-spacing: -0.2px;
  max-width: 60ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
}

.pill.running {
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 16px -4px rgba(139, 92, 246, 0.7);
}

.pill.done {
  color: var(--good);
  border-color: rgba(94, 234, 212, 0.4);
}

.pill.queued {
  color: #fcd34d;
  border-color: rgba(252, 211, 77, 0.45);
}

.pill.prefetch {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.45);
}

.qbox {
  margin: 14px 0 4px;
  border: 1px solid var(--wire);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.025);
}

.qbox.mine {
  border-color: rgba(252, 211, 77, 0.5);
  background: rgba(252, 211, 77, 0.06);
}

.qbox h4 {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--paper);
  display: flex;
  justify-content: space-between;
}

.qbox h4 span {
  color: var(--fog);
  font-weight: 500;
}

.qbox p {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--fog);
  line-height: 1.4;
}

.qbox p b {
  color: #fcd34d;
}

.qrow {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
  padding: 5px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.qrow:first-of-type {
  border-top: 0;
}

.qrow .n {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--fog);
}

.qrow.act .n {
  background: rgba(139, 92, 246, 0.25);
  color: #c4b5fd;
}

.qrow .t {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--paper);
}

.qrow.me .t {
  font-weight: 600;
}

.qrow .s {
  color: var(--fog);
  font-size: 11.5px;
  white-space: nowrap;
}

/* barre d'étapes : trait lumineux qui se remplit */

.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 18px;
  padding: 6px;
  border-radius: var(--r-lg);
  background: rgba(12, 10, 28, 0.7);
  border: 1px solid var(--wire);
  backdrop-filter: blur(12px);
}

.stepper button.cur {
  color: var(--paper);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(59, 130, 246, 0.2));
  box-shadow: inset 0 0 0 1px rgba(140, 130, 255, 0.35);
}

.stepper button.cur .sn {
  border-color: var(--signal);
  background: var(--grad);
  border: 0;
  color: #fff;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.7);
}

.stepper button.reached .sn {
  border-color: rgba(140, 155, 255, 0.7);
  color: #c7ceff;
}

.stepper i {
  width: 18px;
  flex: none;
  height: 2px;
  border-radius: 2px;
  background: rgba(140, 130, 255, 0.15);
}

.stepper i.lit {
  background: var(--grad);
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.8);
}

/* fondu au changement d'étape (seule animation automatique) */

.sec.wiz:not(.off) {
  animation: wizin 0.35s ease-out;
}

@keyframes wizin {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sec.wiz:not(.off) {
    animation: none;
  }
}

/* vumètres */

.vu i {
  border-radius: 1.5px;
  background: rgba(140, 130, 255, 0.12);
}

.vu i.on {
  background: linear-gradient(180deg, #a78bfa, #6366f1);
}

.step.done .vu i.on {
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.55), rgba(99, 102, 241, 0.55));
}

.step.running .nm {
  color: #c4b5fd;
}

.total b {
  font: 600 20px var(--head);
  background: linear-gradient(90deg, #fff, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.score {
  border: 1px solid var(--wire);
  border-radius: var(--r-md);
  padding: 14px;
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.16), rgba(12, 10, 28, 0.7));
  border-color: var(--wire);
}

.meter div,
#insights .ins,
.spk {
  background: rgba(12, 10, 28, 0.6);
}

.sty.sel {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.caption {
  position: relative;
  z-index: 2;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
  background: rgba(8, 6, 20, 0.78);
  border-color: rgba(140, 130, 255, 0.28);
}

.caption .tags {
  color: #a8b4ff;
}

.moodtag {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 99px;
  border: 1px solid var(--wire);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.35);
}

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(79, 216, 224, 0.35);
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 13px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.16), rgba(59, 130, 246, 0.1));
  border-color: rgba(140, 130, 255, 0.35);
}

.proj:hover {
  background: rgba(139, 92, 246, 0.1);
}

.proj.on {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.24), rgba(59, 130, 246, 0.08));
  box-shadow: inset 2px 0 0 var(--violet);
}

.proj .mini i {
  display: block;
  height: 100%;
  background: var(--grad);
}

.dot.running {
  background: var(--violet);
  box-shadow: 0 0 8px var(--violet);
}

.dot.queued {
  background: #fcd34d;
}

.spin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--wire);
  animation: sp 1s linear infinite;
  flex: none;
  border-top-color: var(--violet);
}

dialog {
  border: 1px solid var(--wire);
  border-radius: var(--r-lg);
  color: var(--paper);
  padding: 0;
  width: min(560px, 94vw);
  background: linear-gradient(180deg, #141130, #08071a);
  border-color: rgba(140, 130, 255, 0.25);
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.9);
}

/* menu ⋯ des projets */

.proj .pmenu {
  position: absolute;
  right: 6px;
  top: 7px;
  opacity: 0;
  border: 0;
  background: transparent;
  color: var(--fog);
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 6px;
  line-height: 0;
}

.proj:hover .pmenu,
.proj:focus-within .pmenu,
.proj.on .pmenu {
  opacity: 1;
}

.proj .pmenu:hover {
  color: var(--paper);
  background: rgba(139, 92, 246, 0.18);
}

.pop {
  position: fixed;
  z-index: 50;
  min-width: 210px;
  padding: 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, #17143a, #0b0a1f);
  border: 1px solid rgba(140, 130, 255, 0.28);
  box-shadow:
    0 20px 50px -12px rgba(0, 0, 0, 0.9),
    0 0 30px -10px rgba(139, 92, 246, 0.5);
}

.pop button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--paper);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.pop button:hover,
.pop button:focus-visible {
  background: rgba(139, 92, 246, 0.2);
  outline: none;
}

.pop button.cur::after {
  content: "✓";
  float: right;
  color: #c4b5fd;
}

.pop button.danger {
  color: #ff9db5;
}

.pop button.danger:hover {
  background: rgba(242, 106, 141, 0.16);
}

.pop button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pop .popsep {
  font-size: 11px;
  color: var(--fog);
  padding: 8px 10px 4px;
  border-top: 1px solid var(--wire);
  margin-top: 4px;
}

.pop .popsep:empty {
  padding: 0;
  margin: 4px 0;
}

/* glisser-déposer : zones visibles pendant le glissement */

.droptarget {
  display: none;
  margin: 6px 4px 8px;
  padding: 12px;
  border: 1.5px dashed rgba(140, 130, 255, 0.45);
  border-radius: 10px;
  text-align: center;
  font-size: 12px;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.06);
}

body.dragging .droptarget {
  display: block;
}

body.dragging .folder.dz-over .droptarget {
  border-color: #a78bfa;
  background: rgba(139, 92, 246, 0.22);
  color: #fff;
  box-shadow: 0 0 24px -6px rgba(139, 92, 246, 0.8);
}

body.dragging .folder.dz-over > .fhead {
  background: rgba(139, 92, 246, 0.18);
}

body.dragging .folder.closed .fbody {
  display: none;
}

.proj.dragsrc {
  opacity: 0.4;
}

.dragghost {
  position: fixed;
  top: -100px;
  left: -100px;
  padding: 7px 12px;
  border-radius: 9px;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  color: #fff;
  font: 500 12.5px var(--body);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 10px 30px -8px rgba(124, 92, 255, 0.9);
}

.stopbtn {
  border-color: rgba(242, 106, 141, 0.4) !important;
  color: #ffb3c6;
}

.stopbtn:hover {
  background: rgba(242, 106, 141, 0.14) !important;
}

/* étapes désactivées, script, signal 1 min 01, libellés */

.sec.stepoff > :not(header):not(.keepon):not(.sendbar):not(.nextbar) {
  opacity: 0.32;
  filter: grayscale(0.7);
  pointer-events: none;
  user-select: none;
}

.sec.stepoff::before {
  opacity: 0.35;
}

.stepsw .swl {
  font-size: 12.5px;
  color: var(--paper);
  min-width: 64px;
}

.scriptbox {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--wire);
}

.row-btns {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

#scriptwrap {
  margin-top: 12px;
}

.sumtitle {
  margin: 0 0 6px;
  font: 600 14px var(--head);
  color: var(--paper);
}

.sig svg {
  opacity: 0.9;
}

.caption .copy {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* zone d'effacement : déplaçable + 4 poignées */

.frame .band {
  position: absolute;
  border: 1.5px solid var(--signal);
  border-radius: 4px;
  border-color: var(--violet);
  background: rgba(139, 92, 246, 0.14);
  box-shadow: 0 0 0 9999px rgba(5, 4, 11, 0);
  pointer-events: auto;
  cursor: move;
  touch-action: none;
}

.frame .band .hd {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--violet);
  box-shadow:
    0 0 0 3px rgba(139, 92, 246, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.6);
}

.frame .band .hd.t {
  top: -8px;
  left: 50%;
  margin-left: -7px;
  cursor: ns-resize;
}

.frame .band .hd.b {
  bottom: -8px;
  left: 50%;
  margin-left: -7px;
  cursor: ns-resize;
}

.frame .band .hd.l {
  left: -8px;
  top: 50%;
  margin-top: -7px;
  cursor: ew-resize;
}

.frame .band .hd.r {
  right: -8px;
  top: 50%;
  margin-top: -7px;
  cursor: ew-resize;
}

.frame .band .hd:hover {
  transform: scale(1.2);
}

.frame.grab .band {
  background: rgba(139, 92, 246, 0.22);
}

.optrow {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  align-items: center;
  margin-top: 16px;
}

.optrow .sw {
  white-space: nowrap;
}

.sig {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  font: 600 11.5px var(--head);
  padding: 3px 9px 3px 7px;
  border-radius: 99px;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  box-shadow:
    0 0 14px -3px rgba(139, 92, 246, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  white-space: nowrap;
}

/* suppression de projet */

.proj {
  all: unset;
  display: block;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  cursor: grab;
  position: relative;
  padding-right: 30px;
}

.proj .pdel {
  position: absolute;
  right: 6px;
  top: 8px;
  opacity: 0;
  border: 0;
  background: transparent;
  color: var(--fog);
  cursor: pointer;
  padding: 3px;
  border-radius: 6px;
}

.proj:hover .pdel,
.proj:focus-within .pdel {
  opacity: 1;
}

.proj .pdel:hover {
  color: var(--bad);
  background: rgba(242, 106, 141, 0.12);
}

.proj .pdel:disabled {
  display: none;
}

.proj .confirm {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--paper);
}

.proj .confirm button {
  border: 1px solid var(--wire);
  background: rgba(30, 27, 58, 0.8);
  color: var(--paper);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 12px;
  cursor: pointer;
}

.proj .confirm .yes {
  background: rgba(242, 106, 141, 0.18);
  border-color: rgba(242, 106, 141, 0.5);
  color: #ffd1dc;
}

.empty {
  border: 1px dashed var(--wire);
  border-radius: var(--r-lg);
  padding: 40px;
  text-align: center;
  color: var(--fog);
  border-color: var(--wire);
  background: rgba(12, 10, 28, 0.4);
}

/* placement manuel des sous-titres : aperçu avant effacement, carton déplaçable */
.manwrap {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 20px;
  margin-top: 16px;
  align-items: start;
}
.manwrap .frame {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: var(--r-md);
  background: #000;
  touch-action: none;
}
.manwrap .frame #mimg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.manwrap .frame.mirror #mimg {
  transform: scaleX(-1);
}
.mzone {
  position: absolute;
  border: 1.5px dashed rgba(196, 181, 253, 0.85);
  border-radius: 4px;
  pointer-events: none;
}
.mguide {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px solid rgba(96, 165, 250, 0.9);
  pointer-events: none;
}
.mcard {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: ns-resize;
  touch-action: none;
  outline: 1.5px solid transparent;
  outline-offset: 3px;
  border-radius: 4px;
  user-select: none;
}
.mcard:hover,
.manwrap .frame.grab .mcard {
  outline-color: var(--violet);
}
.mctl {
  display: grid;
  gap: 14px;
  align-content: start;
}
.mhint {
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0;
}
.mrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
@media (max-width: 800px) {
  .manwrap {
    grid-template-columns: 1fr;
  }
  .manwrap .frame {
    max-width: 260px;
  }
}

/* interrupteur inactif (ex. « Adapter au pays » avec un script personnel) */
.sw:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

/* « Créer un script avec l'IA » */
.aibox {
  margin: 10px 0 4px;
  padding: 14px;
  border: 1px solid var(--wire);
  border-radius: var(--r-md);
  background: var(--deck2);
}
.aihelp {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fog);
}
.aiprov {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fog);
}
.aiprov select {
  width: auto;
  min-width: 120px;
}
.aires {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fog);
}
.aires b {
  color: var(--paper);
}
.aires.err {
  color: var(--bad);
}
.aiscores {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}
.aiscores span {
  padding: 3px 9px;
  border: 1px solid var(--wire);
  border-radius: 999px;
  font-size: 12px;
}
.aiscores span.low {
  border-color: var(--warn);
  color: var(--warn);
}
.aiscores span.low b {
  color: var(--warn);
}

/* Raccourcir la vidéo (étape 1) */
.trimwrap {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--wire);
  border-radius: var(--r-md);
  background: var(--deck2);
}
.trimwrap video {
  width: 150px;
  max-height: 270px;
  border-radius: var(--r-sm);
  background: #000;
  flex: none;
}
.trimctl {
  flex: 1;
  min-width: 0;
}
.trimrow {
  display: grid;
  grid-template-columns: 48px 1fr 64px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--fog);
}
.trimrow b {
  color: var(--paper);
  font-weight: 600;
  text-align: right;
}
.trimsum {
  margin: 4px 0 12px;
  font-size: 13px;
  color: var(--paper);
}
.trimmsg {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--fog);
}
.trimmsg.err {
  color: var(--bad);
}
@media (max-width: 640px) {
  .trimwrap {
    flex-direction: column;
  }
}

/* badge d'avertissement (ralenti très visible) */
.sig.warn {
  color: #1a1206;
  background: var(--warn);
  box-shadow: none;
}

/* coût de la voix (onglet Résultat) */
.costline {
  margin: 10px 2px 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fog);
}

/* numéro de version à côté du nom */
.brand .ver {
  margin-left: 8px;
  font: 500 11px var(--body);
  color: var(--fog);
  letter-spacing: 0.02em;
}
.storagebox {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--wire);
}

/* avertissement (effacement en mode rapide…) */
.warnline {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--warn);
  color: var(--warn);
  font-size: 12.5px;
  line-height: 1.45;
}
