/* Layout : téléphone d'abord (barre du haut + barre d'action collante), rail latéral et résumé collant à partir de 960 px */
:root {
  --bg: #f2f4ef;
  --surface: #ffffff;
  --surface-2: #f6f8f3;
  --ink: #152019;
  --muted: #56635a;
  --faint: #737f76;
  --line: #dfe5dc;
  --line-strong: #c6d0c1;
  --brand: #1b2b21;
  --lime: #c4f26b;
  --lime-hover: #b4e657;
  --on-lime: #1c3014;
  --accent: #3d6b20;
  --accent-soft: #ecf4e1;
  --danger: #a1442f;
  --danger-soft: #fbebe6;
  --warn: #7a5200;
  --warn-soft: #fbf1d9;
  --stage: #111915;
  --stage-ink: #ffffff;
  --shadow: 0 1px 2px rgb(21 32 25 / .05), 0 10px 30px rgb(21 32 25 / .07);
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1411; --surface: #151d18; --surface-2: #1a241e; --ink: #e6eee7; --muted: #a3b0a6; --faint: #84918a;
    --line: #26322a; --line-strong: #34433a; --brand: #0a0f0c; --lime: #c4f26b; --lime-hover: #d1f784; --on-lime: #1a2c12;
    --accent: #a9d771; --accent-soft: #1f2c1b; --danger: #f09a85; --danger-soft: #3a1f19; --warn: #f0c46b; --warn-soft: #33270f;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px rgb(0 0 0 / .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1411; --surface: #151d18; --surface-2: #1a241e; --ink: #e6eee7; --muted: #a3b0a6; --faint: #84918a;
  --line: #26322a; --line-strong: #34433a; --brand: #0a0f0c; --lime: #c4f26b; --lime-hover: #d1f784; --on-lime: #1a2c12;
  --accent: #a9d771; --accent-soft: #1f2c1b; --danger: #f09a85; --danger-soft: #3a1f19; --warn: #f0c46b; --warn-soft: #33270f;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px rgb(0 0 0 / .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font-body); }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Coquille et navigation ---------- */
.shell { min-height: 100vh; }
.rail {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.brand b { font-weight: 500; }
.mark { width: 36px; height: 36px; flex: none; border-radius: 11px; background: var(--brand); color: var(--lime); display: grid; place-items: center; font-size: 23px; font-weight: 800; line-height: 1; }
.nav { display: flex; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 12px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px; }
.nav-item svg { width: 20px; height: 20px; flex: none; }
.nav-item:hover { background: var(--surface-2); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.badge { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--line); color: var(--ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.rail-note { display: none; }
@media (max-width: 400px) { .brand-name { display: none; } .steps { gap: 6px; } .steps li { padding-right: 11px; font-size: 12.5px; gap: 6px; } .steps li span { width: 24px; height: 24px; } }

.view {
  max-width: 1200px; margin: 0 auto;
  padding-block: 24px 128px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .rail { flex-direction: column; align-items: stretch; height: 100vh; padding: 28px 18px; border-bottom: 0; border-right: 1px solid var(--line); gap: 28px; }
  .brand { margin-right: 0; }
  .nav { flex-direction: column; }
  .nav-item .badge { margin-left: auto; }
  .rail-note { display: flex; gap: 8px; align-items: baseline; margin: auto 0 0; font-size: 13px; color: var(--faint); }
  .dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }
  .view { padding-block: 40px 64px; padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); }
}

/* ---------- En-tête ---------- */
.intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 20px; }
.intro > div:first-child { min-width: 0; }
.eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
h1 { font-family: var(--font-display); font-size: clamp(32px, 7vw, 48px); line-height: 1.04; letter-spacing: -.035em; margin: 0 0 10px; font-weight: 700; text-wrap: balance; }
h1 span { color: var(--accent); }
.lede { margin: 0; color: var(--muted); max-width: 58ch; }
.intro-side { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.save-status { margin: 0; font-size: 13px; color: var(--faint); }

.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 20px; overflow-x: auto; scrollbar-width: none; }
.steps li { display: flex; align-items: center; gap: 8px; flex: none; padding: 5px 14px 5px 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--faint); }
.steps li span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.steps li.current { color: var(--ink); border-color: var(--line-strong); }
.steps li.current span { background: var(--brand); color: var(--lime); border-color: var(--brand); }
.steps li.done span { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- Mise en page ---------- */
.layout { display: grid; gap: 16px; }
.form-col { display: grid; gap: 16px; min-width: 0; }
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
  .summary { position: sticky; top: 24px; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
@media (min-width: 700px) { .card { padding: 26px; } }
.card-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.card-head > div { min-width: 0; flex: 1; }
.card-num { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
h2 { font-family: var(--font-display); font-size: 21px; letter-spacing: -.02em; margin: 0; line-height: 1.2; font-weight: 700; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- Champs ---------- */
.field { display: grid; gap: 7px; margin-bottom: 16px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
label, .label { font-size: 14px; font-weight: 600; }
.hint { margin: 0; font-size: 13px; color: var(--faint); }
input[type="text"], input[type="number"], textarea, select {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: 16px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: .85; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.error { margin: 0; color: var(--danger); font-size: 14px; font-weight: 600; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.counter { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.grid-2 { display: grid; gap: 0 16px; }
@media (min-width: 600px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--lime); border-color: var(--lime); color: var(--on-lime); min-height: 50px; padding: 0 20px; }
.btn.primary:hover { background: var(--lime-hover); border-color: var(--lime-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); padding: 0 8px; margin-left: -8px; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; }
.icon-btn { width: 44px; padding: 0; flex: none; }

/* ---------- Imports ---------- */
.uploads { display: grid; gap: 16px; }
.uploads > div { display: grid; gap: 7px; align-content: start; min-width: 0; }
@media (min-width: 640px) { .uploads { grid-template-columns: 210px minmax(0, 1fr); } }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center; min-height: 140px; padding: 18px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); background: var(--surface-2); cursor: pointer; font-weight: 400; transition: background .15s, border-color .15s; }
.drop:hover, .drop.dragging { background: var(--accent-soft); border-color: var(--accent); }
.drop:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop strong { font-size: 15px; }
.drop small { font-size: 13px; color: var(--faint); }
.drop-icon { width: 42px; height: 42px; margin-bottom: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); }
.drop-icon svg { width: 22px; height: 22px; }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.file-chip img { width: 52px; height: 52px; flex: none; object-fit: contain; border-radius: 8px; background: #fff; padding: 4px; border: 1px solid var(--line); }
.file-name { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; margin-top: 14px; }
.media-grid:empty { display: none; }
.media-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.media-thumb { position: relative; aspect-ratio: 4 / 5; background: var(--surface-2); }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-kind, .media-order { position: absolute; top: 8px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgb(17 25 21 / .74); color: #fff; }
.media-kind { left: 8px; }
.media-order { right: 8px; font-variant-numeric: tabular-nums; }
.media-body { display: grid; gap: 8px; padding: 10px; }
.media-name { margin: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trim { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.trim label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.trim input { min-height: 44px; padding: 8px 10px; }
.media-actions { display: flex; gap: 6px; }
.media-actions .btn.danger { flex: 1; padding: 0 10px; font-size: 14px; }
.media-info { margin-top: 10px; }

.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; font-weight: 500; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--accent); }
.check + .error { margin-top: 8px; }

/* ---------- Ton ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 15px; color: var(--muted); }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--lime); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.segmented label { position: relative; min-height: 44px; display: grid; place-items: center; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); text-align: center; padding: 0 8px; }
.segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segmented label { min-height: 52px; padding: 6px 8px; align-content: center; gap: 1px; }
.seg-main { font-size: 15px; font-weight: 700; }
.seg-sub { font-size: 12px; font-weight: 600; color: var(--faint); }
.segmented label:has(input:checked) .seg-sub { color: var(--accent); }
.segmented label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 1px; }

/* ---------- Résumé ---------- */
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; min-width: 0; }
.summary-stage { background: var(--brand); padding: 22px; display: grid; place-items: center; }
.poster { width: 100%; max-width: 190px; aspect-ratio: 9 / 16; border-radius: 14px; padding: 18px 16px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: var(--stage-ink); background: radial-gradient(120% 70% at 90% 0%, #4b6d35 0%, transparent 62%), radial-gradient(90% 50% at 0% 100%, #2c4422 0%, transparent 70%), var(--stage); box-shadow: 0 14px 34px rgb(0 0 0 / .3); }
.poster-time { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--lime); }
.poster-title { margin: 0; font-family: var(--font-display); font-size: 22px; line-height: 1.08; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; overflow-wrap: anywhere; }
.poster-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; opacity: .85; }
.poster-foot img { max-height: 26px; max-width: 90px; object-fit: contain; background: #fff; border-radius: 5px; padding: 2px; }
.summary-body { padding: 20px; display: grid; gap: 18px; }
.auto { display: flex; gap: 10px; align-items: flex-start; }
.auto strong { font-size: 15px; }
.auto p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.pill { margin-left: auto; flex: none; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.alloc { display: flex; gap: 3px; height: 8px; }
.alloc span { border-radius: 4px; }
.a-ia { background: var(--ink); }
.a-media { background: var(--lime); }
.a-cta { background: var(--line-strong); }
.legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 14px; }
.checklist li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.checklist li::before { content: ""; width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.checklist li.ok { color: var(--ink); }
.checklist li.ok::before { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat; }
.checklist small { margin-left: auto; font-size: 12px; color: var(--faint); }
.price { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.price-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.price-lines li { display: flex; justify-content: space-between; gap: 12px; }
.price-lines li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); }
.price-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 600; }
.price-total strong { font-family: var(--font-display); font-size: 24px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.order { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid var(--accent); }
.order strong { font-family: var(--font-display); font-size: 17px; }
.order p { margin: 0; font-size: 14px; color: var(--muted); }
.order.pending { background: var(--warn-soft); border-color: transparent; }
.progress { height: 8px; border-radius: 4px; background: var(--surface); overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; width: 3%; background: var(--accent); border-radius: 4px; transition: width .6s ease; }
.downloads { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
@media (max-width: 560px) { .downloads .btn { flex: 1 1 100%; } }
.project-status.paid { background: var(--lime); color: var(--on-lime); border-color: transparent; }
.was { color: var(--faint); font-weight: 500; text-decoration-thickness: 1.5px; margin-right: 6px; }
.seg-sub .was { margin-right: 2px; }
.promo-badge { justify-self: start; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--lime); color: var(--on-lime); }
.music-info { margin: 0; font-size: 14px; color: var(--muted); }
.counter.over { color: var(--danger); font-weight: 700; }
.cost-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.cost-line strong { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.note { margin: 0; font-size: 13px; color: var(--faint); }

@media (min-width: 600px) and (max-width: 959px) {
  .summary { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
}

.access { display: grid; gap: 7px; padding: 14px; border-radius: var(--r-md); background: var(--warn-soft); }
.access-row { display: flex; gap: 8px; }
.access-row input { flex: 1; min-width: 0; background: var(--surface); }
.btn[aria-busy="true"] { cursor: progress; }

/* ---------- Barre d'action (téléphone) ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgb(21 32 25 / .08);
  padding-top: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.actionbar > div { flex: 1; min-width: 0; display: grid; }
.actionbar strong { font-size: 15px; }
.actionbar span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 960px) { .actionbar { display: none; } }

/* ---------- Scénario ---------- */
.scenario { margin-top: 16px; scroll-margin-top: 76px; }
.head-btn { flex: none; }
.callout { margin: 0 0 16px; padding: 14px 16px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--ink); font-size: 14px; }
.callout.info { margin: 0; background: var(--accent-soft); }
.hooks { display: grid; gap: 10px; }
@media (min-width: 760px) { .hooks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hook { display: grid; gap: 6px; align-content: start; text-align: left; padding: 14px 16px; min-height: 44px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); }
.hook small { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.hook strong { font-family: var(--font-display); font-size: 17px; line-height: 1.25; font-weight: 600; overflow-wrap: anywhere; }
.hook:hover { border-color: var(--accent); }
.hook[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.hook[aria-pressed="true"] small { color: var(--accent); }

.scenario-grid { display: grid; gap: 22px; margin-top: 22px; }
@media (min-width: 860px) {
  .scenario-grid { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
  .player { position: sticky; top: 24px; }
}
.player { min-width: 0; }

.stage { position: relative; width: 100%; max-width: 300px; margin: 0 auto; aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden; isolation: isolate; background: var(--stage); color: var(--stage-ink); box-shadow: 0 18px 40px rgb(0 0 0 / .22); }
.stage-layer { position: absolute; inset: 0; }
.stage-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.stage-bg img, .stage-bg video { width: 100%; height: 100%; object-fit: cover; }
.stage-bg.kb img { animation: kenburns 6s ease-out both; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.09); } }
.stage-ia { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 64px 20px 20px; background: repeating-linear-gradient(135deg, rgb(255 255 255 / .035) 0 12px, transparent 12px 24px), radial-gradient(120% 80% at 15% 5%, #44673a 0%, transparent 60%), var(--stage); }
.ia-tag { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--lime); color: var(--on-lime); }
.stage-ia p { margin: 0; font-size: 13px; line-height: 1.45; opacity: .8; }
.stage-graphic { position: absolute; inset: 0; background: radial-gradient(90% 55% at 85% 100%, #6c9a37 0%, transparent 70%), radial-gradient(70% 40% at 0% 0%, #2f4a25 0%, transparent 70%), var(--stage); }
.stage-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgb(0 0 0 / .4) 0%, transparent 22%, transparent 48%, rgb(0 0 0 / .7) 100%); }
.stage-progress { position: absolute; z-index: 3; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; }
.stage-progress span { height: 3px; border-radius: 2px; background: rgb(255 255 255 / .3); overflow: hidden; }
.stage-progress i { display: block; height: 100%; width: 0; background: #fff; }
.stage-badge { position: absolute; z-index: 2; top: 22px; left: 10px; max-width: calc(100% - 20px); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgb(0 0 0 / .5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-text { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 23%; margin: 0; font-family: var(--font-display); font-size: 25px; line-height: 1.08; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; overflow-wrap: anywhere; text-shadow: 0 2px 14px rgb(0 0 0 / .55); }
.stage-end { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 10%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stage-end img { max-height: 42px; max-width: 45%; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
.stage-cta { margin-left: auto; font-size: 14px; font-weight: 700; padding: 10px 16px; border-radius: 999px; background: var(--lime); color: var(--on-lime); white-space: nowrap; }
.stage-ai-label { position: absolute; z-index: 3; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 11.5px; opacity: .7; pointer-events: none; }
.player-controls { display: flex; align-items: center; gap: 8px; max-width: 300px; margin: 14px auto 0; }
.play { background: var(--brand); color: var(--lime); border-color: var(--brand); }
.play:hover { background: var(--brand); opacity: .9; }
.play .i-pause, .play[data-state="pause"] .i-play { display: none; }
.play[data-state="pause"] .i-pause { display: block; }
.time { margin-left: auto; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seek { display: block; width: 100%; max-width: 300px; margin: 10px auto 0; accent-color: var(--accent); height: 28px; }

.scenes { display: grid; gap: 12px; min-width: 0; }
.scene { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); min-width: 0; transition: border-color .15s, box-shadow .15s; }
.scene.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.scene .field { margin: 0; }
.scene textarea { min-height: 80px; background: var(--surface); }
.scene select { background: var(--surface); }
.scene-head { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.scene-time { font-family: var(--font-display); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.scene-role { font-size: 14px; font-weight: 600; color: var(--muted); }
.src { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.src-ia { background: var(--warn-soft); color: var(--warn); }
.src-media { background: var(--accent-soft); color: var(--accent); }
.src-graphique { background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.scene-head .btn { margin-left: auto; min-height: 40px; }
.scene .grid-2 { gap: 14px 16px; }

.scenario-foot { display: grid; gap: 16px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.estimate { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.estimate strong { font-family: var(--font-display); font-size: 26px; font-variant-numeric: tabular-nums; }
.estimate .hint { flex-basis: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 560px) { .actions .btn { flex: 1 1 100%; } }

/* ---------- Projets ---------- */
.project-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.project { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.project-thumb { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; background: var(--brand); color: var(--lime); font-family: var(--font-display); font-size: 34px; font-weight: 700; }
.project-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project-thumb.logo img { object-fit: contain; padding: 22%; }
.project-body { flex: 1; display: grid; gap: 6px; align-content: start; padding: 16px 16px 12px; }
.project-body h3 { margin: 0; font-family: var(--font-display); font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }
.project-meta { margin: 0; font-size: 13px; color: var(--muted); }
.project-status { justify-self: start; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.project-status.ready { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.project-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 16px; }
.project-actions .btn { flex: 1; min-height: 44px; padding: 0 12px; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 48px 20px; text-align: center; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); grid-column: 1 / -1; }
.empty strong { font-family: var(--font-display); font-size: 20px; }
.storage-info { margin-top: 18px; }

/* ---------- Notification ---------- */
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 8px); width: max-content; max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.no-bar .toast { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 960px) { .toast { bottom: 28px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
