* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #05070b; --panel: #0d1119; --panel2: #121826; --border: #1e2637;
  --text: #e7ecf3; --dim: #8b97a8; --accent: #f5a623; --accent2: #3a7afe; --danger: #ff4d4d; --ok: #2ecc71;
}
body {
  font-family: ui-monospace, "DejaVu Sans Mono", monospace;
  background: var(--bg); color: var(--text); height: 100vh; overflow: hidden;
}
button {
  font-family: inherit; cursor: pointer; border: 1px solid var(--border);
  background: var(--panel2); color: var(--text); padding: 8px 14px; border-radius: 8px; font-size: 13px;
  transition: .15s;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #0a0e14; border-color: var(--accent); font-weight: 700; }
button.primary:disabled { opacity: .4; cursor: not-allowed; }
button.ghost { background: transparent; }
textarea, input, select {
  font-family: inherit; background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px; width: 100%; font-size: 13px; resize: vertical;
}
textarea:focus, input:focus { outline: none; border-color: var(--accent); }

/* ── layout ── */
#app { display: grid; grid-template-rows: auto 1fr; height: 100vh; }
header {
  border-bottom: 1px solid var(--border); background: var(--panel);
  display: flex; align-items: center; padding: 0 20px; height: 62px; gap: 24px;
}
.brand { font-weight: 700; letter-spacing: 1px; color: var(--accent); text-transform: uppercase; font-size: 15px; }
.steps { display: flex; align-items: center; gap: 6px; flex: 1; }
.step { display: flex; align-items: center; gap: 8px; opacity: .45; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.step .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--dim); display: grid; place-items: center; font-size: 11px; }
.step.active { opacity: 1; }
.step.active .dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 12px var(--accent); }
.step.done { opacity: .9; }
.step.done .dot { border-color: var(--ok); color: var(--ok); background: rgba(46,204,113,.12); }
.step .sep { width: 26px; height: 1px; background: var(--border); }

main { display: grid; grid-template-columns: 240px 1fr 380px; overflow: hidden; }
.col { overflow-y: auto; padding: 18px; }
#library { border-right: 1px solid var(--border); background: var(--panel); }
#center { background: var(--bg); }
#chat { border-left: 1px solid var(--border); background: var(--panel); display: flex; flex-direction: column; padding: 0; }

.col h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); margin-bottom: 12px; }

/* ── library ── */
.lib-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; font-size: 12px; background: var(--panel2); cursor: pointer; }
.lib-item:hover { border-color: var(--accent); }
.lib-item .s { color: var(--dim); font-size: 11px; }
.lib-item.on { border-color: var(--accent); }

/* ── center ── */
.hero { max-width: 620px; margin: 8vh auto 0; text-align: center; }
.hero h1 { font-size: 30px; margin-bottom: 8px; }
.hero p { color: var(--dim); margin-bottom: 24px; }
.rowbtn { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.panel-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); margin-bottom: 12px; }

.scene-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: var(--panel); }
.scene-card .tag { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); border: 1px solid var(--accent); border-radius: 5px; padding: 2px 8px; margin-bottom: 8px; }
.scene-card .speak { font-size: 14px; line-height: 1.5; }
.scene-card .prompt { color: var(--dim); font-size: 12px; margin-top: 8px; font-style: italic; }

.assets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; }
.asset { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel); }
.asset img { width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block; background:#000; }
.asset .noimg { width:100%; aspect-ratio:9/16; display:grid; place-items:center; color:var(--dim); background:var(--panel2); font-size:11px; text-align:center; padding:10px;}
.asset .body { padding: 10px; }
.asset .speak { font-size: 12px; line-height: 1.4; max-height: 60px; overflow: hidden; }
.asset .acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.asset audio { width: 100%; margin-top: 8px; height: 30px; }

video { width: 100%; max-width: 340px; border-radius: 12px; display:block; margin: 0 auto; background:#000; }

/* ── chat ── */
.chat-head { padding: 16px 18px; border-bottom: 1px solid var(--border); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); display:flex; justify-content:space-between; align-items:center;}
.chat-live { color: var(--ok); font-size: 11px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 90%; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; }
.msg.user { align-self: flex-end; background: var(--accent2); color: #fff; }
.msg.agent { align-self: flex-start; background: var(--panel2); border: 1px solid var(--border); }
.chat-input { padding: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.chat-input input { flex: 1; }

/* ── progress overlay ── */
#overlay { position: fixed; inset: 0; background: rgba(5,7,11,.8); display: none; place-items: center; z-index: 50; }
#overlay.on { display: grid; }
.prog-box { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 28px 32px; width: 440px; max-width: 90vw; }
.prog-box .spin { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.prog-log { font-size: 12px; color: var(--dim); max-height: 180px; overflow-y: auto; }
.prog-log div { padding: 3px 0; }
.muted { color: var(--dim); font-size: 12px; }

/* ── bouton + fenêtre "Mes vidéos" ── */
#myvids { white-space: nowrap; }
#vidsmodal { position: fixed; inset: 0; background: rgba(5,7,11,.75); display: none; place-items: center; z-index: 60; }
#vidsmodal.on { display: grid; }
.vids-box { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; width: 640px; max-width: 92vw; max-height: 82vh; display: flex; flex-direction: column; }
.vids-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); }
#vidslist { overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.vid-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--panel2); }
.vid-row video { width: 68px; height: 120px; border-radius: 6px; flex: none; background: #000; }
.vid-row .info { flex: 1; min-width: 0; }
.vid-row .t { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vid-row .s { font-size: 11px; color: var(--dim); margin-top: 3px; }
.vid-row .dl { flex: none; }
.vid-cur { display: flex; align-items: center; gap: 12px; border: 1px dashed var(--accent); border-radius: 10px; padding: 12px; background: rgba(245,166,35,.06); }
.vid-cur .spin-s { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; flex: none; }
