:root {
  --bg: #0e0f12; --panel: #17191e; --panel2: #1e2127; --text: #eceef2; --muted: #9ba2ae; --line: #2a2e36;
  --accent: #e50914; --accent-text: #fff; --ok: #3fb872; --warn: #e3a03a; --bad: #ef6a5f; --info: #5b8ff0;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; }
nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; white-space: nowrap; }
nav a.active, nav a:hover { background: var(--bg); color: var(--text); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.35rem; margin: 4px 0 14px; }
h2 { font-size: 1.05rem; margin: 22px 0 10px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
/* <dialog> : Chromium 63/76 (TV, sans color-scheme) lui imposent « color: black » → texte invisible sur .panel. */
dialog { color: var(--text); }
.narrow { max-width: 380px; margin: 8vh auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
label { display: block; font-size: .9rem; color: var(--muted); }
input, select { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit; }
input[type=checkbox] { width: auto; }
button, .btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
  font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
button.ghost, .btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
/* Désactivé : couleurs explicites (une opacité sur un bouton clair donnait du noir sur gris illisible). */
button:disabled, button:disabled:hover { background: var(--panel2); color: var(--muted); border-color: var(--line); cursor: default; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.item .name { font-weight: 600; word-break: break-word; overflow-wrap: anywhere; } /* break-word : TV (anywhere = Chromium 80) */
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 6px 0; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar.done > i { background: var(--ok); }
.bar.low > i { background: var(--bad); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: .78rem;
  border: 1px solid var(--line); color: var(--muted); }
.tag.ok { color: var(--ok); border-color: var(--ok); }
.tag.warn { color: var(--warn); border-color: var(--warn); }
.tag.bad { color: var(--bad); border-color: var(--bad); }
.crumbs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
/* Noms de release sans espace (dossier ouvert dans Fichiers) : ils passent à la ligne au lieu de déborder de l'écran
   (téléphone) et de recouvrir « Télécharger le dossier (ZIP) » ; break-word pour la TV (anywhere = Chromium 80). */
.crumbs a { color: var(--accent); text-decoration: none; word-break: break-word; overflow-wrap: anywhere; }
.entry { display: flex; align-items: center; gap: 10px; }
.entry .icon { width: 22px; text-align: center; color: var(--muted); flex: none; }
.entry a.open { color: var(--text); text-decoration: none; }
video, audio { width: 100%; max-height: 70vh; background: #000; border-radius: var(--radius); }
.perms { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.perms label { display: flex; align-items: center; gap: 6px; color: var(--text); }
.code { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; word-break: break-word; overflow-wrap: anywhere;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.qr { width: 200px; height: 200px; background: #fff; border-radius: 8px; image-rendering: pixelated; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
td, th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
/* z-index : au-dessus du lecteur plein écran de la TV (#fsroot, 50) et des listes de choix (.tv-picker, 100). */
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: 90vw; z-index: 200;
  background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; opacity: 0;
  pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }
#toast.err { background: #b3261e; color: #fff; } /* contraste 6,5:1 (blanc sur --bad : 3:1) */
/* grid-gap : Chromium 63 (TV 2019) n'accepte « gap » dans une grille qu'à partir de 66. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); grid-gap: 8px; gap: 8px; margin-bottom: 14px; }
.stat b { display: block; font-size: 1.15rem; }
@media (max-width: 600px) { header { gap: 6px; } .brand { display: none; } }

/* ---------- accueil / fiches / lecteur ---------- */
body.dark-page main { max-width: none; padding: 0; }
.pad { padding: 0 16px; }
.hero { position: relative; min-height: 56vh; display: flex; align-items: flex-end; overflow: hidden; }
.hero-bg, .title-backdrop img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(to top, var(--bg) 4%, rgba(14,15,18,.55) 45%, rgba(14,15,18,.15)), linear-gradient(to right, rgba(14,15,18,.85), transparent 65%); }
.hero-body { position: relative; padding: 24px 16px 18px; max-width: 640px; }
.hero-body h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); margin: 0 0 6px; }
.hero-text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; color: #d6d9df; }
.meta-line { color: var(--muted); font-size: .9rem; margin: 4px 0; }
.shelf { padding: 6px 0 4px; }
.shelf h2 { padding: 0 16px; margin: 14px 0 8px; }
.shelf-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 16px 12px; scroll-snap-type: x proximity; }
/* Taille de l'affiche en variables : la barre de progression et les badges se placent d'après elle. */
.card { --pw: 150px; --ph: 225px; position: relative; flex: 0 0 auto; width: var(--pw); scroll-snap-align: start; color: var(--text); text-decoration: none; }
.card img, .card-fallback { width: var(--pw); height: var(--ph); border-radius: 8px; object-fit: cover; background: var(--panel); display: block; transition: transform .15s; }
.card:hover img, .card:hover .card-fallback { transform: scale(1.04); }
.card-fallback { display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; font-weight: 600; border: 1px solid var(--line); }
.card-title { font-size: .82rem; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.card-badge { position: absolute; top: 6px; left: 6px; background: var(--warn); color: #000; font-size: .72rem; padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.title-page { position: relative; }
.title-backdrop { position: absolute; top: 0; right: 0; left: 0; height: 62vh; overflow: hidden; }
.title-body { position: relative; max-width: 1100px; margin: 0 auto; padding: 22vh 16px 30px; }
.title-head { display: flex; gap: 22px; align-items: flex-end; flex-wrap: wrap; }
.title-head h1 { font-size: clamp(1.5rem, 3.5vw, 2.4rem); margin: 0; }
.title-poster { width: 180px; height: 270px; object-fit: cover; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.5); } /* hauteur fixée : la fiche ne saute pas à l'arrivée de l'affiche */
.overview { max-width: 720px; color: #d6d9df; }
.season-bar { margin-top: 26px; }
.season-pick, .version-pick { width: auto; max-width: 100%; }
.episodes { display: flex; flex-direction: column; gap: 10px; }
.episode { display: flex; gap: 14px; padding: 10px; border-radius: 10px; background: var(--panel); }
.ep-thumb { position: relative; flex: 0 0 auto; width: 200px; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: #000; color: var(--text); text-decoration: none; }
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep-thumb-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); }
.ep-play { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; opacity: 0; background: rgba(0,0,0,.35); transition: opacity .15s; }
.ep-thumb:hover .ep-play { opacity: 1; }
.ep-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.25); }
.ep-progress > i { display: block; height: 100%; background: var(--bad); }
.ep-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 4px 0; }
/* Fiche : « Télécharger » / « Ouvrir dans VLC » (film : boutons ; épisode : liens), lien VLC affiché dessous. */
.vlc-link { max-width: 720px; margin-top: 12px; }
.episode .vlc-link { margin-top: 6px; }
.episode .row.ep-links { flex-direction: row; align-items: center; gap: 4px 16px; } /* aussi sur téléphone (les .row d'épisode y passent en colonne, écart de 2 px) */
.ep-links a, .ep-links .as-link { color: #a9b6ff; text-decoration: underline; text-underline-offset: 2px; }
button.as-link { padding: 0; border: 0; border-radius: 0; background: none; font: inherit; cursor: pointer; }
@media (pointer: coarse) { .ep-links a, .ep-links .as-link { padding: 8px 0; } } /* au doigt : 32 px de haut, pas 16 */
.fix { margin-top: 24px; }
@media (max-width: 600px) { .ep-thumb { width: 130px; } .title-poster { width: 110px; } .card { --pw: 118px; --ph: 177px; } }

.player-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player { position: relative; background: #000; border-radius: 10px; overflow: hidden; }
.player-video { display: block; width: 100%; background: #000; border-radius: 0; }
/* Messages du lecteur (chargement, erreurs) : cartouche sombre, lisible quelle que soit l'image dessous. */
.player-status { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); z-index: 2; width: max-content; max-width: calc(100% - 24px);
  text-align: center; color: #fff; background: rgba(0,0,0,.82); border: 1px solid rgba(255,255,255,.18); border-radius: 8px;
  padding: 8px 14px; font-weight: 500; pointer-events: none; }
body.tv .player-status { top: 96px; font-size: 1.1rem; padding: 12px 20px; } /* sous le titre */
.player-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: linear-gradient(transparent, rgba(0,0,0,.85)); color: #fff; flex-wrap: wrap; }
.ctl { background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; padding: 5px 9px; min-width: 40px; justify-content: center; }
.ctl-time { font-variant-numeric: tabular-nums; font-size: .85rem; white-space: nowrap; }
.seek { flex: 1; min-width: 120px; accent-color: var(--bad); padding: 0; border: 0; background: transparent; }
.vol { width: 80px; accent-color: #fff; padding: 0; border: 0; background: transparent; }
.player-select { width: auto; max-width: 220px; padding: 4px 6px; background: rgba(0,0,0,.6); color: #fff; border-color: rgba(255,255,255,.3); font-size: .85rem; }

/* ---------- pages Torrents / C411 / JOAL / Fichiers ---------- */
header { background: rgba(14,15,18,.92); backdrop-filter: blur(8px); }
/* TV : sans flou (recalculé à chaque image de défilement), donc opaque : à 92 %, le texte de la page restait lisible dessous */
body.tv header { backdrop-filter: none; background: rgb(14,15,18); }
.brand { color: var(--accent); letter-spacing: .5px; }
.page { max-width: 1100px; margin: 0 auto; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.chip { background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; font-size: .88rem; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.badges { display: flex; gap: 5px; flex-wrap: wrap; margin: 6px 0; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: .75rem; font-weight: 600; background: var(--panel2); color: #cfd3da; border: 1px solid var(--line); white-space: nowrap; }
.badge.q { background: #263247; color: #b9cdf5; border-color: #33486b; }
.badge.q4k { background: #3b2a12; color: #f4c47a; border-color: #6b4a1a; }
.badge.hdr { background: #3a1f3f; color: #e4a8ef; border-color: #5e2f66; }
.badge.lang { background: #17332a; color: #8fe0bb; border-color: #245243; }
.badge.ep { background: var(--text); color: var(--bg); border-color: var(--text); }
.badge.owned { background: #173a24; color: #7fe0a3; border-color: #25603a; }
.badge.state.ok { color: var(--ok); border-color: var(--ok); background: transparent; }
.badge.state.warn { color: var(--warn); border-color: var(--warn); background: transparent; }
.badge.state.bad { color: var(--bad); border-color: var(--bad); background: transparent; }
.ok-text { color: var(--ok); font-weight: 600; } .bad-text { color: var(--bad); } .warn-text { color: var(--warn); }
.small-btn { font-size: .85rem; padding: 5px 10px; margin-top: 6px; }

.tlist { display: flex; flex-direction: column; gap: 10px; }
.titem { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.titem-bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: .13; filter: blur(2px); }
body.tv .titem-bg { filter: none; } /* TV : liste refaite toutes les 4 s, flou recalculé sur chaque image */
.titem-body { position: relative; display: flex; gap: 14px; padding: 12px; }
.titem-poster { flex: 0 0 auto; width: 74px; height: 111px; object-fit: cover; border-radius: 6px; background: var(--panel2); }
.titem-poster.empty, .group-poster.empty { display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: var(--muted); }
.titem-title { font-weight: 700; font-size: 1.05rem; }
.tbtns { margin-top: 8px; }

.searchbar { margin-bottom: 4px; }
.filters { align-items: flex-start; }
.filters .chips { margin: 6px 0; }
.sort-pick { width: auto; margin-top: 6px; }
.groups { display: flex; flex-direction: column; gap: 14px; }
.group { position: relative; overflow: hidden; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.group-bg { position: absolute; top: 0; right: 0; left: 0; width: 100%; height: 220px; object-fit: cover; opacity: .22; -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent); }
.group-body { position: relative; display: flex; gap: 16px; padding: 14px; }
.group-poster { flex: 0 0 auto; width: 110px; height: 165px; object-fit: cover; border-radius: 8px; background: var(--panel2); box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.group-title { margin: 0; font-size: 1.2rem; }
.group-text { color: #c9cdd4; font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 6px 0 10px; }
.versions { display: flex; flex-direction: column; gap: 6px; }
.version { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 8px; background: rgba(0,0,0,.28); border: 1px solid var(--line); }
/* Version sans source : texte atténué, sans opacité globale (elle rendait les boutons noir sur gris). */
.version.dead { color: var(--muted); }
.version.dead > .grow { opacity: .7; }
.version .badges { margin: 0 0 3px; }
.vstats { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; min-width: 86px; font-size: .88rem; }
.vbtns { flex-wrap: nowrap; }
.entry-poster { width: 34px; height: 51px; object-fit: cover; border-radius: 4px; }
@media (max-width: 700px) {
  .group-poster { width: 70px; height: 105px; }
  .titem-poster { width: 54px; height: 81px; }
  .version { flex-wrap: wrap; }
  .vstats { flex-direction: row; gap: 8px; min-width: 0; }
}
.allow { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .82rem; font-weight: 600; background: #173a24; color: #7fe0a3; border: 1px solid #25603a; white-space: nowrap; }
.allow.warn { background: #3b2a12; color: #f4c47a; border-color: #6b4a1a; }
.allow.bad { background: #3d1614; color: #ff9c94; border-color: #6e2622; }
.quota-line { margin: 4px 0 10px; }
.limits { margin-bottom: 12px; }
.limits .watch-line { margin: 10px 0 0; color: var(--warn); } /* priorité au visionnage en cours */
.limits details > p { margin: 8px 0 0; }
.limits .row > div { min-width: 160px; }
.bar.mini { height: 4px; margin: 4px 0 0; }
button:disabled { cursor: not-allowed; }
@media (max-width: 600px) { #allow { order: 3; } }
.allow.none { background: var(--panel2); color: var(--muted); border-color: var(--line); font-weight: 500; }

/* ---------- accueil v2 ---------- */
.shelf-head { display: flex; align-items: center; gap: 10px; padding: 0 16px; margin: 16px 0 8px; }
.shelf-head h2 { margin: 0; padding: 0; }
.shelf h2 { padding: 0; }
.arrow { padding: 2px 10px; font-size: 1.2rem; line-height: 1; border-radius: 99px; }
@media (hover: none) { .arrow { display: none; } }
.card-progress { position: absolute; left: 6px; right: 6px; top: calc(var(--ph) - 12px); height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); overflow: hidden; }
.card-progress > i { display: block; height: 100%; background: var(--warn); }
.card-progress.resume > i { background: var(--accent); }
.card-rating { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.72); color: #f4c47a; font-size: .72rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.card-new { position: absolute; top: 6px; left: 6px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: .3px; }
.card.suggest img { filter: saturate(.85); }
.card.suggest:hover img { filter: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-gap: 14px 10px; gap: 14px 10px; padding: 4px 16px 20px; }
.grid .card, .grid .card img, .grid .card-fallback { width: 100%; }
.grid .card img, .grid .card-fallback { height: auto; aspect-ratio: 2/3; }
.grid .card-progress { top: auto; bottom: 26px; }
.home-bar { margin-top: 18px; gap: 10px; align-items: center; }
.home-bar .chips { margin: 0; }
.sugg-sep { display: flex; align-items: baseline; gap: 10px; margin-top: 30px; border-top: 1px solid var(--line); padding-top: 18px; }
.sugg-sep h2 { margin: 0; font-size: 1.3rem; }
.dlcard { position: relative; flex: 0 0 auto; width: 340px; height: 170px; border-radius: 10px; overflow: hidden; background: var(--panel); scroll-snap-align: start; border: 1px solid var(--line); }
.dlcard-bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.dlcard-bg.empty { background: linear-gradient(135deg, #1e2127, #0e0f12); }
.dlcard-shade { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(to top, rgba(10,11,14,.95) 25%, rgba(10,11,14,.35)); }
.dlcard-body { position: absolute; left: 12px; right: 12px; bottom: 10px; }
.dlcard-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlcard-pct { font-size: 1.6rem; font-weight: 800; line-height: 1.1; margin-top: 2px; }
.dlcard .bar { margin: 6px 0; height: 5px; }
.dlcard .bar > i { background: var(--accent); transition: width .8s; }
@media (max-width: 600px) { .dlcard { width: 280px; height: 150px; } }

/* ---------- téléphone ---------- */
.panel table { display: block; overflow-x: auto; }
.panel .allow { white-space: normal; }
@media (max-width: 700px) {
  /* en-tête : marque + pastille + déconnexion, puis le menu sur toute la largeur (défilant) */
  header { padding: 8px 12px 0; gap: 8px; padding-top: max(8px, env(safe-area-inset-top)); }
  .brand { display: inline; font-size: 1.05rem; }
  #allow { order: 2; margin-left: auto; font-size: .74rem; padding: 2px 8px; max-width: 58vw; overflow: hidden; text-overflow: ellipsis; }
  #logout { order: 3; padding: 4px 8px; font-size: .8rem; }
  nav { order: 10; flex: 1 0 100%; margin: 0 -12px; padding: 0 8px 6px; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a { padding: 7px 11px; font-size: .92rem; }
  main { padding: 12px; }
  h1 { font-size: 1.25rem; }

  /* boutons plus compacts */
  button, .btn { padding: 7px 10px; font-size: .88rem; }
  .tbtns { gap: 6px; }
  .tbtns button, .tbtns .btn { padding: 5px 9px; font-size: .8rem; }
  .titem-body { gap: 10px; padding: 10px; }

  /* accueil : sélecteurs en ligne */
  .home-bar { gap: 8px; }
  .home-bar .grow { display: none; }
  .home-bar select { flex: 1 1 40%; width: auto; min-width: 0; font-size: .85rem; padding: 7px 8px; }
  .home-bar .chips { flex: 1 0 100%; }
  .hero { min-height: 48vh; }
  .hero-text { -webkit-line-clamp: 3; font-size: .92rem; }
  .shelf-head { padding: 0 12px; }
  .shelf-row { padding: 4px 12px 10px; gap: 8px; }

  /* C411 : une version = badges, nom, puis chiffres et boutons sur une ligne */
  .group-body { flex-direction: column; gap: 10px; padding: 12px; }
  .group-body > .group-poster { display: none; }
  .group-title { font-size: 1.1rem; }
  .version { flex-direction: column; align-items: stretch; gap: 6px; }
  .vstats { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
  .vbtns { flex-wrap: wrap; }
  .vbtns button { flex: 1; justify-content: center; }
  .filters { gap: 6px; }
  .filters .grow { display: none; }

  /* fiche film / série */
  .title-body { padding-top: 26vh; }
  .title-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .title-poster { width: 96px; height: 144px; }
  .overview { font-size: .92rem; }
  .season-bar { flex-wrap: wrap; }
  .season-bar h2 { flex: 1 0 100%; margin-bottom: 0; }
  .episode { gap: 10px; padding: 8px; }
  .ep-thumb { width: 118px; }
  .episode .row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .ep-text { -webkit-line-clamp: 2; }

  /* lecteur */
  .vol { display: none; }
  .player-select { max-width: 46vw; }

  /* formulaires en ligne : un champ par ligne */
  .limits .row > div { min-width: 0; flex: 1 1 45%; }
  .row > label { flex: 1 1 140px; }
}
.version > .grow, .group-body > .grow, .titem-body > .grow { min-width: 0; }
@media (max-width: 700px) {
  #logout .lbl { display: none; }
  #logout { padding: 4px 9px; font-size: 1rem; }
  #allow { max-width: calc(100vw - 150px); }
  .version > .grow { width: 100%; }
}
@media (max-width: 700px) { .row > h2.grow { flex: 1 0 100%; } }
/* Titre de page à côté de boutons (Fichiers : nom du dossier, Torrents) : un titre court reste sur la ligne des boutons,
   un nom de release trop long prend la ligne entière et passe à la ligne au lieu de déborder sous le bouton ZIP. */
.row > h1.grow { flex: 1 1 auto; word-break: break-word; overflow-wrap: anywhere; }
.ep-seen { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.75); color: #7fe0a3; font-size: .72rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.card-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; padding: 0; justify-content: center; border-radius: 99px; background: rgba(0,0,0,.7); border-color: rgba(255,255,255,.3); color: #fff; font-size: 1rem; opacity: 0; transition: opacity .15s; }
.card:hover .card-x { opacity: 1; }
@media (hover: none) { .card-x { opacity: 1; } }
.next-overlay { position: absolute; right: 16px; bottom: 70px; max-width: min(460px, calc(100% - 32px)); display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 10px; background: rgba(14,15,18,.92); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.next-still { width: 150px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; }
.next-title { font-weight: 700; }
.autoplay { color: var(--muted); }
/* « Passer l'intro » : en bas à droite de l'image, au-dessus de la barre (visible même barre masquée sur la TV). */
.skip-intro { position: absolute; right: 16px; bottom: 70px; z-index: 3; padding: 9px 18px; font-weight: 600; color: #fff;
  background: rgba(20,20,22,.72); border: 1px solid rgba(255,255,255,.7); border-radius: 6px; }
.skip-intro:hover, .skip-intro:focus { background: #fff; color: #000; border-color: #fff; }
body.tv .skip-intro { right: 48px; bottom: 210px; font-size: 1.35rem; padding: 14px 30px; }
body.tv .player.idle .skip-intro { bottom: 72px; }
@media (max-width: 700px) { .next-overlay { left: 8px; right: 8px; bottom: 56px; } .next-still { width: 96px; } }
.more-results { display: block; margin: 6px auto 20px; }

/* #/play : le lecteur couvre toute la fenêtre (#fsroot, fixe, au-dessus de l'en-tête masqué et de la page vide), seul à
   l'écran, comme Netflix. Le vrai plein écran (bouton, F, double-clic) y passe #fsroot tel quel ; en sortir le laisse sur
   toute la fenêtre. 100dvh : hauteur visible des téléphones (barres du navigateur déduites) ; 100vh avant. La TV a ses
   propres règles (body.tv, plus bas : Chromium 63/76). */
#fsroot { display: none; background: #000; }
#fsroot:fullscreen { display: flex; align-items: center; justify-content: center; }
body:not(.tv) #fsroot:not(:empty) { display: flex; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; height: 100vh; height: 100dvh; }
body:not(.tv) #fsroot .player { flex: 1 1 auto; width: 100%; height: 100%; border-radius: 0; }
body:not(.tv) #fsroot .player-video { height: 100%; max-height: none; object-fit: contain; }
body:not(.tv) #fsroot .play-wait { aspect-ratio: auto; max-height: none; }
/* Page ouverte (ou rechargée) sur #/play avant de connaître le profil : le même écran d'attente, dans la page. */
.play-cover { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; display: flex; background: #000; }
.play-cover .play-wait { width: 100%; height: 100%; aspect-ratio: auto; max-height: none; border-radius: 0; }
/* Page dessous immobile pendant la lecture (rien n'y défile, ni rebond sur le téléphone). */
html.play-on, html.play-on body, html.pfs-on, html.pfs-on body { overflow: hidden; overscroll-behavior: none; }
/* Messages (« Reprise à … », « Intro passée ») en haut, sous la flèche retour et le titre : en bas, ils couvraient le
   titre de la barre (ordinateur) ou « Passer l'intro » (téléphone). Encoche comprise (pfs). */
html.play-on #toast { top: calc(64px + env(safe-area-inset-top)); bottom: auto; }
/* Message du lecteur affiché (erreur, coupure : à 64 px lui aussi) : le toast monte dans la bande de l'en-tête plutôt
   que de couvrir le message et ses boutons (voir showStatus). Ses clics passent au travers (pointer-events). */
html.play-on.play-msg #toast { top: calc(12px + env(safe-area-inset-top)); }
/* Lancement : pas de boutons du centre (téléphone) sur l'anneau de chargement (voir booting dans playView). */
.player.booting .pm-center { visibility: hidden; }
/* Message du lecteur affiché (play-msg : coupure, format illisible…) : pas de boutons du centre non plus (téléphone), ils
   recouvraient le bas du message et le lien VLC ; ses propres boutons (Réessayer…) et la barre du bas restent. */
html.play-msg .pm-center { visibility: hidden; }
/* iPhone (setPfs, dès le lancement) : image sous les encoches (viewport-fit=cover), commandes hors de leur zone et de
   celle de la barre d'accueil. */
#fsroot.pfs .player-head, html.pfs-on .play-cover .player-head { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); padding-top: max(10px, env(safe-area-inset-top)); } /* play-cover : flèche de l'écran d'attente, page ouverte sur #/play */
#fsroot.pfs .player-bar { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
/* Analyse impossible (cadre noir, flèche retour) et erreurs de lecture : message, puis « Réessayer », « Ouvrir dans VLC »,
   « Télécharger », et le lien VLC (sélectionnable). */
.player-error .player-status, body.tv .player-error .player-status { top: 50%; transform: translate(-50%, -50%); padding: 16px 20px; }
.player-error .player-head { background: none; }
.status-actions { justify-content: center; }
.player-status .code { pointer-events: auto; -webkit-user-select: all; user-select: all; margin-top: 10px; max-width: 520px; text-align: left; font-weight: 400; color: var(--text); }
.player-status .vlc-note { margin-top: 10px; font-weight: 400; } /* « Lien copié… » ou l'échec, au-dessus du lien (vlcButton) */
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.code.inline { display: inline; padding: 1px 6px; }
.code { white-space: pre-wrap; }
.qc-input { text-transform: uppercase; letter-spacing: 3px; font-family: ui-monospace, Menlo, monospace; }

/* ---------- application TV (télécommande) ---------- */
/* Navigateurs des TV Samsung : Chromium 76 (2021), 63 (2019). Pas d'aspect-ratio (Chromium 88), d'où des hauteurs explicites. */
body.tv { font-size: 16px; }
/* TV : un seul repère de sélection, en rouge et sans animation (la TV saccade dès qu'on anime) :
   boutons, menus et liens remplis de rouge (texte blanc), vignettes et champs entourés de rouge. */
body.tv :focus { outline: none; }
body.tv *, body.tv *::before, body.tv *::after { transition: none !important; }
/* Hors sélection : bouton principal blanc (texte noir), secondaire et « danger » en texte blanc. Le rouge = sélection. */
body.tv button:not(.ghost):not(.danger):not(.profile):not(.ctl):not(.chip):not(:focus):not(:disabled), body.tv .btn:not(.ghost):not(:focus) {
  background: #fff; color: #000; border-color: #fff; }
body.tv button:disabled:not(:focus) { background: var(--panel2); color: var(--muted); border-color: var(--line); }
/* :not(:disabled) : un bouton secondaire désactivé (« JOAL » après l'envoi, « Plus de résultats » en chargement) reste grisé. */
body.tv button.ghost:not(:focus):not(:disabled), body.tv .btn.ghost:not(:focus), body.tv button.danger:not(:focus):not(:disabled) {
  background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
body.tv button:focus, body.tv .btn:focus, body.tv summary:focus { background: var(--accent); color: #fff; border-color: var(--accent); }
body.tv button.danger:focus { background: var(--accent); color: #fff; border-color: #fff; }
body.tv input:focus, body.tv select:focus { border-color: var(--accent); background: var(--panel2); box-shadow: 0 0 0 3px var(--accent); }
/* Encadré focalisable sans action (résumé de Mon compte, focus initial) : entouré de rouge comme un champ. */
body.tv .panel[tabindex]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent); }
body.tv a:not(.btn):not(.card):not(.ep-thumb):focus { color: #fff; background: var(--accent); border-radius: 6px; text-decoration: none; box-shadow: 0 0 0 4px var(--accent); }
body.tv .ep-thumb { transition: transform .15s; }
body.tv .ep-thumb:focus { box-shadow: 0 0 0 4px var(--accent); }
body.tv .card { transition: transform .15s; }
body.tv .card:focus { z-index: 2; }
/* Vignette sélectionnée : contour rouge autour de l'affiche + ombre (agrandissement modéré : reste dans l'écran). */
/* Pas d'animation sur le contour (coûteuse sur la TV, elle partait en décalé) : il apparaît avec l'agrandissement. */
body.tv .card img, body.tv .card .card-fallback { transition: none; }
body.tv .card:focus img, body.tv .card:focus .card-fallback { box-shadow: 0 0 0 4px var(--accent); }
body.tv .card:focus .card-title { color: var(--text); }
body.tv .shelf-row { padding: 14px 40px 18px; scroll-behavior: auto; scroll-snap-type: none; }
/* Marge de fin de rangée : Chromium 76 ne compte pas le padding droit dans la zone qui défile. */
body.tv .shelf-row::after { content: ''; flex: 0 0 40px; height: 1px; }
/* × de « Reprendre » (.card-x) : à la télécommande, on n'y arrive que par hasard en changeant de rangée (OK retirerait
   le titre et sa position sans confirmation), et il était blanc ou invisible (opacity 0 si la TV se dit « hover »). */
body.tv .shelf-head .arrow, body.tv .fix, body.tv a[href*="dl=1"], body.tv a[href*="/api/files/zip"], body.tv .card-x { display: none; }
body.tv .ep-thumb { height: 112px; }
body.tv .ep-thumb:focus .ep-play { opacity: 1; }
/* Grille d'affiches : pas d'aspect-ratio avant Chromium 88. Hauteur explicite (7 colonnes de 169,7 px sur 1280 px, × 3/2),
   sinon chaque affiche fait 0 px de haut jusqu'à son chargement (ou pour toujours si elle échoue) et la grille saute sous le focus. */
body.tv .grid .card img, body.tv .grid .card .card-fallback { height: 254px; }
body.tv .next-still { height: 84px; }
body.tv .play-page > .row, body.tv .play-page > .code, body.tv .player-bar .vol, body.tv .player-bar .ctl[title^="Plein"] { display: none; }
body.tv #fsroot:not(:empty) { display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; background: #000; }
body.tv #fsroot .player { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 0; }
body.tv #fsroot .player-video { width: 100%; height: 100%; max-height: none; border-radius: 0; object-fit: contain; }
body.tv #fsroot .player-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 28px 24px; }
body.tv .player-head { padding: 22px 32px 40px; font-size: 1.2rem; transition: opacity .3s; }
body.tv .ph-back:focus { background: var(--accent); }
body.tv .player-bar { transition: opacity .3s; }
body.tv .player.idle .player-bar, body.tv .player.idle .player-head { opacity: 0; visibility: hidden; }
body.tv .player.idle { cursor: none; }
.tv-picker { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.7); }
.tv-picker-list { display: flex; flex-direction: column; gap: 8px; max-height: 80vh; overflow-y: auto; padding: 16px; min-width: 360px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tv-picker-list button { justify-content: flex-start; }

/* « Qui regarde ? » et ajout d'un profil */
.profiles-page { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; text-align: center; }
.profiles-page h1 { font-size: 2.4rem; font-weight: 500; margin: 0; }
.profiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }
.profile { flex-direction: column; gap: 10px; width: 150px; padding: 0; background: none; border: 0; color: var(--muted); }
.profile .avatar { display: flex; align-items: center; justify-content: center; width: 150px; height: 150px; border-radius: 8px;
  font-size: 4rem; font-weight: 700; color: #fff; background: var(--panel2); transition: transform .15s; }
.profile.add .avatar { color: var(--muted); }
.profile.manage .avatar { opacity: .55; }
.profile:focus .avatar, .profile:hover .avatar { transform: scale(1.12); box-shadow: 0 12px 34px rgba(0,0,0,.8); }
body.tv .profile:focus { background: none; color: #fff; }
body.tv .profile:focus .avatar { transform: none; box-shadow: 0 0 0 5px var(--accent); }
.profile:focus, .profile:hover { color: var(--text); }
.profile-name { font-size: 1.15rem; }
.pair { max-width: 900px; margin: 6vh auto; padding: 0 16px; }
.pair-body { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; }
.pair-qr { width: 300px; height: 300px; }
.pair-code { font: 700 3rem/1.2 ui-monospace, Menlo, monospace; letter-spacing: .12em; }

/* Chromium 76 (TV) : ni clamp()/min() ni « gap » dans les boîtes flex (.nogap posé par tv.js). */
body.tv .hero-body h1 { font-size: 2.6rem; }
body.tv .title-head h1 { font-size: 2.4rem; }
body.tv .next-overlay { max-width: 460px; }
body.nogap header > *, body.nogap nav > *, body.nogap .row > *, body.nogap .chips > *, body.nogap .badges > *,
body.nogap .shelf-head > *, body.nogap .player-bar > *, body.nogap .perms > *, body.nogap .crumbs > *,
body.nogap .entry > *, body.nogap .title-head > *, body.nogap .episode > *, body.nogap .titem-body > *,
body.nogap .version > *, body.nogap .next-overlay > *, body.nogap .sugg-sep > *,
body.nogap .group-body > *, body.nogap .pair-body > * { margin-right: 10px; }
body.nogap .row, body.nogap .chips, body.nogap .badges, body.nogap .perms { margin-bottom: -6px; }
body.nogap .row > *, body.nogap .chips > *, body.nogap .badges > *, body.nogap .perms > * { margin-bottom: 6px; }
body.nogap .shelf-row > * { margin-right: 10px; flex-shrink: 0; }
body.nogap .profiles > * { margin: 0 14px 14px; }
body.nogap .list > * + *, body.nogap .tlist > * + *, body.nogap .episodes > * + *, body.nogap .groups > * + *,
body.nogap .versions > * + *, body.nogap .play-page > * + *, body.nogap .tv-picker-list > * + *,
body.nogap .profiles-page > * + *, body.nogap .steps > * + *, body.nogap .vstats > * + * { margin-top: 10px; }
body.nogap button > * + *, body.nogap .btn > * + * { margin-left: 6px; }
body.nogap .profile > * + * { margin-left: 0; margin-top: 10px; }
/* TV : onglet / filtre actif en rouge, élément focalisé en blanc (on distingue les deux). */
body.tv .chip { transition: transform .12s; }
/* Filtre actif (non sélectionné) : contour blanc ; le rouge est réservé à la sélection. */
body.tv .chip.on:not(:focus) { background: transparent; border-color: #fff; color: #fff; }
body.tv .chip:focus { background: var(--accent); border-color: var(--accent); color: #fff; }
/* TV : champ texte focalisé mais pas encore en saisie (OK ouvre le clavier). */
body.tv input[data-tvkb="1"][readonly]:focus, body.tv textarea[data-tvkb="1"][readonly]:focus { caret-color: transparent; }
/* TV : pas de barres de défilement (navigation à la télécommande). */
body.tv, body.tv * { scrollbar-width: none; }
body.tv ::-webkit-scrollbar { display: none; width: 0; height: 0; }
/* TV, menu du haut : page active = texte rouge ; élément sélectionné = texte blanc dans un cadre rouge.
   (!important : plus fort que le style de sélection des liens et boutons.) */
body.tv header a, body.tv header button { background: transparent !important; border-color: transparent !important; color: var(--muted); }
body.tv header nav a.active { color: var(--accent) !important; font-weight: 600; }
body.tv header a:focus, body.tv header button:focus { background: transparent !important; color: #fff !important;
  border-color: transparent !important; box-shadow: inset 0 0 0 3px var(--accent) !important; transform: none; }
body.tv header a, body.tv header a:focus { text-decoration: none !important; } /* plus fort que le soulignement des liens */

/* Mode simplifié : plus grand, plus aéré. */
body.simple .shelf-row .card { --pw: 190px; --ph: 285px; }
body.simple .shelf-head h2 { font-size: 1.25rem; }
body.simple .search-big input { font-size: 1.2rem; padding: 12px 14px; }
body.simple .search-big button { font-size: 1.1rem; padding: 11px 18px; }
body.simple .title-body .row .btn, body.simple .title-body .row button { font-size: 1.15rem; padding: 12px 20px; }
/* Remplir l'écran : image recadrée, sans bandes noires. */
.player.fill .player-video, body.tv #fsroot .player.fill .player-video, #fsroot:fullscreen .player.fill .player-video, #fsroot.pfs .player.fill .player-video { object-fit: cover; }
.player-bar .ctl.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.player-status a, .player-status button { pointer-events: auto; margin-top: 10px; }

/* TV, lecteur natif (AVPlay) : l'image est derrière la page, dans la coquille Tizen. Tout ce qui recouvre
   l'écran devient transparent, et le reste de l'interface est masqué pendant la lecture. */
html.av-on, html.av-on body, html.av-on body.tv #fsroot:not(:empty), html.av-on .player, html.av-on .player-video { background: transparent !important; }
html.av-on body > *:not(#fsroot):not(#toast):not(.tv-picker):not(dialog) { visibility: hidden; } /* listes Audio / Sous-titres restent visibles */
.av-video { position: relative; width: 100%; height: 100%; }
.av-subs { position: absolute; left: 8%; right: 8%; bottom: 9%; text-align: center; white-space: pre-line; font-size: 1.6rem; line-height: 1.3;
  color: #fff; text-shadow: 0 0 4px #000, 0 2px 3px #000, 0 0 2px #000; pointer-events: none; }

/* TV : barre de temps (affichage seul) au-dessus des boutons. */
body.tv .player-bar .seek, body.tv .player-bar .ctl-time { display: none; }
body.tv #fsroot .player-bar { padding: 60px 48px 28px; background: linear-gradient(transparent, rgba(0,0,0,.55) 35%, rgba(0,0,0,.9)); }
.tv-prog { flex: 1 1 100%; display: flex; align-items: center; margin-bottom: 18px; padding: 10px 0; font-variant-numeric: tabular-nums; font-size: 1rem; border-radius: 8px; }
.tv-btns { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
body.nogap .tv-btns > * { margin-right: 12px; }
body.tv .tv-prog:focus { background: transparent; box-shadow: none; outline: none; }
body.tv .tv-prog:not(:focus) .tv-mark { transform: scale(.7); opacity: .8; }
body.tv .tv-prog:focus .tv-track { height: 7px; }
.tv-cur, .tv-end { flex: none; min-width: 64px; }
.tv-end { text-align: right; color: rgba(255,255,255,.7); }
.tv-track { position: relative; flex: 1; height: 5px; margin: 0 16px; border-radius: 3px; background: rgba(255,255,255,.25); }
.tv-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: #fff; }
/* Barre de temps blanche ; rouge seulement quand elle est sélectionnée. */
body.tv .tv-prog:focus .tv-fill { background: var(--accent); }
body.tv .tv-prog:focus .tv-mark { background: var(--accent); }
.tv-mark { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 6px rgba(0,0,0,.6); transition: transform .15s; }
.tv-prog.previewing .tv-track { height: 7px; }
.tv-prog.previewing .tv-mark { transform: scale(1.4); }
.tv-tip { position: absolute; bottom: 20px; transform: translateX(-50%); white-space: nowrap; padding: 6px 12px; border-radius: 6px;
  background: rgba(20,20,24,.92); color: #fff; font-size: .95rem; }
body.tv .player-bar .ctl { font-size: 1rem; padding: 8px 16px; border-radius: 8px; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.08); }
body.tv .player-bar .ctl:focus { background: var(--accent); color: #fff; border-color: var(--accent); }
body.tv .player-bar .player-select { font-size: 1rem; padding: 8px 12px; border-radius: 8px; }

/* Icônes SVG (boutons du lecteur) */
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: middle; }
.ctl { display: inline-flex; align-items: center; gap: 8px; }
body.tv .player-bar .ctl { min-width: 56px; justify-content: center; }
.badge .icon, .ep-seen .icon { width: 1.1em; height: 1.1em; margin-right: 3px; vertical-align: -0.2em; }

/* Photos de profil */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.avatar-lg { display: flex; align-items: center; justify-content: center; width: 96px; height: 96px; border-radius: 8px; flex: none;
  font-size: 2.6rem; font-weight: 700; color: #fff; background: var(--panel2); }
.avatar-edit { align-items: center; gap: 16px; }
.file-btn { position: relative; cursor: pointer; align-self: flex-start; }
.file-btn input { position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0; cursor: pointer; width: 100%; }

/* Saisons : celles sur la seedbox en évidence, les autres grisées. */
.episode.missing { opacity: .55; }
.episode.missing .ep-thumb img { filter: grayscale(.7); }
.season-pick.owned { border-color: var(--ok); }
.tv-picker-list button.owned::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 10px; border-radius: 50%; background: var(--ok); }
.tv-picker-list button:not(.owned) { opacity: .75; }
.tv-picker-list button:focus { opacity: 1; }

/* iPhone / iPad : Safari agrandit la page quand on touche un champ écrit en moins de 16 px (texte de base 15 px,
   sélecteurs de l'accueil et du lecteur 12,75 px), et elle reste agrandie ensuite. -webkit-touch-callout n'existe que
   dans WebKit iOS : ni la TV, ni Android, ni le bureau ne sont touchés (pas de maximum-scale : le zoom reste possible). */
@supports (-webkit-touch-callout: none) {
  input, select, .home-bar select, .player-select { font-size: 16px; }
}

/* Lecteur : en-tête dans l'image (flèche retour, titre) et chargement à la Netflix (anneau, pourcentage). */
.player-head { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; padding: 10px 16px 30px;
  color: #fff; background: linear-gradient(rgba(0,0,0,.72), transparent); pointer-events: none; }
.player-head > * { pointer-events: auto; }
.ph-back { flex: none; display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; padding: 0; margin-right: 12px;
  background: transparent; border: 0; border-radius: 50%; color: #fff; }
.ph-back .icon { width: 32px; height: 32px; }
.ph-back:hover, .ph-back:focus { background: rgba(255,255,255,.16); }
.ph-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.ph-sub { font-weight: 400; opacity: .85; margin-left: 10px; }
.player-bar { position: relative; z-index: 2; }
.player-loader { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #fff; pointer-events: none; }
.player-loader.startup { background: #000; }
.player-loader .spin { width: 64px; height: 64px; border-radius: 50%; border: 5px solid rgba(255,255,255,.14); border-top-color: var(--bad, #e50914);
  animation: player-spin .9s linear infinite; }
.player-loader .pct { margin-top: 16px; font-weight: 600; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
@keyframes player-spin { to { transform: rotate(360deg); } }
.play-wait { width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 190px); }
body.tv .play-wait { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 0; aspect-ratio: auto; max-height: none; }
body.tv .player-loader .spin { width: 84px; height: 84px; border-width: 6px; }
body.tv .player-loader .pct { font-size: 1.4rem; }
body.tv .player-head .ph-back { background: transparent; border: 0; color: #fff; }
body.tv .player-head .ph-back:focus { background: var(--accent); color: #fff; }

/* ---------- Lecteur à la Netflix : ordinateur (pm-desktop), téléphone (pm-mobile), TV (pm-tv) ---------- */
.player > .player-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-direction: column; flex-wrap: nowrap;
  align-items: stretch; gap: 6px; padding: 40px 20px 12px; background: linear-gradient(transparent, rgba(0,0,0,.8)); transition: opacity .25s; }
.player-head, .pm-center { transition: opacity .25s; }
.player.idle .player-bar, .player.idle .player-head, .player.idle .pm-center { opacity: 0; visibility: hidden; }
.player.idle { cursor: none; }
.pb-line { display: flex; align-items: center; gap: 14px; }
.pb-line .seek { flex: 1; min-width: 0; accent-color: #e50914; height: 18px; }
.pb-line .ctl-time { min-width: 48px; text-align: right; font-size: .95rem; }
.pb-row { display: flex; align-items: center; gap: 12px; }
.pb-side { flex: 1 1 0; display: flex; align-items: center; gap: 14px; }
.pb-side.right { justify-content: flex-end; }
.player-bar .ctl { border: 0; background: transparent; padding: 6px; min-width: 0; color: #fff; transition: transform .12s; }
.player-bar .ctl:hover, .player-bar .ctl:focus-visible { transform: scale(1.15); }
.player-bar .ctl .icon { width: 30px; height: 30px; }
.pm-desktop .player-bar .ph-title { flex: 0 1 auto; max-width: 46%; text-align: center; font-size: 1.05rem; text-shadow: none; }
.player-bar .ctl.on { background: transparent; color: #e50914; }
/* Téléphone : titre en haut au centre, −10 / lecture / +10 au milieu de l'image, boutons texte en bas. */
.pm-mobile .player-head .ph-title { flex: 1; text-align: center; font-size: .95rem; }
.ph-tools { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.ph-tools .ctl { border: 0; background: transparent; color: #fff; padding: 6px; min-width: 0; }
.ph-tools .ctl.on { color: #e50914; }
.pm-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2; display: flex; align-items: center; gap: 44px; }
.pm-center .ctl { border: 0; background: transparent; color: #fff; padding: 4px; min-width: 0; }
.pm-center .ctl .icon { width: 44px; height: 44px; filter: drop-shadow(0 1px 4px rgba(0,0,0,.6)); }
.pm-center .pb-play .icon { width: 64px; height: 64px; }
.pm-mobile > .player-bar { padding: 30px 10px 8px; }
.pm-mobile .pb-row { justify-content: space-around; flex-wrap: wrap; gap: 4px; }
.pm-mobile .pb-row .ctl { font-size: .82rem; gap: 6px; }
.pm-mobile .pb-row .ctl .icon { width: 22px; height: 22px; }
/* Panneaux : Épisodes, Audio et sous-titres, Vitesse. */
.pp { position: absolute; right: 24px; bottom: 110px; z-index: 4; display: flex; gap: 36px; max-width: calc(100% - 48px); max-height: calc(100% - 170px);
  padding: 18px 22px; border-radius: 8px; color: #fff; background: rgba(24,24,26,.96); box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.pp-col { display: flex; flex-direction: column; min-width: 180px; min-height: 0; }
.pp-col h3 { margin: 0 0 10px; font-size: 1.15rem; }
.pp-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }
.pp .pp-item { justify-content: flex-start; gap: 10px; padding: 7px 10px; border: 0; border-radius: 4px; background: transparent; color: #b3b3b3; text-align: left; }
.pp .pp-item.on { color: #fff; font-weight: 600; }
.pp .pp-item:hover, .pp .pp-item:focus { background: rgba(255,255,255,.14); color: #fff; }
.pp-item .icon, .pp-tick { flex: none; width: 20px; height: 20px; display: inline-block; }
.pp-eps .pp-col { min-width: 280px; }
.pm-mobile .pp { left: 8px; right: 8px; bottom: 96px; gap: 18px; max-height: calc(100% - 150px); }
.pm-mobile .pp-col { min-width: 0; flex: 1; }
.pm-desktop .skip-intro { right: 32px; bottom: 120px; }
.pm-mobile .skip-intro { right: 16px; bottom: 100px; }
#fsroot.pfs .pm-mobile .skip-intro { right: max(16px, env(safe-area-inset-right)); bottom: calc(100px + env(safe-area-inset-bottom)); }
.pm-desktop .next-overlay, .pm-mobile .next-overlay { bottom: 110px; }
.pm-desktop .next-overlay { right: 32px; } /* aligné sur « Passer l'intro » */
/* TV : titre au-dessus de la barre, temps restant à droite, boutons texte dessous. */
body.tv .pm-tv .player-bar .ph-title { flex: 1 1 100%; margin-bottom: 8px; font-size: 1.35rem; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
body.tv .pm-tv .tv-cur { display: none; }
body.tv .pm-tv .tv-track { margin-left: 0; }
body.tv .pm-tv .player-bar .ctl { border: 0; background: transparent; font-size: 1.05rem; padding: 8px 14px; }
body.tv .pm-tv .player-bar .ctl .icon { width: 26px; height: 26px; }
body.tv .pm-tv .player-bar .ctl:focus { background: #fff; color: #000; transform: none; }
body.tv .pp { right: 48px; bottom: 200px; font-size: 1.15rem; }
body.tv .pp .pp-item:focus { background: #fff; color: #000; }

/* ---------- clés d'accès : connexion, avis, Mon compte, confirmations (jamais sur la TV) ---------- */
/* Connexion par Internet : la clé d'accès d'abord, sur toute la largeur, puis « ou avec ton mot de passe ». */
.pk-login { width: 100%; justify-content: center; padding: 11px 14px; font-weight: 600; }
.pk-login .icon { width: 1.35em; height: 1.35em; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.login-or::before, .login-or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.pk-msg { margin: 0; }
/* Boîtes de dialogue des clés d'accès (step-up, confirmation, ajout) : au-dessus de tout (calque supérieur), boutons à
   droite, le principal en dernier. */
.pk-dialog { width: 440px; max-width: calc(100vw - 32px); }
.pk-dialog::backdrop { background: rgba(0,0,0,.6); }
.pk-dialog h2 { margin: 0 0 10px; }
.pk-dialog p { margin: 0 0 10px; }
.pk-dialog .pk-msg { margin: 10px 0 0; }
.pk-actions { justify-content: flex-end; margin-top: 14px; }
/* Bandeau sous l'en-tête : avis de sécurité, proposition d'ajouter une clé sur cet appareil. */
#notice { max-width: 1100px; margin: 12px auto; padding: 0 16px; }
#notice > * + * { margin-top: 8px; }
.notice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); }
.notice > .icon { width: 1.5em; height: 1.5em; color: var(--accent); }
.notice.warn { background: #2a1f10; border-color: #6b4a1a; }
.notice.warn > .icon { color: var(--warn); }
.notice-text { flex: 1 1 280px; margin: 0; }
.notice-btns { flex: 0 0 auto; }
/* Avis de sécurité : tous ceux de la session dans un cadre (clé d'accès ajoutée, TV hors de la maison liée, mot de
   passe connu d'un tiers), chacun avec l'icône de sa sorte, puis les boutons (un par sorte, et « C'est bien moi »). */
.notice-items { flex: 1 1 280px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.notice-item { display: flex; align-items: flex-start; gap: 10px; }
.notice-item > .icon { flex: 0 0 auto; width: 1.5em; height: 1.5em; color: var(--warn); }
.notice-item > .notice-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.login-msg { margin: 0; }
/* Mon compte : clés d'accès et sessions (nom, étiquettes, puis date et adresse ; boutons à droite). */
.pk-anchor { scroll-margin-top: 72px; } /* « Voir mes clés d'accès » : le titre sous l'en-tête collant, pas dessous */
.pk-item { align-items: flex-start; }
.pk-head { gap: 4px 8px; }
.pk-name { word-break: break-word; overflow-wrap: anywhere; } /* nom choisi par l'utilisateur, sans espace possible */
.pk-btns { flex: 0 0 auto; }
label.check { color: var(--text); }
@media (max-width: 700px) {
  #notice { padding: 0 12px; margin: 10px auto; }
  .pk-anchor { scroll-margin-top: 104px; } /* en-tête du téléphone sur deux lignes (menu dessous) */
  .notice-btns { flex: 1 1 100%; }
  .notice-btns > * { flex: 1 1 auto; justify-content: center; }
  .pk-item { flex-direction: column; align-items: stretch; }
  .pk-item.sess-item { flex-direction: row; align-items: flex-start; flex-wrap: nowrap; } /* un seul bouton : à droite */
  .pk-btns { justify-content: flex-end; }
  .pk-actions > * { flex: 1 1 auto; justify-content: center; }
}
