/* StudioWClip v2 — compléments à legacy.css (thème de l'ancienne application) :
   données réelles (miniatures, statuts), éditeur d'émission, habillage, formulaires. */

:root {
  --red: #EF4444;
  --red-dim: rgba(239, 68, 68, .15);
  --gradient: linear-gradient(135deg, var(--purple), var(--pink));
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ── Titres de page ── */
.page-head { margin: 8px 0 24px; }
.page-head h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.page-head p { color: var(--text2); margin-top: 6px; max-width: 760px; font-size: .9rem; line-height: 1.6; }
.back-link { color: var(--text3); font-size: .82rem; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.back-link:hover { color: var(--text); }
.back-link svg { width: 14px; height: 14px; }
.muted { color: var(--text3); font-size: .82rem; }
h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
h3 { font-size: .9rem; font-weight: 700; margin-bottom: 8px; }

/* ── Miniatures réelles sur les blocs de couleur de l'ancien design ── */
.project-thumb, .project-detail-thumb, .clip-thumb, .export-thumb { position: relative; overflow: hidden; }
.project-thumb img, .project-detail-thumb img, .clip-thumb img, .export-thumb img, .screen-thumb {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.screen-thumb { opacity: .55; }
.video-play-btn { position: relative; z-index: 2; color: #fff; text-decoration: none; }
.clip-card { text-decoration: none; display: block; }
.clip-card.rejected { opacity: .4; }
.clip-play, .clip-duration, .clip-num { z-index: 2; }
.clip-done {
  position: absolute; top: 4px; right: 4px; z-index: 2; font-size: .58rem; font-weight: 700;
  background: var(--green); color: #04120A; padding: 1px 6px; border-radius: 3px;
}
.project-detail { display: none; }
.project-detail.shown { display: block; }
.project-detail-thumb { width: 96px; height: 54px; }
.status-wait { background: rgba(255, 255, 255, .06); color: var(--text3); }
.status-error { background: var(--red-dim); color: var(--red); }
.status-process-pill { background: rgba(245, 158, 11, .12); color: var(--orange); }
.status-wait-pill { background: rgba(255, 255, 255, .06); color: var(--text3); }
.status-error-pill { background: var(--red-dim); color: var(--red); }
.export-title { font-size: .75rem; font-weight: 600; line-height: 1.35; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.export-thumb.export-vertical { width: 44px; height: 78px; }
.user-menu { display: none; }
.user-menu.open { display: block; }
.user-menu-item svg { width: 14px; height: 14px; }

/* ── Grilles des pages Projets / Exports ── */
.cards-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); padding-bottom: 32px; }
.project-card { text-decoration: none; display: block; padding: 0; transition: border-color .2s, transform .2s; }
.project-card:hover { border-color: rgba(124, 58, 237, .4); transform: translateY(-2px); }
.project-card .cover { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.project-card .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project-card .body { padding: 14px; }
.project-card .project-name { font-size: .92rem; font-weight: 700; white-space: normal; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.step { font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--card2); color: var(--text3); border: 1px solid var(--border); }
.step.ok { background: var(--green-dim); color: var(--green); border-color: transparent; }
.step.wait { background: var(--orange-dim); color: var(--orange); border-color: transparent; }
.step.ko { background: var(--red-dim); color: var(--red); border-color: transparent; }
.short-card { padding: 0; }
.short-card video { width: 100%; aspect-ratio: 9/16; background: #000; display: block; }
.short-card .body { padding: 12px 14px; }
.short-card .actions { margin-top: 8px; }

/* ── Boutons de l'éditeur ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--card2); font-weight: 600; font-size: .82rem; cursor: pointer; text-decoration: none;
  transition: background .2s, border-color .2s, opacity .2s; white-space: nowrap;
}
.btn:hover { border-color: #3A3A4A; background: #1C1C27; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn.primary { background: var(--gradient); border-color: transparent; }
.btn.green { background: var(--green); border-color: transparent; color: #04120A; }
.btn.small { padding: 5px 10px; font-size: .76rem; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn svg { width: 14px; height: 14px; }

/* ── Formulaires ── */
label { display: block; font-size: .75rem; font-weight: 600; color: var(--text2); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; outline: none; transition: border-color .2s; font-size: .85rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--purple); }
textarea { resize: vertical; min-height: 60px; }
input[type=range] { width: 100%; accent-color: var(--pink); }
input[type=color] { width: 44px; height: 34px; border: 1px solid var(--border); border-radius: 6px; background: none; padding: 2px; }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 110px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text); font-weight: 500; margin: 0; cursor: pointer; }
.check input { accent-color: var(--pink); width: 16px; height: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.error-box { background: var(--red-dim); color: #FCA5A5; padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: .82rem; }
code { background: var(--card2); padding: 1px 6px; border-radius: 4px; font-size: .8rem; }

/* ── Envoi d'une vidéo ── */
.upload-progress { margin-top: 14px; }
.upload-bar { height: 6px; background: var(--border2); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.upload-bar div { height: 100%; width: 0; background: var(--gradient); transition: width .3s; }
.dropzone-modal { display: block; }

/* ── Page émission (éditeur) ── */
.episode-layout { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 16px; align-items: start; padding-bottom: 32px; }
.player-col { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; }
.player { width: 100%; border-radius: var(--radius); background: #000; aspect-ratio: 16/9; border: 1px solid var(--border2); display: block; }
.transcript { max-height: 46vh; overflow-y: auto; padding: 0; }
.transcript .seg { display: flex; gap: 10px; padding: 7px 14px; cursor: pointer; border-bottom: 1px solid var(--border2); font-size: .82rem; line-height: 1.5; }
.transcript .seg:hover { background: var(--card2); }
.transcript .seg.current { background: var(--purple-dim); }
.transcript .seg .t { color: var(--pink); font-variant-numeric: tabular-nums; flex-shrink: 0; font-size: .75rem; padding-top: 2px; }
.transcript .seg .txt { flex: 1; }
.transcript .seg.edited .txt { color: #FCD34D; }
.transcript .seg-form { flex: 1; }
.seg-edit { background: none; border: 0; cursor: pointer; opacity: .35; padding: 0 2px; font-size: .9rem; align-self: flex-start; }
.transcript .seg:hover .seg-edit { opacity: 1; }
@media (hover: none) { .seg-edit { opacity: .8; } }
.transcript-search { padding: 12px 14px; border-bottom: 1px solid var(--border2); position: sticky; top: 0; background: var(--card); z-index: 1; }

.proposal { margin-bottom: 12px; overflow: visible; }
.proposal.rejected { opacity: .45; }
.proposal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; cursor: pointer; }
.proposal-head .meta { color: var(--text3); font-size: .75rem; }
.proposal-thumb { width: 96px; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: linear-gradient(135deg, #1D4ED8, #7C3AED); position: relative; }
.proposal-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.proposal-head .grow { flex: 1; min-width: 0; }
.proposal-title { font-weight: 700; font-size: .98rem; margin: 2px 0 4px; }
.proposal-body { display: none; margin-top: 16px; border-top: 1px solid var(--border2); padding-top: 16px; }
.proposal.open .proposal-body { display: grid; grid-template-columns: 1fr 250px; gap: 20px; }
.badge { font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--purple-dim); color: #C4B5FD; }
.badge.green { background: var(--green-dim); color: var(--green); }

.timebox { display: flex; gap: 6px; align-items: center; }
.timebox input { width: 88px; font-variant-numeric: tabular-nums; }
.time-group { background: var(--card2); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; }
.time-group .row { margin-top: 6px; }

.subs { max-height: 260px; overflow-y: auto; border: 1px solid var(--border2); border-radius: var(--radius-sm); }
.subs .sub { display: flex; gap: 8px; align-items: center; padding: 4px 8px; border-bottom: 1px solid var(--border2); }
.subs .sub .t { font-size: .72rem; color: var(--text3); width: 44px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.subs .sub .sub-input { padding: 5px 8px; font-size: 16px; line-height: 1.35; width: 100%; resize: none; overflow: hidden; min-height: 32px; }
@media (min-width: 701px) { .subs .sub .sub-input { font-size: .82rem; } }
.subs .sub.edited input { border-color: var(--orange); }

.preview-box { display: flex; flex-direction: column; gap: 8px; }
.preview-img { width: 100%; aspect-ratio: 9/16; background: var(--card2); border: 1px solid var(--border2); border-radius: var(--radius-sm); object-fit: cover; }
.renders { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.render-line { display: flex; gap: 10px; align-items: center; font-size: .8rem; background: var(--card2); padding: 6px 10px; border-radius: var(--radius-sm); }
.render-line .grow { flex: 1; }

/* ── Habillage ── */
.style-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; padding-bottom: 32px; }
.style-preview { position: sticky; top: 16px; }
fieldset { border: 1px solid var(--border2); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; background: var(--card); }
legend { padding: 0 8px; font-weight: 700; font-size: .9rem; }

/* ── Notifications ── */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(140px);
  background: var(--card2); border: 1px solid var(--border); padding: 12px 18px; border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6); transition: transform .3s; z-index: 400; max-width: 90vw; font-size: .88rem;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--red); }

/* ── Connexion ── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; width: 100%; }
.login-card { position: relative; z-index: 10; background: rgba(18, 18, 26, .9); border: 1px solid rgba(255, 255, 255, .08); border-radius: 24px; padding: 44px 36px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 40px 100px rgba(0, 0, 0, .7); backdrop-filter: blur(20px); }
.login-card h1 { font-size: 2rem; font-weight: 800; margin: 14px 0 8px; }
.login-card p { color: var(--text2); margin-bottom: 28px; }
.google-btn { width: 100%; padding: 13px; font-size: .95rem; display: flex; justify-content: center; text-decoration: none; }
.blob { position: fixed; border-radius: 50%; filter: blur(80px); opacity: .18; pointer-events: none; }
.blob-1 { width: 500px; height: 500px; background: #7C3AED; top: -100px; left: -100px; }
.blob-2 { width: 400px; height: 400px; background: #EC4899; bottom: -100px; right: -100px; }

@media (max-width: 1100px) {
  .episode-layout, .style-layout { grid-template-columns: 1fr; }
  .player-col, .style-preview { position: static; }
  .proposal.open .proposal-body { grid-template-columns: 1fr; }
}
.preview-empty { display: flex; align-items: center; justify-content: center; text-align: center; color: var(--text3); font-size: .78rem; line-height: 1.6; padding: 20px; }
img.preview-img[hidden] { display: none; }
/* Téléphone : rien ne doit dépasser de l'écran */
.content-grid > *, .episode-layout > *, .style-layout > * { min-width: 0; }
@media (max-width: 768px) {
  .project-detail-header { flex-wrap: wrap; }
  .project-detail-header .btn-primary { width: 100%; justify-content: center; }
  .project-detail-title { white-space: normal; }
  .proposal-thumb { width: 72px; }
  .hero-visual { max-width: 100%; overflow: hidden; }
}

/* ── Recadrage par plans ── */
.reframe-summary { display: flex; gap: 12px; align-items: center; background: var(--card2); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; }
.reframe-summary .grow { flex: 1; min-width: 0; font-size: .85rem; }
.modal.reframe-modal { max-width: 1180px; width: 96vw; max-height: 94vh; overflow-y: auto; }
.rf-layout { display: grid; grid-template-columns: 1fr 290px; gap: 18px; }
.rf-main { min-width: 0; }
.rf-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.rf-tab { padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card2); color: var(--text2); font-size: .8rem; font-weight: 600; cursor: pointer; }
.rf-tab.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.rf-stage { position: relative; background: #000; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 16/9; }
.rf-stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
.rf-boxes { position: absolute; touch-action: none; }
.rf-box { position: absolute; border: 2px solid #A78BFA; background: rgba(124, 58, 237, .12); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); cursor: move; touch-action: none; border-radius: 4px; }
.rf-boxes .rf-box + .rf-box { box-shadow: none; border-color: #F472B6; background: rgba(236, 72, 153, .12); }
.rf-box-label { position: absolute; top: 4px; left: 4px; font-size: .62rem; font-weight: 700; background: rgba(0, 0, 0, .6); color: #fff; padding: 1px 6px; border-radius: 3px; pointer-events: none; }
.rf-handle { position: absolute; right: -7px; bottom: -7px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--purple); cursor: nwse-resize; }
.rf-transport { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.rf-seek-wrap { position: relative; flex: 1; }
.rf-marks { position: absolute; left: 0; right: 0; top: -6px; height: 6px; pointer-events: none; }
.rf-mark { position: absolute; width: 3px; height: 8px; border-radius: 2px; transform: translateX(-1px); }
.rf-side canvas { width: 100%; max-width: 270px; aspect-ratio: 9/16; display: block; margin: 0 auto; border-radius: var(--radius-sm); border: 1px solid var(--border2); background: #000; }
.rf-positions-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 14px 0 8px; }
.rf-positions { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.rf-pos { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--card2); border: 1px solid var(--border2); font-size: .8rem; cursor: pointer; }
.rf-pos.active { border-color: var(--purple); background: var(--purple-dim); }
.rf-pos .grow { flex: 1; }
.rf-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.rf-vertical { background: #A78BFA; }
.rf-split { background: #F472B6; }
.rf-horizontal { background: #60A5FA; }
.modal-footer .btn-primary { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 900px) {
  .rf-layout { grid-template-columns: 1fr; }
  .rf-side canvas { max-width: 200px; }
}
.video-play-btn { border: 0; cursor: pointer; }
.screen-video-player { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; z-index: 3; }

/* ── Émissions (programmes) ── */
.programme-switch { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 9px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border2); background: rgba(255, 255, 255, .03); text-decoration: none; color: var(--text); transition: border-color .2s; }
.programme-switch:hover { border-color: rgba(124, 58, 237, .5); }
.programme-switch-logo { width: 46px; height: 30px; border-radius: 6px; background: var(--gradient); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.programme-switch-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.programme-switch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.programme-switch-text small { font-size: .62rem; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.programme-switch-text b { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.programme-switch svg { width: 14px; height: 14px; color: var(--text3); }
.programmes-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.programme-card { padding: 0; display: flex; flex-direction: column; }
.programme-card.current { border-color: rgba(124, 58, 237, .5); box-shadow: 0 0 0 1px rgba(124, 58, 237, .25); }
.programme-logo { height: 120px; background: linear-gradient(135deg, #1A0E2E, #0D0D18); display: flex; align-items: center; justify-content: center; padding: 16px; }
.programme-logo img { max-width: 80%; max-height: 100%; object-fit: contain; }
.programme-card .body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.programme-name { font-size: 1.05rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.programme-name svg { width: 18px; height: 18px; color: var(--pink); }
.programme-card .actions { margin-top: auto; padding-top: 10px; }
.programme-new { border-style: dashed; }
.episode-programme { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; flex-wrap: wrap; }
.episode-programme label { margin: 0; }
.episode-programme select { width: auto; min-width: 200px; }
.drive-line { font-size: .78rem; margin-top: 4px; }
.drive-line a { color: #93C5FD; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.drive-line a:hover { text-decoration: underline; }
.drive-line svg, .drive-folders svg { width: 14px; height: 14px; }
.drive-folders { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.drive-folders a { justify-content: flex-start; }

/* ── Choix des polices ── */
.font-field { flex-basis: 100%; }
.font-sample { margin: 8px 0 6px; padding: 10px 12px; background: var(--card2); border: 1px solid var(--border2); border-radius: var(--radius-sm); font-size: 1.3rem; line-height: 1.25; text-transform: uppercase; }
.font-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 10px; max-height: 360px; overflow-y: auto; padding: 2px; }
.font-tile { text-align: left; background: var(--bg); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 10px; cursor: pointer; color: var(--text); display: flex; flex-direction: column; gap: 6px; transition: border-color .2s; }
.font-tile:hover { border-color: var(--purple); }
.font-tile.active { border-color: var(--pink); background: var(--purple-dim); }
.font-tile-sample { font-size: 1.05rem; text-transform: uppercase; line-height: 1.2; }
.font-tile-name { font-family: Inter, sans-serif; font-size: .7rem; color: var(--text3); }

/* ── Panneau du bas : texte / visuel ── */
.seg-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 8px; }
.seg-toggle button { background: var(--card2); border: 0; padding: 6px 14px; font-size: .8rem; font-weight: 600; color: var(--text2); cursor: pointer; }
.seg-toggle button.active { background: var(--purple); color: #fff; }
.panel-visual { display: flex; gap: 12px; align-items: center; }
.panel-visual .grow { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.panel-thumb { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border2); }
.modal.panel-modal { max-width: 900px; width: 96vw; max-height: 94vh; overflow-y: auto; }
.pm-layout { display: grid; grid-template-columns: minmax(240px, 360px) 1fr; gap: 20px; align-items: start; }
.pm-stage { position: relative; width: 100%; aspect-ratio: 9/16; background: #000; border-radius: var(--radius-sm); overflow: hidden; touch-action: none; }
.pm-stage img, .pm-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pm-box { position: absolute; border: 2px dashed #F472B6; cursor: move; touch-action: none; }
@media (max-width: 760px) { .pm-layout { grid-template-columns: 1fr; } }

/* ── Transition ── */
.transition-block .row { align-items: center; }
.transition-video { width: 100%; max-width: 220px; aspect-ratio: 9/16; margin-top: 8px; border-radius: var(--radius-sm); background: #000; display: block; }
.transition-video[hidden] { display: none; }

/* ── Accroche / séquence : texte et sélection dans la transcription ── */
.phrase { font-size: .8rem; color: #C4B5FD; margin-top: 8px; line-height: 1.45; }
.transcript .w { cursor: text; border-radius: 3px; }
.transcript .w:hover { background: rgba(124, 58, 237, .25); }
.sel-toolbar { position: absolute; z-index: 300; display: flex; gap: 6px; background: var(--card2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.sel-toolbar[hidden] { display: none; }

/* ── Autocomplétion des phrases (accroche, début et fin de séquence) ── */
.ac { position: relative; margin: 6px 0; }
.ac-input { width: 100%; resize: none; overflow: hidden; min-height: 40px; line-height: 1.4; font-size: 16px; /* 16 px : pas de zoom auto sur iPhone */ }
.ac-hint { font-size: .75rem; color: var(--pink); margin-top: 3px; font-variant-numeric: tabular-nums; }
.ac-hint[hidden] { display: none; }
.ac-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 700px) { .ac-pair { grid-template-columns: 1fr; } }
/* galerie des visuels du panneau du bas */
.panel-visual { flex-direction: column; align-items: stretch; }
.visual-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; padding: 2px; }
.visual-item, .visual-add { aspect-ratio: 1; border-radius: 8px; border: 2px solid var(--border2); background: repeating-conic-gradient(#2a2f45 0 25%, #1d2133 0 50%) 0 0 / 14px 14px; padding: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.visual-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.visual-item.selected { border-color: var(--pink); box-shadow: 0 0 0 2px rgba(236, 72, 153, .35); }
.visual-add { flex-direction: column; background: var(--card2); color: var(--muted, #aaa); font-size: 1.4rem; border-style: dashed; }
.visual-add span { font-size: .7rem; }
.ac-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); background: var(--card2); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 16px 40px rgba(0, 0, 0, .55); max-height: 300px; overflow-y: auto; min-width: 280px; }
.ac-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--border2); font-size: .82rem; line-height: 1.4; }
.ac-item:last-child { border-bottom: 0; }
.ac-item.active, .ac-item:hover { background: var(--purple-dim); }
.ac-time { color: var(--pink); font-variant-numeric: tabular-nums; font-size: .75rem; padding-top: 2px; flex-shrink: 0; }
.ac-time small { display: block; color: var(--muted, #888); font-size: .65rem; }
.ac-text { flex: 1; }
.ac-play { background: none; border: 1px solid var(--border); border-radius: 50%; width: 24px; height: 24px; color: var(--text); cursor: pointer; flex-shrink: 0; font-size: .65rem; }
.ac-play:hover { border-color: var(--pink); }
.ac-empty { padding: 10px; font-size: .8rem; color: var(--text3); }
@media (max-width: 640px) { .ac-pair { grid-template-columns: 1fr; } }
.rf-banner { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none; background: repeating-linear-gradient(135deg, rgba(0,0,0,.55) 0 8px, rgba(0,0,0,.35) 8px 16px); border-top: 2px dashed #F472B6; }
.rf-banner span { position: absolute; right: 6px; top: 4px; font-size: .7rem; color: #fff; opacity: .85; }
.visual-item { position: relative; }
.visual-del { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: #111; border: 1px solid var(--border); color: #fff; font-size: 15px; line-height: 19px; text-align: center; }
.visual-del:hover { background: #e11d48; }
/* éditeur de cadrage : changements de plan détectés, boutons toujours visibles (téléphone) */
.rf-shot { position: absolute; top: -2px; width: 2px; height: 22px; background: rgba(255, 255, 255, .55); transform: translateX(-1px); border-radius: 1px; }
.modal.reframe-modal { overflow-x: hidden; }
.reframe-modal .rf-stage { max-width: 100%; }
.reframe-modal .modal-footer { position: sticky; bottom: -1px; z-index: 5; background: var(--card, #161a2b); padding-top: 12px; padding-bottom: 12px; margin-bottom: -1px; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--border2); }
@media (max-width: 640px) {
  .reframe-modal .modal-footer > span { display: none; }
  .reframe-modal .modal-footer .btn, .reframe-modal .modal-footer .btn-primary { flex: 1 1 45%; justify-content: center; }
}
@media (max-width: 640px) {
  .rf-transport { flex-wrap: wrap; }
  .rf-transport #rfTime { width: 100%; text-align: right; font-size: .8rem; }
  .reframe-modal .modal-footer { display: grid; grid-template-columns: 1fr 1fr; padding-top: 8px; padding-bottom: 8px; }
  .reframe-modal .modal-footer .btn { padding: 8px 6px; font-size: .8rem; }
  .reframe-modal .modal-footer .btn-primary { grid-column: 1 / -1; }
}

/* récupération de la vidéo depuis Drive (supprimée du serveur au bout de 7 jours) */
.restore-source { padding: 12px 14px; margin: 10px 0; display: grid; gap: 8px; }
.restore-source p { margin: 0; }
.restore-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.restore-bar > div { height: 100%; width: 0; background: var(--accent, #a855f7); transition: width .4s; }
