/* Plex Manager — thème « cabine de projection »
   Noirs chauds de salle obscure, une seule lumière (le faisceau jaune Plex),
   titres en Archivo étendu comme sur un fronton de cinéma, et un mur des vraies
   affiches de la bibliothèque qui défile derrière le titre de chaque page. */
:root {
  --ecran: #000000;      /* fond */
  --cabine: #121110;     /* surfaces */
  --siege: #1c1a17;      /* survol, champs */
  --bobine: #2b2824;     /* traits marqués, boutons */
  --papier: #f3efe8;     /* texte */
  --poussiere: #9c968b;  /* texte secondaire */
  --faisceau: #e5a00d;   /* l'unique accent */

  --bg: var(--ecran);
  --panel: var(--cabine);
  --panel-2: var(--siege);
  --panel-3: var(--bobine);
  --line: #23211d;
  --line-strong: #3a362f;
  --input-line: #4a453d;
  --text: var(--papier);
  --muted: var(--poussiere);
  --faint: #6e695f;
  --accent: var(--faisceau);
  --accent-hi: #f5b521;
  --accent-ink: #000;
  --accent-soft: rgba(229, 160, 13, .13);
  --accent-glow: rgba(229, 160, 13, .3);
  --ok: #6fcf8a;
  --ok-soft: rgba(111, 207, 138, .12);
  --warn: var(--faisceau);
  --warn-soft: rgba(229, 160, 13, .13);
  --bad: #e5483f;
  --bad-soft: rgba(229, 72, 63, .15);
  --info: #d8d2c7;
  --info-soft: rgba(243, 239, 232, .07);

  --r-btn: 6px;
  --r-card: 10px;
  --r-big: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --wide: 125%;          /* Archivo étendu, pour les titres et les chiffres */
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 400 14px/1.55 "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .25s var(--ease), color .15s; }
a:hover { background-size: 100% 1px; color: var(--accent-hi); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: #000; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bobine); border-radius: 99px; border: 2px solid #000; }
::-webkit-scrollbar-thumb:hover { background: #4a453d; }
::-webkit-scrollbar-track { background: transparent; }

/* icônes au trait */
.ic { width: 16px; height: 16px; flex: none; vertical-align: -3px; transition: transform .35s var(--ease); }
.ic-big { width: 44px; height: 44px; stroke-width: 1.3; }

.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }

/* ================================================================ sidebar */
.sidebar {
  background: var(--ecran); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 5;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 24px 20px 18px; }
.brand b { display: block; font-size: 15px; font-weight: 800; font-stretch: var(--wide); letter-spacing: -.005em; }
.brand small { color: var(--faint); font-size: 12px; }
.logo { width: 34px; height: 34px; flex: none; transition: transform .9s var(--ease); }
.brand:hover .logo { transform: rotate(144deg); }   /* la bobine tourne d'un cran au survol */
nav { padding: 4px 12px; overflow-y: auto; flex: 1; }
.nav-title { color: var(--faint); font-size: 12px; font-weight: 500; margin: 22px 12px 6px; }
nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--r-btn);
  color: var(--muted); cursor: pointer; text-decoration: none; user-select: none; font-weight: 500; background: none;
  transition: color .15s, background-color .15s;
}
nav a::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent); transform: scaleY(0); transition: transform .25s var(--ease);
}
nav a .ic { width: 18px; height: 18px; stroke-width: 1.7; }
nav a:hover { color: var(--papier); background: var(--cabine); background-size: 0; }
nav a.active { color: var(--papier); background: var(--siege); font-weight: 600; }
nav a.active::before { transform: scaleY(1); }
nav a.active .ic { color: var(--accent); }
.side-foot { padding: 14px 20px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); display: grid; gap: 6px; word-break: break-all; }
.pill { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(111, 207, 138, .15); } .dot.bad { background: var(--bad); }

/* ========================================================= mur d'affiches */
.stage { position: relative; min-width: 0; overflow-x: clip; }
#marquee {
  position: absolute; top: 0; left: 0; right: 0; height: 330px; overflow: hidden; pointer-events: none; z-index: 0;
  opacity: 0; transition: opacity 1.4s ease;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .6) 55%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .6) 55%, transparent 100%);
}
#marquee.on { opacity: 1; }
#marquee::after {   /* voile : le titre reste lisible, les affiches s'éteignent vers la gauche */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .9) 0%, rgba(0, 0, 0, .5) 38%, rgba(0, 0, 0, .12) 70%, rgba(0, 0, 0, .4) 100%);
}
.mq-row { display: flex; gap: 10px; width: max-content; margin: -36px 0 46px -40px; rotate: -4deg; animation: drift 170s linear infinite; }
.mq-row.r2 { margin-left: -120px; animation-duration: 210s; animation-direction: reverse; }
.mq-row span {
  width: 104px; height: 156px; flex: none; border-radius: 4px; background: var(--siege) center / cover no-repeat;
  filter: saturate(.75) brightness(.78);
}
@keyframes drift { to { translate: -50% 0; } }

