:root {
  --fond: #151517; --panneau: #1b1b1e; --releve: #222226; --bord: #2b2b30; --bord-fort: #3a3a40;
  --texte: #e9e6df; --doux: #a7a39b; --discret: #8f8b84; --accent: #e0a95a; --accent-texte: #1a1712;
  --rouge: #e5484d; --vert: #6fbf8a; --bleu: #7fa3b6;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 14px/1.4 'IBM Plex Sans', system-ui, sans-serif; }
a { color: var(--accent); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
button, .bouton, select, input { font: inherit; color: inherit; }
button, .bouton {
  height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--bord-fort); background: var(--releve);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap;
}
button:hover, .bouton:hover { border-color: #55555c; }
button:disabled { opacity: .45; cursor: default; }
button.primaire { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); font-weight: 600; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
select, input[type=number], input[type=text], input[type=password] {
  height: 36px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--bord-fort); background: #121214;
}
input[type=range] { accent-color: var(--accent); }
.espace { flex: 1; }
.aide { color: var(--discret); font-size: 12px; }

/* top bar */
.barre { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 56px; background: var(--panneau); border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 5; }
.logo { font-weight: 600; font-size: 16px; color: var(--texte); text-decoration: none; display: flex; gap: 8px; align-items: center; }
.projet { display: flex; gap: 8px; align-items: center; color: var(--doux); }
.projet b { color: var(--texte); font-weight: 500; }
.modes { display: flex; gap: 4px; margin-left: 8px; }
.mode { padding: 6px 10px; border-radius: 6px; font-size: 13px; color: var(--doux); }
.mode.actif { background: #2b2a2e; color: var(--texte); box-shadow: inset 0 -2px 0 var(--accent); }
.statut { font-size: 12px; color: var(--doux); }
.statut.sale { color: var(--accent); }

/* login + list */
.centre { max-width: 720px; margin: 48px auto; padding: 0 16px; }
.carte { background: var(--panneau); border: 1px solid var(--bord); border-radius: 12px; padding: 20px; }
.connexion { max-width: 360px; margin: 12vh auto; display: flex; flex-direction: column; gap: 12px; }
.erreur { color: #ff9a9d; }
.projets { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.projets a { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 10px; background: var(--releve); border: 1px solid var(--bord); color: var(--texte); text-decoration: none; }
.projets a:hover { border-color: var(--accent); }

/* overview */
.apercu { padding: 12px 16px; border-bottom: 1px solid var(--bord); display: flex; flex-direction: column; gap: 8px; }
.apercu-tete { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
#onde { width: 100%; height: 96px; display: block; background: #121214; border-radius: 6px; cursor: crosshair; touch-action: none; }
.morceaux { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.puce { height: 30px; padding: 0 10px; border-radius: 15px; background: #2a2620; border: 1px solid #4a3d2b; font-size: 12px; }
.puce .x { margin-left: 4px; color: var(--doux); }

/* transport */
.transport { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--bord); flex-wrap: wrap; }
.rond { width: 44px; height: 40px; justify-content: center; background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
#temps { font-size: 18px; min-width: 96px; }
.ab { display: inline-flex; padding: 3px; gap: 3px; border-radius: 8px; background: #121214; }
.ab button { height: 30px; border: 0; background: transparent; color: var(--doux); }
.ab button.on { background: #2e2d31; color: var(--texte); font-weight: 600; }
.lufs { font-size: 13px; color: var(--doux); display: flex; gap: 10px; align-items: baseline; }
.lufs b { font-family: var(--mono); color: var(--texte); font-size: 15px; min-width: 44px; display: inline-block; text-align: right; }
.lufs .cible-ok { color: var(--vert); }

/* mixer */
.mixeur { display: flex; gap: 6px; padding: 12px 16px; overflow-x: auto; border-bottom: 1px solid var(--bord); }
.tranche { width: 104px; flex-shrink: 0; background: #1c1c20; border: 1px solid var(--bord); border-radius: 8px; padding: 8px 6px; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.tranche.choisie { border-color: var(--accent); }
.tranche.master { width: 150px; background: #211f1c; border-color: #4a3d2b; }
.t-nom { display: flex; align-items: center; gap: 4px; }
.t-nom input { width: 100%; height: 28px; padding: 0 4px; font-weight: 600; font-size: 12px; background: transparent; border: 1px solid transparent; }
.t-nom input:hover, .t-nom input:focus { border-color: var(--bord-fort); }
.t-id { font-family: var(--mono); font-size: 10px; color: var(--discret); }
.t-fx { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.t-fx button { height: 28px; padding: 0 4px; font-size: 11px; justify-content: center; }
.t-fx button.on { border-color: var(--vert); color: var(--vert); }
.t-fader { display: flex; gap: 6px; justify-content: center; height: 170px; align-items: stretch; }
.fader { writing-mode: vertical-lr; direction: rtl; width: 28px; height: 170px; margin: 0; }
.vu { width: 12px; height: 170px; background: #121214; border-radius: 3px; }
.t-db, .t-pan { text-align: center; font-size: 12px; }
.pan { width: 100%; }
.t-auto { height: 28px; padding: 0 4px; font-size: 11px; width: 100%; }
.t-auto.ecrit { border-color: var(--rouge); color: #ff9a9d; }
.t-auto.lit { border-color: #4f7488; color: #9cc3d6; }
.t-envoi { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--doux); }
.t-envoi .t-env { color: var(--texte); }
.t-envoi input { width: 100%; }
.t-envoi input.actif { accent-color: #9cc3d6; }
.tranche.retour { background: #1c2024; border-color: #2f4450; }
.t-ms .on-off.on { border-color: var(--vert); color: var(--vert); }
.t-ms { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.t-ms button { height: 30px; justify-content: center; font-weight: 600; font-size: 12px; }
.t-ms .m.on { background: #5a2a2c; border-color: var(--rouge); }
.t-ms .s.on { background: #5a4a26; border-color: var(--accent); }
.gr { font-size: 11px; color: var(--doux); text-align: center; }

/* detail panel */
.detail { padding: 14px 16px 40px; display: grid; grid-template-columns: minmax(280px, 1.2fr) minmax(260px, 1fr); gap: 16px; }
.detail h3 { margin: 0 0 8px; font-size: 14px; }
.bloc { background: var(--panneau); border: 1px solid var(--bord); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.bloc canvas { width: 100%; height: 160px; background: #121214; border-radius: 6px; }
.reglages { display: grid; grid-template-columns: 110px 1fr 70px; gap: 6px 10px; align-items: center; }
.reglages label { font-size: 12px; color: var(--doux); }
.reglages output { font-family: var(--mono); font-size: 12px; text-align: right; }
.bandes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bande { background: var(--releve); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.bande input[type=number] { height: 30px; width: 100%; }
.ligne { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
dialog { background: var(--panneau); color: var(--texte); border: 1px solid var(--bord-fort); border-radius: 12px; padding: 20px; max-width: 460px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
.progression { height: 6px; background: #2a2a30; border-radius: 3px; overflow: hidden; }
.progression span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
/* video monitor and multicam */
.ecrans { display: flex; gap: 8px; align-items: flex-start; }
.ecran canvas { width: 100%; height: 100%; display: block; }
.ecran.vertical { width: 152px; aspect-ratio: 9 / 16; }
.cadre916 { position: absolute; top: 0; bottom: 0; width: 31.64%; border-left: 1px dashed var(--accent); border-right: 1px dashed var(--accent); background: rgba(224, 169, 90, .06); cursor: ew-resize; touch-action: none; }
.badge.gris { background: rgba(18, 18, 20, .85); color: var(--texte); font-weight: 400; }
.cams { display: flex; gap: 8px; flex-wrap: wrap; }
.cam { width: 132px; height: auto; padding: 4px; border-radius: 8px; border: 2px solid var(--bord-fort); background: #1e1e22; display: flex; flex-direction: column; align-items: stretch; gap: 3px; font-size: 12px; }
.cam canvas { width: 100%; aspect-ratio: 16 / 9; background: #0c0c0e; border-radius: 4px; }
.cam.prog { border-color: var(--rouge); }
.cam.vide { opacity: .45; }
.lecteurs-video { position: fixed; left: -8px; top: 0; width: 2px; height: 2px; overflow: hidden; opacity: .01; pointer-events: none; }
.lecteurs-video video { width: 2px; height: 2px; }
.rapport { margin: 0; padding: 10px 10px 10px 26px; background: var(--releve); border-radius: 8px; font-size: 12px; line-height: 1.5; max-height: 38vh; overflow-y: auto; }
#dlg-auto { max-width: 720px; }
fieldset.choix { border: 1px solid var(--bord); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; margin: 0; }
/* video monitor */
.moniteur { display: flex; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--bord); align-items: flex-start; }
.moniteur[hidden] { display: none; }
.ecran { position: relative; width: min(100%, 480px); aspect-ratio: 16 / 9; background: #0c0c0e; border: 1px solid var(--bord); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.ecran video { width: 100%; height: 100%; object-fit: contain; display: block; }
.ecran-vide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; color: var(--doux); font-size: 13px; }
.badge { position: absolute; top: 8px; left: 8px; padding: 2px 6px; border-radius: 4px; background: var(--rouge); color: #fff; font-size: 11px; font-weight: 600; }
.badge.tc { top: auto; left: auto; right: 8px; bottom: 8px; background: rgba(18, 18, 20, .85); color: var(--texte); font-weight: 400; }
.video-infos { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
@media (max-width: 900px) { .moniteur { flex-direction: column; } }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } .bandes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
