/* Studio Montage : direction artistique de la maquette (brief §11). */

/* Polices embarquées (licence OFL, voir THIRD-PARTY.md) : la page s'affiche sans connexion. */
@font-face { font-family: 'Anton'; src: url('/polices/anton/Anton-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/polices/spacegrotesk/SpaceGrotesk-Variable.ttf') format('truetype'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/polices/manrope/Manrope-Variable.ttf') format('truetype'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/polices/jetbrainsmono/JetBrainsMono-Variable.ttf') format('truetype'); font-weight: 100 800; font-display: swap; }

:root {
  --fond: #F5F2EA;
  --encre: #121314;
  --accent: #C6FF4A;
  --bordure: #DDD8CC;
  --gris: #5E5B54;
  --rec: #D97757;
  --rec-texte: #9A4A2E;
  --titre: 'Space Grotesk', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --texte: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--texte); font-size: 15px; line-height: 1.5; }
button { font-family: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus-visible, input:focus-visible, label:focus-within, a:focus-visible { outline: 3px solid #3E95DB; outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; }
.muted { color: var(--gris); font-size: 13px; }

.page { min-height: 100vh; padding: 24px; max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 24px; }
.top-spacer { width: 160px; }
@media (max-width: 900px) { .top-spacer { display: none; } }
.brand { margin: 0; font-family: var(--titre); font-weight: 700; font-size: 28px; line-height: 1; letter-spacing: -0.025em; }
.brand-mark { background: var(--accent); border: 2px solid var(--encre); border-radius: 4px; padding: 0 8px; }
.tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.tab { min-height: 44px; padding: 6px 16px; color: var(--encre); background: #FFFFFF; border: 2px solid var(--encre); border-radius: 8px; font-family: var(--titre); font-size: 14px; font-weight: 700; }
.tab[aria-pressed="true"] { background: var(--accent); box-shadow: 4px 4px 0 var(--encre); }

.toast { margin: 0; padding: 12px 16px; background: var(--encre); color: var(--fond); border-radius: 8px; font-size: 14px; font-weight: 600; }

.columns { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 22px; }
.panel { min-width: 0; background: #FFFFFF; border: 2px solid var(--encre); border-radius: 12px; box-shadow: 5px 5px 0 var(--encre); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.col-new { flex: 1 1 340px; gap: 18px; }
.col-jobs { flex: 1 1 300px; }
.col-done { flex: 2 1 460px; }
.head { display: flex; flex-direction: column; gap: 4px; }
.head h2 { margin: 0; font-family: var(--titre); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.row { display: flex; align-items: center; gap: 10px; }
.label { margin: 0; padding: 0; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gris); }
.rec { display: flex; align-items: center; gap: 6px; color: var(--rec-texte); }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rec); display: inline-block; }
.count { font-family: var(--mono); font-size: 12px; font-weight: 600; background: var(--encre); color: var(--fond); border-radius: 3px; padding: 2px 8px; }
.group { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 10px; }

.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 16px; background: var(--fond); border: 2px dashed var(--encre); border-radius: 8px; text-align: center; cursor: pointer; }
.drop strong { font-size: 15px; overflow-wrap: anywhere; max-width: 100%; }
.drop.over { background: var(--accent); }
.drop.ready { border-style: solid; }

.styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.style-card { display: flex; flex-direction: column; gap: 6px; padding: 6px; background: #FFFFFF; color: var(--encre); border: 2px solid var(--bordure); border-radius: 8px; text-align: left; }
.style-card[aria-pressed="true"] { border-color: var(--encre); background: var(--accent); box-shadow: 3px 3px 0 var(--encre); }
.style-card { align-items: stretch; text-align: center; }
.style-card .name { font-size: 13px; font-weight: 700; }
.style-card:disabled { color: var(--encre); }
.style-card .soon-badge { font-family: var(--mono); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gris); }
.thumb { aspect-ratio: 9 / 16; width: 100%; background: var(--encre); border: 2px solid var(--encre); border-radius: 6px; display: flex; align-items: center; justify-content: center; padding: 6px; text-align: center; overflow: hidden; }
.thumb-line { display: inline-block; line-height: 1.2; }
.thumb-line .hl { margin-left: 0.28em; }

.options { gap: 4px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--encre); }
.check.disabled { color: var(--gris); }
.soon { font-style: normal; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; border: 1px solid var(--bordure); border-radius: 3px; padding: 1px 6px; margin-left: 4px; }

