:root {
  --bg: #F6F6F3;
  --surface: #FFFFFF;
  --surface-2: #FBFBF9;
  --sunken: #F1F1EE;
  --line: #E8E8E4;
  --line-strong: #DCDCD7;
  --ink: #121316;
  --ink-2: #4A4E56;
  --muted: #5C6069;
  --accent: #2B3FD6;
  --accent-hover: #1E2DA8;
  --accent-soft: #F3F4FF;
  --accent-soft-2: #E7E9F7;
  --ok: #0D7247; --ok-soft: #E6F0EA;
  --warn: #8A5300; --warn-soft: #FBF0DC;
  --err: #B42318; --err-soft: #FDECEA;
  --radius: 14px;
  --font: Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Boutons & champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 500 14px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--sunken); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #2A2C31; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn.danger { color: var(--err); }
.btn.lg { height: 44px; padding: 0 20px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; }
.btn svg { width: 16px; height: 16px; flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink); }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font: 14px var(--font); transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 70px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43, 63, 214, .14); background: var(--surface); }
.input.mono { font-family: var(--mono); font-size: 13px; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235C6069' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; line-height: 1.4; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.range { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; }
.range .top { display: flex; justify-content: space-between; }
.range .top span { font-family: var(--mono); color: var(--muted); font-weight: 400; }
input[type="range"] { width: 100%; accent-color: var(--accent); margin: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { width: 36px; height: 20px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sunken); gap: 2px; flex-wrap: wrap; }
.seg button { height: 34px; padding: 0 12px; border-radius: 8px; border: none; background: transparent; font: 500 13px var(--font); color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(18,19,22,.08); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.seg button { display: inline-flex; align-items: center; gap: 6px; }
.seg svg, .locked svg, .note svg { width: 14px; height: 14px; flex: none; vertical-align: -2px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.accent { background: var(--accent-soft-2); color: var(--accent); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.sm { gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.span-all { grid-column: 1 / -1; }
.bar { height: 8px; border-radius: 999px; background: #EEEEEA; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s; }
.bar.thin { height: 6px; }
.error-box { padding: 10px 12px; border-radius: 10px; background: var(--err-soft); color: var(--err); font-size: 13px; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.note.warn { background: var(--warn-soft); border-color: #F1DDB5; color: var(--warn); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.locked { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }

/* ---------- Structure ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; color: var(--ink); font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.brand:hover { color: var(--ink); }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); display: grid; place-items: center; flex: none; }
.nav a { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: 9px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--sunken); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--sunken); color: var(--ink); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #fff; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; padding-top: 16px; }
.usage { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.usage .top { display: flex; justify-content: space-between; font-size: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 6px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft-2); color: var(--accent); display: grid; place-items: center; font-size: 13px; font-weight: 600; flex: none; }
.me .who { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.me .who b, .me .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who b { font-size: 13px; }
.me .who span { font-size: 12px; color: var(--muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page { padding: 32px 40px 56px; display: flex; flex-direction: column; gap: 24px; max-width: 1360px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .sub { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.page-head p { color: var(--muted); margin-top: 6px; }

/* ---------- Tableau de bord & projets ---------- */
.stat { display: flex; flex-direction: column; gap: 8px; }
.stat .v { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.stat .l, .stat .s { font-size: 13px; color: var(--muted); }
.stat .s { font-size: 12px; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.project { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; color: var(--ink); transition: box-shadow .15s, border-color .15s; }
.project:hover { color: var(--ink); border-color: var(--line-strong); box-shadow: 0 6px 20px -10px rgba(18,19,22,.25); }
.project .thumb { height: 200px; background: var(--sunken) center/cover no-repeat; position: relative; display: grid; place-items: center; }
.project .thumb .badge { position: absolute; left: 12px; top: 12px; background: var(--surface); }
.project .thumb .dur { position: absolute; right: 12px; bottom: 12px; font: 500 12px var(--mono); padding: 3px 8px; border-radius: 6px; background: rgba(18,19,22,.78); color: #fff; }
.project .thumb .prog { position: absolute; left: 12px; right: 12px; bottom: 12px; }
.project .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 3px; }
.project .body b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project .body span { font-size: 12px; color: var(--muted); }
.templates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.template { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.template:hover { border-color: var(--line-strong); background: var(--surface); }
.template b { font-size: 14px; }
.template span { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* ---------- Assistant de création ---------- */
.wizard-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 40px 0; }
.wizard-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wizard-title input { border: none; background: transparent; font: 600 18px var(--font); color: var(--ink); padding: 2px 4px; margin-left: -4px; border-radius: 6px; width: 320px; max-width: 100%; }
.wizard-title input:hover { background: var(--sunken); }
.wizard-title input:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 6px; }
.steps li + li::before { content: ''; width: 22px; height: 1px; background: var(--line-strong); }
.steps a { display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 14px 0 7px; border-radius: 999px; border: 1px solid transparent; color: var(--muted); font-weight: 500; }
.steps a:hover { color: var(--ink); background: var(--sunken); }
.steps .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: #EEEEEA; color: var(--muted); }
.steps a.done { color: var(--ink); }
.steps a.done .dot { background: var(--accent-soft-2); color: var(--accent); }
.steps a[aria-current="step"] { background: var(--surface); border-color: var(--line-strong); color: var(--ink); font-weight: 600; }
.steps a[aria-current="step"] .dot { background: var(--accent); color: #fff; }
.wizard-body { flex: 1; padding: 24px 40px 32px; display: grid; gap: 24px; align-items: start; max-width: 1360px; width: 100%; }
.wizard-body.side { grid-template-columns: minmax(0, 1fr) 320px; }
.wizard-body.side-preview { grid-template-columns: minmax(0, 1fr) 300px; }
.wizard-body.framing { grid-template-columns: 132px minmax(0, 1fr) 300px; }
.wizard-foot { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 40px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.wizard-foot .saved { font-size: 12px; color: var(--muted); }
.intro { display: flex; flex-direction: column; gap: 4px; }
.intro h1 { font-size: 24px; }
.intro p { color: var(--muted); }

.clip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.clip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; gap: 14px; align-items: center; }
.clip .order { display: flex; flex-direction: column; gap: 2px; }
.clip .order button { width: 26px; height: 22px; border: none; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; font-size: 10px; }
.clip .order button:hover { background: var(--sunken); color: var(--ink); }
.clip .thumb { width: 128px; height: 72px; border-radius: 8px; background: var(--sunken) center/cover no-repeat; flex: none; position: relative; display: grid; place-items: center; }
.clip .thumb .dur { position: absolute; right: 6px; bottom: 6px; font: 500 11px var(--mono); padding: 2px 6px; border-radius: 5px; background: rgba(18,19,22,.8); color: #fff; }
.clip .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.clip .title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.clip .title b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.clip .trim { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.clip .trim .input { width: 92px; height: 34px; font-family: var(--mono); font-size: 13px; }
.timeline { position: relative; height: 26px; border-radius: 6px; background: var(--sunken); flex: 1 1 160px; min-width: 120px; }
.timeline i { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: var(--accent-soft-2); border: 2px solid var(--accent); }
.clip.loading { color: var(--muted); }
.drop { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); font-size: 13px; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.summary-line { display: flex; justify-content: space-between; font-size: 14px; }
.summary-line span:first-child { color: var(--muted); }

/* Cadrage */
.clip-rail { display: flex; flex-direction: column; gap: 10px; }
.clip-rail button { display: flex; flex-direction: column; gap: 6px; border: none; background: none; padding: 0; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.clip-rail .t { display: block; height: 72px; border-radius: 8px; background: var(--sunken) center/cover no-repeat; outline: 1px solid var(--line); }
.clip-rail button[aria-pressed="true"] .t { outline: 2px solid var(--accent); outline-offset: 2px; }
.clip-rail span.n { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-rail button[aria-pressed="true"] span.n { font-weight: 600; }
.stage-wrap { flex: 1 1 auto; min-height: 140px; display: flex; justify-content: center; align-items: center; }
.stage { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #2A2D33 center/cover no-repeat; user-select: none; touch-action: none; flex: none; }
.stage .shade { position: absolute; background: rgba(18,19,22,.58); pointer-events: none; }
.stage .crop { position: absolute; border: 2px solid #fff; border-radius: 3px; cursor: grab; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.stage .crop:active { cursor: grabbing; }
.stage .crop::before, .stage .crop::after { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(to right, rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,.35) 1px, transparent 1px); background-size: 33.33% 33.33%; background-position: -1px -1px; }
.stage .crop::after { display: none; }
.stage .tag { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 5px; background: #fff; color: var(--ink); pointer-events: none; }
.modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mode { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.mode b { font-size: 14px; }
.mode span { font-size: 12px; color: var(--muted); }
.mode[aria-pressed="true"] { border: 2px solid var(--accent); background: var(--accent-soft); padding: 11px 13px; }

/* Aperçu téléphone */
.phone-wrap { display: flex; flex-direction: column; gap: 10px; align-items: center; position: sticky; top: 24px; }
.phone-wrap > span { align-self: flex-start; font-size: 12px; color: var(--muted); }
.phone { width: 280px; border-radius: 38px; padding: 9px; background: #121316; }
.screen { position: relative; aspect-ratio: 9 / 16; border-radius: 30px; overflow: hidden; background: #2A2D33 no-repeat; container-type: inline-size; }
.screen .layer { position: absolute; left: 0; right: 0; background: #2A2D33 no-repeat; overflow: hidden; }
.screen .blurbg { position: absolute; inset: -10%; background: center/cover no-repeat; filter: blur(18px) brightness(.85) saturate(1.2); }
.screen .pbar { position: absolute; left: 0; right: 0; top: 0; height: 1.4cqw; background: rgba(255,255,255,.25); z-index: 3; }
.screen .pbar i { display: block; width: 38%; height: 100%; }
.screen .hook { position: absolute; left: 8%; right: 8%; top: 22%; display: flex; justify-content: center; z-index: 3; }
.screen .hook span { font-weight: 800; font-size: 6.6cqw; line-height: 1.2; text-align: center; padding: 2.4cqw 3.6cqw; border-radius: 1.6cqw; }
.screen .cap { position: absolute; left: 4%; right: 13%; text-align: center; font-weight: 900; font-size: 8.6cqw; line-height: 1.1; z-index: 3; transform: translateY(-50%); }
.screen .cap span.w { display: inline-block; margin: 0 .12em; }
.screen .handle { position: absolute; left: 0; right: 0; top: 9.5%; text-align: center; font-size: 4cqw; font-weight: 700; color: rgba(255,255,255,.65); z-index: 3; }
.screen .ui { position: absolute; right: 4%; bottom: 20%; display: flex; flex-direction: column; gap: 6cqw; z-index: 3; }
.screen .ui i { width: 9cqw; height: 9cqw; border-radius: 50%; background: rgba(255,255,255,.35); }
.screen .safe { position: absolute; left: 0; right: 0; bottom: 0; height: 18%; border-top: 1px dashed rgba(255,255,255,.35); z-index: 2; }
.screen .wm { position: absolute; right: 4%; bottom: 3%; font-size: 3cqw; color: rgba(255,255,255,.6); z-index: 3; }

/* Textes */
.styles-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.style-tile { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font: inherit; cursor: pointer; text-align: left; color: var(--ink); }
.style-tile[aria-pressed="true"] { border: 2px solid var(--accent); padding: 7px; }
.style-tile .demo { height: 76px; border-radius: 8px; background: #3E4652; display: grid; place-items: center; padding: 0 8px; }
.style-tile .demo span { font-weight: 800; font-size: 16px; letter-spacing: .01em; }
.style-tile b { font-size: 13px; padding: 0 4px 4px; }
.swatches { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; outline: 1px solid var(--line-strong); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--accent); }
.color-input { width: 40px; height: 32px; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: none; cursor: pointer; }
.clip-texts { display: flex; flex-direction: column; gap: 10px; }
.clip-text { display: flex; gap: 12px; align-items: flex-start; }
.clip-text .t { width: 72px; height: 44px; border-radius: 6px; background: var(--sunken) center/cover no-repeat; flex: none; margin-top: 2px; }

/* Voix & musique */
.voices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 320px; overflow: auto; padding: 2px; }
.voice { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font: inherit; text-align: left; cursor: pointer; color: var(--ink); min-width: 0; }
.voice[aria-pressed="true"] { border: 2px solid var(--accent); background: var(--accent-soft); padding: 9px; }
.voice .meta { display: flex; flex-direction: column; min-width: 0; }
.voice .meta b { font-size: 14px; }
.voice .meta span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play { width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--sunken); display: grid; place-items: center; flex: none; cursor: pointer; color: var(--ink); }
.play:hover, .play.on { background: var(--ink); color: #fff; }
.play svg { width: 12px; height: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font: 500 13px var(--font); color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tracks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; }
.track { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); }
.track[aria-selected="true"] { border: 2px solid var(--accent); background: var(--accent-soft); padding: 7px 9px; }
.track .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.track .meta b, .track .meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track .meta b { font-size: 14px; }
.track .meta span { font-size: 12px; color: var(--muted); }

/* Export */
.recap { display: flex; flex-direction: column; }
.recap > div { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid #F0F0EC; }
.recap > div:last-child { border-bottom: none; }
.recap .k { width: 140px; font-size: 13px; color: var(--muted); flex: none; }
.recap .v { flex: 1; min-width: 0; }
.phases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; font-size: 13px; color: var(--muted); }
.phases li.done { color: var(--ok); }
.phases li.cur { color: var(--accent); font-weight: 600; }
.player { width: 100%; max-height: 70vh; background: #000; border-radius: 12px; display: block; }

/* Admin */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { height: 40px; display: flex; align-items: center; padding: 0 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); font-weight: 500; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { border-bottom-color: var(--ink); color: var(--ink); font-weight: 600; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 500; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid #F0F0EC; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .input, .table .select { height: 36px; min-width: 90px; }
.table small { display: block; color: var(--muted); font-size: 12px; }
.integration { display: flex; flex-direction: column; gap: 12px; }
.test-result { font-size: 13px; }
.test-result.ok { color: var(--ok); }
.test-result.err { color: var(--err); }
.sys-list { display: flex; flex-direction: column; }
.sys-list div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #F0F0EC; font-size: 14px; }
.sys-list div:last-child { border-bottom: none; }
.sys-list span:last-child { color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plan { display: flex; flex-direction: column; gap: 12px; }
.plan.current { border: 2px solid var(--accent); padding: 17px 19px; }
.plan .price { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); }
.plan li::before { content: '✓  '; color: var(--ok); font-weight: 600; }
.plan li.no { color: var(--muted); }
.plan li.no::before { content: '–  '; color: var(--muted); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 50; padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 12px 32px -8px rgba(18,19,22,.4); max-width: calc(100vw - 32px); }
.modal-back { position: fixed; inset: 0; z-index: 40; background: rgba(18,19,22,.45); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 24px 60px -12px rgba(18,19,22,.35); }

/* ---------- Connexion ---------- */
.auth { display: flex; flex-wrap: wrap; min-height: 100vh; background: var(--surface); }
.auth-form { flex: 1 1 520px; display: flex; flex-direction: column; padding: 40px 56px; }
.auth-form form { margin: auto 0; width: 100%; max-width: 380px; align-self: center; display: flex; flex-direction: column; gap: 18px; padding: 40px 0; }
.auth-form .input { height: 46px; background: var(--surface); }
.auth-side { flex: 1 1 520px; background: #F3F3F0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 32px; padding: 40px; text-align: center; }
.auth-side b { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Assistant : chaque étape tient dans l'écran, seules les listes défilent ---------- */
.main.wizard-mode { height: 100vh; overflow: hidden; }
.wizard-mode .wizard-top { padding-top: 12px; }
.wizard-mode .wizard-body { flex: 1 1 auto; min-height: 0; overflow: hidden; padding-top: 16px; padding-bottom: 16px; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
.wizard-mode .wizard-body > * { min-height: 0; max-height: 100%; }
.wizard-mode .wizard-body > aside { overflow: auto; }
.wizard-mode .phone-wrap { position: static; justify-content: flex-start; }
.wizard-mode .phone { width: min(280px, calc((100vh - 250px) * 0.55)); padding: 8px; border-radius: 34px; }
.wizard-mode .voices, .wizard-mode .tracks { max-height: none; }
.fill { min-height: 0; flex: 1 1 auto; }
section.fill { display: flex; flex-direction: column; overflow: hidden; }
.scroll { overflow: auto; min-height: 0; }
.clip-list.scroll { flex: 1 1 auto; padding-right: 4px; }
.card.scroll { overflow: auto; }
.stepper { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.steps { gap: 4px; }
.steps li + li::before { width: 12px; }
.steps a { padding: 0 6px; height: 34px; }
.steps a[aria-current="step"] { padding: 0 12px 0 6px; }
.steps a:not([aria-current]) .lbl { display: none; }
.steps a[aria-disabled="true"], .btn[aria-disabled="true"] { pointer-events: none; opacity: .5; }
.intro h1 { font-size: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px), (max-height: 600px) {
  /* écrans étroits ou très bas : on revient à une page qui défile normalement */
  .main.wizard-mode { height: auto; overflow: visible; }
  .wizard-mode .wizard-body { overflow: visible; grid-template-rows: none; }
  .wizard-mode .wizard-body > * { max-height: none; }
  section.fill { overflow: visible; }
}
@media (max-width: 1180px) {
  .wizard-body.side, .wizard-body.side-preview { grid-template-columns: minmax(0, 1fr); }
  .wizard-body.framing { grid-template-columns: 110px minmax(0, 1fr); }
  .wizard-body.framing .phone-wrap { grid-column: 1 / -1; }
  .phone-wrap { position: static; }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar { position: static; width: auto; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; border-right: none; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .brand { padding: 0 8px 0 0; }
  .nav { display: flex; gap: 2px; }
  .nav a span.lbl, .side-foot .usage, .me .who { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; }
  .page, .wizard-body { padding: 20px 16px 40px; }
  .wizard-top, .wizard-foot { padding-left: 16px; padding-right: 16px; }
  .steps a span.lbl { display: none; }
  .grid2, .grid3, .templates, .styles-grid, .voices { grid-template-columns: minmax(0, 1fr); }
  .wizard-body.framing { grid-template-columns: minmax(0, 1fr); }
  .clip-rail { flex-direction: row; overflow-x: auto; }
  .clip-rail button { width: 110px; flex: none; }
  .clip { flex-wrap: wrap; }
  .auth-form { padding: 32px 20px; }
}
@media (max-width: 520px) { .grid4 { grid-template-columns: minmax(0, 1fr); } .modes { grid-template-columns: minmax(0, 1fr); } .phases { grid-template-columns: minmax(0, 1fr); } }

/* Script : un document complet (accroche, texte, appel à l'action), pas un texte par clip */
.script-doc .script-body { flex: 1 0 auto; display: flex; flex-direction: column; }
.script-doc .script-body > .row { align-items: center; min-height: 30px; }
.script-doc #scriptText { flex: 1 1 auto; min-height: 220px; resize: vertical; font-size: 15px; line-height: 1.65; padding: 14px 16px; }