/* ================================================================== main */
main { padding: 56px 44px 140px; max-width: 1320px; width: 100%; position: relative; z-index: 1; }
.page-head { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 34px; min-height: 96px; }
.page-head h1 {
  margin: 0 0 6px; font-size: 46px; line-height: 1.02; font-weight: 800; font-stretch: var(--wide); letter-spacing: -.02em;
}
.page-head .sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.page-head .sub .badge { margin-left: 6px; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ================================================================ boutons */
.btn {
  --b: var(--bobine);
  position: relative; border: 0; background: var(--b); color: var(--papier); padding: 9px 16px; border-radius: var(--r-btn);
  cursor: pointer; display: inline-flex; gap: 8px; align-items: center; justify-content: center; white-space: nowrap;
  font-weight: 600; font-size: 13.5px; line-height: 1.2; text-decoration: none;
  transition: background-color .15s, color .15s, box-shadow .2s, transform .08s;
}
.btn:hover { --b: #3a362f; background-size: auto; color: #fff; }
.btn:active { transform: scale(.97); }
.btn.primary { --b: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.primary:hover { --b: var(--accent-hi); color: #000; box-shadow: 0 0 24px -4px var(--accent-glow); }
.btn.danger { --b: var(--bad); color: #fff; }
.btn.danger:hover { --b: #f25a50; }
.btn.ghost { --b: transparent; color: var(--papier); font-weight: 500; box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.ghost:hover { --b: var(--siege); box-shadow: inset 0 0 0 1px #4a453d; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; gap: 6px; }
.btn.sm .ic { width: 14px; height: 14px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:hover .ic-spin { transform: rotate(180deg); }

/* ================================================================== cartes */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); transition: border-color .2s, background-color .2s; }
.empty { padding: 64px 24px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); margin: 14px 0 6px; font-size: 21px; font-weight: 700; font-stretch: 112%; }
.empty .big { color: var(--accent); display: grid; place-items: center; }
.empty p { max-width: 560px; margin: 0 auto 8px; }

/* compteurs : une seule bande, comme le bandeau d'une marquise */
.stats {
  display: flex; flex-wrap: wrap; margin-bottom: 30px;
  border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line);
}
.stats .stat { flex: 1 1 0; min-width: 150px; padding: 16px 22px 16px 0; background: none; border: 0; border-radius: 0; }
.stats .stat + .stat { padding-left: 22px; border-left: 1px solid var(--line); }
.stat .n { font-size: 38px; font-weight: 700; font-stretch: var(--wide); line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.stat.ok .n { color: var(--ok); } .stat.warn .n { color: var(--accent); } .stat.bad .n { color: #ff6b61; }
.stat.info .n { color: var(--papier); }

/* =================================================================== onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 11px 14px; cursor: pointer; color: var(--muted); white-space: nowrap; font-weight: 600; transition: color .15s; }
.tab::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: var(--accent); transform: scaleX(0); transition: transform .3s var(--ease);
}
.tab:hover { color: var(--papier); }
.tab.active { color: var(--papier); }
.tab.active::after { transform: scaleX(1); }
.tab .badge { margin-left: 8px; }

.badge { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11.5px; font-weight: 600; background: var(--bobine); color: var(--muted); vertical-align: middle; font-variant-numeric: tabular-nums; }
.badge.new { background: var(--accent); color: #000; }
.badge.ex { background: rgba(243, 239, 232, .12); color: var(--papier); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--accent-soft); color: var(--accent); }
.badge.bad { background: var(--bad); color: #fff; }

.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; color: var(--muted); transition: color .15s; }
.toolbar label:hover { color: var(--papier); }
.search, input.field, select.field {
  background: var(--cabine); border: 1px solid var(--input-line); border-radius: var(--r-btn); padding: 9px 12px; outline: none;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.search { min-width: 280px; padding-left: 36px;
  background: var(--cabine) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239c968b' stroke-width='1.8'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") 12px 50% no-repeat; }
input.field, select.field { width: 100%; height: 40px; }
select.field {
  cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c9c2b6' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px;
}
select.field option { background: var(--cabine); color: var(--papier); }
.search:hover, input.field:hover, select.field:hover { border-color: #6e695f; }
.search:focus, input.field:focus, select.field:focus { border-color: var(--accent); background-color: #0a0908; box-shadow: 0 0 0 3px var(--accent-soft); }
::placeholder { color: var(--faint); }

/* ============================================================ lignes / listes
   Les lignes forment un seul « programme » : un bloc, séparé par des filets.
   Au survol, un projecteur suit le curseur (--mx / --my posés par app.js). */
.rows { display: grid; gap: 0; }
.rows > .card { border-radius: 0; border-width: 1px 1px 0; }
.rows > .card:first-child { border-radius: var(--r-card) var(--r-card) 0 0; }
.rows > .card:last-child { border-radius: 0 0 var(--r-card) var(--r-card); border-bottom-width: 1px; }
.rows > .card:only-child { border-radius: var(--r-card); }
.rows > .card.empty { background: transparent; }
.rows > .dup { border-radius: var(--r-card) !important; border-width: 1px !important; margin-bottom: 12px; }

.row { position: relative; display: grid; grid-template-columns: auto 52px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 16px; }
.row > div, .mshow > div, .pmain, .review > div { min-width: 0; }
.row .meta, .mshow .folder { overflow-wrap: anywhere; }
.row::before, .mshow::before, .pstrip::before, .review::before {
  content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px;
  background: var(--accent); transform: scaleY(0); transition: transform .3s var(--ease);
}
.row:hover, .mshow:hover, .pstrip:hover, .review:hover, .unk:hover, .dup:hover, .result:hover {
  background-color: #161513;
  background-image: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(229, 160, 13, .085), transparent 70%);
}
.row:hover::before, .mshow:hover::before, .pstrip:hover::before, .review:hover::before { transform: scaleY(1); }
.row.off { opacity: .45; }
.row .title { font-weight: 650; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row .meta { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 2px 14px; }
.row-actions { display: flex; gap: 8px; }
.thumb {
  width: 52px; height: 78px; border-radius: 4px; background: var(--bobine) center/cover no-repeat;
  display: grid; place-items: center; color: var(--faint); font-weight: 800; font-size: 20px; font-stretch: var(--wide); overflow: hidden;
  box-shadow: 0 0 0 1px rgba(243, 239, 232, .06); transition: box-shadow .25s, filter .25s;
}
.row:hover .thumb, .mshow:hover .thumb, .result:hover .thumb { filter: brightness(1.12); box-shadow: 0 0 0 1px rgba(229, 160, 13, .5), 0 6px 22px -6px rgba(229, 160, 13, .35); }

/* case à cocher maison */
.chk {
  appearance: none; -webkit-appearance: none; width: 19px; height: 19px; border-radius: 4px; flex: none; margin: 0;
  border: 1.5px solid var(--input-line); background: transparent; cursor: pointer; display: inline-grid; place-items: center;
  transition: background-color .15s, border-color .15s;
}
.chk::after {
  content: ""; width: 5px; height: 10px; border: solid #000; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0); margin-top: -2px; transition: transform .2s var(--ease);
}
.chk:hover { border-color: var(--accent); }
.chk:checked { background: var(--accent); border-color: var(--accent); }
.chk:checked::after { transform: rotate(45deg) scale(1); }

.details { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; animation: rise .25s var(--ease) both; }
.op { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 7px 8px; border-radius: 4px; font-size: 12.5px; transition: background-color .15s; }
.op:hover { background: var(--siege); }
.op .from { color: var(--faint); word-break: break-all; }
.op .to { color: var(--papier); word-break: break-all; }
.op .to::before { content: "→ "; color: var(--accent); font-weight: 700; }
.op.del .from { text-decoration: line-through; }
.inline-edit { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.inline-edit .btn { flex: none; }
body.busy, body.busy * { cursor: progress !important; }

/* cartes « à vérifier » */
.review { position: relative; padding: 16px 18px; display: grid; gap: 12px; }
.review .src { font-weight: 650; word-break: break-all; }
.review .prop { color: var(--muted); font-size: 13px; }
.cands { display: flex; gap: 12px; overflow-x: auto; padding: 6px 4px 8px; }
.cand { width: 116px; flex: none; cursor: pointer; position: relative; }
.cand .img { width: 100%; aspect-ratio: 2/3; border-radius: 4px; background: var(--bobine) center/cover no-repeat; outline: 2px solid transparent; outline-offset: 3px; transition: outline-color .2s, filter .2s; filter: brightness(.85); }
.cand:hover .img { outline-color: var(--accent); filter: none; }
.cand .cap { font-size: 11.5px; margin-top: 7px; line-height: 1.3; color: var(--muted); transition: color .2s; }
.cand:hover .cap { color: var(--papier); }

.list-plain { margin: 0; padding: 4px; list-style: none; }
.list-plain li { padding: 8px 12px; border-radius: 4px; font-size: 13px; color: var(--muted); word-break: break-all; transition: background-color .15s, color .15s; }
.list-plain li:hover { background: var(--siege); color: var(--papier); }
.section-title { margin: 30px 0 12px; font-size: 18px; font-weight: 700; font-stretch: 112%; display: flex; gap: 10px; align-items: center; }
.section-title .ic { color: var(--accent); width: 18px; height: 18px; }

/* barre « Appliquer » */
.applybar {
  position: fixed; bottom: 22px; left: calc(240px + 44px); right: 44px; max-width: 1232px; z-index: 20;
  display: flex; gap: 16px; align-items: center; padding: 14px 16px 14px 22px;
  background: rgba(18, 17, 16, .9); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(229, 160, 13, .45); border-radius: var(--r-big);
  box-shadow: 0 -10px 60px -20px rgba(229, 160, 13, .25);
  animation: slideup .45s var(--ease) both;
}
.applybar .txt { flex: 1; }
.applybar .txt b { font-size: 15px; font-weight: 700; font-stretch: 112%; }
.applybar .txt small { display: block; color: var(--muted); }
.applybar .btn.primary { padding: 12px 24px; font-size: 14.5px; }

/* ================================================================ doublons */
.dup { display: grid; grid-template-columns: 1fr 1fr; gap: 0; overflow: hidden; }
.dup-head { grid-column: 1/-1; padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.dup-side { padding: 14px 16px; cursor: pointer; display: grid; gap: 5px; border-right: 1px solid var(--line); position: relative; transition: background-color .2s, opacity .2s; }
.dup-side:last-child { border-right: 0; }
.dup-side .nm { word-break: break-all; font-size: 13px; }
.dup-side .q { color: var(--muted); font-size: 12.5px; }
.dup-side.keep { background: linear-gradient(160deg, rgba(111, 207, 138, .13), rgba(111, 207, 138, .02)); }
.dup-side.drop { opacity: .55; }
.dup-side.drop:hover { opacity: 1; background: var(--siege); }
.dup-side.drop:hover .tag::after { content: "cliquer pour garder celle-ci"; color: var(--accent); font-weight: 500; margin-left: 4px; }
.dup-side .tag { font-size: 12.5px; font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dup-side .tag .muted { font-weight: 400; }
.dup-side.keep .tag { color: var(--ok); } .dup-side.drop .tag { color: var(--muted); }

/* ============================================================ outils films */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .card, .tool-card { background: var(--cabine); border-color: var(--line); border-radius: var(--r-big); }
.chart { display: flex; align-items: flex-end; gap: 2px; height: 190px; padding: 10px 4px 0; }
.chart .b { flex: 1; background: linear-gradient(to top, #6b4a06, var(--accent)); border-radius: 2px 2px 0 0; min-height: 1px; opacity: .7; transition: opacity .15s; }
.chart .b:hover { opacity: 1; background: var(--accent-hi); }
.chart-axis { display: flex; justify-content: space-between; color: var(--faint); font-size: 11px; padding: 6px 4px; font-variant-numeric: tabular-nums; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line-strong); }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); transition: background-color .15s; }
table.t tr:hover td { background: var(--siege); }
.result { display: flex; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 6px; transition: background-color .15s; }
.result .thumb { width: 36px; height: 54px; font-size: 13px; }

/* ================================================================= réglages */
.form { display: grid; gap: 20px; padding: 26px; border-radius: var(--r-big); }
.form .f { display: grid; gap: 7px; }
.form label { font-weight: 600; font-size: 13px; }
.form .hint { color: var(--faint); font-size: 12.5px; }
.form .sw { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; margin: -10px -12px; border-radius: 6px; transition: background-color .15s; }
.form .sw:hover { background: var(--siege); }
.form .sw input { margin-top: 1px; }
.form .sw label { font-weight: 500; cursor: pointer; }
.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ===================================================== fenêtre d'opération */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .8); display: grid; place-items: center; z-index: 50; backdrop-filter: blur(6px); animation: fade .2s both; }
.hidden { display: none !important; }
.job-card {
  background: var(--cabine); border: 1px solid var(--line-strong); border-radius: var(--r-big); padding: 34px 34px 30px;
  width: min(480px, 92vw); text-align: center; animation: pop .3s var(--ease) both; position: relative; overflow: hidden;
}
.job-card::before {   /* le faisceau du projecteur, du haut vers l'écran */
  content: ""; position: absolute; left: 50%; top: -60px; width: 340px; height: 260px; translate: -50% 0; pointer-events: none;
  background: radial-gradient(50% 60% at 50% 0%, rgba(229, 160, 13, .16), transparent 70%);
}
.job-card h3 { margin: 18px 0 4px; font-size: 19px; font-weight: 700; font-stretch: 112%; position: relative; }
.job-card p { color: var(--muted); margin: 0 0 18px; min-height: 21px; word-break: break-word; font-size: 13px; position: relative; }
.bar { height: 3px; background: rgba(243, 239, 232, .1); border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width .3s var(--ease); box-shadow: 0 0 12px var(--accent-glow); }
.bar.indet > div { width: 35%; animation: indet 1.2s infinite ease-in-out; }
.spinner { width: 36px; height: 36px; border: 2.5px solid rgba(243, 239, 232, .1); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto; animation: spin .8s linear infinite; position: relative; }

#toasts { position: fixed; top: 20px; right: 20px; display: grid; gap: 10px; z-index: 60; }
.toast {
  background: var(--siege); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 6px; max-width: 400px; font-size: 13.5px; font-weight: 500;
  animation: tin .35s var(--ease) both;
}
.toast.ok { border-left-color: var(--ok); } .toast.bad { border-left-color: var(--bad); }

.muted { color: var(--muted); } .small { font-size: 12.5px; }
.complete { color: var(--ok); display: inline-flex; gap: 6px; align-items: center; }
.callout { padding: 14px 18px; border-radius: 8px; background: rgba(243, 239, 232, .05); border-left: 2px solid var(--faint); color: var(--text); font-size: 13.5px; margin-bottom: 18px; }
.callout.warn { background: var(--accent-soft); border-left-color: var(--accent); }

/* ====================================================== épisodes manquants */
.mshow { position: relative; display: grid; grid-template-columns: 60px 1fr auto; gap: 16px; padding: 14px 16px; align-items: start; }
.mshow .thumb { width: 60px; height: 90px; }
.mshow.done { opacity: .7; }
.mshow.ign { opacity: .45; }
.mshow.done:hover, .mshow.ign:hover { opacity: 1; }
.mshow h4 { margin: 0 0 2px; font-size: 16px; font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mshow .folder { color: var(--faint); font-size: 12px; }
.mprog { display: flex; align-items: center; gap: 12px; margin: 10px 0 8px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mprog .track { flex: 1; max-width: 280px; height: 3px; border-radius: 99px; background: rgba(243, 239, 232, .1); overflow: hidden; }
.mprog .fill { height: 100%; background: var(--ok); border-radius: 99px; }
.mprog .fill.part { background: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; transition: background-color .2s; }
.chip:hover { background: rgba(229, 160, 13, .24); }
.chip.full { background: var(--bad-soft); color: #ff7a71; }
.chip.full:hover { background: rgba(229, 72, 63, .26); }
.mshow .side { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 170px; }
.mnext { font-size: 12.5px; color: var(--papier); margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.mnext::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; flex: none; }
.unk { position: relative; display: grid; grid-template-columns: 1fr minmax(200px, 340px) auto; gap: 12px; align-items: center; padding: 12px 16px; }

/* ================================================================= posters */
.pstrip { position: relative; display: grid; grid-template-columns: 100px 1fr; gap: 18px; padding: 14px 16px; }
.pcur .img { width: 100px; height: 150px; border-radius: 4px; background: var(--bobine) center/cover; box-shadow: 0 0 0 1px rgba(243, 239, 232, .06); }
.pcur .img.none { display: grid; place-items: center; text-align: center; color: var(--faint); font-size: 11px; border: 1px dashed var(--line-strong); background: transparent; }
.pmain { min-width: 0; }
.pmain .nm { font-weight: 700; font-size: 15px; margin-bottom: 6px; word-break: break-word; }
.pmatch { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.field.sm { padding: 5px 8px; font-size: 12.5px; width: auto; max-width: 100%; height: auto; }
.plangs { margin-bottom: 8px; }
.pthumbs { display: flex; gap: 10px; overflow-x: auto; padding: 8px 6px 10px; margin: -8px -6px 0; }
.pthumb { position: relative; flex: 0 0 auto; cursor: pointer; }
.pthumb .img { width: 84px; height: 126px; border-radius: 4px; background: var(--bobine) center/cover; outline: 2px solid transparent; outline-offset: 3px; transition: outline-color .2s, filter .2s; filter: brightness(.82); }
.pthumb:hover .img { outline-color: rgba(243, 239, 232, .6); filter: none; }
.pthumb.sel .img { outline-color: var(--accent); filter: none; }
.pthumb.sel::after {
  content: ""; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
  animation: pop .3s var(--ease) both;
}
.pthumb.busy { opacity: .5; pointer-events: none; }
.pthumb .lang { position: absolute; left: 5px; bottom: 5px; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; background: rgba(0, 0, 0, .8); color: #fff; }

/* ================================================== actualisation automatique */
.fresh { font-size: 12.5px; display: inline-flex; align-items: center; gap: 7px; margin-top: 4px; }
.fresh.ok { color: var(--ok); } .fresh.run { color: var(--accent); } .fresh.bad { color: #ff7a71; }
.mini-spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .8s linear infinite; }
#bg-status { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
#bg-status .pill { color: var(--accent); }
#lib-pending { color: var(--accent); font-size: 12.5px; }

/* --- bandeau « relance nécessaire » --- */
.outdated { position: sticky; top: 0; z-index: 40; background: var(--accent); color: #000; padding: 10px 20px; font-size: 14px; text-align: center; }

/* --- nature des changements (couleurs) --- */
.tagpill { --tc: #808080; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: #e9e4db;
  padding: 2px 8px 2px 7px; border-radius: 4px; background: color-mix(in srgb, var(--tc) 15%, transparent); white-space: nowrap; }
.tagpill i { width: 8px; height: 8px; border-radius: 2px; background: var(--tc); flex: none; }
.tagpill b { color: var(--tc); font-weight: 700; }
.tagline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.legend-item { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 5px; transition: opacity .2s; }
.legend-item.on .tagpill { outline: 1.5px solid var(--tc); outline-offset: 1px; }
.legend-item.dim { opacity: .4; }
.legend-item.dim:hover { opacity: .9; }
.op { --tc: transparent; border-left: 2px solid var(--tc); padding-left: 10px; margin: 2px 0; }
.op-head { margin-bottom: 3px; }
.op-head .tagpill { font-size: 10.5px; padding: 1px 7px 1px 6px; }

/* --- bouton « ouvrir le dossier » sur les affiches --- */
.thumbwrap, .pcur { position: relative; flex: none; }
.openbtn {
  position: absolute; top: 4px; right: 4px; z-index: 2; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 5px;
  display: grid; place-items: center; cursor: pointer; color: #fff; background: rgba(0, 0, 0, .75);
  opacity: 0; transform: scale(.85); transition: opacity .18s, transform .18s var(--ease), background-color .15s, color .15s;
}
.row:hover .openbtn, .mshow:hover .openbtn, .pstrip:hover .openbtn, .result:hover .openbtn, .openbtn:focus-visible { opacity: 1; transform: scale(1); }
.openbtn:hover { background: var(--accent); color: #000; }
.openbtn.busy { opacity: .5; pointer-events: none; }
@media (hover: none) { .openbtn { opacity: 1; transform: none; } }
.result .openbtn { width: 20px; height: 20px; top: 2px; right: 2px; }
.tmdbbtn { display: none !important; }

/* --- titre = lien TMDB --- */
.tlink { color: inherit; text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1.5px no-repeat;
  transition: background-size .3s var(--ease), color .15s; display: inline; }
.tlink:hover { color: #fff; background-size: 100% 1.5px; }
/* replié (largeur 0) tant qu'on ne survole pas : pas de trou avant les étiquettes */
.tlink-ic { display: inline-flex; align-items: center; gap: 3px; max-width: 0; margin-left: 0; overflow: hidden; font-size: 10.5px; font-weight: 700;
  color: var(--accent); vertical-align: middle; opacity: 0; white-space: nowrap;
  transition: max-width .3s var(--ease), margin-left .3s var(--ease), opacity .2s; }
.tlink-ic .ic { width: 12px; height: 12px; vertical-align: 0; }
.tlink:hover .tlink-ic, .tlink:focus-visible .tlink-ic { max-width: 90px; margin-left: 8px; opacity: 1; }
@media (hover: none) { .tlink-ic { max-width: 90px; margin-left: 8px; opacity: .8; } }

/* ================================================================ animations
   Peu de mouvement : le mur d'affiches, et ce qui répond à un geste. */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes slideup { from { opacity: 0; transform: translateY(24px); } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }
@keyframes fade { from { opacity: 0; } }
@keyframes tin { from { opacity: 0; transform: translateX(24px); } }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .mq-row { animation: none !important; }
}

/* ================================================================== mobile */
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; border-right: 0; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .92); backdrop-filter: blur(10px); min-width: 0; }
  .brand { padding: 12px 16px 4px; }
  nav { display: flex; flex-wrap: nowrap; gap: 2px; overflow-x: auto; padding: 4px 10px 10px; scrollbar-width: none; min-width: 0; max-width: 100vw; }
  nav::-webkit-scrollbar { display: none; }
  .nav-title { display: none; }
  #nav-cats { display: contents; }
  nav a { flex: none; padding: 8px 12px; }
  nav a::before { left: 12px; right: 12px; top: auto; bottom: 0; width: auto; height: 2px; transform: scaleX(0); border-radius: 0; }
  nav a.active::before { transform: scaleX(1); }
  .side-foot { display: none; }
  #marquee { height: 230px; }
  .mq-row span { width: 72px; height: 108px; }
  main { padding: 28px 16px 140px; }
  .page-head { min-height: 0; margin-bottom: 22px; }
  .page-head h1 { font-size: 32px; }
  .page-head .actions { margin-left: 0; }
  .page-head .actions .btn { padding: 8px 12px; font-size: 13px; }
  .applybar { left: 10px; right: 10px; bottom: 10px; padding: 12px; gap: 10px; flex-wrap: wrap; }
  .applybar .txt b { font-size: 14px; }
  .applybar .txt small { display: none; }
  .applybar .btn.primary { width: 100%; padding: 12px; }
  .stats .stat { flex: 1 1 45%; min-width: 0; padding: 12px 12px 12px 0; }
  .stats .stat + .stat { padding-left: 12px; }
  .stats .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stat .n { font-size: 28px; }
  .grid2, .form-cols, .dup { grid-template-columns: 1fr; }
  .search { min-width: 0; width: 100%; }
  .row { grid-template-columns: auto 44px minmax(0, 1fr); }
  .row > :last-child { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
  .thumb { width: 44px; height: 66px; }
  .mshow { grid-template-columns: 44px minmax(0, 1fr); } .mshow .thumb { width: 44px; height: 66px; }
  .mshow .side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
  .unk { grid-template-columns: 1fr; }
  .pstrip { grid-template-columns: 68px 1fr; } .pcur .img { width: 68px; height: 102px; }
}

/* boutons discrets posés sur le mur d'affiches : un verre fumé */
.page-head .btn.ghost, .page-head select.field { --b: rgba(0, 0, 0, .55); background-color: rgba(0, 0, 0, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.page-head .btn.ghost:hover { --b: rgba(28, 26, 23, .85); }


/* ============================================================ À l'affiche */
.nsec { margin-bottom: 34px; }
.nhead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nhead .section-title { margin: 0; }
.nsec > .nhead { margin-bottom: 12px; }
.nnote { color: var(--muted); font-size: 12.5px; margin: -4px 0 12px; max-width: 72ch; }
.plat-tabs { margin-bottom: 12px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--cabine); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { border: 0; background: none; color: var(--muted); padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 12.5px; font-weight: 600; transition: background-color .15s, color .15s; }
.seg button:hover { color: var(--papier); }
.seg button.on { background: var(--bobine); color: var(--papier); }

.rail-wrap { position: relative; margin: 0 -8px; }
.rail { display: flex; gap: 14px; overflow-x: auto; padding: 6px 8px 10px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-btn {
  position: absolute; top: 6px; bottom: 54px; z-index: 3; width: 44px; border: 0; cursor: pointer; color: var(--papier);
  display: grid; place-items: center; opacity: 0; transition: opacity .2s;
}
.rail-btn .ic { width: 26px; height: 26px; stroke-width: 2.2; }
.rail-btn.prev { left: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .85), transparent); }
.rail-btn.next { right: 0; background: linear-gradient(-90deg, rgba(0, 0, 0, .85), transparent); }
.rail-wrap:hover .rail-btn { opacity: 1; }
.rail-btn:hover .ic { color: var(--accent); }
@media (hover: none) { .rail-btn { display: none; } }

.ncard { flex: 0 0 auto; width: 148px; scroll-snap-align: start; color: var(--papier); background: none; display: grid; gap: 3px; align-content: start; position: relative; text-decoration: none; }
.ncard:hover { background: none; color: var(--papier); }
.nposter {
  width: 148px; aspect-ratio: 2/3; border-radius: 4px; background: var(--bobine) center/cover no-repeat; position: relative; margin-bottom: 6px;
  display: grid; place-items: center; color: var(--faint); font-weight: 800; font-size: 34px; font-stretch: var(--wide);
  box-shadow: 0 0 0 1px rgba(243, 239, 232, .06); transition: box-shadow .25s, filter .25s;
}
.ncard:hover .nposter { box-shadow: 0 0 0 1px rgba(229, 160, 13, .6), 0 10px 30px -10px rgba(229, 160, 13, .45); filter: brightness(1.08); }
.ntitle { font-weight: 650; font-size: 13.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ncard:hover .ntitle { color: var(--accent); }
.nsub { color: var(--muted); font-size: 12px; display: grid; }
.nweeks { color: var(--faint); font-size: 11.5px; }
.owned {
  position: absolute; left: 6px; top: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 2px 5px;
  border-radius: 4px; background: rgba(0, 0, 0, .78); color: var(--ok); font-size: 11px; font-weight: 700; font-stretch: 100%;
}
.owned .ic { width: 12px; height: 12px; stroke-width: 2.6; }
/* Top 10 : le grand chiffre derrière l'affiche */
.ncard.ranked { width: 214px; padding-left: 66px; }
.ncard.ranked .nposter { width: 148px; }
.rank {
  position: absolute; left: 0; top: 102px; width: 120px; height: 120px; z-index: 0; pointer-events: none;
  color: #6e695f; transition: color .25s;
}
.rank svg { display: block; width: 100%; height: 100%; overflow: visible; }
.rank text { font-family: "Archivo", system-ui, sans-serif; font-size: 150px; font-weight: 900; font-stretch: 75%;
  fill: var(--ecran); stroke: currentColor; stroke-width: 2.5px; }
.ncard.ranked.r10 .rank { width: 200px; }
.ncard.ranked:hover .rank { color: var(--accent); }
.ncard.ranked .nposter { z-index: 1; }
@media (max-width: 860px) {
  .ncard, .nposter { width: 116px; } .ncard.ranked { width: 170px; padding-left: 54px; } .ncard.ranked .nposter { width: 116px; }
  .rank { width: 96px; height: 96px; top: 80px; } .ncard.ranked.r10 .rank { width: 160px; }
}
/* Top 10 : « 10 » prend deux chiffres, on lui laisse la place */
.ncard.ranked.r10 { width: 268px; padding-left: 120px; }

@media (max-width: 860px) { .ncard.ranked.r10 { width: 214px; padding-left: 98px; } }

/* À la télé : cartes en paysage (images du programme) */
.tvcard { flex: 0 0 auto; width: 262px; display: grid; gap: 3px; align-content: start; color: var(--papier); background: none; text-decoration: none; }
.tvcard:hover { background: none; color: var(--papier); }
.tvimg {
  position: relative; width: 262px; aspect-ratio: 16/9; border-radius: 4px; margin-bottom: 6px;
  background: var(--bobine) center/cover no-repeat; box-shadow: 0 0 0 1px rgba(243, 239, 232, .06); transition: box-shadow .25s, filter .25s;
}
a.tvcard:hover .tvimg { box-shadow: 0 0 0 1px rgba(229, 160, 13, .6), 0 10px 30px -10px rgba(229, 160, 13, .45); filter: brightness(1.08); }
a.tvcard:hover .ntitle { color: var(--accent); }
.tvimg .chan { position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 4px; background: rgba(0, 0, 0, .8); color: #fff; font-size: 11.5px; font-weight: 700; }
.tvcard .nsub { display: flex; flex-wrap: wrap; gap: 0 10px; }
.tvcard .nsub span:first-child { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .tvcard, .tvimg { width: 220px; } }

/* logos des plateformes et des chaînes */
.plat-tab { display: inline-flex; align-items: center; gap: 8px; }
.plat-tab img { width: 22px; height: 22px; border-radius: 5px; flex: none; filter: grayscale(.6) brightness(.8); transition: filter .2s; }
.plat-tab:hover img, .plat-tab.active img { filter: none; }
.tvimg .chan.logo { padding: 3px; background: rgba(255, 255, 255, .92); display: grid; place-items: center; }
.tvimg .chan.logo img { height: 22px; width: auto; max-width: 64px; display: block; object-fit: contain; }

/* flèches : seulement s'il reste quelque chose à voir de ce côté */
.rail-wrap.at-start .rail-btn.prev, .rail-wrap.at-end .rail-btn.next { opacity: 0 !important; pointer-events: none; }
/* barre d'avancement du programme en cours */
.tvprog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0, 0, 0, .55); border-radius: 0 0 4px 4px; overflow: hidden; }
.tvprog i { display: block; height: 100%; background: var(--accent); }

/* ===================================================== À l'antenne : frise */
.rail.timeline { gap: 0; padding-top: 4px; align-items: flex-start; }
.tl-day { flex: 0 0 188px; min-width: 188px; position: relative; padding-right: 12px; }
.tl-head { display: flex; align-items: baseline; gap: 8px; height: 22px; padding-left: 2px; }
.tl-head b { font-size: 13.5px; font-weight: 700; }
.tl-head span { color: var(--muted); font-size: 12px; }
.tl-day.past .tl-head, .tl-day.past .tl-list { opacity: .5; }
.tl-day.noep .tl-head b { color: var(--muted); font-weight: 500; }
.tl-day.today .tl-head b { color: var(--accent); }
/* l'axe : un trait continu d'une colonne à l'autre, un repère par jour */
.tl-tick { position: relative; height: 22px; margin-right: -12px; }
.tl-tick::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--line-strong); }
.tl-tick::after { content: ""; position: absolute; left: 2px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--ecran); box-shadow: inset 0 0 0 2px var(--line-strong); }
.tl-day:not(.noep) .tl-tick::after { background: var(--papier); box-shadow: none; }
.tl-day.today .tl-tick::after { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-day.today .tl-tick::before { background: linear-gradient(90deg, var(--accent) 0 12px, var(--line-strong) 12px); }
.tl-list { display: grid; gap: 10px; }
.tl-item { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; color: var(--papier); background: none; text-decoration: none; padding: 4px; margin: -4px; border-radius: 6px; transition: background-color .15s; }
.tl-item:hover { background: var(--cabine); color: var(--papier); }
.tl-item:hover .ntitle { color: var(--accent); }
.tl-poster { width: 52px; height: 78px; border-radius: 4px; background: var(--bobine) center/cover no-repeat; display: grid; place-items: center;
  color: var(--faint); font-weight: 800; font-size: 18px; box-shadow: 0 0 0 1px rgba(243, 239, 232, .06); }
.tl-txt { display: grid; gap: 2px; min-width: 0; }
.tl-txt .ntitle { font-size: 13px; }
.tl-txt .nsub { font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .tl-day { flex-basis: 160px; min-width: 160px; } }

/* Top 10 des plateformes : la couleur de la plateforme en dégradé derrière le classement */
@property --pc { syntax: "<color>"; inherits: true; initial-value: #e5a00d; }
.plat-zone {
  position: relative; margin-left: -20px; margin-right: -20px; padding: 18px 20px 10px; border-radius: var(--r-big);
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--pc) 30%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--pc) 16%, transparent), transparent 75%);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--pc) 45%, transparent);
  transition: --pc .6s ease;
}
.plat-zone .tab.active::after { background: var(--pc); }
.plat-zone .tab.active { color: #fff; }
.plat-zone .rail-btn.prev { background: linear-gradient(90deg, rgba(0, 0, 0, .7), transparent); }
@media (max-width: 860px) { .plat-zone { margin-left: -16px; margin-right: -16px; padding: 14px 16px 8px; border-radius: 0; } }
.plat-zone .rank { color: color-mix(in srgb, var(--pc) 55%, #6e695f); }
.plat-zone .ncard.ranked:hover .rank { color: var(--pc); }

/* la phrase sous les onglets garde toujours la même hauteur : les affiches ne sautent plus */
.plat-zone .nnote { min-height: 1.55em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: none; }

/* changement d'onglet : les affiches glissent depuis le côté de l'onglet choisi, en cascade */
.rail.swap > * { animation: swapin .5s cubic-bezier(.2, .8, .2, 1) both; }
.rail.swap.from-right > * { --dx: 46px; }
.rail.swap.from-left > * { --dx: -46px; }
.rail.swap.fade > * { --dx: 0px; --dy: 10px; }
.rail.swap > :nth-child(2) { animation-delay: .03s; } .rail.swap > :nth-child(3) { animation-delay: .06s; }
.rail.swap > :nth-child(4) { animation-delay: .09s; } .rail.swap > :nth-child(5) { animation-delay: .12s; }
.rail.swap > :nth-child(6) { animation-delay: .15s; } .rail.swap > :nth-child(7) { animation-delay: .18s; }
.rail.swap > :nth-child(n+8) { animation-delay: .21s; }
@keyframes swapin { from { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)); } }

/* fiche au survol */
.hovercard {
  position: fixed; z-index: 80; display: none; width: 300px; padding: 12px 14px 13px; pointer-events: none;
  background: #1c1a17; border: 1px solid var(--line-strong); border-radius: 6px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .8);
  opacity: 0; transform: translateX(-6px); transition: opacity .16s ease, transform .2s cubic-bezier(.2, .8, .2, 1);
}
.hovercard.left { transform: translateX(6px); }
.hovercard.on { opacity: 1; transform: none; }
.hovercard b { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--papier); }
.hovercard .hc-meta { display: block; color: var(--accent); font-size: 12px; font-weight: 600; margin-top: 3px; }
.hovercard p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; color: #d6d0c5;
  display: -webkit-box; -webkit-line-clamp: 9; -webkit-box-orient: vertical; overflow: hidden; }
.hovercard .hc-none { color: var(--faint); font-style: italic; }
@media (prefers-reduced-motion: reduce) { .rail.swap > * { animation: none; } }

/* trait de l'onglet actif des plateformes : un seul trait qui glisse */
.plat-tabs { position: relative; }
.plat-zone .plat-tab.active::after { display: none; }
.plat-ink {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; border-radius: 2px; background: var(--pc);
  transition: transform .22s cubic-bezier(.4, 0, .2, 1), width .22s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 0 10px color-mix(in srgb, var(--pc) 60%, transparent);
}

@media (prefers-reduced-motion: reduce) { .plat-ink { transition: none; } }

/* Calendrier sur plusieurs mois : jours sans épisode étroits, longues périodes vides resserrées */
.tl-day.thin { flex-basis: 30px; min-width: 30px; padding-right: 0; }
.tl-day.thin .tl-head { visibility: hidden; }
.tl-day.thin .tl-tick { margin-right: 0; }
.tl-day.thin .tl-tick::after { left: 10px; width: 6px; height: 6px; top: 8px; }
.tl-gap { flex: 0 0 92px; min-width: 92px; }
.tl-gap .tl-head { justify-content: center; }
.tl-gap .tl-head span { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.tl-gap .tl-tick::before { background: repeating-linear-gradient(90deg, var(--line-strong) 0 5px, transparent 5px 10px); }
.tl-gap .tl-tick::after { display: none; }
.lan-url { color: var(--accent); font-weight: 700; user-select: all; }

/* opération longue : boutons de la fenêtre, et pastille quand elle tourne en arrière-plan */
.job-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; position: relative; }
.job-actions:empty { display: none; }
.jobdock {
  position: fixed; right: 20px; bottom: 20px; z-index: 45; display: flex; align-items: center; gap: 12px;
  width: min(420px, calc(100vw - 32px)); padding: 12px 12px 12px 16px;
  background: rgba(28, 26, 23, .96); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent); border-radius: 8px;
  box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .8); animation: tin .3s var(--ease) both;
}
.jobdock .mini-spin { color: var(--accent); flex: none; }
.jd-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.jd-txt b { font-size: 13px; }
.jd-txt span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jd-bar { height: 3px; border-radius: 99px; background: rgba(243, 239, 232, .1); overflow: hidden; margin-top: 4px; }
.jd-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s var(--ease); }
.toast a { color: var(--accent); font-weight: 600; }
@media (max-width: 860px) { .jobdock { right: 16px; left: 16px; width: auto; bottom: 16px; } }
.job-min {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 32px; height: 32px; border: 0; border-radius: 6px; padding: 0;
  display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer; transition: background-color .15s, color .15s;
}
.job-min:hover { background: var(--bobine); color: var(--papier); }
.job-min .ic { width: 17px; height: 17px; }

/* fichiers non reconnus : identification à la main */
.stat-link { cursor: pointer; }
.stat-link:hover .l { color: var(--papier); text-decoration: underline; text-underline-offset: 3px; }
.unk-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 12px 16px; }
.unk-name { font-weight: 600; overflow-wrap: anywhere; }
.unk-form { grid-column: 1 / -1; display: none; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding-top: 4px; }
.unk-row.editing .unk-form { display: flex; animation: rise .2s var(--ease) both; }
.unk-row.editing [data-ident] { display: none; }
.unk-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.unk-form .u-show { width: 280px; }
.unk-form .u-season { width: 80px; }
.unk-form .u-ep { width: 110px; }
.unk-row.done { opacity: .5; }
.unk-row.done [data-ident] { display: none; }
@media (max-width: 860px) { .unk-form .u-show { width: 100%; } .unk-form label:first-child { flex: 1 1 100%; } }
.unk-form { flex-direction: column; align-items: stretch; }
.unk-common { display: flex; gap: 10px; flex-wrap: wrap; }
.unk-files { display: grid; gap: 4px; max-height: 420px; overflow: auto; padding-right: 4px; }
.u-file { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 4px 8px; border-radius: 4px; }
.u-file:hover { background: var(--siege); }
.u-file label { grid-auto-flow: column; align-items: center; gap: 8px; }
.u-fname { font-size: 12.5px; color: var(--papier); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-file .u-ep { width: 90px; }
.unk-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
select.field.sm { padding-right: 34px; background-position: right 12px center; background-size: 11px; }

/* Posters : affiche agrandie au survol */
.pzoom {
  position: fixed; z-index: 85; width: 300px; pointer-events: none; padding: 6px; border-radius: 8px;
  background: #1c1a17; border: 1px solid var(--line-strong); box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .9);
  opacity: 0; transform: scale(.92); transition: opacity .14s ease, transform .2s cubic-bezier(.2, .8, .2, 1);
}
.pzoom.on { opacity: 1; transform: none; }
.pz-img { width: 100%; aspect-ratio: 2/3; border-radius: 4px; background-size: cover; background-position: center; background-color: var(--bobine); }
.pzoom span { display: block; padding: 7px 4px 1px; font-size: 12px; color: var(--muted); }
[data-zoom] { cursor: zoom-in; }
.pthumb [data-zoom] { cursor: pointer; }
@media (hover: none) { .pzoom { display: none; } }
.pmore-box { overflow-anchor: none; }   /* sinon le navigateur suit le bouton vers le bas après l ajout */

/* =================================================================== Suivi */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center;
  background: var(--accent); color: #000; font-size: 11px; font-weight: 800; font-style: normal; }
.nav-badge[hidden] { display: none; }
/* marque-page sur les affiches de films (À l'affiche) */
.follow {
  position: absolute; right: 6px; top: 6px; z-index: 3; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; cursor: pointer;
  display: grid; place-items: center; background: rgba(0, 0, 0, .72); color: #fff; opacity: 0; transform: translateY(-3px);
  transition: opacity .15s, transform .2s var(--ease), background-color .15s, color .15s;
}
.follow .ic { width: 16px; height: 16px; }
.ncard:hover .follow, .follow:focus-visible, .follow.on { opacity: 1; transform: none; }
.follow:hover { background: var(--accent); color: #000; }
.follow.on { background: var(--accent); color: #000; }
@media (hover: none) { .follow { opacity: 1; transform: none; } }

.wadd { position: relative; margin-bottom: 26px; }
.wadd .search { width: 100%; max-width: 620px; height: 44px; font-size: 14.5px; }
.wres { position: absolute; z-index: 30; top: 50px; left: 0; width: min(620px, 100%); padding: 6px; border-radius: 8px;
  background: #1c1a17; border: 1px solid var(--line-strong); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .8); animation: rise .18s var(--ease) both; }
.wr { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 6px 8px; border-radius: 6px; }
.wr:hover { background: var(--siege); }
.wr-img { width: 36px; height: 54px; border-radius: 3px; background: var(--bobine) center/cover; }
.wr-t b { font-weight: 650; }

.wevents { padding: 6px 0; margin-bottom: 30px; }
.wev { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 7px 16px; font-size: 13.5px; color: var(--muted); }
.wev.new { color: var(--papier); }
.wev.new .wev-txt::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; }
.wev-img { width: 28px; height: 42px; border-radius: 3px; background: var(--bobine) center/cover; }
.wev-when { font-size: 12px; color: var(--faint); white-space: nowrap; }

.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.wfilm { position: relative; display: grid; grid-template-columns: 92px 1fr; gap: 16px; padding: 12px; transition: opacity .25s, transform .25s; }
.wfilm.leaving { opacity: 0; transform: scale(.97); }
.wfilm.got { border-color: rgba(111, 207, 138, .35); }
.wposter { width: 92px; aspect-ratio: 2/3; border-radius: 4px; background: var(--bobine) center/cover; display: grid; place-items: center;
  color: var(--faint); font-weight: 800; font-size: 22px; box-shadow: 0 0 0 1px rgba(243, 239, 232, .06); }
.wposter:hover { background-size: cover; box-shadow: 0 0 0 1px rgba(229, 160, 13, .6); }
.winfo { min-width: 0; padding-right: 26px; }
.wtitle { font-weight: 700; font-size: 15px; line-height: 1.3; margin-bottom: 8px; }
.wtitle .muted { font-weight: 500; }
.wchips { display: flex; flex-wrap: wrap; gap: 6px; }
.wchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 4px; font-size: 12px; font-weight: 600;
  background: var(--bobine); color: var(--papier); }
.wchip .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.wchip img { width: 16px; height: 16px; border-radius: 3px; }
.wchip.ok { background: var(--ok-soft); color: var(--ok); }
.wchip.stream { background: rgba(243, 239, 232, .1); }
.wchip.soon { background: var(--accent-soft); color: var(--accent); }
.wchip.muted { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line-strong); font-weight: 500; }
.wremove { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; cursor: pointer;
  display: grid; place-items: center; background: transparent; color: var(--faint); opacity: 0; transition: opacity .15s, background-color .15s, color .15s; }
.wfilm:hover .wremove, .wremove:focus-visible { opacity: 1; }
.wremove:hover { background: var(--bobine); color: var(--papier); }
@media (hover: none) { .wremove { opacity: 1; } }
@media (max-width: 860px) { .wgrid { grid-template-columns: 1fr; } .wfilm { grid-template-columns: 72px 1fr; } .wposter { width: 72px; } }

/* ======================================================= comptes / connexion */
body:not([data-role="admin"]) .adm-only { display: none !important; }
body.locked .app, body.locked #toasts { display: none; }

/* Écran de connexion : la salle est éteinte, seul le faisceau du projecteur éclaire le guichet */
.auth { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px 16px; background: var(--ecran); overflow: auto; }
.auth::before {
  content: ""; position: fixed; left: 50%; top: -120px; width: min(900px, 160vw); height: 620px; translate: -50% 0; pointer-events: none;
  background: radial-gradient(42% 70% at 50% 0%, rgba(229, 160, 13, .17), rgba(229, 160, 13, .04) 55%, transparent 75%);
  animation: beam 1.4s var(--ease) both;
}
@keyframes beam { from { opacity: 0; transform: scaleY(.6); transform-origin: top; } to { opacity: 1; transform: none; } }
.auth-card { position: relative; width: min(380px, 100%); display: grid; gap: 16px; padding: 34px 30px 30px; background: var(--cabine);
  border: 1px solid var(--line-strong); border-radius: var(--r-big); animation: pop .4s .15s var(--ease) both; }
.auth-card .brand { display: flex; align-items: center; gap: 12px; padding: 0; margin: 0 0 6px; }
.auth-card .brand .logo { width: 34px; height: 34px; }
.auth-card .brand b { display: block; font-stretch: var(--wide); font-weight: 800; letter-spacing: -.01em; }
.auth-card .brand small { color: var(--muted); font-size: 12px; }
.auth-card h1 { margin: 0; font-size: 30px; font-weight: 800; font-stretch: var(--wide); letter-spacing: -.02em; line-height: 1.05; }
.auth-sub { margin: -6px 0 4px; color: var(--muted); font-size: 13.5px; }
.auth-card .f { display: grid; gap: 7px; font-weight: 600; font-size: 13px; }
.auth-card .field { width: 100%; padding: 11px 12px; font-size: 15px; }
.auth-err { margin: 0; min-height: 1.2em; color: var(--bad); font-size: 13px; font-weight: 600; }
.auth-err:empty { min-height: 0; margin-top: -10px; }
.auth-card .btn.primary { justify-content: center; padding: 12px; font-size: 15px; }

/* Compte connecté, en bas de la barre latérale */
.me { display: flex; align-items: center; gap: 8px; margin: 0 -8px 8px; word-break: normal; }
.me-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; color: var(--text); background: none; transition: background-color .15s; }
.me-link:hover { background: var(--siege); color: var(--text); }
.me-txt { display: grid; min-width: 0; line-height: 1.25; }
.me-txt b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-txt small { color: var(--muted); font-size: 11.5px; }
.avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent); color: #000;
  font-weight: 800; font-size: 13px; font-stretch: var(--wide); }
.avatar.sm { width: 22px; height: 22px; font-size: 10.5px; margin-right: 8px; vertical-align: -6px; background: var(--bobine); color: var(--papier); }
.btn.icon-only { padding: 7px; }

/* Page Comptes */
.form-cols.three { grid-template-columns: 1.1fr 1.3fr 1fr; }
.acc-new { margin-bottom: 18px; animation: pop .25s var(--ease) both; }
.acc-new-actions { display: flex; justify-content: flex-end; gap: 10px; }
.pw-row { display: flex; gap: 6px; }
.pw-row .field { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
table.acc td { vertical-align: middle; }
table.acc .faint { color: var(--faint); font-size: 11.5px; }
.field.sm { padding: 5px 30px 5px 9px; font-size: 13px; }
.acc-act { text-align: right; white-space: nowrap; }
.acc-act .btn { margin-left: 4px; }
.btn.danger-ghost:hover { color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.roles-help { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 22px; padding: 0 4px; font-size: 12.5px; color: var(--muted); }
.roles-help b { display: block; color: var(--text); font-size: 13px; margin-bottom: 2px; }
.creds { margin-bottom: 18px; padding: 18px 20px; border-color: var(--accent); background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--cabine); display: grid; gap: 12px; animation: pop .3s var(--ease) both; }
.creds-head { display: grid; gap: 2px; }
.creds-head span { color: var(--muted); font-size: 12.5px; }
.creds dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; font-size: 13.5px; }
.creds dt { color: var(--muted); }
.creds dd { margin: 0; font-weight: 600; word-break: break-all; }
.creds dd.pw { color: var(--accent); font-size: 15px; letter-spacing: .02em; }
.creds .btn { justify-self: start; }
.me-form { max-width: 520px; }
.me-form h3 { margin: 0; font-size: 17px; font-stretch: 112%; }

/* Page Activité : un registre de cabine, jour par jour */
.act-filters { flex-wrap: nowrap; }
.act-filters .field { min-width: 0; width: auto; }
.act-filters select.field { max-width: 200px; }
.act-filters input.field { width: 260px; }
.act-day { font-size: 13px; font-weight: 700; color: var(--muted); margin: 28px 0 8px; font-stretch: 112%; }
.act-day:first-child { margin-top: 0; }
.act { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-strong); margin-left: 6px; }
.act-row { position: relative; display: grid; grid-template-columns: 52px auto 1fr auto; align-items: baseline; gap: 14px; padding: 9px 12px 9px 20px; border-radius: 0 6px 6px 0; transition: background-color .15s; }
body:not([data-role="admin"]) .act-row { grid-template-columns: 52px 1fr; }
.act-row:hover { background: var(--siege); }
.act-row::before { content: ""; position: absolute; left: -4px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--bobine); box-shadow: 0 0 0 3px var(--ecran); }
.act-row.k-action::before { background: var(--accent); }
.act-row.k-compte::before { background: var(--papier); }
.act-row.k-securite::before { background: var(--bad); }
.act-row.k-securite .act-what { color: #ff8a83; }
.act-row time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.act-user { color: var(--text); font-weight: 600; white-space: nowrap; background: none; font-size: 13px; }
.act-user:hover { color: var(--accent); }
.act-what { min-width: 0; }
.act-detail { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.act-ip { color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.more-box { text-align: center; margin-top: 18px; }

@media (max-width: 760px) {
  .form-cols.three, .roles-help { grid-template-columns: 1fr; }
  .act-row { grid-template-columns: 44px 1fr; gap: 4px 10px; }
  .act-user, .act-what { grid-column: 2; }
  .act-ip { display: none; }
  table.acc tr { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.acc tr:first-child { display: none; }
  table.acc td { border: 0; padding: 2px 12px; }
  .acc-act { grid-column: 1 / -1; text-align: left; }
  .act-filters input.field { width: 100%; }
}
