:root {
  --bg: #07080a; --bg2: #0c0f13; --panel: #10141a; --panel2: #151b22; --panel3: #1a212a; --line: #212a34; --line2: #2b3642;
  --text: #e1e7ee; --dim: #8592a0; --dim2: #5a6673;
  --tx: #4cc2ff; --rx: #a48dff; --ok: #2fd36b; --warn: #ffb020; --bad: #ff453a; --live: #e5221b; --pvw: #19c45a;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  --r: 7px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.45 var(--sans); }
body { min-height: 100vh; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--tx); }
b, .mono, td.n, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); } .dim2 { color: var(--dim2); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); } .tx { color: var(--tx); } .rx { color: var(--rx); }
small { font-size: 11px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ---------- marque ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .3em; font-size: 14px; white-space: nowrap; }
.brand em { font-style: normal; font-weight: 500; letter-spacing: .12em; color: var(--dim); font-size: 10.5px; border-left: 1px solid var(--line2); padding-left: 10px; }
.logo { display: grid; grid-template-columns: 8px 8px; gap: 2px; }
.logo i { width: 8px; height: 8px; border-radius: 2px; background: var(--tx); }
.logo i:first-child { background: var(--live); } .logo i:last-child { background: var(--ok); }

/* ---------- connexion ---------- */
.login { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(1100px 620px at 50% -5%, #14202c, var(--bg)); padding: 16px; z-index: 50; }
.card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 30px 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.card.wide { width: min(520px, 100%); }
.card .brand { justify-content: center; font-size: 19px; margin-bottom: 2px; }
.card .sub { text-align: center; color: var(--dim); margin: 0 0 6px; letter-spacing: .14em; text-transform: uppercase; font-size: 10.5px; }
.card h2 { margin: 0; font-size: 16px; text-align: center; }
.card p { margin: 0; color: var(--dim); }
.err { color: var(--bad); text-align: center; min-height: 1.2em; margin: 0; font-size: 12px; }
.note { color: var(--warn); font-size: 12px; margin: 0; }
.qr { display: grid; place-items: center; background: #fff; border-radius: 8px; padding: 10px; width: 240px; margin: 0 auto; }
.qr svg { width: 220px; height: 220px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-family: var(--mono); font-size: 14px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; padding: 12px; text-align: center; letter-spacing: .06em; }
.secret { font-family: var(--mono); background: var(--bg2); border: 1px dashed var(--line2); border-radius: 6px; padding: 6px 8px; text-align: center; word-break: break-all; font-size: 12px; }

/* ---------- champs ---------- */
input[type=text], input[type=password], input[type=number], input[type=url], input[type=datetime-local], input:not([type]), select, textarea {
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 6px; padding: 8px 10px; width: 100%; min-width: 0; outline: none; font-size: 13px;
}
input:focus, select:focus, textarea:focus { border-color: var(--tx); box-shadow: 0 0 0 3px rgba(76,194,255,.12); }
textarea { resize: vertical; min-height: 60px; font-family: var(--mono); font-size: 12px; }
input[type=range] { width: 100%; accent-color: var(--tx); }
input[type=checkbox] { accent-color: var(--tx); width: 15px; height: 15px; vertical-align: -2px; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--dim); letter-spacing: .04em; min-width: 0; }
label.f > span { font-weight: 600; }
label.c { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.hint { font-size: 11px; color: var(--dim2); margin-top: -2px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 14px; }
.form .full { grid-column: 1 / -1; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--panel3); border: 1px solid var(--line2); border-radius: 6px; padding: 7px 13px; font-weight: 600; font-size: 12px; letter-spacing: .02em; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: #222b36; border-color: #3a4756; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.pri { background: #0f5f8f; border-color: #1c7bb3; color: #fff; } .btn.pri:hover { background: #136fa6; }
.btn.go { background: #0d5a2c; border-color: #1a8443; color: #fff; } .btn.go:hover { background: #10703a; }
.btn.danger { background: #3a1210; border-color: #6b221d; color: #ffb4ae; } .btn.danger:hover { background: #4e1714; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 11px; }
.btn.big { padding: 12px 18px; font-size: 14px; }
.btn.block { width: 100%; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 5px; padding: 3px 6px; color: var(--dim); }
.icon-btn:hover { color: var(--text); border-color: var(--line2); }

/* ---------- barre du haut ---------- */
.top { display: flex; align-items: center; gap: 18px; padding: 10px 18px; background: linear-gradient(#0e1217, #0a0d10); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tally { display: flex; align-items: center; gap: 9px; padding: 6px 14px; border-radius: 4px; font-weight: 800; letter-spacing: .22em; font-size: 12px; border: 1px solid var(--line2); color: var(--dim); background: #14181d; min-width: 120px; justify-content: center; }
.tally i { width: 9px; height: 9px; border-radius: 50%; background: var(--dim2); }
.tally.live { background: var(--live); border-color: #ff5a52; color: #fff; box-shadow: 0 0 18px rgba(229,34,27,.45); } .tally.live i { background: #fff; }
.tally.idle { background: #2a2108; border-color: #5a4512; color: var(--warn); } .tally.idle i { background: var(--warn); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.master { display: flex; align-items: center; gap: 9px; padding: 8px 16px; border-radius: 6px; font: 800 13px var(--sans); letter-spacing: .2em; border: 2px solid var(--line2); background: #14181d; color: var(--dim); min-width: 150px; justify-content: center; }
.master i { width: 11px; height: 11px; border-radius: 50%; background: var(--dim2); }
.master.on { background: #0d5a2c; border-color: #2fd36b; color: #fff; box-shadow: 0 0 16px rgba(47,211,107,.35); } .master.on i { background: #7dffb0; box-shadow: 0 0 8px #7dffb0; }
.master.off { background: #3a1210; border-color: #ff453a; color: #ffb4ae; } .master.off i { background: var(--bad); animation: blink 1s steps(2) infinite; }
.master:disabled { cursor: not-allowed; opacity: .8; }
.kpis { display: flex; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.kpi { display: flex; flex-direction: column; align-items: flex-end; }
.kpi label { font-size: 9px; letter-spacing: .2em; color: var(--dim2); font-weight: 700; }
.kpi b { font-size: 16px; font-weight: 600; } .kpi b small { color: var(--dim); font-family: var(--sans); font-weight: 400; margin-left: 3px; }
.clock { font: 600 20px var(--mono); letter-spacing: .04em; color: #cfd7df; }

.tabs { display: flex; align-items: center; gap: 2px; padding: 0 14px; background: var(--bg2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: 0; padding: 11px 13px 9px; font-size: 11px; font-weight: 700; letter-spacing: .16em; color: var(--dim); border-bottom: 2px solid transparent; flex: none; }
.tabs button.on { color: var(--text); border-bottom-color: var(--warn); }
.tabs button:hover { color: var(--text); }
.tabs .badge { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--live); color: #fff; font-size: 9.5px; letter-spacing: 0; margin-left: 5px; text-align: center; }
.tabs .spacer { flex: 1; }
.who { display: inline-flex; align-items: center; gap: 7px; color: var(--dim); font: 11px var(--mono); white-space: nowrap; flex: none; }
.role { font: 700 9px var(--sans); letter-spacing: .14em; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; }
.role.admin { background: #2a2108; color: var(--warn); border: 1px solid #5a4512; }
.role.operator { background: #0e2a17; color: var(--ok); border: 1px solid #1d5230; }
.role.viewer { background: #0e1c26; color: var(--tx); border: 1px solid #1d3d52; }

main { padding: 16px 18px 60px; max-width: 1760px; margin: 0 auto; }
.tab { display: none; } .tab.on { display: block; }

/* ---------- panneaux ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px 15px; margin-bottom: 14px; min-width: 0; }
.ph { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; flex-wrap: wrap; min-height: 26px; }
.ph h3 { margin: 0; font-size: 11px; letter-spacing: .2em; font-weight: 800; color: #b9c3ce; text-transform: uppercase; }
.ph .r { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ph .sub { color: var(--dim2); font-size: 11px; }
.g2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.g2 > .panel, .g3 > .panel { margin-bottom: 0; }
.mb { margin-bottom: 14px; }
.empty { color: var(--dim2); text-align: center; padding: 26px 10px; border: 1px dashed var(--line2); border-radius: 8px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.tile { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; min-width: 0; }
.tile label { display: block; font-size: 9px; letter-spacing: .16em; color: var(--dim2); font-weight: 700; margin-bottom: 3px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile b { font-size: 17px; font-weight: 600; } .tile b small { color: var(--dim); margin-left: 3px; font-family: var(--sans); font-weight: 400; }
.tile .s { font-size: 11px; color: var(--dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 4px; background: #1d242c; margin-top: 6px; border-radius: 2px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--tx); transition: width .4s; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; font-size: 9.5px; letter-spacing: .14em; color: var(--dim2); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line2); white-space: nowrap; text-transform: uppercase; }
td { padding: 6px 8px; border-bottom: 1px solid #19202a; vertical-align: middle; }
th.n, td.n { text-align: right; }
tr:hover td { background: #121820; }
.scroll { overflow-x: auto; }
.tag { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 3px; background: #1d242c; color: #b8c2cd; margin: 1px 3px 1px 0; white-space: nowrap; }
.tag.ok { background: #0c2a17; color: var(--ok); } .tag.warn { background: #2c2208; color: var(--warn); } .tag.bad { background: #351210; color: #ff8a80; } .tag.live { background: var(--live); color: #fff; } .tag.tx { background: #0b2333; color: var(--tx); }

/* ---------- états ---------- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dim2); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(47,211,107,.6); }
.dot.live { background: var(--live); box-shadow: 0 0 8px rgba(229,34,27,.7); animation: pulse 1.6s infinite; }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
@keyframes pulse { 50% { opacity: .55; } }
.state { font: 700 9.5px var(--sans); letter-spacing: .16em; padding: 3px 7px; border-radius: 3px; text-transform: uppercase; white-space: nowrap; }
.state.live { background: var(--live); color: #fff; } .state.ok { background: #0d3a1d; color: #5df09a; }
.state.wait { background: #1f2630; color: var(--dim); } .state.warn { background: #3a2a06; color: var(--warn); } .state.bad { background: #3f1210; color: #ff8a80; }

/* ---------- cartes entrée / sortie ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(560px, 100%), 1fr)); gap: 14px; }
.ec { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; min-width: 0; position: relative; }
.ec.live { box-shadow: inset 3px 0 0 var(--live); }
.ec.stby { box-shadow: inset 3px 0 0 var(--warn); }
.ec.off { opacity: .72; }
.ec-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.ec-h .nm { font-weight: 800; letter-spacing: .05em; font-size: 15px; }
.ec-h .r { margin-left: auto; display: flex; gap: 5px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px 12px; margin: 10px 0; }
.kv div { min-width: 0; }
.kv label { display: block; font-size: 9px; letter-spacing: .14em; color: var(--dim2); font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.kv span { font: 13px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.big-rate { font: 600 30px var(--mono); letter-spacing: -.02em; line-height: 1; }
.big-rate small { font: 12px var(--sans); color: var(--dim); margin-left: 4px; }
.sect { font-size: 9.5px; letter-spacing: .18em; color: var(--dim2); font-weight: 800; margin: 12px 0 6px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.sect::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.warnbox { background: #2a1f06; border: 1px solid #5a4512; color: #ffd27a; border-radius: 6px; padding: 7px 10px; font-size: 12px; margin-top: 8px; }
.errbox { background: #2a0f0d; border: 1px solid #5c1c18; color: #ffaba4; border-radius: 6px; padding: 7px 10px; font: 11.5px var(--mono); margin-top: 8px; word-break: break-word; }
canvas.chart { width: 100%; height: 90px; display: block; background: var(--bg2); border: 1px solid var(--line); border-radius: 5px; }
canvas.chart.sm { height: 56px; }
canvas.chart.lg { height: 140px; }
.legend { display: flex; gap: 12px; font-size: 10.5px; color: var(--dim); margin-top: 4px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }

/* ---------- synoptique ---------- */
.syn { display: grid; grid-template-columns: minmax(0, 1fr) 220px minmax(0, 1fr); gap: 26px; position: relative; }
.syn-col { display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 2; min-width: 0; }
.syn-col h4 { margin: 0 0 2px; font-size: 9.5px; letter-spacing: .2em; color: var(--dim2); font-weight: 800; }
.node { background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; padding: 8px 10px; display: flex; align-items: center; gap: 9px; min-width: 0; }
.node .t { min-width: 0; flex: 1; }
.node .t b { font-family: var(--sans); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node .t small { color: var(--dim); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 10.5px; }
.node .v { font: 600 13px var(--mono); text-align: right; white-space: nowrap; }
.node.live { border-color: #6b221d; background: linear-gradient(90deg, rgba(229,34,27,.13), var(--panel2) 55%); }
.node.ok { border-color: #1d5230; }
.node.stby { border-color: #5a4512; background: linear-gradient(90deg, rgba(255,176,32,.1), var(--panel2) 55%); }
.node.pgm { border: 2px solid var(--live); background: #1a0c0b; flex-direction: column; align-items: stretch; text-align: center; padding: 12px; }
.node.pgm.off { border-color: var(--line2); background: var(--panel2); }
#syn-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; }

/* ---------- régie ---------- */
.monitors { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mon { position: relative; background: #000; border-radius: 6px; overflow: hidden; aspect-ratio: 16/9; border: 3px solid #1d242c; }
.mon.pvw { border-color: var(--pvw); } .mon.pgm { border-color: var(--live); }
.mon video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.mon .lbl { position: absolute; top: 8px; left: 8px; font: 800 11px var(--sans); letter-spacing: .2em; padding: 3px 8px; border-radius: 3px; background: rgba(0,0,0,.65); }
.mon.pvw .lbl { color: #6dffa4; } .mon.pgm .lbl { background: var(--live); color: #fff; }
.mon .src { position: absolute; bottom: 8px; left: 8px; font: 600 12px var(--sans); background: rgba(0,0,0,.65); padding: 3px 8px; border-radius: 3px; }
.mon .ov { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 12px; text-align: center; padding: 10px; }
.mon .vu { position: absolute; right: 8px; top: 34px; width: 16px; height: calc(100% - 80px); }
.mon .play { position: absolute; bottom: 8px; right: 34px; }
.switcher { display: grid; grid-template-columns: 92px 1fr; gap: 6px 10px; align-items: center; margin-top: 12px; }
.switcher .rl { font: 800 10px var(--sans); letter-spacing: .18em; color: var(--dim); text-align: right; }
.bus { display: flex; gap: 6px; flex-wrap: wrap; }
.bus button { min-width: 96px; max-width: 160px; height: 46px; border-radius: 6px; border: 1px solid var(--line2); background: #171d24; font-weight: 700; font-size: 11.5px; padding: 4px 8px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; position: relative; }
.bus button small { display: block; font-weight: 500; font-size: 9.5px; color: var(--dim); letter-spacing: .08em; }
.bus button:hover { border-color: #46566a; }
.bus button.pgm-on { background: var(--live); border-color: #ff6b63; color: #fff; box-shadow: 0 0 16px rgba(229,34,27,.4); }
.bus button.pgm-on small { color: #ffd2cf; }
.bus button.pvw-on { background: #0b6b31; border-color: #22c463; color: #fff; }
.bus button.pvw-on small { color: #c6ffd9; }
.bus button.down { opacity: .45; }
.bus button.down::after { content: "HORS LIGNE"; position: absolute; top: 2px; right: 4px; font-size: 7.5px; letter-spacing: .1em; color: var(--bad); }
.tbar { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.tbar .btn.cut { min-width: 92px; height: 52px; font-size: 14px; letter-spacing: .2em; background: #2a1110; border-color: #7a2620; color: #ffd2cf; }
.tbar .btn.auto { min-width: 92px; height: 52px; font-size: 14px; letter-spacing: .2em; background: #2b200a; border-color: #7a5a17; color: #ffd27a; }
.tbar .btn.ftb { height: 52px; min-width: 72px; letter-spacing: .14em; }
.tbar .btn.ftb.on { background: #000; border-color: #fff; color: #fff; animation: blink 1s steps(2) infinite; }
.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.ch { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 0; }
.ch.master { border-color: #4a3a12; background: #17140c; }
.ch .nm { font-size: 11px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch .meter { display: flex; gap: 3px; justify-content: center; height: 130px; }
.ch .meter canvas { width: 34px; height: 130px; }
.ch select { padding: 4px 6px; font-size: 11px; }
.ch .vol { font: 11px var(--mono); text-align: center; color: var(--dim); }
.ch.afv-live { box-shadow: inset 0 3px 0 var(--live); }
.gfx-list { display: flex; flex-direction: column; gap: 6px; }
.gfx { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; }
.gfx.on { border-color: #7a2620; background: #1d0f0e; }
.gfx .t { flex: 1; min-width: 0; }
.gfx .t b { font-family: var(--sans); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gfx .t small { color: var(--dim); }
.onair { min-width: 64px; height: 30px; border-radius: 5px; border: 1px solid var(--line2); background: #181e25; font: 800 10px var(--sans); letter-spacing: .14em; color: var(--dim); }
.onair.on { background: var(--live); color: #fff; border-color: #ff6b63; }
.multiview { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.mv { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 5px; overflow: hidden; border: 2px solid #1d242c; cursor: pointer; }
.mv.pgm { border-color: var(--live); } .mv.pvw { border-color: var(--pvw); }
.mv video { width: 100%; height: 100%; object-fit: contain; }
.mv span { position: absolute; bottom: 4px; left: 4px; font: 600 11px var(--sans); background: rgba(0,0,0,.7); padding: 2px 6px; border-radius: 3px; }

/* ---------- médias ---------- */
.drop { border: 2px dashed var(--line2); border-radius: 10px; padding: 26px; text-align: center; color: var(--dim); transition: border-color .15s, background .15s; cursor: pointer; }
.drop.over { border-color: var(--tx); background: rgba(76,194,255,.06); color: var(--text); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mc { background: var(--panel2); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; min-width: 0; }
.mc .th { aspect-ratio: 16/9; background: #000 center/cover no-repeat; position: relative; }
.mc .th .k { position: absolute; top: 6px; left: 6px; }
.mc .th .d { position: absolute; bottom: 6px; right: 6px; font: 11px var(--mono); background: rgba(0,0,0,.7); padding: 1px 5px; border-radius: 3px; }
.mc .b { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.mc .b b { font-family: var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog { height: 4px; background: #1d242c; border-radius: 2px; overflow: hidden; } .prog i { display: block; height: 100%; background: var(--warn); transition: width .3s; }

/* ---------- journal ---------- */
.log { font: 11.5px/1.55 var(--mono); max-height: 360px; overflow: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
.log div { white-space: pre-wrap; word-break: break-word; }
.log .t { color: var(--dim2); margin-right: 8px; }
.log .c { color: var(--tx); margin-right: 6px; }
.log .warn { color: var(--warn); } .log .error { color: var(--bad); } .log .security { color: #ff9bf0; }

/* ---------- divers ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.62); display: grid; place-items: center; z-index: 40; padding: 16px; backdrop-filter: blur(3px); }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.modal .mh { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.modal .mh h3 { margin: 0; font-size: 14px; letter-spacing: .04em; }
.modal .mb2 { padding: 16px 18px; }
.modal .mf { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; background: var(--panel); }
.copy { display: flex; gap: 6px; align-items: center; }
.copy input { font-family: var(--mono); font-size: 12px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--panel3); border: 1px solid var(--line2); border-left: 3px solid var(--tx); border-radius: 6px; padding: 9px 12px; font-size: 12.5px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: tin .2s ease-out; }
.toast.err { border-left-color: var(--bad); } .toast.ok { border-left-color: var(--ok); } .toast.warn { border-left-color: var(--warn); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.subtabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.subtabs button { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; font-size: 11.5px; font-weight: 700; color: var(--dim); }
.subtabs button.on { color: var(--text); border-color: var(--warn); background: #1b1a12; }
.cores { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 5px; }
.core { background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; height: 54px; position: relative; overflow: hidden; }
.core i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, #1c7bb3, var(--tx)); transition: height .5s; }
.core span { position: absolute; top: 3px; left: 0; right: 0; text-align: center; font: 10px var(--mono); color: #d0dae4; z-index: 1; }
.flag { font-size: 14px; }
.pill-group { display: inline-flex; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; }
.pill-group button { background: var(--panel2); border: 0; border-right: 1px solid var(--line2); padding: 5px 10px; font-size: 11px; font-weight: 700; color: var(--dim); }
.pill-group button:last-child { border-right: 0; }
.pill-group button.on { background: #0f5f8f; color: #fff; }

@media (max-width: 1100px) {
  .g3 { grid-template-columns: 1fr; }
  .syn { grid-template-columns: 1fr; gap: 14px; }
  #syn-svg { display: none; }
}
@media (max-width: 860px) {
  .g2, .monitors { grid-template-columns: 1fr; }
  .top { gap: 10px; padding: 8px 12px; }
  .kpis { gap: 12px; margin-left: 0; width: 100%; justify-content: space-between; }
  .clock { display: none; }
  main { padding: 12px 10px 60px; }
  input, select, textarea { font-size: 16px !important; }
  .switcher { grid-template-columns: 1fr; } .switcher .rl { text-align: left; }
  .bus button { min-width: 84px; }
}

/* ---------- lecteurs MP1 / MP2 ---------- */
.mp.mp-pgm { box-shadow: inset 3px 0 0 var(--live); border-color: #6b221d; }
.mp.mp-pvw { box-shadow: inset 3px 0 0 var(--pvw); }
.mp-body { display: grid; grid-template-columns: 200px 1fr; gap: 14px; align-items: start; }
.mp-th { aspect-ratio: 16/9; background: #000 center/cover no-repeat; border-radius: 5px; border: 1px solid var(--line2); position: relative; }
.mp-th span { position: absolute; right: 5px; bottom: 5px; font: 11px var(--mono); background: rgba(0,0,0,.7); padding: 1px 5px; border-radius: 3px; }
.mp-ctl { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bus button.blk { background: #000; border-color: #3a4654; }
.bus button.mpb { border-style: dashed; }
.bus button.blk.pgm-on, .bus button.mpb.pgm-on { background: var(--live); border-style: solid; }
.bus button.blk.pvw-on, .bus button.mpb.pvw-on { background: #0b6b31; border-style: solid; }
@media (max-width: 860px) { .mp-body { grid-template-columns: 1fr; } }
