:root {
  color-scheme: dark;
  --bg: #0d0e10; --surface: #15171a; --surface-2: #1c1f23; --text: #ece8e1; --muted: #8e8b84; --line: rgba(255,255,255,.08);
  --accent: #c9b27c; --on-accent: #14120c; --ok: #7fa58b; --warn: #c99a6b; --bad: #b8736b;
  --ok-bg: rgba(127,165,139,.14); --warn-bg: rgba(201,154,107,.14); --bad-bg: rgba(184,115,107,.16); --mute-bg: #1c1f23;
  --ease: cubic-bezier(.22,1,.36,1); --serif: "Cormorant Garamond", Georgia, serif; --sans: Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); }
#app { display: flex; min-height: 100vh; }
#side { width: 224px; flex: none; background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; display: flex;
  flex-direction: column; padding: 20px 12px 16px; overflow-y: auto; transition: margin-left .2s ease; }
#tabs { display: grid; gap: 2px; }
#tabs a { padding: 9px 14px; border-radius: 10px; color: var(--muted); text-decoration: none; }
#tabs a:hover { color: var(--text); }
#tabs a.on { background: var(--mute-bg); color: var(--text); font-weight: 600; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 14px 0; text-decoration: none; color: var(--text); }
.side-brand b { font-weight: 600; font-size: 17px; letter-spacing: .01em; }
.side-sep { border: 0; border-top: 1px solid var(--line); margin: 14px 8px; }
#tabs .side-sep { margin: 10px 8px; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
#sum { padding: 0 14px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.side-gear { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 10px; color: var(--muted); text-decoration: none; }
.side-gear:hover { color: var(--text); }
.side-gear.on { background: var(--mute-bg); color: var(--text); font-weight: 600; }
#content { flex: 1; min-width: 0; }
#scrim { display: none; }
body.side-collapsed #side { margin-left: -224px; }
#top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 14px 18px; padding: 12px 24px; background: var(--bg);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
#top, .gl, .gl-filters { --gl-accent: var(--accent); --gl-card: var(--surface); --gl-soft: var(--mute-bg); }
.icon-btn { font: inherit; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--gl-accent); }
#brand { display: none; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
#brand b { font-weight: 600; letter-spacing: .01em; font-size: 16px; }
#brand rect { fill: var(--gl-accent); }
#top-q { flex: 1 1 320px; max-width: 680px; min-width: 0; border-radius: 999px; padding: 11px 20px; font-size: 15px; }
#top-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#top-cat[hidden] { display: none; }
#top-lang, #top-cat { border-radius: 999px; padding: 8px 14px; max-width: 220px; }
main { max-width: 1100px; margin: 0 auto; padding: 22px 24px 60px; }
main.wide { max-width: none; }
@media (max-width: 900px) {
  #brand { display: flex; }
  #side { position: fixed; z-index: 20; left: 0; top: 0; margin-left: -250px; width: 240px; box-shadow: 0 0 40px rgba(0,0,0,.25); transition: margin-left .2s ease; }
  body.side-collapsed #side { margin-left: -250px; }
  body.menu-open #side { margin-left: 0; }
  #scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 15; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.menu-open #scrim { opacity: 1; pointer-events: auto; }
  #top { padding: 10px 14px; }
  main { padding: 16px 14px 50px; }
}
@media (max-width: 640px) { #top-q { flex-basis: 100%; max-width: none; order: 5; } #top-filters { order: 6; width: 100%; } #top-lang, #top-cat { flex: 1; max-width: none; } }
@media (prefers-reduced-motion: reduce) { #side, #scrim { transition: none; } }
.bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
input, select, button.btn, a.btn, summary.btn { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--text); }
input[type=search], input[type=text] { min-width: 220px; }
button.btn { cursor: pointer; }
button.btn:hover, a.btn:hover, summary.btn:hover { border-color: var(--accent); }
button.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: 0; }
tr.sub td { background: var(--bg); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--mute-bg); color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.switch { position: relative; width: 34px; height: 20px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 20px; cursor: pointer; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; border-radius: 50%;
  background: #fff; transition: .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(14px); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.tile b { display: block; font-size: 22px; }
.tile span { color: var(--muted); font-size: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 10px; font-size: 14px; }
.row { display: flex; align-items: center; gap: 10px; margin: 5px 0; }
.row .lbl { width: 190px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .track { flex: 1; background: var(--mute-bg); border-radius: 4px; height: 10px; }
.row .fill { height: 100%; background: var(--accent); border-radius: 4px; }
.row .n { width: 70px; text-align: right; color: var(--muted); }
.copy { display: flex; gap: 8px; align-items: center; }
.copy input { flex: 1; font-family: ui-monospace, monospace; font-size: 12px; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 8px 14px; border-radius: 6px; opacity: 0; transition: .2s; pointer-events: none; }
#toast.show { opacity: .92; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
@media (max-width: 700px) { .hide-s { display: none; } }

h2 { font-size: 15px; margin: 0 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.chip input { margin: 0; }
.langlist { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.langrow { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-bottom: 1px solid var(--line); }
.langrow:last-child { border-bottom: 0; }
.langrow .rank { width: 24px; text-align: right; }
.langrow .row { flex: 1; margin: 0; }
.langrow .n { font-size: 12px; }
button.mini { padding: 0 8px; line-height: 22px; }
.nowrap { white-space: nowrap; }
.found .row { justify-content: space-between; padding: 4px 0; }

/* programmes TV (guide XMLTV) */
.epgbox { margin: 0 0 6px; }
.prog { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.prog.now { background: var(--mute-bg); border-radius: 6px; padding: 6px 8px; margin-bottom: 4px; }

a { color: var(--accent); }
a.btn { display: inline-block; text-decoration: none; }
/* Le menu est en flux (pas absolu) : le conteneur .scroll de la modale clips les positionnements absolus. */
.scroll { overflow-x: auto; }
.scroll table { min-width: 560px; }
.grow { flex: 1; min-width: 0; }

/* pagination numérotée */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0; }
.pager .count { font-size: 13px; }
.pgs { display: flex; flex-wrap: wrap; gap: 4px; }
.pg { min-width: 34px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; text-align: center; background: var(--surface);
  color: var(--text); text-decoration: none; line-height: 1.3; }
a.pg:hover { border-color: var(--accent); }
.pg.cur { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.pg.disabled { opacity: .4; }
.pg.gap { border-color: transparent; background: none; min-width: 0; padding: 5px 2px; }
.jumpbox { display: inline-flex; gap: 4px; align-items: center; }
input.jump { width: 64px; min-width: 0; }



/* modales : détail d'une chaîne (avec lecteur) et lecteur seul */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal .box { background: var(--surface); border-radius: 10px; padding: 14px; width: min(860px, 100%); max-height: 92vh; overflow-y: auto; }
.modal .box.wide { width: min(1100px, 100%); }
.modal .head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.modal .head h3 { margin: 0 0 2px; font-size: 17px; }
.modal .head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal h3.sec { font-size: 14px; margin: 16px 0 8px; }
.pwrap { background: var(--surface); padding-bottom: 6px; }
.pwrap.on { position: sticky; top: 0; z-index: 2; padding-top: 4px; }
.phead { display: none; align-items: center; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.pwrap.on .phead { display: flex; }
.plabel { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmin { margin-left: auto; }
.pclose { display: none; }
/* lecteur réduit : la vidéo continue dans le coin bas-droit pendant qu'on navigue derrière */
.floatbox { position: fixed; right: 14px; bottom: 14px; z-index: 40; width: min(340px, calc(100vw - 28px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.floatbox .pwrap { background: none; padding-bottom: 0; }
.floatbox .pwrap.on { position: static; padding-top: 0; }
.floatbox .player { border-radius: 0; }
.floatbox .player video { height: 190px; }
.floatbox .pstatus { margin-top: 0; padding: 4px 8px 6px; font-size: 12px; }
.pwrap.floating .pmin { display: none; }
.pwrap.floating .pclose { display: inline-block; }
.player { position: relative; background: #000; border-radius: 8px; overflow: hidden; }
.player video { display: block; width: 100%; height: 260px; background: #000; object-fit: contain; }
.pidle[hidden] { display: none; }
.pidle { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; color: #aaa; font-size: 13px; }
.pstatus { margin-top: 6px; font-size: 13px; min-height: 18px; }
tr.playing td { background: var(--ok-bg); }
@media (max-width: 700px) {
  .modal { padding: 0; align-items: stretch; }
  .modal .box, .modal .box.wide { width: 100%; max-height: 100vh; border-radius: 0; }
  .player video { height: 190px; }
  .pager { gap: 6px; }
}

/* mobile : un menu aux options très longues (groupes, hébergeurs) ne doit pas élargir la page */
select, input[type=text], input[type=search] { max-width: 100%; }
select { min-width: 0; text-overflow: ellipsis; }
@media (max-width: 700px) {
  input[type=search], input[type=text] { min-width: 0; width: 100%; }
  .bar > select { flex: 1 1 100%; }
}

/* mobile : les flux d'une chaîne s'empilent en cartes (URL lisible, boutons accessibles sans défilement latéral) */
@media (max-width: 700px) {
  .scroll table.streams { min-width: 0; }
  table.streams, table.streams tbody, table.streams tr, table.streams td { display: block; width: 100%; }
  table.streams { border: 0; background: none; }
  table.streams tr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; padding: 4px 2px; background: var(--surface); }
  table.streams td { border: 0; padding: 4px 8px; }
  table.streams .mono { word-break: break-all; }
  table.streams td.nowrap { white-space: normal; display: flex; flex-wrap: wrap; gap: 6px; }
}

/* grille de disponibilité (jour × heure) */
.hist { margin-top: 12px; }
table.heat { border-collapse: separate; border-spacing: 2px; background: none; border: 0; min-width: 0; width: auto; }
table.heat th { font-size: 10px; padding: 0 2px; border: 0; text-transform: none; letter-spacing: 0; text-align: center; color: var(--muted); font-weight: 500; }
table.heat tbody th { text-align: right; padding-right: 6px; font-size: 11px; }
table.heat td.hc { width: 15px; height: 17px; padding: 0; border: 0; border-radius: 3px; }
.scroll table.heat { min-width: 0; }
.legend { margin-top: 6px; font-size: 12px; }
ul.events { margin: 4px 0 0; padding-left: 18px; }

#alerts:empty { display: none; }
#alerts .alert { padding: 8px 16px; font-size: 13px; border-bottom: 1px solid var(--border, #ddd); }
#alerts .alert.warn { background: var(--warn-bg); color: var(--warn); }
#alerts .alert.crit { background: var(--bad-bg); color: var(--bad); }

/* ---------- vue galerie des chaînes : sobre, calme, un seul accent sauge ---------- */
.gl, .gl-filters { --gl-accent: var(--accent); --gl-card: var(--surface); --gl-soft: var(--mute-bg); }
.gl-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.gl-seg button { font: inherit; border: 0; background: none; color: var(--muted); padding: 6px 14px; cursor: pointer; }
.gl-seg button.on { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.gl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.gl-card { position: relative; background: var(--gl-card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 10px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 8px 24px rgba(0,0,0,.04); transition: transform .15s, border-color .15s; min-width: 0; }
.gl-card:hover { transform: translateY(-2px); border-color: var(--gl-accent); }
.gl-card.dim .gl-logo, .gl-card.dim .gl-name { opacity: .5; }
.gl-media { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; background: var(--gl-soft); overflow: hidden; margin-bottom: 12px; }
.gl-logo { text-decoration: none; display: grid; place-items: center; position: absolute; inset: 0; }
.gl-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }   /* le logo occupe toute la zone image, contenu et jamais étiré */
.gl-mark { width: 72px; height: 72px; border-radius: 18px; display: grid; place-items: center; font-weight: 500; font-size: 17px; letter-spacing: .04em;
  color: hsl(var(--h) 32% 36%); background: hsl(var(--h) 38% 88%); }
.gl-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; opacity: 0; transition: opacity .2s; }
.gl-card.live .gl-video { opacity: 1; }
.gl-card.loading .gl-logo::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 8px; height: 2px; border-radius: 2px; background: var(--gl-accent); opacity: .6; animation: gl-load 1s ease-in-out infinite alternate; }
@keyframes gl-load { from { transform: scaleX(.2); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .gl-card, .gl-video { transition: none; } .gl-card.loading .gl-logo::after { animation: none; } }
.gl-flag { position: absolute; top: 10px; left: 12px; font-size: 18px; line-height: 1; filter: drop-shadow(0 0 1px rgba(0,0,0,.25)); z-index: 2; pointer-events: none; }
.gl-dot { position: absolute; top: 10px; right: 10px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: #fff; z-index: 2; background: var(--muted); }
.gl-dot.on { background: var(--ok); } .gl-dot.doubt { background: var(--warn); } .gl-dot.off { background: var(--muted); opacity: .8; }
.gl-dot.unk { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--muted); }
.gl-edit { position: absolute; right: 10px; bottom: 10px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; z-index: 2; text-decoration: none;
  background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.18); font-size: 15px; opacity: 0; transition: opacity .15s; }
.gl-card:hover .gl-edit, .gl-edit:focus-visible { opacity: 1; }
.gl-edit:hover { color: var(--gl-accent); }
.gl-name { display: block; color: var(--text); font-weight: 500; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-now { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; min-height: 18px; }
.gl-foot { display: flex; justify-content: center; margin-top: 28px; }
.gl-sentinel { height: 1px; }
@media (max-width: 640px) {
  .gl-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .gl-edit { opacity: 1; } .gl-seg { margin-left: 0; }
}

/* ---------- barre de filtres simplifiée (galerie et liste) ---------- */
.gl-filters { margin-bottom: 18px; display: grid; gap: 12px; }
.gl-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gl-row > .gl-seg:last-child { margin-left: auto; }
.gl-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.gl-chip { font: inherit; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); padding: 6px 16px; cursor: pointer; list-style: none; }
.gl-chip:hover { border-color: var(--gl-accent); color: var(--text); }
.gl-chip.on { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--gl-accent); }
.gl-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 8px; padding: 0 5px; border-radius: 9px; background: var(--gl-accent); color: #fff; font-size: 11px; }
.gl-panel { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.gl-panel[hidden] { display: none; }
.gl-field { display: grid; gap: 4px; min-width: 180px; flex: 1 1 180px; font-size: 12px; color: var(--muted); }
.gl-field select { width: 100%; }
.gl-bulk { flex-basis: 100%; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.gl-bulkbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.gl-count-line { margin-bottom: 12px; font-size: 13px; }
@media (max-width: 640px) { .gl-row > .gl-seg:last-child { margin-left: 0; } .gl-row > input[type=search] { max-width: none; } }

/* ---------- en-tête de page des chaînes et fenêtre « Avancé » ---------- */
.gl-pagehead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; --gl-accent: var(--accent); }
.gl-pagehead .gl-count-line { margin: 0; flex: 1; text-align: center; font-size: 13px; }
#top-filters .gl-seg button { padding: 7px 14px; }
#top-adv.on { color: var(--text); box-shadow: inset 0 0 0 1px var(--gl-accent); }
.gl-adv { width: min(560px, 100%); }
.gl-advfields { display: grid; gap: 14px; margin-bottom: 16px; }
@media (max-width: 640px) { .gl-pagehead .gl-count-line { order: 5; flex-basis: 100%; text-align: left; } }

.gl-title { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: .01em; }
/* radios : cartes carrées et plus compactes */
.gl.radio .gl-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.gl.radio .gl-media { aspect-ratio: 1 / 1; }
.gl.radio .gl-mark { width: 84px; height: 84px; font-size: 24px; border-radius: 22px; }
@media (max-width: 640px) { .gl.radio .gl-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); } }

/* ---------- fiche d'édition d'une chaîne ---------- */
.gl-form { --gl-accent: var(--accent); display: grid; gap: 22px; }
.gl-sec h3.sec { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.gl-sec h4 { margin: 18px 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.gl-formgrid { display: grid; gap: 14px; max-width: 640px; }
.gl-formgrid .gl-field, .gl-form .gl-field { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.gl-formgrid input[type=text], .gl-formgrid input[type=url], .gl-formgrid select { width: 100%; font-size: 14px; color: var(--text); }
.gl-inline { margin-top: -8px; }
.gl-logoprev { width: 200px; aspect-ratio: 16 / 9; border-radius: 12px; background: var(--mute-bg); display: grid; place-items: center; overflow: hidden; }
.gl-logoprev img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.gl-streams { display: grid; gap: 10px; }
.gl-stream { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); min-width: 0; }
.gl-stream.dim { opacity: .65; }
.gl-streamhead { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.gl-addstream { margin-top: 16px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; }
.gl-addstream input[type=url] { flex: 1; min-width: 0; }
.gl-pickres { display: grid; gap: 6px; margin-top: 8px; }
.gl-pick input[type=search] { width: 100%; max-width: 420px; }
.gl-mergepreview { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--mute-bg); }
.gl-note { margin: 8px 0; padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--text); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.found[hidden], .gl-mergepreview[hidden] { display: none; }

/* aide à la saisie iptv-org */
.orgpick { position: relative; display: inline-block; min-width: 260px; vertical-align: middle; }
.orgpick-in { width: 100%; }
.orgpick-in.picked { border-color: var(--ok, #2e9e5b); }
.orgpick-list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; max-height: 320px; overflow: auto; min-width: 340px;
  background: var(--panel, #1c1f26); border: 1px solid var(--border, #3a3f4b); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.orgpick-item { display: flex; gap: 8px; align-items: center; padding: 6px 8px; cursor: pointer; }
.orgpick-item.on, .orgpick-item:hover { background: rgba(120,140,255,.18); }
.orgpick-item img, .orgpick-nologo { width: 36px; height: 24px; object-fit: contain; flex: none; background: rgba(255,255,255,.06); border-radius: 3px; }
.orgpick-txt { min-width: 0; }

/* fiches parentes */
.gl-group { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 10px; }
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.kid { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border, #3a3f4b); border-radius: 8px; padding: 6px; }
.kid-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.kid-main img, .kid-main .gl-mark { width: 40px; height: 28px; object-fit: contain; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.kid-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* liste déroulante de la recherche */
.topsugg { position: fixed; z-index: 60; max-height: 70vh; overflow: auto; background: var(--panel, #1c1f26); border: 1px solid var(--border, #3a3f4b); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4); padding: 4px 0; }
.topsugg-h { padding: 8px 14px 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .6; }
.topsugg-i { display: flex; gap: 10px; align-items: center; padding: 6px 14px; cursor: pointer; }
.topsugg-i.on, .topsugg-i:hover { background: rgba(120,140,255,.18); }
.topsugg-i img, .topsugg-nologo { width: 40px; height: 26px; object-fit: contain; flex: none; background: rgba(255,255,255,.06); border-radius: 4px; }
.topsugg-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topsugg-empty { padding: 10px 14px; }

/* ---- Programme TV : frise « maintenant / ensuite » (sobre : traits fins, beaucoup d'air, un seul accent) ---- */
.tv-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.tv-head h2 { margin: 0; font-weight: 500; font-size: 22px; letter-spacing: .01em; }
.tv-tools { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tv-tools input[type=search] { width: 170px; border-radius: 999px; padding: 6px 14px; }
.tv-cats, .tv-time { margin: 0 0 16px; }
.tv-time { margin-top: 14px; justify-content: center; }
.tv-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.tv-grid { min-width: max-content; }
.tv-row { display: flex; border-bottom: 1px solid var(--line); min-height: 62px; }
.tv-row:last-child { border-bottom: 0; }
.tv-axis { position: sticky; top: 0; z-index: 3; background: var(--surface); min-height: 34px; }
.tv-ch { position: sticky; left: 0; z-index: 2; flex: none; width: 190px; display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--surface);
  border: 0; border-right: 1px solid var(--line); font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.tv-axis .tv-ch { z-index: 4; cursor: default; }
.tv-ch span:last-child { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 13px; }
.tv-ch img { width: 38px; height: 38px; object-fit: contain; flex: none; border-radius: 8px; }
.tv-mark { width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--mute-bg); color: var(--muted); display: grid; place-items: center; font-weight: 500; }
.tv-track { position: relative; flex: none; }
.tv-tick { position: absolute; top: 9px; transform: translateX(-50%); font-size: 12px; color: var(--muted); }
.tv-tick::after { content: ""; position: absolute; left: 50%; top: 19px; height: 8px; border-left: 1px solid var(--line); }
.tv-prog { position: absolute; top: 8px; bottom: 8px; padding: 4px 12px; line-height: 1.3; overflow: hidden; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; justify-content: center; gap: 1px; transition: border-color .15s, background .15s; }
.tv-prog:hover { border-color: var(--accent); }
.tv-prog b { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-prog small { color: var(--muted); font-size: 11.5px; }
.tv-prog.live { background: var(--mute-bg); border-color: var(--accent); }
.tv-nowline { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--accent); pointer-events: none; opacity: .8; }
.tv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tv-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: grid; gap: 12px; cursor: pointer; transition: border-color .15s; align-content: start; }
.tv-card:hover { border-color: var(--accent); }
.tv-card .tv-ch { position: static; width: auto; padding: 0; border: 0; }
.tv-now, .tv-next { display: grid; gap: 3px; }
.tv-kicker { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.tv-next .tv-kicker { color: var(--muted); }
.tv-bar { height: 3px; background: var(--line); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.tv-bar i { display: block; height: 100%; background: var(--accent); }
@media (max-width: 640px) { .tv-ch { width: 120px; padding: 8px; } .tv-ch img, .tv-mark { width: 30px; height: 30px; } .tv-tools { margin-left: 0; } }

.miss-logo { width: 44px; height: 28px; object-fit: contain; background: rgba(255,255,255,.06); border-radius: 4px; }

/* ---------- favoris, récents, reprise ---------- */
.gl-star { position: absolute; left: 10px; bottom: 10px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; z-index: 2; border: 0; cursor: pointer;
  background: var(--surface); color: var(--muted); box-shadow: 0 1px 4px rgba(0,0,0,.18); font: inherit; font-size: 15px; line-height: 1; opacity: 0; transition: opacity .15s; }
.gl-card:hover .gl-star, .gl-star:focus-visible, .gl-star.on { opacity: 1; }
.gl-star.on, .star-btn.on { color: #c9a24a; }
.gl-star:hover { color: #c9a24a; }
.star-btn { padding: 6px 11px; }
@media (max-width: 640px) { .gl-star { opacity: 1; } }
#resume { display: grid; gap: 1px; margin: 0 14px; padding: 9px 12px; border-radius: 10px; background: var(--mute-bg); text-decoration: none; color: var(--text); min-width: 0; }
#resume[hidden] { display: none; }
#resume:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.resume-k { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.resume-n { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-play { position: absolute; left: 44px; bottom: 10px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; z-index: 2; border: 0; cursor: pointer;
  background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.18); opacity: 0; transition: opacity .15s; padding: 0 0 0 2px; }
.gl-card:hover .gl-play, .gl-play:focus-visible { opacity: 1; }
.gl-play:hover { color: var(--gl-accent); }
@media (max-width: 640px) { .gl-play { opacity: 1; } }

/* ---------- lecteur plein écran calme + mini-lecteur ---------- */
body.th-lock { overflow: hidden; }
.th { --th-ink: #ecebe6; --th-soft: rgba(236,235,230,.68); --th-acc: var(--accent); position: fixed; z-index: 50; background: #0b0b0a; color: var(--th-ink); overflow: hidden; }
.th[hidden] { display: none; }
.th video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.th.full { inset: 0; }
.th.mini { right: 16px; bottom: 16px; width: min(340px, calc(100vw - 32px)); aspect-ratio: 16 / 9; border-radius: 14px; box-shadow: 0 10px 34px rgba(0,0,0,.35); }
.th-top, .th-bottom { position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: 14px 18px; transition: opacity .4s; z-index: 2; }
.th-top { top: 0; padding-bottom: 40px; background: linear-gradient(rgba(0,0,0,.62), transparent); }
.th-bottom { bottom: 0; padding-top: 40px; background: linear-gradient(transparent, rgba(0,0,0,.68)); }
.th-bottom .grow { flex: 1; }
.th-id { min-width: 0; flex: 1; }
.th-title { font-size: 19px; font-weight: 500; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-now { font-size: 13px; color: var(--th-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 18px; }
.th-logo { height: 34px; width: 54px; object-fit: contain; flex: none; }
.th-btn { all: unset; box-sizing: border-box; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--th-ink); flex: none; transition: background .15s; }
.th-btn:hover, .th-btn:focus-visible { background: rgba(255,255,255,.14); }
.th-btn[hidden], .th-sel[hidden], .th-expandbtn { display: none; }
.th-sel { font: inherit; font-size: 12.5px; color: var(--th-ink); background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 6px 12px; max-width: 170px; cursor: pointer; }
.th-sel option { color: #111; }
.th-vol { width: 84px; accent-color: var(--th-acc); }
.th-msg { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); padding: 8px 18px; border-radius: 999px; background: rgba(0,0,0,.55); font-size: 14px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 2; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
.th-msg.show { opacity: 1; }
.th-msg.soft { background: none; color: var(--th-soft); }
.th-num { position: absolute; top: 76px; right: 28px; font-size: 64px; font-weight: 200; letter-spacing: .04em; z-index: 2; text-shadow: 0 2px 16px rgba(0,0,0,.6); }
.th-num[hidden] { display: none; }
.th.full.idle .th-top, .th.full.idle .th-bottom { opacity: 0; pointer-events: none; }
.th.full.idle { cursor: none; }
/* réduit : seul le haut apparaît, au survol */
.th.mini .th-bottom, .th.mini .th-logo, .th.mini .th-collapse, .th.mini .th-num { display: none; }
.th.mini .th-expandbtn { display: grid; }
.th.mini .th-top { padding: 6px 8px 22px; opacity: 0; }
.th.mini:hover .th-top, .th.mini:focus-within .th-top { opacity: 1; }
.th.mini .th-title { font-size: 13px; }
.th.mini .th-now { display: none; }
.th.mini .th-btn { width: 32px; height: 32px; }
.th.mini .th-msg { bottom: 12px; font-size: 12px; padding: 4px 12px; }
.th.mini video { cursor: pointer; }
.floatbox { z-index: 40; }
@media (max-width: 700px) {
  .th-bottom { flex-wrap: wrap; padding: 36px 12px 12px; gap: 6px; }
  .th-vol { display: none; }
  .th-sel { max-width: 120px; }
  .th-title { font-size: 16px; }
  .th-num { font-size: 44px; top: 70px; }
}
@media (prefers-reduced-motion: reduce) { .th-top, .th-bottom, .th-msg, .th-btn { transition: none; } }

/* ---------- palette de commandes ---------- */
.pal { position: fixed; inset: 0; z-index: 100; background: rgba(10,10,9,.45); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 0; }
.pal-box { width: min(620px, 100%); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 60px rgba(0,0,0,.35); overflow: hidden; }
.pal-in { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 18px 22px; font-size: 17px; background: transparent; color: inherit; outline: none; }
.pal-list { max-height: min(56vh, 460px); overflow-y: auto; padding: 6px 0 8px; }
.pal-h { padding: 10px 22px 4px; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.pal-i { display: flex; align-items: center; gap: 12px; padding: 7px 22px; cursor: pointer; }
.pal-i.on { background: var(--mute-bg); }
.pal-i img, .pal-nologo { width: 40px; height: 26px; flex: none; object-fit: contain; border-radius: 5px; background: var(--mute-bg); display: grid; place-items: center; color: var(--muted); }
.pal-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-t b { font-weight: 500; }
.pal-empty { padding: 16px 22px; }
.pal-foot { padding: 10px 22px; border-top: 1px solid var(--line); font-size: 12px; }
@media (max-width: 640px) { #top-pal { display: none; } }

/* rappels « me prévenir » */
.tv-bellpos { position: absolute; top: 9px; z-index: 1; }
.tv-bell { background: transparent; border: 0; padding: 2px 4px; font-size: 14px; cursor: pointer; opacity: .55; line-height: 1; }
.tv-bell:hover, .tv-bell.on { opacity: 1; color: var(--accent); }
.tv-bell.on svg path { fill: currentColor; }
#tabs a[data-n]:not([data-n=""])::after { content: attr(data-n); margin-left: 8px; font-size: 11px; background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; }
.rem-list { display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.rem-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rem-when { width: 120px; flex: none; font-variant-numeric: tabular-nums; color: var(--muted); }
.rem-what { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rem-banners { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.rem-banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--accent); border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.25); }
.rem-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* éditeur en masse */
.sel-box { position: absolute; bottom: 8px; left: 8px; z-index: 3; width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.selbar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 55; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: calc(100vw - 32px);
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--accent); border-radius: 16px; box-shadow: 0 10px 34px rgba(0,0,0,.28); }
.selbar-n { margin-right: 4px; }
.sel-dlg { max-width: 560px; }
.sel-dlg input[type=text] { width: 100%; }
.ord-fields { display: flex; gap: 16px; margin-bottom: 8px; }
.ord-fields input { width: 90px; }
.ord-list { list-style: none; margin: 8px 0; padding: 0; max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.ord-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface); cursor: grab; }
.ord-row:last-child { border-bottom: 0; }
.ord-row.drag { opacity: .45; }
.ord-n { width: 44px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.ord-grip { color: var(--muted); }
.ord-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ord-old { font-size: 12px; }
.gl-rm { position: absolute; top: 8px; right: 8px; z-index: 3; width: 26px; height: 26px; border-radius: 999px; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; display: grid; place-items: center; }

/* profils et connexion */
.profile-slot { display: flex; align-items: center; gap: 8px; }
.profile-slot:empty { display: none; }
.profile-out { background: transparent; border: 0; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; }
.login { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; }
.login-box { width: min(340px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 12px; }
.login-box h2 { margin: 0; font-weight: 500; text-align: center; }
.login-logo { align-self: center; }
.login-err { color: #b3402e; min-height: 1.2em; font-size: 13px; }

/* retour arrière (timeshift) */
.th-ts { position: absolute; left: 0; right: 0; bottom: 64px; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 0 18px; flex-wrap: wrap; transition: opacity .4s; }
.th-ts[hidden] { display: none; }
.th.mini .th-ts { display: none; }
.th.full.idle .th-ts { opacity: 0; pointer-events: none; }
.th-tsb { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.th-tsb:hover:not(:disabled) { background: rgba(255,255,255,.26); }
.th-tsb:disabled { opacity: .45; cursor: default; }
.th-tsinfo { margin-left: auto; color: rgba(255,255,255,.85); font-size: 13px; font-variant-numeric: tabular-nums; }
.th-btn.on { color: var(--gl-accent, #9cc2a6); }

/* multi-vues */
.mv-add { position: relative; }
.mv-add input { width: 190px; border-radius: 999px; padding: 6px 14px; }
.mv-results { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 4px; }
.mv-results[hidden] { display: none; }
.mv-res { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: transparent; font: inherit; color: var(--text); border-radius: 8px; cursor: pointer; }
button.mv-res:hover { background: var(--mute-bg); }
.mv-grid { display: grid; gap: 12px; grid-template-columns: 1fr; margin-top: 12px; }
.mv-grid.n2, .mv-grid.n3, .mv-grid.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .mv-grid.n2, .mv-grid.n3, .mv-grid.n4 { grid-template-columns: 1fr; } }
.mv-tile { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; border: 2px solid transparent; cursor: pointer; }
.mv-tile.active { border-color: var(--accent); }
.mv-tile video { width: 100%; height: 100%; object-fit: contain; display: block; }
.mv-msg { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: #ccc; font-size: 14px; background: rgba(0,0,0,.35); }
.mv-msg.show { display: flex; }
.mv-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 22px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; }
.mv-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mv-snd { display: none; color: var(--gl-accent, #9cc2a6); }
.mv-tile.active .mv-snd { display: inline; }
.mv-bar .btn { padding: 3px 10px; font-size: 12.5px; }

/* enregistrements */
.tv-rec { color: #c0392b; opacity: .6; }
.tv-rec:hover { opacity: 1; color: #c0392b; }
.rec-quota { margin: 6px 0 14px; display: flex; flex-direction: column; gap: 6px; max-width: 760px; }
.rec-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.rec-bar i { display: block; height: 100%; background: var(--accent); }
.rec-act { display: flex; gap: 6px; flex-wrap: wrap; }
td.rec-act { display: table-cell; white-space: normal; min-width: 230px; }
td.rec-act > * { margin: 2px 6px 2px 0; display: inline-block; }
.rec-box { max-width: 860px; width: calc(100vw - 32px); }
.rec-prog { display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; min-width: 220px; }
button.rec-prog { cursor: pointer; }
.rec-thumb { width: 54px; height: 76px; flex: none; object-fit: cover; border-radius: 6px; background: var(--line); }
.rec-nothumb { display: flex; align-items: center; justify-content: center; opacity: .6; }
.rec-info { display: flex; gap: 14px; align-items: flex-start; }
.rec-info code { overflow-wrap: anywhere; }
.rec-poster { width: 180px; max-width: 40%; border-radius: 8px; flex: none; }
.rec-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.rec-form label { display: flex; flex-direction: column; gap: 2px; }
.rec-form .bar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.rec-video { width: 100%; max-height: 70vh; background: #000; border-radius: 10px; }

/* ---- comptes et administration ---- */
.role-user .adm-only, .role-user .gl-edit, .role-user #top-adv { display: none !important; }
.profile-slot:has(.acct-line) { flex-direction: column; align-items: stretch; }
.acct-line { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.acct-name { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-name:hover { text-decoration: underline; }
.acct-id { display: grid; gap: 2px; min-width: 0; }
.acct-lead { padding: 0 0 2px; }
.acct-id .acct-name { font-size: 16px; }
.acct-role { font-size: 13px; overflow-wrap: anywhere; }
.acct-role .muted { color: var(--muted); }
.acc-tabs { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.acc-tabs .gl-chip { text-decoration: none; }
.acc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.acc-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.acc-n { font-size: 24px; font-weight: 600; line-height: 1.2; }
.acc-l { color: var(--muted); font-size: 12.5px; }
.acc-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.acc-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 16px; max-width: 760px; }
.acc-field { display: flex; flex-direction: column; gap: 4px; }
.acc-field input, .acc-field select { width: 100%; }
.acc-quota-row { display: flex; flex-direction: column; gap: 4px; }
.acc-def { font-size: 12.5px; color: var(--muted); }
.acc-rows { display: grid; gap: 10px; max-width: 760px; }
.acc-table td { vertical-align: top; }
.acc-table tr.off { opacity: .55; }
.acc-rec { min-width: 150px; display: table-cell; }
.acc-rec .rec-bar { margin-bottom: 4px; }
.small { font-size: 12px; }
.copy { display: flex; gap: 8px; } .copy input { flex: 1; min-width: 0; }
.acc-quota-row { align-self: start; } .acc-quota-row .acc-field { flex: none; min-height: 0; }

/* ------------------------------------------------------------------ fiche d'un programme (fiche.js, planif.js) */
.tv-plink { cursor: pointer; border-radius: 10px; margin: -6px -8px; padding: 6px 8px; }
.tv-plink:hover, .tv-plink:focus-visible { background: var(--mute-bg); outline: none; }
.fc-modal { z-index: 80; }
.modal .box.fiche { width: min(780px, 100%); padding: 6px 26px 26px; border-radius: 18px; }
.fc-top { display: flex; align-items: center; padding: 14px 0 4px; }
.fc-body { display: grid; gap: 18px; }
.fc-grid { display: grid; gap: 22px; }
.fc-grid.has-img { grid-template-columns: 168px minmax(0, 1fr); align-items: start; }
.fc-poster { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; background: var(--mute-bg); box-shadow: 0 6px 22px rgba(0,0,0,.18); }
.fc-main { display: grid; gap: 10px; align-content: start; min-width: 0; }
.fc-kicker { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; }
.fc-logo { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; background: #fff; padding: 2px; }
.fc-title { margin: 2px 0 0; font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: .005em; overflow-wrap: anywhere; }
.fc-sub { font-size: 16px; color: var(--text); opacity: .85; }
.fc-ep { color: var(--accent); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.fc-meta { color: var(--muted); font-size: 13.5px; }
.fc-when { font-size: 14.5px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fc-when .fc-bar { flex: 1 0 100%; margin-top: 8px; }
.fc-desc { margin: 0; font-size: 15px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.fc-row { display: flex; gap: 12px; font-size: 14px; line-height: 1.5; }
.fc-lab { flex: none; width: 44px; color: var(--muted); text-transform: uppercase; font-size: 11.5px; letter-spacing: .06em; padding-top: 2px; }
.fc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fc-actions .btn { padding: 9px 18px; border-radius: 999px; }
.fc-plan { display: grid; gap: 12px; }
@media (max-width: 640px) {
  .modal .box.fiche { padding: 0 16px 20px; border-radius: 0; }
  .fc-grid.has-img { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
  .fc-title { font-size: 21px; }
}

/* planification (planif.js) */
.fc-plan:empty { display: none; }
.pl-panel { display: grid; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.pl-margins { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.pl-field { display: grid; gap: 6px; }
.pl-lab { color: var(--muted); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
.pl-step { display: flex; align-items: center; gap: 6px; }
.pl-step input { width: 64px; text-align: center; min-width: 0; }
.pl-step .btn { width: 32px; padding: 5px 0; text-align: center; border-radius: 999px; }
.pl-info { display: grid; gap: 8px; }
.pl-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.pl-line.muted { color: var(--muted); }
.pl-line.ok { color: var(--ok); } .pl-line.warn { color: var(--warn); } .pl-line.bad { color: var(--bad); }
.pl-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pl-recap { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; }
.pl-recap .pl-lab { display: inline-block; width: 128px; }
.pl-alts { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-alts:empty { display: none; }
.pl-why { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; }
.pl-done { display: grid; gap: 10px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.plan-sec { margin: 0 0 22px; }
tr.plan-risk td { background: var(--warn-bg); }
@media (max-width: 640px) { .pl-recap .pl-lab { display: block; width: auto; } }
button.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- lecteur unique : barre d'outils, panneau à onglets (Programme, Sources, édition), détail d'un flux (lecteur.js, lecteur_edit.js) ---- */
.th-src { font-size: 12px; color: var(--th-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 16px; letter-spacing: .02em; }
.th-tools { display: flex; align-items: center; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; max-width: 62%; }
.th-chip { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: rgba(255,255,255,.13); color: var(--th-ink);
  font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .15s; }
.th-chip:hover, .th-chip:focus-visible { background: rgba(255,255,255,.24); }
.th-chip.on { box-shadow: inset 0 0 0 1.5px var(--th-acc); }
.th-chip input[type=checkbox] { accent-color: var(--th-acc); margin: 0; width: 15px; height: 15px; }
.th-auto { cursor: pointer; }
.th-star { font-size: 21px; line-height: 1; } .th-star.on { color: #e9c46a; }
.th-btn[hidden] { display: none; }
.th-starslot { display: contents; }
.th.mini .th-tools, .th.mini .th-src, .th.mini .th-edit, .th.mini .th-ask, .th.mini .fc-modal { display: none; }

.th-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; padding: 2px 0 8px; }
.th-card { min-width: 0; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1.5px solid transparent; cursor: pointer; display: flex; flex-direction: column; gap: 5px;
  transition: background .15s, border-color .15s; }
.th-card:hover, .th-card:focus-visible { background: rgba(255,255,255,.13); outline: none; }
.th-card.cur { border-color: var(--th-acc); background: rgba(147,179,158,.16); }
.th-card.off { opacity: .55; cursor: not-allowed; } .th-card.dim { opacity: .7; }
.th-card-h { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 14px; }
.th-card-i { all: unset; box-sizing: border-box; width: 26px; height: 26px; margin: -4px -6px -4px 0; display: grid; place-items: center; border-radius: 50%; color: var(--th-soft); cursor: pointer; }
.th-card-i:hover, .th-card-i:focus-visible { background: rgba(255,255,255,.18); color: var(--th-ink); }
.th-card-s { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--th-soft); }
.th-card-cur { margin-left: auto; font-size: 11.5px; color: var(--th-acc); }
.th-card-m { font-size: 12.5px; color: var(--th-ink); font-variant-numeric: tabular-nums; }
.th-card-t { display: flex; gap: 5px; flex-wrap: wrap; }
.th-card-res { font-size: 12.5px; line-height: 1.3; overflow-wrap: anywhere; } .th-card-res.ok { color: #7fd69c; } .th-card-res.bad { color: #f0968b; } .th-card-res.wait { color: var(--th-soft); } .th-card-res.muted { color: var(--th-soft); font-size: 12px; }
.th-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; background: rgba(255,255,255,.4); }
.th-dot.on { background: #6cc58a; } .th-dot.doubt { background: #e3b25b; } .th-dot.off { background: #e0786b; } .th-dot.unk { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5); }
.th-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; background: rgba(255,255,255,.12); color: var(--th-ink); }
.th-tag.ok { background: rgba(108,197,138,.22); color: #9be0b2; } .th-tag.bad { background: rgba(224,120,107,.22); color: #f3a89f; }
.th-empty { color: var(--th-soft); font-size: 13px; padding: 8px 2px; }
.th-kids-t { font-size: 12.5px; color: var(--th-soft); margin-bottom: 6px; }
.th-kids[hidden] { display: none; }
.th-kidlist { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.th-kid { all: unset; box-sizing: border-box; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 12px; background: rgba(255,255,255,.08); cursor: pointer; color: var(--th-ink); }
.th-kid:hover, .th-kid:focus-visible { background: rgba(255,255,255,.16); }
.th-kid img, .th-kid .gl-mark { width: 38px; height: 26px; object-fit: contain; flex: none; }
.th-kid .gl-mark { border-radius: 8px; font-size: 13px; display: grid; place-items: center; background: hsl(var(--h) 18% 24%); color: hsl(var(--h) 40% 80%); }
.th-kid .gl-dot { position: static; }
.th-kid-n { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

/* confirmation posée dans le lecteur (visible en plein écran) ; détail d'un flux : vue de l'onglet Sources */
.th-ask { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.th-ask { z-index: 12; }
.th-ask-box { width: min(560px, 100%); max-height: min(90vh, 720px); overflow-y: auto; border-radius: 20px; background: rgba(24,24,22,.96); border: 1px solid rgba(255,255,255,.12);
  padding: 18px 22px 20px; box-shadow: 0 18px 60px rgba(0,0,0,.5); color: var(--th-ink); }
.th-ask-box { width: min(420px, 100%); } .th-ask-box input { width: 100%; margin: 8px 0; font-size: 14px; background: rgba(255,255,255,.08); color: var(--th-ink); border-color: rgba(255,255,255,.2); }
.th-pop-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.th-pop-h h3 { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: .01em; }
.th-ask .muted, .th-edit .muted { color: var(--th-soft); }
.th-kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 6px 14px; margin: 8px 0 12px; font-size: 13.5px; }
.th-kv dt { color: var(--th-soft); } .th-kv dd { margin: 0; overflow-wrap: anywhere; }
.th-detail h4 { margin: 14px 0 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--th-soft); font-weight: 600; }
.th-events { margin: 4px 0 0; padding: 0 0 0 18px; font-size: 13px; }
.th-detail .btn { background: rgba(255,255,255,.1); color: var(--th-ink); border-color: rgba(255,255,255,.2); }
.th-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.th-b { all: unset; box-sizing: border-box; padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.13); color: var(--th-ink); font-size: 13px; cursor: pointer; }
.th-b:hover:not(:disabled), .th-b:focus-visible { background: rgba(255,255,255,.24); }
.th-b.pri { background: var(--th-acc); color: #14130f; } .th-b.pri:hover:not(:disabled) { background: #a9c8b4; }
.th-b.danger { color: #f3a89f; } .th-b:disabled, .th-b[disabled] { opacity: .4; cursor: not-allowed; }
.th-note { font-size: 12.5px; color: var(--th-soft); }
.th-url { font: 12.5px/1.5 ui-monospace, monospace; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.08); overflow-wrap: anywhere; user-select: all; margin-top: 12px; }
.th-urlbox[hidden] { display: none; }
.th-move { margin-top: 12px; display: grid; gap: 6px; } .th-move input { width: 100%; background: rgba(255,255,255,.08); color: var(--th-ink); border-color: rgba(255,255,255,.2); }
.th-pickrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; }

/* tiroir d'édition (administrateur) : mêmes composants que le reste de l'appli, en thème sombre */
.th-edit { --bg: #1b1b19; --surface: #222220; --text: #ecebe6; --muted: #9a9a93; --line: #3a3a35; --accent: var(--accent); --on-accent: #14130f;
  --ok: #5fcf8a; --warn: #e3b25b; --bad: #ee7b6d; --ok-bg: #1c3226; --warn-bg: #3a2f17; --bad-bg: #3d1f1b; --mute-bg: #2b2b28;
  /* sous la barre du haut et au-dessus de la barre de lecture : « Panneau », Auto et ★ restent accessibles quand il est ouvert */
  position: absolute; top: 68px; right: 12px; bottom: 84px; z-index: 7; width: min(480px, calc(100% - 24px)); display: flex; flex-direction: column; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.45); font-size: 14px; }
.th-edit-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px 6px; } .th-edit-h h3 { margin: 0; font-size: 17px; font-weight: 600; }
.th-edit-tabs { display: flex; gap: 4px; padding: 6px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.th-edit-tab { all: unset; box-sizing: border-box; padding: 7px 14px; border-radius: 999px; color: var(--muted); cursor: pointer; font-size: 13.5px; white-space: nowrap; }
.th-edit-tab:hover, .th-edit-tab:focus-visible { color: var(--text); } .th-edit-tab.on { background: var(--mute-bg); color: var(--text); font-weight: 600; }
.th-edit-body { flex: 1; overflow-y: auto; padding: 14px 16px 28px; }
.th-edit .grow { flex: 1; } .th-edit .btn-reset { all: unset; cursor: pointer; }
.th-edit input, .th-edit select { background: var(--bg); color: var(--text); }
.th-edit .kids { grid-template-columns: 1fr; }
.th-edit .orgpick-list { min-width: 0; }
.th-edit .gl-stream { background: var(--bg); }

/* onglet Programme */
.th-edit .th-prog { display: flex; flex-direction: column; gap: 2px; }
.th-prog-day { margin: 14px 0 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--th-soft); font-weight: 600; } .th-prog-day:first-child { margin-top: 0; }
.th-prog-row { all: unset; box-sizing: border-box; display: flex; gap: 12px; align-items: flex-start; padding: 9px 10px; border-radius: 12px; cursor: pointer; color: var(--th-ink); }
.th-prog-row:hover, .th-prog-row:focus-visible { background: rgba(255,255,255,.1); }
.th-prog-row.live { background: rgba(147,179,158,.18); box-shadow: inset 0 0 0 1.5px var(--th-acc); }
.th-prog-t { flex: none; width: 48px; font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--th-soft); padding-top: 1px; } .th-prog-row.live .th-prog-t { color: var(--th-ink); font-weight: 600; }
.th-prog-m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; } .th-prog-m b { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.th-prog-m .th-tag { align-self: flex-start; } .th-prog-m small { font-size: 12.5px; color: var(--th-soft); }
.th-prog-bar { display: block; height: 4px; border-radius: 2px; background: rgba(255,255,255,.18); overflow: hidden; margin-top: 3px; } .th-prog-bar i { display: block; height: 100%; background: var(--th-acc); }
.th-src-hint { margin: 0 0 10px; font-size: 13px; } .th-src-hint b { color: var(--th-ink); }
.th-edit .th-kids { margin-bottom: 10px; }
.th-detail[hidden], .th-srclist[hidden] { display: none; }
.th-detail { color: var(--th-ink); }
.th-edit .th-empty { padding: 4px 0 12px; }
.th-edit .th-bar .th-b, .th-edit .th-prog .th-b { color: var(--th-ink); }

@media (max-width: 760px) {
  .th-tools { max-width: 100%; order: 3; flex-basis: 100%; justify-content: flex-start; }
  .th-top { flex-wrap: wrap; row-gap: 6px; padding-bottom: 26px; }
  .th-chip span { font-size: 12.5px; }
  .th-cards { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); }
  .th-kv { grid-template-columns: 1fr; gap: 0; } .th-kv dd { margin-bottom: 8px; }
  .th-edit { inset: 0; width: 100%; border-radius: 0; border: 0; }   /* petit écran : le panneau prend tout l'écran */
}
@media (prefers-reduced-motion: reduce) { .th-chip, .th-card { transition: none; } }

/* ---- Réglages : calme, une colonne, peu de bruit */
body.route-settings #top-q, body.route-settings #top-filters { display: none; }
@media (min-width: 901px) { body.route-settings #top { display: none; } }
.set-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 6px; }
.set-head h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: .01em; }
.set-links { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: 13px; }
.set-links a { color: var(--muted); text-decoration: none; }
.set-links a:hover { color: var(--text); }
.set-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 14px 0 22px; overflow-x: auto; }
.set-tabs a { padding: 9px 16px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.set-tabs a:hover { color: var(--text); }
.set-tabs a.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.set-body { max-width: 760px; }
.set-body .card { padding: 22px 24px; margin-bottom: 18px; }
.set-body .card h3 { font-size: 16px; font-weight: 600; margin: 0 0 6px; }

.set-lede { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 14px; }
.set-hero { border-color: var(--accent); }
.set-summary { font-size: 16px; line-height: 1.6; margin: 8px 0 10px; }
.set-more { margin-top: 12px; }
.set-more select { border-radius: 999px; }
.set-sub { margin: 10px 0 14px 26px; }
.set-switch { margin: 6px 0; }
.set-save { position: sticky; bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border: 1px solid var(--accent); border-radius: 14px; background: var(--surface); box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.set-save[hidden] { display: none; }
.set-panel .bar { margin: 12px 0 0; }
.set-zones { display: grid; gap: 8px; margin-bottom: 12px; }
.set-zone { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 640px) { .set-tabs a { padding: 9px 11px; } .set-card { padding: 18px 16px; } }

/* ---- lecteur radio (radio.js) : barre de lecture fixe réduite, page « en écoute » agrandie ; pas de lecteur vidéo */
.th .rd-bar, .th .rd-art { display: none; }
.th.radio video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rd-cover { flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: #1b1b19; }
.rd-cover img { width: 100%; height: 100%; object-fit: contain; }
.rd-cover .gl-mark { width: 100%; height: 100%; border-radius: 0; font-size: 20px; background: hsl(var(--h) 18% 24%); color: hsl(var(--h) 40% 80%); }
.rd-song { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-sub { font-size: 12.5px; color: var(--th-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-eq { display: none; align-items: flex-end; gap: 3px; height: 18px; flex: none; }
.rd-eq i { width: 3px; height: 4px; background: var(--th-acc); border-radius: 2px; }
.playing .rd-eq { display: inline-flex; }
.playing .rd-eq i { animation: rd-eq 1s ease-in-out infinite; }
.rd-eq i:nth-child(2) { animation-delay: -.3s; } .rd-eq i:nth-child(3) { animation-delay: -.6s; } .rd-eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes rd-eq { 0%, 100% { height: 4px; } 50% { height: 17px; } }
@media (prefers-reduced-motion: reduce) { .playing .rd-eq i { animation: none; height: 10px; } }
/* réduite : barre fixe en bas, à droite du menu */
.th.radio.mini { left: 72px; right: 0; bottom: 0; width: auto; aspect-ratio: auto; height: 76px; border-radius: 0; box-shadow: 0 -6px 26px rgba(0,0,0,.28); border-top: 1px solid rgba(255,255,255,.08); background: #121211; }
body.side-collapsed .th.radio.mini { left: 0; }
.th.radio.mini .th-top, .th.radio.mini .th-bottom, .th.radio.mini .th-msg, .th.radio.mini .th-ts { display: none; }
.th.radio.mini .rd-bar { display: flex; align-items: center; gap: 14px; height: 100%; padding: 0 18px; }
.rd-bar .rd-cover { width: 52px; height: 52px; }
.rd-coverbtn { all: unset; cursor: pointer; display: block; flex: none; border-radius: 10px; }
.rd-coverbtn:focus-visible, .rd-text:focus-visible { outline: 2px solid var(--th-acc); outline-offset: 2px; }
.rd-text { all: unset; cursor: pointer; flex: 1; min-width: 0; display: block; }
.rd-play { width: 48px !important; height: 48px !important; background: var(--th-ink); color: #0b0b0a; }
.rd-play:hover, .rd-play:focus-visible { background: #fff; }
.rd-volbox { display: flex; align-items: center; gap: 4px; }
body.rd-on { padding-bottom: 80px; }
@media (max-width: 900px) { .th.radio.mini { left: 0; } }
@media (max-width: 640px) { .rd-volbox .rd-vol, .rd-eq { display: none !important; } .th.radio.mini .rd-bar { gap: 10px; padding: 0 10px; } }
/* agrandie : page en écoute */
.th.radio.full { background: radial-gradient(120% 90% at 50% 0%, #26332b 0%, #0b0b0a 70%); }
.th.radio.full .rd-art { position: absolute; inset: 0; z-index: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 80px 24px 110px; text-align: center; }
.rd-big { width: min(300px, 62vw); height: min(300px, 62vw); border-radius: 18px; box-shadow: 0 18px 60px rgba(0,0,0,.55); margin-bottom: 14px; }
.rd-big .gl-mark { font-size: 64px; }
.rd-live { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; letter-spacing: .14em; color: var(--th-acc); }
.rd-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--th-acc); }
.playing .rd-dot { animation: rd-pulse 1.6s ease-in-out infinite; }
@keyframes rd-pulse { 50% { opacity: .25; } }
.rd-bigsong { font-size: clamp(20px, 4.2vw, 32px); max-width: min(760px, 92vw); white-space: normal; }
.rd-art .rd-sub { font-size: 15px; max-width: min(760px, 92vw); }
.rd-next { font-size: 13px; color: var(--th-soft); min-height: 18px; }
.th.radio .th-ts, .th.radio .th-pip, .th.radio .th-full { display: none; }
.th.radio.full .th-top .th-title, .th.radio.full .th-top .th-now { visibility: hidden; }
.rec-box .bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.sub-steps { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; }
.sub-steps .done, .sub-steps .todo { color: var(--muted); }
.sub-steps .now { font-weight: 600; }

/* ---- page de montage (montage.js) */
.mt-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.mt-top h2 { margin: 0; }
.mt-top .grow { flex: 1; }
.mt-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 14px; align-items: stretch; }
.mt-player { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mt-screen { position: relative; background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; max-height: 52vh; width: 100%; }
.mt-video { width: 100%; height: 100%; display: block; object-fit: contain; cursor: pointer; }
.mt-overlay { position: absolute; left: 4%; right: 4%; bottom: 4%; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; pointer-events: none; }
.mt-overlay span { background: rgba(0,0,0,.72); color: #fff; padding: 2px 8px; border-radius: 4px; font-size: clamp(13px, 1.5vw, 19px); }
.mt-overlay .alt { color: #ffe08a; font-size: clamp(11px, 1.2vw, 15px); }
.mt-gone { position: absolute; top: 8px; right: 8px; background: var(--bad); color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 12.5px; pointer-events: none; }
.mt-transport, .mt-zoom, .mt-sel, .mt-subtools, .mt-foot { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mt-transport { justify-content: center; }
.mt-play { min-width: 52px; }
input.mt-clock { width: 108px; min-width: 0; font-variant-numeric: tabular-nums; }
.mt-pos { white-space: nowrap; }
.mt-check { display: inline-flex; align-items: center; gap: 2px; }
.mt-check input { width: auto; }
.mt-side { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); height: 0; min-height: 100%; }
.mt-tabs { display: flex; border-bottom: 1px solid var(--line); }
.mt-tab { flex: 1; font: inherit; padding: 8px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer; }
.mt-tab.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.mt-pane { display: flex; flex-direction: column; gap: 8px; padding: 10px; flex: 1; min-height: 0; }
.mt-pane[hidden] { display: none; }
.mt-list { overflow-y: auto; flex: 1; min-height: 0; position: relative; }
.mt-list p { margin: 4px 0; }
.mt-cutrow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mt-subtools label { display: flex; flex-direction: column; }
.mt-cue { display: flex; gap: 8px; width: 100%; text-align: left; font: inherit; color: var(--text); background: none; border: 0; border-left: 3px solid transparent; padding: 5px 6px; cursor: pointer; }
.mt-cue:hover { background: var(--line); }
.mt-cue.on { border-left-color: var(--accent); background: var(--line); }
.mt-cue.removed .mt-cuetext { text-decoration: line-through; opacity: .55; }
.mt-cuetime { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; flex: none; padding-top: 2px; }
.mt-cuetext { display: flex; flex-direction: column; min-width: 0; }
.mt-editor { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.mt-sel { align-items: flex-end; }
.mt-sel label { display: flex; flex-direction: column; gap: 2px; }
.mt-field { display: flex; gap: 4px; }
.mt-cutbtn:not(:disabled) { border-color: var(--bad); color: var(--bad); font-weight: 600; }
.mt-editor button:disabled, .mt-top button:disabled { opacity: .5; cursor: default; }
.mt-track { position: relative; user-select: none; touch-action: none; cursor: crosshair; background: #141413; color: #ecebe6; border-radius: 8px; overflow: hidden; }
.mt-ruler { position: relative; height: 22px; border-bottom: 1px solid #333330; }
.mt-mark { position: absolute; top: 2px; font-size: 11px; padding-left: 3px; border-left: 1px solid #6b6b66; line-height: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mt-strip { position: relative; height: 68px; }
.mt-thumb { position: absolute; top: 0; height: 100%; object-fit: cover; border-right: 1px solid #141413; background: #262624; }
.mt-sublane { position: relative; height: 34px; border-top: 1px solid #333330; }
.mt-sublane[hidden] { display: none; }
.mt-cueblock { position: absolute; top: 3px; bottom: 3px; overflow: hidden; white-space: nowrap; font-size: 11.5px; line-height: 28px; padding-left: 3px; background: #3d5a4b; border: 1px solid #141413; border-radius: 4px; box-sizing: border-box; }
.mt-layer { position: absolute; inset: 22px 0 0 0; pointer-events: none; }
.mt-cutzone, .mt-selzone { position: absolute; top: 0; bottom: 0; }
.mt-cutzone { background: repeating-linear-gradient(45deg, rgba(200,50,40,.72) 0 7px, rgba(120,20,15,.72) 7px 14px); }
.mt-selzone { background: rgba(255,214,10,.28); border-top: 2px solid #ffd60a; border-bottom: 2px solid #ffd60a; box-sizing: border-box; }
.mt-edge { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; pointer-events: auto; }
.mt-edge.start { left: -3px; border-left: 3px solid #fff; }
.mt-edge.end { right: -3px; border-right: 3px solid #fff; }
.mt-selzone .mt-edge { border-color: #ffd60a; }
.mt-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px #000; pointer-events: none; }
.mt-head[hidden] { display: none; }
.mt-overview { position: relative; height: 14px; background: var(--line); border-radius: 4px; overflow: hidden; cursor: pointer; touch-action: none; }
.mt-ov-cut { position: absolute; top: 0; bottom: 0; background: var(--bad); }
.mt-ov-view { position: absolute; top: 0; bottom: 0; border: 2px solid var(--accent); border-radius: 3px; box-sizing: border-box; }
.mt-foot { justify-content: space-between; }
.mt-joins { color: var(--warn); }
.mt-top a.btn.off { opacity: .5; cursor: default; }
@media (max-width: 900px) {
  .mt-main { grid-template-columns: minmax(0, 1fr); }
  .mt-side { height: 360px; min-height: 0; }
  .mt-screen { max-height: none; }
}

/* appareil non relié : accueil, attente et « Accès validé » */
body.unlinked > #app, body.unlinked > #toast, body.unlinked > .th, body.unlinked > .modal { display: none !important; }
.login.welcome { overflow-y: auto; padding: 24px 16px; }
.welcome .login-box .btn { width: 100%; padding: 11px 16px; font-size: 15px; }
.welcome input { width: 100%; font-size: 16px; padding: 10px 12px; }
.wl-center { text-align: center; margin: 0; }
.wl-field { display: flex; flex-direction: column; gap: 4px; }
.wl-link { background: none; border: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; padding: 6px; align-self: center; }
.wl-link:hover { color: var(--text); }
.wl-admin { margin-top: 28px; font-size: 12.5px; }
.welcome input.wl-code-in { text-align: center; font: 600 24px/1.4 ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; }
.wl-code { text-align: center; font: 600 34px/1.2 ui-monospace, monospace; letter-spacing: .12em; color: var(--accent); border: 1px solid var(--line); border-radius: 14px; padding: 18px 8px; user-select: all; }
.wl-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); align-self: center; animation: wl-pulse 1.8s ease-in-out infinite; }
@keyframes wl-pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
.wl-check { width: 96px; height: 96px; align-self: center; border-radius: 50%; border: 2px solid var(--accent); display: grid; place-items: center; animation: wl-ring .6s var(--ease) both; }
.wl-check i { width: 24px; height: 46px; margin-top: -10px; border: solid var(--accent); border-width: 0 3px 3px 0; transform: rotate(45deg); animation: wl-tick .5s var(--ease) .35s both; }
.wl-hello { text-align: center; margin: 0; font-size: 17px; animation: wl-rise .6s var(--ease) .55s both; }
.wl-ok h2 { animation: wl-rise .5s var(--ease) both; }
@keyframes wl-ring { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes wl-tick { from { clip-path: inset(0 100% 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes wl-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .wl-pulse, .wl-check, .wl-check i, .wl-hello, .wl-ok h2 { animation: none !important; } }

/* personnes et appareils */
.dev-list { list-style: none; margin: 0 0 10px; padding: 0; }
.dev-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dev-row:last-child { border-bottom: 0; }
.dev-row .dev-main { flex: 1; min-width: 180px; }
.dev-row .dev-main > div { overflow-wrap: anywhere; }
.pers-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pers-head h3 { margin: 0; flex: 1; min-width: 140px; }
.pers-off { opacity: .65; }
.pers-invite { margin: 8px 0; }
.code-big { text-align: center; font: 600 28px/1.3 ui-monospace, monospace; letter-spacing: .12em; color: var(--accent); margin: 8px 0 14px; user-select: all; }
.acc-tabs.gl-seg { border-radius: 16px; padding: 4px; gap: 4px; }
