/* Console Totems — esprit signalisation routière : bleu de panneau, filet blanc, jaune réservé à ce qui est actif */
:root {
  color-scheme: light dark;
  --bg: #edf0f3; --card: #ffffff; --sunk: #f4f6f8; --line: #d3dae2; --line-strong: #b4bfcb;
  --text: #14202b; --muted: #5a6a7a;
  --panel: #0a4c9a; --panel-ink: #ffffff; --accent: #0a4c9a; --accent-hover: #083c7a; --accent-ink: #ffffff;
  --signal: #ffc800; --signal-ink: #1a1400;
  --ok: #1b8a50; --ko: #cf2e2e; --warn: #f2a900;
  --screen: #0b1118;
  --font: "Barlow", "Segoe UI", system-ui, sans-serif;
  --font-display: "Barlow Semi Condensed", "Segoe UI Semibold", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1620; --card: #16212d; --sunk: #101a25; --line: #263647; --line-strong: #37495d;
    --text: #e8eef4; --muted: #93a3b3;
    --accent: #5aa2ff; --accent-hover: #86bbff; --accent-ink: #06182e;
    --ok: #3ccf82; --ko: #ff6b6b; --warn: #ffc800;
  }
}
:root[data-theme="dark"] {
    --bg: #0e1620; --card: #16212d; --sunk: #101a25; --line: #263647; --line-strong: #37495d;
    --text: #e8eef4; --muted: #93a3b3;
    --accent: #5aa2ff; --accent-hover: #86bbff; --accent-ink: #06182e;
    --ok: #3ccf82; --ko: #ff6b6b; --warn: #ffc800;
  }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: .005em; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 4px; }

/* ----- En-tête : un panneau bleu bordé d'un filet blanc ----- */
header { position: relative; display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap;
  padding: 18px 34px; background: var(--panel); color: var(--panel-ink); }
