:root {
  --bg: #f5f4f0; --card: #fff; --ink: #151515; --muted: #6e6c66; --line: #e3e0d8; --soft: #efede7;
  --accent: #3700ff; --accent-ink: #fff; --mark: #ff3b30; --bleu: #3700ff; --menthe: #c9f5e6; --ok: #1f8a4c; --stage: #0d0d0d;
  --r: 14px; --shadow: 0 1px 2px #0000000d, 0 6px 24px #0000000a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
a.btn, a.mini { text-decoration: none; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* en-tête */
.top { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 5; }
.logo { height: 26px; width: auto; display: block; }
.brand { display: flex; align-items: baseline; gap: 6px; text-decoration: none; white-space: nowrap; }
.brand b { font-weight: 800; letter-spacing: .22em; font-size: 14px; }
.brand span { font-weight: 400; letter-spacing: .22em; font-size: 14px; color: var(--muted); }
.top .sep { width: 1px; height: 22px; background: var(--line); }
.top .titre { min-width: 0; }
.top .titre h1 { font-size: 15px; margin: 0; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .titre p { margin: 0; font-size: 12.5px; color: var(--muted); }
.top .fill { flex: 1; }

/* boutons et champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 14px; font-weight: 550; font-size: 14px; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn:hover { border-color: #cfcbc1; background: var(--soft); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #2a00c4; border-color: #2a00c4; }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.ok:hover { background: #18703d; }
.btn.danger { color: #b3261e; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: default; }
.field { display: grid; gap: 6px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.input, textarea.input { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: #9a968c; box-shadow: 0 0 0 3px #00000010; }
textarea.input { resize: vertical; min-height: 84px; }

/* page de relecture */
.rv { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; padding: 20px 24px; max-width: 1500px; margin: 0 auto; align-items: start; }
.col { display: grid; gap: 12px; min-width: 0; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tab { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 550; }
.tab.on { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.tab .n { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--mark); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.tab.on .n { background: #fff; color: var(--ink); }
select.input.ver { width: auto; padding: 6px 10px; font-size: 13.5px; }
.stage-wrap { background: var(--stage); border-radius: var(--r); display: flex; justify-content: center; align-items: center; overflow: hidden; box-shadow: var(--shadow); }
.stage { position: relative; max-width: 100%; }
.stage video { display: block; width: 100%; height: 100%; background: #000; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; touch-action: none; }
.stage.drawing canvas { pointer-events: auto; cursor: crosshair; }
.stage .badge { position: absolute; left: 12px; top: 12px; background: #000000b3; color: #fff; font-size: 12px; padding: 4px 9px; border-radius: 99px; pointer-events: none; }
.ctrl { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; }
.ic { width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; display: grid; place-items: center; flex: none; }
.ic:hover { background: var(--soft); }
.ic svg { width: 20px; height: 20px; }
.time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); white-space: nowrap; }
.bar { position: relative; flex: 1; height: 34px; cursor: pointer; touch-action: none; }
.bar .rail { position: absolute; left: 0; right: 0; top: 15px; height: 4px; border-radius: 2px; background: var(--line); }
.bar .fill { position: absolute; left: 0; top: 15px; height: 4px; border-radius: 2px; background: var(--bleu); }
.bar .head { position: absolute; top: 10px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--bleu); box-shadow: 0 0 0 3px #fff; }
.bar .mk { position: absolute; top: 4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--mark); border: 2px solid #fff; box-shadow: 0 1px 3px #0003; }
.bar .mk.fait { background: var(--ok); }
.tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; }
.tools .lab { font-size: 12.5px; color: var(--muted); font-weight: 550; margin-right: 4px; }
.tool { height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid transparent; background: transparent; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 550; }
.tool:hover { background: var(--soft); }
.tool.on { background: var(--bleu); color: #fff; }
.tool svg { width: 18px; height: 18px; }
.sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); padding: 0; }
.sw.on { box-shadow: 0 0 0 2px var(--ink); }
.tools .vr { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

/* panneau des commentaires */
.aside { position: sticky; top: 76px; display: grid; gap: 12px; max-height: calc(100vh - 96px); grid-template-rows: auto minmax(0, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.compose { padding: 14px; display: grid; gap: 10px; }
.compose .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.compose h2 { font-size: 14px; margin: 0; }
.tc { font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 650; background: var(--soft); border-radius: 6px; padding: 2px 7px; border: 0; }
button.tc:hover { background: var(--line); }
.compose .row { display: flex; gap: 8px; align-items: center; }
.compose .hint { font-size: 12.5px; color: var(--muted); }
.list { overflow: auto; padding: 6px; }
.list .vide { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.list .cnt { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 4px; font-size: 12.5px; color: var(--muted); font-weight: 550; }
.cm { padding: 12px; border-radius: 11px; display: grid; gap: 6px; border: 1px solid transparent; cursor: pointer; }
.cm textarea { cursor: text; }
.cm:hover { background: #faf9f6; }
.cm.sel { border-color: var(--bleu); background: #faf9f6; }
.cm.fait > .meta .who, .cm.fait > .txt { opacity: .55; }
.cm .meta { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.cm .who { font-weight: 650; }
.cm .when { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.cm .txt { white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.cm .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.cm .acts .lnk { padding: 5px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 12.5px; }
.cm .acts .lnk:hover { border-color: #cfcbc1; background: var(--soft); }
.cm .acts .lnk.sup { color: #b3261e; }
.cm .acts .lnk.ok { color: var(--ok); }
.cm .lnk { border: 0; background: none; padding: 2px 0; font-size: 12.5px; color: var(--muted); font-weight: 550; }
.cm .lnk:hover { color: var(--ink); }
.cm .rep { margin-left: 14px; padding-left: 12px; border-left: 2px solid var(--line); display: grid; gap: 4px; }
.cm .rep .who { font-size: 12.5px; }
.cm .pen { color: var(--mark); font-size: 12px; font-weight: 600; }
.okbadge { font-size: 11.5px; font-weight: 650; color: var(--ok); background: #e6f4ec; border-radius: 6px; padding: 1px 7px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); z-index: 50; }
.center { min-height: 70vh; display: grid; place-items: center; padding: 24px; text-align: center; }

/* administration */
.adm { max-width: 980px; margin: 0 auto; padding: 28px 24px 60px; display: grid; gap: 20px; }
.adm h2 { font-size: 20px; margin: 0; }
.adm .bloc { padding: 18px; display: grid; gap: 14px; }
.adm .grid3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 10px; align-items: end; }
.adm .grid2 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.pj { padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.pj h3 { margin: 0; font-size: 15.5px; }
.pj p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.pj .fill { flex: 1; min-width: 0; }
.pill { font-size: 12px; font-weight: 650; border-radius: 99px; padding: 3px 9px; background: var(--soft); white-space: nowrap; }
.pill.rouge { background: #ffe9e4; color: #c2341a; }
.vrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.vrow:first-child { border-top: 0; }
.vrow .fill { flex: 1; min-width: 0; }
.vrow b { font-weight: 600; }
.prog { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: var(--bleu); transition: width .2s; }
.mdpbox { position: relative; }
.mdpbox .input { padding-right: 46px; }
.oeil { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 32px; border: 0; background: transparent; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.oeil:hover { background: var(--soft); color: var(--ink); }
.oeil.on { color: var(--bleu); }
.oeil svg { width: 20px; height: 20px; }
.login { width: min(380px, 100%); padding: 26px; display: grid; gap: 14px; text-align: left; }
.demo-banner { background: #fff5d6; border-bottom: 1px solid #f0e2b0; font-size: 13px; padding: 6px 24px; text-align: center; }

/* sélecteur vidéos / photos */
.seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 8px; padding: 6px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px #0001; }
.lien { border: 0; background: none; padding: 0; color: inherit; text-decoration: underline; font-size: inherit; }
.stage-wrap { position: relative; }
.nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: #ffffffe6; font-size: 26px; line-height: 1; box-shadow: var(--shadow); z-index: 2; }
.nav:hover { background: #fff; }
.prevp { left: 12px; } .nextp { right: 12px; }
.avisbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px 8px 14px; font-size: 13.5px; }
.rebadge { font-size: 11.5px; font-weight: 650; color: #b4560a; background: #fff1df; border-radius: 6px; padding: 1px 7px; }
body.mode-photo #ctrl, body.mode-photo #ctc { display: none; }
body.nodl .dl-only { display: none !important; }
.btn.rouge { background: #c62828; color: #fff; border-color: #c62828; }
.btn.rouge:hover { background: #a61f1f; }
.btn.rouge:disabled { background: #e9b6b6; border-color: #e9b6b6; }
.alerte { font-size: 30px; line-height: 1; }
/* espace société */
.esp { max-width: 1200px; margin: 0 auto; padding: 28px 24px 60px; display: grid; gap: 22px; }
.esp-tete h2 { margin: 0; font-size: 24px; }
.esp-tete p { margin: 6px 0 0; }
.esp section { display: grid; gap: 10px; }
.esp-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.esp-carte { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; box-shadow: var(--shadow); display: grid; transition: transform .15s, border-color .15s; }
.esp-carte:hover { transform: translateY(-2px); border-color: var(--bleu); }
.esp-apercu { aspect-ratio: 16 / 9; background: #ece9e2; display: grid; place-items: center; overflow: hidden; }
.esp-apercu img { width: 100%; height: 100%; object-fit: cover; }
.esp-apercu img.vide { width: 44px; height: auto; object-fit: contain; opacity: .5; }
.esp-info { padding: 12px 14px 14px; display: grid; gap: 4px; }
.esp-info b { font-size: 15px; }
.esp-info .muted { font-size: 13px; }
.esp-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
/* qui êtes-vous ? */
.qui { position: fixed; inset: 0; z-index: 60; background: #0d0d0d8c; display: grid; place-items: center; padding: 16px; }
.quibox { width: min(420px, 100%); padding: 26px; display: grid; gap: 14px; }
.chip.grand { padding: 10px 18px; font-size: 15px; font-weight: 650; }
.chip.grand:hover { border-color: var(--bleu); color: var(--bleu); }
.moi { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.moi:hover { background: var(--soft); }
/* galerie */
.gal { max-width: 1500px; margin: 0 auto; padding: 20px 24px 60px; display: grid; gap: 12px; }
.galbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.galbar .fill { flex: 1; }
.galaide { margin: 0; font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 550; }
.chip b { font-weight: 700; margin-left: 2px; }
.chip.on { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ph { position: relative; background: var(--card); border-radius: 12px; overflow: hidden; border: 2px solid transparent; box-shadow: var(--shadow); }
.ph.valide { border-color: var(--ok); }
.ph.retouche { border-color: #f08a24; }
.ph .im { display: block; aspect-ratio: 3 / 2; background: #e9e7e1; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.ph:hover img { transform: scale(1.03); }
.ph .st { position: absolute; left: 8px; top: 8px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; color: #fff; }
.ph .st.ok { background: var(--ok); } .ph .st.re { background: #f08a24; }
.ph .nb { position: absolute; left: 8px; bottom: 8px; font-size: 11.5px; font-weight: 650; padding: 3px 8px; border-radius: 6px; background: #000000b3; color: #fff; }
.ph .acts { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.ph:hover .acts, .ph .acts:focus-within { opacity: 1; }
.mini { width: 34px; height: 34px; border-radius: 9px; border: 0; background: #fff; display: grid; place-items: center; font-weight: 800; text-decoration: none; box-shadow: 0 1px 4px #0003; font-size: 15px; }
.mini.on { background: var(--ok); color: #fff; }
@media (hover: none) { .ph .acts { opacity: 1; } }

/* bandeau client : accueil, date de retour, validation du projet */
.bandeau { max-width: 1500px; margin: 0 auto; padding: 16px 24px 0; display: grid; gap: 10px; }
.accueil { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--bleu); border-radius: var(--r); padding: 14px 16px; }
.accueil img { height: 26px; width: auto; margin-top: 2px; }
.accueil p { margin: 0; white-space: pre-wrap; font-size: 14.5px; }
.bandeau .etat { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.bandeau .etat .fill { flex: 1; }
.echeance { background: #fff5d6; color: #7a5a00; border-radius: 8px; padding: 5px 10px; font-weight: 600; font-size: 13px; }
/* filigrane des vidéos en relecture */
.filigrane { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; overflow: hidden; }
.stage { container-type: size; }
.filigrane span { transform: rotate(-24deg); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #ffffff33; font-size: min(6.4cqw, 9cqh); line-height: 1.3; text-align: center; white-space: nowrap; text-shadow: 0 0 2px #0000001f; }
#dlFinal.verrou { background: var(--soft); color: var(--muted); border-color: var(--line); cursor: help; }
/* comparaison de versions */
.cmp { position: fixed; inset: 0; z-index: 40; background: #0d0d0df2; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; padding: 16px 20px; color: #fff; }
.cmp-top { display: flex; align-items: center; gap: 10px; }
.cmp-vids { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 0; }
.cmp-vids > div { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; min-height: 0; }
.cmp-vids video { width: 100%; height: 100%; object-fit: contain; background: #000; border-radius: 10px; min-height: 0; }
.cmp-vids select { justify-self: start; }
.cmp-ctrl, .cmp select, .cmp .btn { color: var(--ink); }

@media (max-width: 980px) {
  .rv { grid-template-columns: 1fr; padding: 14px 16px; }
  .aside { position: static; max-height: none; }
  .top { padding: 12px 16px; }
  .top .sep, .brand span { display: none; }
  .top { flex-wrap: wrap; position: static; }
  .galbar .fill { display: none; }
  .gal { padding: 14px 16px 48px; }
  .grille { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .logo { height: 22px; }
  .bandeau { padding: 12px 16px 0; }
  .esp { padding: 18px 16px 48px; }
  .cmp-vids { grid-template-columns: 1fr; }
  .adm { padding: 20px 16px 48px; }
  .adm .grid2, .adm .grid3 { grid-template-columns: 1fr; }
  .pj { flex-wrap: wrap; }
}

/* administration : réglages de la page client */
.reglages { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.reglages .field { min-width: 200px; }
label.btn.disabled { opacity: .6; pointer-events: none; }

/* administration : dépôt et file d'envoi */
.depot { display: grid; place-items: center; gap: 4px; text-align: center; padding: 26px 16px; border: 2px dashed #cfcbc1; border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.depot:hover, .depot.on { border-color: var(--bleu); background: #f3f0ff; }
.depot b { font-size: 15px; }
.depot span { font-size: 13px; }
.qrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.qrow .fill { flex: 1; min-width: 0; display: grid; gap: 4px; }
.qtype { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--bleu); background: #efeaff; border-radius: 6px; padding: 3px 7px; }
.soustitre { margin: 6px 0 2px; font-size: 13px; font-weight: 650; color: var(--muted); }
.vign { width: 72px; height: 42px; object-fit: cover; border-radius: 6px; background: var(--soft); flex: none; }
.pill.orange { background: #fff1df; color: #b4560a; }
.pill.vert { background: #e6f4ec; color: var(--ok); }
.bascule { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 550; margin-right: 6px; }
.bascule input { accent-color: var(--bleu); width: 16px; height: 16px; }
.minigrille { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.mph { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: var(--soft); }
.mph.valide { border-color: var(--ok); } .mph.retouche { border-color: #f08a24; }
.mph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mph .nb { position: absolute; left: 4px; bottom: 4px; font-size: 11px; font-weight: 700; background: var(--mark); color: #fff; border-radius: 9px; padding: 0 6px; line-height: 18px; }
.mph .x { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #000000a0; color: #fff; font-size: 15px; line-height: 1; opacity: 0; }
.mph:hover .x { opacity: 1; }
