:root {
  --bg: #0e0e10; --card: #18181b; --line: #2f2f35; --text: #efeff1; --muted: #a0a0ab;
  --twitch: #9146ff; --youtube: #ff0033; --ok: #2ecc71; --warn: #f5a623; --err: #ff5c5c;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: #bf94ff; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--card); }
.brand { font-weight: 700; font-size: 18px; }
.tw { color: var(--twitch); } .yt { color: var(--youtube); }
.me { display: flex; align-items: center; gap: 10px; }
.me img { width: 32px; height: 32px; border-radius: 50%; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.card.center { text-align: center; max-width: 560px; margin: 60px auto; padding: 36px; }
h1 { font-size: 24px; margin-top: 0; } h2 { font-size: 18px; margin: 0 0 12px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.alert { background: #3a1a1d; border: 1px solid var(--err); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.btn { display: inline-block; border: 0; border-radius: 6px; padding: 9px 16px; font-weight: 600; color: #fff; text-decoration: none; cursor: pointer; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.twitch { background: var(--twitch); } .btn.youtube { background: var(--youtube); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.small { padding: 4px 10px; font-size: 12px; }
form.inline { display: inline; }
.accounts { display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.acc .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.ok { color: var(--ok); font-weight: 600; margin-bottom: 6px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar h2 { margin: 0; }
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
select, input.title { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font: inherit; }
.vods { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.vod { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.vod.selected { border-color: var(--youtube); box-shadow: 0 0 0 1px var(--youtube); }
.pick { position: relative; display: block; cursor: pointer; aspect-ratio: 16/9; background: #000; }
.pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick input { position: absolute; top: 10px; left: 10px; width: 22px; height: 22px; z-index: 1; accent-color: var(--youtube); }
.dur { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.8); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.info { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
input.title { width: 100%; }
.meta { font-size: 13px; color: var(--muted); }
.badge { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 10px; background: var(--line); color: var(--text); text-decoration: none; font-weight: 600; }
.badge.done { background: #1d3a28; color: var(--ok); }
.badge.downloading, .badge.analyzing, .badge.uploading { background: #3a2f12; color: var(--warn); }
.badge.error { background: #3a1a1d; color: var(--err); }
.jobs { display: flex; flex-direction: column; gap: 10px; }
.job { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; gap: 12px; align-items: center; }
.jbody { flex: 1; min-width: 0; }
.jthumb { width: 128px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; display: block; }
.badge.thumbnail { background: #2a1f3d; color: #bf94ff; }
.job .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 8px 0; }
.bar div { height: 100%; background: var(--warn); transition: width .5s; }
.job.done .bar div { background: var(--ok); }
.job.uploading .bar div { background: var(--youtube); }
.more { text-align: center; margin-top: 14px; }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
@media (max-width: 600px) { .top { padding: 10px 16px; } .vods { grid-template-columns: 1fr; } .jthumb { width: 80px; } }
.styles { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.style { position: relative; }
.style img { height: 90px; border-radius: 6px; border: 1px solid var(--line); display: block; }
.style button { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.75); color: #fff; border: 0; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; }
label.upload { cursor: pointer; }
label.block { display: block; margin: 14px 0 8px; font-size: 13px; color: var(--muted); }
textarea { width: 100%; margin-top: 6px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font: inherit; resize: vertical; }
dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; max-width: 700px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog pre { white-space: pre-wrap; background: var(--bg); padding: 12px; border-radius: 6px; font: 13px/1.5 ui-monospace, monospace; max-height: 60vh; overflow: auto; }
.manual { margin-top: 10px; padding: 12px; border: 1px dashed var(--warn); border-radius: 8px; background: #221d10; }
.manual p { margin: 0 0 8px; font-size: 13px; }
.manual textarea { font-size: 12px; }
.manual ol { margin: 0 0 8px; padding-left: 20px; font-size: 13px; }
.manual-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.badge.waiting_thumbnail { background: #3a2f12; color: var(--warn); }
.job.waiting_thumbnail { border-color: var(--warn); }
.keybox { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.keybox .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.keybox input { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font: inherit; width: min(420px, 100%); }
.faces { margin: 6px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.manual details { margin-top: 10px; }
.manual summary { cursor: pointer; color: var(--muted); margin-bottom: 6px; }
.legal h2 { font-size: 16px; margin: 18px 0 6px; }
.legal li, .legal p { line-height: 1.55; }
.legal-links { text-align: center; }
.sys { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tablewrap { overflow-x: auto; }
table.admin { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.admin td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.admin .av { width: 24px; height: 24px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.okc { color: var(--ok); }
.errc { color: var(--err); }
pre.log { max-height: 360px; overflow: auto; font-size: 11px; background: #0d0d10; padding: 10px; border-radius: 6px; white-space: pre-wrap; }
.acting { background: #2a1f3d; border: 1px solid #9146ff; color: #e9dcff; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.steptxt { color: var(--text, inherit); font-weight: 600; font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 18px; border-radius: 6px; overflow: hidden; background: #2a2a30; margin: 8px 0; }
.stack span { display: block; height: 100%; }
.s-vod { background: #9146ff; } .s-app { background: #ff4d6d; } .s-other { background: #6b6b76; } .s-free { background: #2a2a30; border: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.switch { display: flex; gap: 8px; align-items: center; font-weight: 600; margin-bottom: 6px; }
.live { color: #ff4d6d; font-weight: 700; }

/* Agent IA */
.switch.indent { margin-left: 1.6rem; }
img.scene { max-width: 320px; width: 100%; border-radius: 6px; display: block; margin: .4rem 0; }
.job .ai { margin-top: .4rem; }
.job .ai .err { color: var(--err); }
.job .ai details { margin: .2rem 0; }
.job .ai .titles { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.job .ai .tsel { padding: .2rem .5rem; border-radius: 6px; background: rgba(80, 200, 120, .15); }

.ytvideo { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px solid rgba(127,127,127,.2); }
.ytvideo .controls { margin: 4px 0; flex-wrap: wrap; }
.ytvideo .yt-title { flex: 1 1 260px; min-width: 0; }
@media (max-width: 600px) { .ytvideo { flex-direction: column; } }

/* ---------- Habillage « app PC » : barre latérale, deux colonnes, violet ---------- */
:root {
  --bg: #0d0b17; --card: #161327; --line: #2b2645; --text: #f1eefb; --muted: #a49fbd;
  --accent: #8b5cf6; --accent2: #a855f7; --twitch: #8b5cf6;
}
body { background: radial-gradient(1200px 600px at 70% -10%, #1d1440 0%, var(--bg) 60%) fixed; }
.card { border-radius: 14px; background: linear-gradient(180deg, #19152d, var(--card)); box-shadow: 0 1px 0 rgba(255,255,255,.03) inset; }
.btn { border-radius: 9px; }
.btn.twitch, .btn.youtube { background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 4px 14px rgba(139,92,246,.3); }
.btn.ghost { background: #1e1a33; border-color: var(--line); }
select, input.title, textarea, .keybox input, #editorLogin { background: #100e1d; border-color: var(--line); border-radius: 8px; }
.vod.selected { border-color: var(--accent2); box-shadow: 0 0 0 1px var(--accent2); }
.pick input { accent-color: var(--accent2); }
h2 { display: flex; align-items: center; gap: 10px; }
h2 .num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; flex: none; }
.job { background: #12101f; border-radius: 10px; }
.bar div { background: var(--accent2); }

body.withside { padding-left: 230px; padding-bottom: 64px; }
body.withside main { max-width: 1500px; }
.side { position: fixed; inset: 0 auto 0 0; width: 230px; background: #0b0914; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 14px; gap: 22px; z-index: 5; }
.side .logo { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.side .logo .mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px;
  background: linear-gradient(135deg, #7c3aed, #ec4899); color: #fff; }
.side .logo strong { display: block; font-size: 17px; }
.side .ver { color: var(--muted); font-size: 12px; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.side nav a i { font-style: normal; width: 20px; text-align: center; color: var(--muted); }
.side nav a:hover, .side nav a.on { background: linear-gradient(90deg, rgba(139,92,246,.28), rgba(139,92,246,.05)); color: #d8c8ff; }
.side nav a.on i, .side nav a:hover i { color: var(--accent2); }
.sidebox { margin-top: auto; border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; font-size: 13px; color: var(--muted); }
.sidebox p { margin: 6px 0 0; }
body.withside .top { background: transparent; border: 0; padding: 22px 24px 6px; align-items: flex-start; }
.hero h1 { font-size: 26px; margin: 0 0 4px; }
.hero p { margin: 0; color: var(--muted); font-weight: 400; font-size: 15px; }
.cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 18px; align-items: start; }
.cols .vods { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.statusbar { position: fixed; left: 230px; right: 0; bottom: 0; height: 56px; display: flex; align-items: center; gap: 26px;
  padding: 0 24px; background: rgba(11,9,20,.92); backdrop-filter: blur(6px); border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); z-index: 4; }
.statusbar b { color: var(--text); margin-right: 4px; }
.statusbar .btn { margin-left: auto; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.dot.run { background: var(--accent2); } .dot.wait { background: var(--warn); } .dot.done { background: var(--ok); } .dot.err { background: var(--err); }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  body.withside { padding-left: 0; } .side { display: none; } .statusbar { left: 0; gap: 14px; font-size: 12px; overflow-x: auto; }
  body.withside .top { flex-direction: column; gap: 10px; padding: 16px 16px 4px; }
  .hero h1 { font-size: 20px; } .hero p { font-size: 13px; }
  .statusbar span { white-space: nowrap; } .statusbar .btn { display: none; }
}

/* Tout ce qui se déplie est un vrai bouton, visible au premier coup d'œil */
details > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  padding: 7px 14px; margin: 6px 0; border: 1px solid var(--accent); border-radius: 9px; background: rgba(139,92,246,.14);
  color: #e6dbff; font-weight: 600; font-size: 13px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; font-size: 12px; }
details[open] > summary::before { content: "▾"; }
details > summary:hover { background: rgba(139,92,246,.28); }
details[open] > summary { background: rgba(139,92,246,.24); margin-bottom: 10px; }
.picktag { position: absolute; top: 8px; left: 40px; z-index: 1; background: rgba(0,0,0,.75); padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.pick .picktag .on, .vod.selected .picktag .off { display: none; }
.vod.selected .picktag .on { display: inline; color: #c9f7d8; }
.tlabel { font-size: 12px; color: var(--muted); margin-bottom: -2px; }
.cols { grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); }
.settings-title { padding: 4px 4px 12px; } .settings-title h2 { margin-bottom: 2px; }
.side-settings .card { background: #131022; }
.steph { margin: -4px 0 12px; }
.navsep { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 14px 12px 4px; }
.side nav a i { font-weight: 700; }
#vods { max-height: 620px; overflow-y: auto; padding-right: 4px; }
.statusbar a.sb { color: inherit; text-decoration: none; } .statusbar a.sb:hover { color: var(--text); }