header::after { content: ""; position: absolute; inset: 6px; border: 2px solid rgba(255, 255, 255, .85); border-radius: 10px; pointer-events: none; }
header h1 { margin: 0; font-size: 25px; font-weight: 700; display: flex; align-items: center; gap: 14px; }
header h1::before { content: ""; width: 15px; height: 15px; background: var(--signal); border: 2px solid #fff; transform: rotate(45deg); flex: none; }
.summary { margin-left: auto; padding: 3px 12px; border-radius: 99px; background: rgba(255, 255, 255, .16); font-weight: 600; font-size: 14px; }
.summary:empty { display: none; }
#who { color: rgba(255, 255, 255, .8); font-size: 14px; }
header button#logout { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .55); padding: 4px 12px; font-size: 13px; }
header button#logout:hover { background: rgba(255, 255, 255, .14); }
nav { display: flex; gap: 2px; flex-wrap: wrap; }
nav button { background: transparent; color: rgba(255, 255, 255, .78); padding: 8px 14px; border-radius: 4px; font-family: var(--font-display);
  font-size: 17px; font-weight: 600; box-shadow: inset 0 -3px 0 transparent; }
nav button:hover { color: #fff; background: rgba(255, 255, 255, .1); }
nav button.active { color: #fff; box-shadow: inset 0 -3px 0 var(--signal); border-radius: 4px 4px 0 0; }
header :focus-visible { outline-color: #fff; }

main { max-width: 1180px; margin: 28px auto 60px; padding: 0 24px; }
.tab { display: grid; gap: 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 22px 24px; }
.card h2 { margin: 0 0 14px; font-size: 21px; font-weight: 700; }
.card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.small { font-size: 13px; margin: 10px 0 0; }
.muted { color: var(--muted); }

/* ----- Formulaires ----- */
form, .bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.bar { align-items: center; }
.spacer { flex: 1; }
label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
input, select, textarea { background: var(--card); color: var(--text); border: 1px solid var(--line-strong); border-radius: 5px; padding: 8px 10px; font: inherit; min-width: 0; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--signal); outline-offset: 0; border-color: var(--text); }
input[type=file] { padding: 6px; }
input[type=color] { height: 38px; padding: 3px; width: 70px; }
#f-name { width: 240px; } #f-w, #f-h { width: 110px; }

button { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 5px; padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer; }
button:hover { background: var(--accent-hover); }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--text); padding: 5px 11px; font-size: 13.5px; font-weight: 500; }
button.ghost:hover { background: var(--sunk); border-color: var(--text); }
button.danger { color: var(--ko); }
button.danger:hover { border-color: var(--ko); background: transparent; }
a.btn { display: inline-block; padding: 9px 18px; border-radius: 5px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; }
a.btn:hover { background: var(--accent-hover); }

/* ----- Tableaux ----- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; }
th, td { padding: 10px 10px; border-bottom: 1px solid var(--line); }
tbody tr:hover { background: var(--sunk); }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.actions button + button { margin-left: 6px; }
td.vers { font-family: ui-monospace, Consolas, monospace; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: var(--sunk); padding: 1px 5px; border-radius: 3px; }
.notice { margin: 14px 0 0; padding: 10px 12px; background: var(--sunk); border: 2px dashed var(--signal); border-radius: 5px; word-break: break-all; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--ko); }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--line); color: var(--text); }
.badge.ok { background: color-mix(in srgb, var(--ok) 20%, var(--card)); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 30%, var(--card)); color: var(--text); }

/* ----- Totems : une fiche par écran, avec sa disposition en miniature ----- */
.totems { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.totem { position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 16px 16px 14px 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.totem::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--ko); }
.totem.on::before { background: var(--ok); }
.totem .screenbox { display: grid; place-items: center; height: 118px; }
.mini { position: relative; width: 100%; max-height: 118px; background: var(--screen); border: 3px solid #1d2730; border-radius: 3px; outline: 1px solid var(--line-strong); }
.mini i { position: absolute; display: grid; place-items: center; font: 700 12px var(--font-display); font-style: normal; color: #fff;
  background: color-mix(in srgb, var(--zc) 55%, var(--screen)); border: 1px solid var(--zc); }
.totem:not(.on) .mini { opacity: .55; }
.totem h3 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.15; }
.totem .state { display: flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--ko); margin-bottom: 2px; }
.totem.on .state { color: var(--ok); }
.totem .state .dot { margin-right: 6px; width: 9px; height: 9px; }
.totem .facts { margin: 4px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.totem .acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.totem .acts > .ghost { flex: 1 1 0; }
.totem .acts .spacer { flex: 1 0 100%; height: 0; }
.totem .acts .spacer + .link { margin-left: auto; }
.totem .acts button.link { background: none; border: 0; color: var(--muted); padding: 5px 6px; font-size: 13px; font-weight: 500; }
.totem .acts button.link:hover { color: var(--text); text-decoration: underline; background: none; }
.totem .acts button.link.danger:hover { color: var(--ko); }

/* ----- Médias ----- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.media { background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: grid; }
.media .thumb { height: 125px; width: 100%; object-fit: cover; background: #000; display: block; }
.media .meta { padding: 8px 10px; display: grid; gap: 6px; font-size: 13px; }
.media .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

/* ----- Playlists ----- */
.split { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; }
.list li { padding: 9px 12px; border-radius: 5px; cursor: pointer; border: 1px solid transparent; font-weight: 500; }
.list li:hover { background: var(--sunk); }
.list li.active { background: var(--sunk); border-color: var(--line-strong); box-shadow: inset 4px 0 0 var(--signal); }
#pl-editor { display: grid; gap: 14px; }
.items { display: grid; gap: 8px; }
.item { display: flex; gap: 8px; align-items: center; background: var(--sunk); border: 1px solid var(--line); border-radius: 6px; padding: 8px; flex-wrap: wrap; }
.item .idx { width: 22px; text-align: center; color: var(--muted); font-family: var(--font-display); font-weight: 600; }
.item select:nth-of-type(2), .item input[type=url], .item .src { flex: 1; min-width: 180px; }
.item .dur { display: flex; align-items: center; gap: 4px; }
.item .dur input { width: 70px; }

/* ----- Commandes, captures, mises à jour ----- */
.shot { display: block; max-width: min(100%, 760px); margin-top: 12px; border: 1px solid var(--line); border-radius: 4px; background: #000; }
#cmd-hist-box { margin-top: 18px; }

/* ----- Modèles dédiés ----- */
.tplbox { flex: 1 1 100%; display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; }
.tplbox p { margin: 0; }
.tplparams { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pv { width: min(100%, 560px); border: 1px solid var(--line); border-radius: 4px; background: #000; }

/* ----- Éditeur de zones ----- */
.check { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.canvas { position: relative; max-width: 760px; margin: 16px 0 6px; background: var(--screen); border: 4px solid #1d2730; outline: 1px solid var(--line-strong);
  border-radius: 4px; overflow: hidden; user-select: none; touch-action: none; }
.zone { position: absolute; border: 2px solid var(--zc); background: color-mix(in srgb, var(--zc) 26%, transparent);
  cursor: move; padding: 6px 8px; font-size: 13px; overflow: hidden; color: #fff; }
.zone .zl { pointer-events: none; text-shadow: 0 1px 2px #000; }
.z1 { --zc: #4d94ff; } .z2 { --zc: #2fc27a; } .z3 { --zc: #f2a900; } .z4 { --zc: #ec5f9e; }
.handle { position: absolute; width: 14px; height: 14px; background: #fff; border-radius: 3px; border: 2px solid var(--zc); }
.handle.nw { left: -1px; top: -1px; cursor: nwse-resize; }
.handle.ne { right: -1px; top: -1px; cursor: nesw-resize; }
.handle.sw { left: -1px; bottom: -1px; cursor: nesw-resize; }
.handle.se { right: -1px; bottom: -1px; cursor: nwse-resize; }
.zonelist { display: grid; gap: 8px; margin: 12px 0; }
.zrow { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; background: var(--sunk); border: 1px solid var(--line); border-left: 5px solid var(--zc);
  border-radius: 6px; padding: 10px; }
.zrow strong { align-self: center; min-width: 54px; }
.zrow select { align-self: center; min-width: 200px; }
.zrow input { width: 80px; }
.zrow button { align-self: center; }
.zdot { width: 12px; height: 12px; border-radius: 3px; background: var(--zc); align-self: center; }

/* ----- Planning ----- */
.week { display: grid; gap: 4px; margin: 12px 0 6px; }
.wrow { display: grid; grid-template-columns: 42px 1fr; gap: 8px; align-items: center; }
.wday { color: var(--muted); font-size: 13px; font-weight: 600; }
.track { position: relative; height: 26px; background: var(--sunk); border: 1px solid var(--line); border-radius: 4px;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: 25% 100%; }
.blk { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; font: 700 12px var(--font-display); color: #0a1410;
  display: grid; place-items: center; overflow: hidden; }
.blk.now { outline: 3px solid var(--signal); outline-offset: 0; z-index: 2; }
.ticks { position: relative; height: 16px; font-size: 11px; color: var(--muted); }
.ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ticks span:last-child { transform: translateX(-100%); }
.blk.z1, .lg.z1 { background: #4d94ff; } .blk.z2, .lg.z2 { background: #2fc27a; } .blk.z3, .lg.z3 { background: #f2a900; } .blk.z4, .lg.z4 { background: #ec5f9e; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; align-items: center; font-size: 13px; }
.lg { padding: 2px 10px; border-radius: 99px; color: #0a1410; font-weight: 600; }
.scform { margin-top: 16px; display: grid; gap: 10px; }
.scform label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.scform .check { display: flex; flex-direction: row; color: var(--text); }

/* ----- Paramètres ----- */
details { margin-top: 12px; } summary { cursor: pointer; font-weight: 500; }

/* ----- Connexion ----- */
.overlay { position: fixed; inset: 0; background: rgba(6, 18, 34, .82); display: flex; align-items: center; justify-content: center; z-index: 50; }
.overlay[hidden] { display: none; }
.overlay form { width: min(380px, 90vw); display: grid; gap: 14px; border-top: 6px solid var(--panel); }
.overlay h2 { margin: 0; }

/* ----- Rôles : on masque ce que le rôle ne permet pas (le serveur refuse de toute façon) ----- */
body[data-role="viewer"] main button:not(.ghost):not(#cmd-close):not(#ly-close),
body[data-role="viewer"] #add-form, body[data-role="viewer"] [data-cmd] { display: none; }
body[data-role="editor"] #add-form, body[data-role="editor"] [data-cmd="rebootPc"], body[data-role="editor"] [data-cmd="update"] { display: none; }
body:not([data-role="admin"]) .admin-only { display: none; }
body:not([data-role="admin"]) [data-cmd="rebootPc"], body:not([data-role="admin"]) [data-cmd="shutdownPc"] { display: none; }

@media (max-width: 640px) {
  header { padding: 14px 18px; } main { padding: 0 14px; }
  .totems { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  button, nav button { transition: background-color .12s, box-shadow .12s; }
}

/* ----- Médiathèque : dossiers, favoris, corbeille ----- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip { background: var(--sunk); color: var(--text); border: 1px solid var(--line-strong); border-radius: 99px; padding: 5px 14px; font-size: 14px; font-weight: 500; }
.chip:hover { border-color: var(--text); background: var(--sunk); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip .n { margin-left: 7px; font-size: 12px; font-weight: 700; opacity: .75; }
.media { position: relative; }
.media .star { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 20px; line-height: 1;
  background: rgba(10, 17, 24, .65); color: #fff; border: 0; }
.media .star:hover { background: rgba(10, 17, 24, .85); }
.media .star.on { color: var(--signal); }
.media .meta select.mv { font-size: 13px; padding: 4px 8px; }
.dupgroup { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 14px; background: var(--sunk); }

/* ----- Page Accueil ----- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; display: grid; gap: 6px; }
.tile .label { color: var(--muted); font-size: 14px; font-weight: 500; }
.tile .value { font-family: var(--font-display); font-size: 34px; font-weight: 700; line-height: 1.1; }
.tile .value small { font-size: 17px; font-weight: 600; color: var(--muted); }
.tile .sub { color: var(--muted); font-size: 13px; }
.tile.ko .value { color: var(--ko); }
.tile.ok .value { color: var(--ok); }
.meter { height: 8px; border-radius: 99px; background: var(--sunk); border: 1px solid var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--ok); }
.meter.warn > span { background: var(--warn); }
.meter.ko > span { background: var(--ko); }
.watch { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.watch li { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; border-radius: 6px; background: var(--sunk); border-left: 4px solid var(--warn); }
.watch li.ko { border-left-color: var(--ko); }
.watch li.ok { border-left-color: var(--ok); }
button#theme { background: transparent; border: 1px solid rgba(255, 255, 255, .6); color: var(--panel-ink); padding: 4px 12px; font-size: 13.5px; font-weight: 500; }
button#theme:hover { background: rgba(255, 255, 255, .16); }

/* ======================= Version courbée : formes arrondies et douces ======================= */
:root { --r-card: 24px; --r-inner: 16px; --r-ctl: 14px; --shadow: 0 8px 24px rgba(10, 45, 90, .09); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --shadow: 0 8px 24px rgba(0, 0, 0, .35); } }
:root[data-theme="dark"] { --shadow: 0 8px 24px rgba(0, 0, 0, .35); }

header { border-radius: 0 0 44px 44px; padding: 20px 40px 24px; box-shadow: var(--shadow); }
header::after { inset: 7px 10px 9px; border-radius: 38px; }
header h1::before { border-radius: 8px; }
nav { gap: 6px; }
nav button, nav button.active { border-radius: 99px; padding: 8px 18px; }
nav button.active { background: var(--signal); color: var(--signal-ink); box-shadow: none; }
nav button.active:hover { background: var(--signal); color: var(--signal-ink); }
header button#logout, button#theme { border-radius: 99px; }

main { margin-top: 34px; }
.card, .tile { border-radius: var(--r-card); box-shadow: var(--shadow); }
.card { padding: 26px 28px; }
.totem, .media, .dupgroup { border-radius: var(--r-card); box-shadow: var(--shadow); }
.media { border-radius: 20px; }
.item, .list li, .watch li, .zonelist > *, .scform { border-radius: var(--r-inner); }
.dupgroup { border-radius: 20px; box-shadow: none; }

input, select, textarea { border-radius: var(--r-ctl); padding: 9px 14px; }
input[type=file] { border-radius: var(--r-ctl); }
input[type=checkbox], input[type=radio] { border-radius: 6px; }
button, a.btn { border-radius: 99px; padding: 10px 22px; }
button.ghost { padding: 6px 16px; }
button.link, .totem .acts button.link { border-radius: 8px; }
.badge, .lg, .chip, .summary { border-radius: 99px; }
.notice, details { border-radius: var(--r-inner); }
code { border-radius: 8px; padding: 1px 7px; }

.mini { border-radius: 10px; }
.mini *, .zone, .z { border-radius: 4px; }
.canvas, .shot, .pv, .screenbox { border-radius: var(--r-inner); }
.track { border-radius: 99px; }
.blk { border-radius: 99px; }
.handle { border-radius: 50%; }
.zdot { border-radius: 50%; }
.media .thumb { border-radius: 0; }
.media .meta select.mv { border-radius: 99px; }
.tile .value, .card h2 { letter-spacing: 0; }
@media (max-width: 720px) { header { border-radius: 0 0 28px 28px; padding: 16px 20px 20px; } header::after { border-radius: 22px; } }
.watch li { border-left: 0; position: relative; padding-left: 34px; }
.watch li::before { content: ""; position: absolute; left: 14px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--warn); }
.watch li.ko::before { background: var(--ko); }
.watch li.ok::before { background: var(--ok); }
.totem { padding: 18px 20px 16px; border: 2px solid color-mix(in srgb, var(--ko) 55%, var(--line)); }
.totem.on { border-color: color-mix(in srgb, var(--ok) 60%, var(--line)); }
.totem::before { display: none; }

/* ----- Courbes de statistiques (une couleur par mesure ; variantes sombres choisies, pas inversées) ----- */
:root { --c-on: #1baf7a; --c-cpu: #2a78d6; --c-mem: #6250d6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-on: #199e70; --c-cpu: #3987e5; --c-mem: #9085e9; } }
:root[data-theme="dark"] { --c-on: #199e70; --c-cpu: #3987e5; --c-mem: #9085e9; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px 22px; margin-top: 14px; }
.chart { position: relative; min-width: 0; }
.ch-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 4px; }
.ch-title { font-weight: 600; }
.ch-big { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-left: auto; }
.ch-sub { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.ch-plot { position: relative; }
.ch-plot svg { display: block; max-width: 100%; overflow: visible; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-axis { fill: var(--muted); font: 500 12px var(--font); }
.ch-cross { stroke: var(--line-strong); stroke-width: 1; }
.ch-hit { cursor: crosshair; touch-action: pan-y; }
.ch-tip { position: absolute; z-index: 3; pointer-events: none; background: var(--card); color: var(--text); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 6px 12px; box-shadow: var(--shadow); white-space: nowrap; top: 0; }
.ch-tip-t { font-size: 12px; color: var(--muted); }
.ch-tip-v { font-weight: 700; }
.ch-empty { color: var(--muted); padding: 24px 0; }
.charts.empty { display: block; }
.ch-table { grid-column: 1 / -1; }
.ch-tablewrap { max-height: 260px; overflow: auto; margin-top: 8px; }

/* ----- Demandes d'inscription de nouveaux totems ----- */
.pending { display: grid; gap: 12px; }
.pend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding: 14px 18px; border-radius: var(--r-inner, 14px); background: var(--sunk); border: 1px solid var(--line); }
.pcode { font: 700 30px/1 ui-monospace, Consolas, monospace; letter-spacing: .14em; padding: 10px 6px 10px 16px; border: 2px dashed var(--signal); border-radius: 12px; }
.pinfo { flex: 1; min-width: 220px; }
.pact { display: flex; gap: 8px; }

/* Catalogue de modèles */
.tplpick { text-align: left; background: var(--sunk); color: var(--text); border: 1px solid var(--line-strong); flex: 1 1 220px; }
.tplpick:hover { border-color: var(--text); background: var(--sunk); color: var(--text); }
dialog.catalogue { width: min(1000px, 94vw); max-height: 90vh; padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); }
dialog.catalogue::backdrop { background: rgba(8, 14, 22, .6); }
.tp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tp-head h2 { margin: 0; }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, 260px); gap: 16px; justify-content: center; margin-top: 8px; }
.tp-card { display: grid; align-content: start; gap: 6px; text-align: left; padding: 10px; background: var(--sunk); color: var(--text); border: 2px solid var(--line); border-radius: 14px; font-weight: 400; }
.tp-card:hover, .tp-card:focus-visible { border-color: var(--accent); background: var(--card); color: var(--text); }
.tp-card.on { border-color: var(--accent); background: var(--card); }
.tp-thumb { display: block; position: relative; width: 238px; height: 134px; overflow: hidden; border-radius: 8px; background: #000; }
.tp-thumb iframe { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; border: 0; transform: scale(.1859); transform-origin: top left; pointer-events: none; }
.tp-name { font-weight: 700; font-size: 15px; margin-top: 4px; }
.tp-desc { font-size: 12.5px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tp-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--card); border: 1px solid var(--line-strong); color: var(--muted); margin-left: 0; }
.tag.ok { color: #1c7c4a; border-color: #1c7c4a; }
.tag.warn { color: #b25e00; border-color: #b25e00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.ok { color: #5fd58f; border-color: #5fd58f; } :root:not([data-theme="light"]) .tag.warn { color: #ffb454; border-color: #ffb454; } }
:root[data-theme="dark"] .tag.ok { color: #5fd58f; border-color: #5fd58f; }
:root[data-theme="dark"] .tag.warn { color: #ffb454; border-color: #ffb454; }
p.warn { color: #b25e00; margin: 0; }
:root[data-theme="dark"] p.warn { color: #ffb454; }
.sk-row { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.sk-row:first-child { border-top: 0; }
.sk-row .tag { margin-left: 10px; }
.sk-row input { flex: 1 1 260px; }

.assoc { border-radius: 0; flex: 1 1 100%; border-top: 1px solid var(--line); padding-top: 8px; font-size: 14px; }
.assoc summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.assoc > * { margin-top: 8px; }
.assoc .bar select, .assoc .bar input { min-width: 0; }
#us-list .tag { margin-left: 8px; }