.btn-launch { min-height: 50px; padding: 10px 18px; background: var(--accent); color: var(--encre); border: 2px solid var(--encre); border-radius: 8px; box-shadow: 4px 4px 0 var(--encre); font-family: var(--titre); font-size: 17px; font-weight: 700; }
.btn-launch:disabled { background: #EDE9DF; color: var(--gris); box-shadow: none; }

.jobs { display: flex; flex-direction: column; gap: 12px; }
.job { background: var(--fond); border: 1px solid var(--bordure); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.job-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.job-top strong { font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.pct { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.bar { height: 10px; background: #FFFFFF; border: 2px solid var(--encre); border-radius: 3px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); border-right: 2px solid var(--encre); transition: width 0.4s ease; }
.job-step { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 13px; color: var(--gris); }
.job.failed { border: 2px solid var(--encre); background: #FFFFFF; }
.job .error { margin: 0; font-size: 13px; color: var(--encre); }
.job-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 14px; background: #FFFFFF; color: var(--encre); border: 2px solid var(--encre); border-radius: 8px; font-size: 14px; font-weight: 700; text-decoration: none; }
.btn.dark { background: var(--encre); color: var(--fond); }

.empty { margin: 0; padding: 20px 14px; border: 2px dashed var(--bordure); border-radius: 8px; font-size: 14px; color: var(--gris); text-align: center; }

.done { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 8px; background: var(--fond); border: 1px solid var(--bordure); border-radius: 8px; }
.card video { aspect-ratio: 9 / 16; width: 100%; background: var(--encre); border: 2px solid var(--encre); border-radius: 6px; display: block; object-fit: cover; }
.card strong { font-size: 14px; overflow-wrap: anywhere; }
.card .meta { font-family: var(--mono); font-size: 12px; color: var(--gris); }
.card .warn { margin: 0; font-size: 12px; color: var(--gris); }

[hidden] { display: none !important; }

.pair { display: flex; flex-wrap: wrap; gap: 10px; }
.pair .btn { flex: 1 1 150px; gap: 8px; }
.btn.dashed { border-style: dashed; }
.btn:disabled { opacity: 0.55; }
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.card .actions { display: flex; flex-direction: column; gap: 6px; }
.card.running { background: #FFFFFF; border: 2px dashed var(--encre); }
.card .status { font-family: var(--mono); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.card .placeholder { aspect-ratio: 9 / 16; width: 100%; background: var(--encre); border: 2px solid var(--encre); border-radius: 6px; display: flex; align-items: center; justify-content: center; }

.library { gap: 16px; }
.library h2, #view-boutique h2 { margin: 0; font-family: var(--titre); font-size: 24px; font-weight: 700; letter-spacing: -0.025em; }
.library-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.search { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.search input { width: 260px; max-width: 100%; min-height: 44px; padding: 8px 12px; background: #FFFFFF; color: var(--encre); border: 2px solid var(--encre); border-radius: 8px; font-family: inherit; font-size: 15px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { min-height: 44px; padding: 6px 16px; color: var(--encre); background: #FFFFFF; border: 2px solid var(--encre); border-radius: 8px; font-family: var(--titre); font-size: 14px; font-weight: 700; }
.filter[aria-pressed="true"] { background: var(--accent); box-shadow: 4px 4px 0 var(--encre); }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.day { grid-column: 1 / -1; margin: 8px 0 0; padding-bottom: 8px; border-bottom: 2px solid var(--encre); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-family: var(--titre); font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.intro { margin: 6px 0 0; max-width: 62ch; color: var(--gris); }
.pair .btn { white-space: nowrap; }
