/* CUT Home — interface web.
   Jetons repris du design system CUT (« Table de Montage »): CutColors,
   CutSpacing, CutRadius, CutTypography, CutMotion, CutMesh. Chrome quasi
   monochrome; la couleur n'existe que dans les fonds mesh des visuels de repli;
   l'halogène est l'unique accent, réservé à l'interactif.
   Structure inspirée de Plex (barre latérale, rangées, fiche, épisodes). */

:root {
  --bitume: #0e0e10;      /* fond */
  --cale: #1a1a1e;        /* surface 1 */
  --regie: #26262b;       /* surface 2, pressé */
  --poussiere: #edeae3;   /* texte principal */
  --gaffer: #8e8b84;      /* texte secondaire (≈5:1 sur bitume) */
  --halogene: #f5efdf;    /* accent unique */
  --voyant: #e5484d;      /* erreurs uniquement (traits, pastilles) */
  --voyant-text: #f2686c; /* même rouge éclairci pour le texte: 4,4:1 → 5,7:1 sur les surfaces sombres (WCAG AA) */
  --hairline: rgba(237, 234, 227, 0.08);
  --separator: rgba(237, 234, 227, 0.12);
  --focus: rgba(245, 239, 223, 0.55);
  --glass: rgba(26, 26, 30, 0.72);

  --s-xxs: 4px; --s-xs: 8px; --s-s: 12px; --s-m: 16px; --s-l: 20px;
  --s-xl: 24px; --s-xxl: 32px; --s-xxxl: 40px; --s-huge: 48px;
  --r-xs: 4px; --r-s: 8px; --r-m: 14px; --r-l: 20px; --r-xl: 28px; --r-full: 999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Voix « leader »: condensé noir, majuscules. Helvetica Neue porte ses graisses
     condensées sur macOS/iOS; Arial Narrow et Roboto Condensed prennent le relais ailleurs. */
  --font-display: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Arial Narrow", "Roboto Condensed", "Segoe UI", sans-serif;
  --ease-tap: cubic-bezier(0.2, 0.8, 0.3, 1);
  --dur-tap: 280ms;
  --dur-crossfade: 220ms;

  --side-w: 248px;
  --gutter: 32px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bitume); color: var(--poussiere);
  font: 400 15px/1.45 var(--font-sans);
  -webkit-font-smoothing: antialiased; color-scheme: dark; overflow-x: clip;
}
body.no-scroll { overflow: hidden; }
::selection { background: var(--halogene); color: var(--bitume); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--r-xs); }
main:focus { outline: none; }
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }

/* ---- Voix typographiques ---------------------------------------------- */
.leader, .carton, .title2 {
  font-family: var(--font-display); font-stretch: condensed; text-transform: uppercase; margin: 0;
}
.leader { font-weight: 900; font-size: clamp(2.4rem, 5.4vw, 4.25rem); line-height: .92; letter-spacing: -.005em; text-wrap: balance; }
.leader.long { font-size: clamp(2rem, 3.9vw, 3.1rem); }
.leader.xlong { font-size: clamp(1.6rem, 2.7vw, 2.3rem); line-height: 1; }
.carton { font-weight: 800; font-size: clamp(1.75rem, 3.2vw, 2.5rem); line-height: 1; }
.title2 { font-weight: 800; font-size: 1.2rem; line-height: 1.05; }
.etiquette {
  font-weight: 600; font-size: .75rem; line-height: 1.3;
  letter-spacing: .1em; text-transform: uppercase; color: var(--gaffer);
}
.compteur { font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.muted { color: var(--gaffer); }
.strong { font-weight: 600; }
.error-text { color: var(--voyant-text); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .8rem; overflow-wrap: anywhere; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.attribution { font-size: .75rem; color: var(--gaffer); }
.tagline { font-style: italic; color: var(--gaffer); margin-top: var(--s-xs); font-size: 1.05rem; }
.orig { display: block; margin-top: var(--s-xs); }
.match { display: flex; align-items: center; gap: var(--s-s); flex-wrap: wrap; margin-bottom: var(--s-m); }
.match button { min-height: 32px; padding: 8px 14px; }
.match-list { display: flex; flex-direction: column; max-height: 52vh; overflow: auto; }
.match-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: var(--s-m); align-items: center; padding: var(--s-s) 0; border-bottom: 1px solid var(--hairline); }
.match-row .art { border-radius: var(--r-s); }
.match-row p { color: var(--gaffer); font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: var(--s-s); align-items: end; }

/* ---- Utilitaires ------------------------------------------------------- */
.stack { display: flex; flex-direction: column; gap: var(--s-m); }
.stack.tight { gap: 6px; }
.row { display: flex; gap: var(--s-s); align-items: center; flex-wrap: wrap; }
.row.tight { gap: var(--s-xs); }
.row.end { justify-content: flex-end; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.mt { margin-top: 6px; }
.relative { position: relative; display: inline-flex; }
.scroll-x { overflow-x: auto; }
.lead { max-width: 720px; }
.grid { display: grid; gap: var(--s-m); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.section { margin-top: var(--s-xxl); }
.section > .etiquette { display: block; margin-bottom: var(--s-s); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--halogene); color: var(--bitume); padding: 8px 14px; border-radius: var(--r-full); }
.skip:focus { left: 8px; }

/* ---- Châssis ----------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; max-height: 100vh;
  width: var(--side-w); min-width: var(--side-w); max-width: var(--side-w); flex-shrink: 0;
  overflow: hidden; overflow-y: hidden;
  display: flex; flex-direction: column; gap: var(--s-xl);
  padding: var(--s-xl) var(--s-m) var(--s-l); border-right: 1px solid var(--hairline);
}
.brand { display: inline-flex; align-items: flex-end; gap: var(--s-xs); text-decoration: none; padding: 0 var(--s-s); width: fit-content; }
.brand img { width: 88px; height: auto; }
.brand .etiquette { color: var(--halogene); padding-bottom: 6px; }
.brand.compact { display: none; padding: 0; }
.brand.compact img { width: 64px; }

.nav { display: flex; flex-direction: column; gap: var(--s-l); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 0 var(--s-s); margin-bottom: 6px; }
.nav-item {
  display: flex; align-items: center; gap: var(--s-s); text-decoration: none;
  padding: 9px var(--s-s); border-radius: var(--r-full); color: var(--gaffer); font-weight: 500;
  transition: background var(--dur-crossfade), color var(--dur-crossfade);
}
.nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { background: var(--cale); color: var(--poussiere); }
.nav-item[aria-current="page"] { background: var(--regie); color: var(--halogene); }
.icon { flex: none; }

.stage { min-width: 0; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--s-m);
  padding: var(--s-s) var(--gutter);
  background: transparent; transition: background var(--dur-crossfade);
}
.shell.scrolled .top { background: rgba(14, 14, 16, 0.78); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); box-shadow: 0 1px 0 var(--hairline); }
.search-wrap { position: relative; flex: 1; max-width: 520px; }
.search {
  width: 100%; display: flex; flex-direction: row; align-items: center; gap: var(--s-xs);
  background: var(--cale); border: 1px solid var(--hairline); border-radius: var(--r-full); padding: 0 var(--s-m); color: var(--gaffer);
  transition: border-color var(--dur-crossfade), background var(--dur-crossfade);
}
.search:focus-within { border-color: var(--focus); background: var(--regie); color: var(--poussiere); }
.search-input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 0; min-height: 42px; border-radius: 0; font-size: .95rem; }
.search-input:focus { outline: none; }
.search-input::-webkit-search-cancel-button { filter: invert(.8); cursor: pointer; }
.user { margin-left: auto; position: relative; }
.user-btn {
  display: inline-flex; align-items: center; gap: var(--s-xs); text-transform: none; letter-spacing: 0;
  background: transparent; padding: 4px 12px 4px 4px; min-height: 40px; font-weight: 500; font-size: .9rem;
}
.user-btn:hover { background: var(--cale); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--halogene); color: var(--bitume); display: grid; place-items: center; font-weight: 800; font-family: var(--font-display); }
.popover {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; z-index: 10;
  background: var(--cale); border: 1px solid var(--separator); border-radius: var(--r-l); padding: var(--s-xs);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
.popover-head { padding: var(--s-s); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; border-bottom: 1px solid var(--hairline); margin-bottom: var(--s-xs); }

main { padding: var(--s-xl) var(--gutter) 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-m); margin-bottom: var(--s-xl); flex-wrap: wrap; }
.page-head .etiquette { display: block; margin-bottom: var(--s-xs); }

.busy-bar { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; pointer-events: none; opacity: 0; background: linear-gradient(90deg, transparent, var(--halogene), transparent); background-size: 40% 100%; background-repeat: no-repeat; }
.shell[data-busy] .busy-bar { opacity: 1; animation: busy 1.1s linear infinite, busy-in 0s 180ms backwards; }
@keyframes busy { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@keyframes busy-in { from { opacity: 0; } to { opacity: 0; } }

/* Rail: capsule de verre centrée en bas (écrans étroits), comme dans l'app CUT. */
.rail { display: none; }

/* ---- Surfaces ---------------------------------------------------------- */
.card { background: var(--cale); border: 1px solid var(--hairline); border-radius: var(--r-l); padding: var(--s-l); }
.card.plain { text-decoration: none; display: block; transition: background var(--dur-crossfade); }
a.card.plain:hover { background: var(--regie); }
.card.stat .value { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: var(--s-xs); }
.card.empty-line, .empty-line { color: var(--gaffer); padding: var(--s-l); }
.card.empty-line { padding: var(--s-l); }
.list { display: flex; flex-direction: column; }
.list > * { padding: var(--s-s) 0; border-bottom: 1px solid var(--hairline); }
.list > *:last-child { border-bottom: 0; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-full);
  background: var(--cale); border: 1px solid var(--hairline); font-size: .78rem; font-weight: 600; color: var(--poussiere); font-variant-numeric: tabular-nums;
}
.pill.on { background: var(--halogene); border-color: transparent; color: var(--bitume); }
.pill.bad { background: transparent; border-color: var(--voyant); color: var(--voyant-text); }
.pill.tech { background: transparent; color: var(--gaffer); font-weight: 500; }
.pills { margin: var(--s-s) 0 var(--s-m); }
.pills.tech { margin-top: calc(var(--s-xs) * -1); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gaffer); display: inline-block; flex: none; }
.dot.on { background: var(--halogene); box-shadow: 0 0 10px rgba(245, 239, 223, .5); }
.dot.bad { background: var(--voyant); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-xs); }
.chip { display: inline-flex; align-items: center; gap: var(--s-xs); background: var(--regie); border-radius: var(--r-full); padding: 6px 6px 6px 14px; min-width: 0; max-width: 100%; }
.chip.mono { padding: 6px 14px; overflow-wrap: anywhere; }
.chip button { min-height: 26px; padding: 4px 10px; }

/* ---- Contrôles --------------------------------------------------------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-xs); text-decoration: none;
  font: 600 .82rem/1 var(--font-sans); letter-spacing: .08em; text-transform: uppercase;
  border: 0; cursor: pointer; border-radius: var(--r-full); padding: 12px 20px; min-height: 40px;
  background: var(--regie); color: var(--poussiere);
  transition: transform var(--dur-tap) var(--ease-tap), opacity var(--dur-tap) var(--ease-tap), background var(--dur-crossfade), color var(--dur-crossfade);
}
button:hover, .btn:hover { background: #303036; }
button:active, .btn:active { transform: scale(.96); opacity: .82; }
button.primary, .btn.primary { background: var(--halogene); color: var(--bitume); }
button.primary:hover, .btn.primary:hover { background: #fffaee; }
button.ghost, .btn.ghost { background: transparent; border: 1px solid var(--separator); }
button.ghost:hover, .btn.ghost:hover { background: var(--cale); }
button.danger { background: transparent; color: var(--voyant-text); border: 1px solid rgba(229, 72, 77, .4); }
button.big, .btn.big { min-height: 52px; padding: 16px 28px; font-size: .88rem; }
button:disabled { opacity: .4; cursor: default; transform: none; }
.icon-btn { width: 40px; min-height: 40px; padding: 0; background: var(--cale); border: 1px solid var(--hairline); }
.icon-btn.on { background: var(--halogene); color: var(--bitume); border-color: transparent; }
.icon-btn:disabled { opacity: .3; }

label { display: flex; flex-direction: column; gap: var(--s-xs); }
label.check { flex-direction: row; align-items: flex-start; gap: var(--s-s); }
label.check input { margin-top: 1px; }
input, select {
  font: 400 15px var(--font-sans); color: var(--poussiere);
  background: var(--regie); border: 1px solid var(--hairline);
  border-radius: var(--r-m); padding: 12px 14px; min-height: 44px; width: 100%;
}
input::placeholder { color: var(--gaffer); }
input:focus, select:focus { outline: none; border-color: var(--focus); }
select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238e8b84' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
select option { background: var(--cale); color: var(--poussiere); }
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; min-height: 0; padding: 0; cursor: pointer;
  display: inline-grid; place-content: center; border-radius: 6px; background: var(--regie); border: 1px solid var(--separator);
  transition: background var(--dur-crossfade), border-color var(--dur-crossfade);
}
input[type="checkbox"]:checked { background: var(--halogene); border-color: transparent; }
input[type="checkbox"]:checked::after { content: ""; width: 10px; height: 6px; margin-top: -2px; border-left: 2px solid var(--bitume); border-bottom: 2px solid var(--bitume); transform: rotate(-45deg); }
.pill-select { width: auto; border-radius: var(--r-full); padding: 8px 38px 8px 16px; min-height: 40px; font-size: .85rem; font-weight: 600; background-color: var(--cale); background-position: right 14px center; }

.segmented { display: inline-flex; flex-shrink: 0; background: var(--cale); border: 1px solid var(--hairline); border-radius: var(--r-full); padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button { background: transparent; min-height: 34px; padding: 8px 16px; white-space: nowrap; }
.segmented button:hover { background: var(--regie); }
.segmented button[aria-pressed="true"] { background: var(--halogene); color: var(--bitume); }
.tab-count { font-size: .72rem; opacity: .7; margin-left: 4px; }
.toolbar { display: flex; align-items: center; gap: var(--s-s); flex-wrap: wrap; margin-bottom: var(--s-xl); }
.toolbar > .etiquette { margin: 0; }

/* ---- Écrans d'accès ---------------------------------------------------- */
.gate {
  min-height: 100vh; display: grid; place-items: center; padding: var(--s-xl);
  background:
    radial-gradient(90% 70% at 85% -10%, rgba(138, 74, 22, .35), transparent 60%),
    radial-gradient(80% 70% at 0% 110%, rgba(20, 40, 61, .55), transparent 70%), var(--bitume);
}
.gate-card { width: min(440px, 100%); background: var(--glass); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); border: 1px solid var(--hairline); border-radius: var(--r-xl); padding: var(--s-xxl); display: flex; flex-direction: column; gap: var(--s-xxl); }
.gate .brand { padding: 0; }
.gate .brand img { width: 120px; }

/* ---- Visuels (affiche, vignette, fond) --------------------------------- */
/* Signature mesh: 60 % sombre proche du bitume, 30 % médian, 10 % d'éclat décentré. */
.art {
  position: relative; overflow: hidden; width: 100%;
  background:
    radial-gradient(120% 90% at 88% -8%, hsl(var(--hue) 55% 38% / .85), transparent 58%),
    radial-gradient(90% 80% at 4% 108%, hsl(var(--hue) 50% 17%), transparent 70%),
    hsl(var(--hue) 45% 7%);
}
.art-poster { aspect-ratio: 2 / 3; }
.art-wide { aspect-ratio: 16 / 9; }
.art-hero, .art-backdrop { position: absolute; inset: 0; height: 100%; }
.art-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; object-position: center; transition: opacity var(--dur-crossfade); }
.art-img:not(.loaded) { opacity: 0 !important; }  /* le mesh reste visible jusqu'à l'arrivée de l'image */
.art-hero .art-img, .art-backdrop .art-img { filter: blur(30px) saturate(1.15); transform: scale(1.25); opacity: .65; }
.art-title {
  position: absolute; left: 0; right: 0; bottom: 0; padding: var(--s-m) var(--s-s) var(--s-s);
  font-family: var(--font-display); font-stretch: condensed; font-weight: 900; text-transform: uppercase;
  font-size: clamp(1.15rem, 2.2vw, 1.7rem); line-height: .95; color: var(--poussiere); text-wrap: balance;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .45);
}
/* La coupe se fait sur l'intérieur: avec le remplissage sur le même élément, une 6e ligne affleurait. */
.art-title > span { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; hyphens: auto; }
.art.sharp .art-img { filter: none; transform: none; opacity: 1; }
.art.has-img .art-title { display: none; }
/* Barre de progression sur un visuel de repli: le titre remonte pour ne pas passer dessous. */
.tile-art:has(.tile-progress) .art-title { padding-bottom: 28px; }
.art.with-mark::after { content: ""; position: absolute; inset: 0; background: url("monogram.png") center / 18% no-repeat; opacity: .18; }
.art.has-img.with-mark::after { display: none; }

/* ---- Cartes (tuiles) --------------------------------------------------- */
.tile { position: relative; display: flex; flex-direction: column; gap: var(--s-xs); min-width: 0; }
.tile-frame {
  position: relative; border-radius: var(--r-m); box-shadow: 0 0 0 1px var(--hairline);
  transition: transform var(--dur-tap) var(--ease-tap), box-shadow var(--dur-tap);
}
.tile:hover .tile-frame, .tile:focus-within .tile-frame { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--separator), 0 14px 34px rgba(0, 0, 0, .5); }
.tile:active .tile-frame { transform: scale(.975); }
.tile-art { position: relative; display: block; border-radius: inherit; overflow: hidden; background: var(--regie); }
.tile-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.85); opacity: 0; pointer-events: none;
  width: 52px; height: 52px; min-height: 0; padding: 0; border-radius: 50%;
  background: var(--halogene); color: var(--bitume); box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.tile:hover .tile-play, .tile:focus-within .tile-play { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.tile-play:hover { background: #fffaee; transform: translate(-50%, -50%) scale(1.06) !important; }
@media (hover: none) { .tile-play { display: none; } }
.tile-meta { display: flex; flex-direction: column; gap: 2px; text-decoration: none; min-width: 0; padding: 0 2px; }
.tile-title { font-weight: 600; font-size: .92rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-sub { font-size: .8rem; color: var(--gaffer); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1.1em; }
.tile-progress { position: absolute; left: 10px; right: 10px; bottom: 10px; }

.badges { position: absolute; inset: 8px 8px auto 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; pointer-events: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: var(--r-full); font-size: .72rem; font-weight: 700; }
.badge.tag { background: var(--halogene); color: var(--bitume); padding: 4px 9px 4px 7px; }
.badge.tag .etiquette { color: inherit; font-size: .62rem; }
.badge.disc { width: 24px; height: 24px; justify-content: center; background: var(--glass); backdrop-filter: blur(10px); color: var(--halogene); margin-left: auto; }
.badge.count { min-width: 24px; height: 24px; justify-content: center; padding: 0 7px; background: var(--halogene); color: var(--bitume); margin-left: auto; font-variant-numeric: tabular-nums; }
.badge.bad { border: 1px solid var(--voyant); color: var(--voyant-text); background: rgba(14, 14, 16, .8); padding: 3px 9px; }

.progress { height: 4px; background: rgba(237, 234, 227, .18); border-radius: var(--r-full); overflow: hidden; }
.progress > div { height: 100%; background: var(--halogene); transition: width .4s var(--ease-tap); }

/* ---- Rangées ----------------------------------------------------------- */
.rail-section { margin-top: var(--s-xxl); }
.rail-head { display: flex; align-items: center; gap: var(--s-m); margin-bottom: var(--s-s); }
.rail-title { margin: 0; text-decoration: none; color: var(--poussiere); }
.rail-title .etiquette { color: var(--poussiere); font-size: .8rem; }
.rail-head .rule { flex: 1; height: 1px; background: var(--hairline); }
.rail-head .icon-btn { width: 32px; min-height: 32px; }
.rail-track {
  --cols: 7; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--cols) - 1) * var(--s-m)) / var(--cols));
  gap: var(--s-m); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 6px 4px 14px; margin: -6px -4px -14px;
}
.rail-track.wide { --cols: 4; }
.rail-track::-webkit-scrollbar { display: none; }
.rail-cell { scroll-snap-align: start; min-width: 0; }
.grid-posters { display: grid; gap: var(--s-xl) var(--s-m); grid-template-columns: repeat(auto-fill, minmax(var(--tile-min, 158px), 1fr)); }
.grid-wide { display: grid; gap: var(--s-xl) var(--s-m); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.sentinel { height: 1px; }

/* ---- Héros d'accueil --------------------------------------------------- */
.hero { position: relative; border-radius: var(--r-xl); overflow: hidden; min-height: clamp(340px, 54vh, 540px); display: flex; align-items: flex-end; box-shadow: 0 0 0 1px var(--hairline); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(14, 14, 16, .92) 0%, rgba(14, 14, 16, .35) 45%, transparent 75%), linear-gradient(to right, rgba(14, 14, 16, .55), transparent 62%); }
.hero-body { position: relative; z-index: 1; padding: var(--s-xxxl); max-width: 760px; width: 100%; }
.hero-kicker { color: var(--halogene); display: block; margin-bottom: var(--s-s); }
.hero-overview { color: var(--poussiere); opacity: .86; max-width: 56ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: var(--s-l); }
.actions-row { gap: var(--s-s); }
.hero-progress { max-width: 320px; margin-top: var(--s-m); }

/* ---- Fiche ------------------------------------------------------------- */
.detail { position: relative; isolation: isolate; }
.detail-backdrop { position: absolute; z-index: -1; pointer-events: none; left: calc(var(--gutter) * -1); right: calc(var(--gutter) * -1); top: calc(var(--s-xl) * -1 - 66px); height: 540px; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 25%, transparent 100%); mask-image: linear-gradient(to bottom, #000 25%, transparent 100%); opacity: .8; }
/* Voile à gauche: une vraie image de fond (TMDb, vignette) ne doit jamais gêner la lecture du titre. */
.detail-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, rgba(14, 14, 16, .92) 0%, rgba(14, 14, 16, .6) 42%, rgba(14, 14, 16, .22) 100%); }
.detail-backdrop .art.sharp .art-img { filter: saturate(1.1) brightness(.72); }
.crumb { position: relative; z-index: 10; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px 8px 8px; min-height: 36px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: .78rem; text-decoration: none; margin-bottom: var(--s-xl); border-radius: var(--r-full); color: var(--poussiere); border: 0; }
.crumb:hover { background: var(--cale); color: var(--halogene); }
.detail-head { display: grid; grid-template-columns: minmax(150px, 240px) minmax(0, 1fr); gap: var(--s-xxl); align-items: start; }
.detail-poster { width: 100%; max-width: 240px; }
.detail-poster.wide { max-width: 380px; }
.detail-poster .art { border-radius: var(--r-l); box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px var(--separator); }
.detail-info { padding-bottom: var(--s-xs); }
.detail-info > .etiquette { display: block; margin-bottom: var(--s-xs); }
.actions { display: flex; gap: var(--s-xl); margin: var(--s-xl) 0; flex-wrap: wrap; }
.action { flex-direction: column; background: none; padding: 0; min-height: 0; gap: var(--s-xs); text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--gaffer); font-size: .8rem; }
.action:hover { background: none; color: var(--poussiere); }
.action-disc { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--cale); border: 1px solid var(--hairline); color: var(--poussiere); transition: background var(--dur-crossfade), color var(--dur-crossfade); }
.action:hover .action-disc { background: var(--regie); }
.action[aria-pressed="true"] .action-disc { background: var(--halogene); color: var(--bitume); border-color: transparent; }
.action[aria-pressed="true"] { color: var(--halogene); }
.overview { max-width: 68ch; font-size: 1.02rem; line-height: 1.55; margin-bottom: var(--s-m); }
.detail-info .chips { margin-bottom: var(--s-m); }

.episodes { display: flex; flex-direction: column; }
.ep { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: var(--s-m); align-items: center; padding: var(--s-s) 0; border-bottom: 1px solid var(--hairline); }
.ep-thumb { position: relative; display: block; padding: 0; min-height: 0; border-radius: var(--r-s); overflow: hidden; background: var(--regie); }
.ep-thumb:hover { background: var(--regie); }
.ep-num { position: absolute; left: 8px; top: 6px; font-weight: 800; font-size: .9rem; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.ep-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(14, 14, 16, .45); opacity: 0; transition: opacity var(--dur-crossfade); }
.ep-thumb:hover .ep-play, .ep-thumb:focus-visible .ep-play { opacity: 1; }
.ep-main { display: flex; flex-direction: column; gap: 3px; text-decoration: none; min-width: 0; }
.ep-title { font-weight: 600; }
.ep-main:hover .ep-title { color: var(--halogene); }

.files { margin-top: var(--s-xxl); }
.files summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: var(--s-s); padding: var(--s-s) 0; border-top: 1px solid var(--hairline); }
.files summary::-webkit-details-marker { display: none; }
.files summary::after { content: "+"; margin-left: auto; color: var(--gaffer); font-size: 1.2rem; }
.files[open] summary::after { content: "–"; }
.file-card { background: var(--cale); border: 1px solid var(--hairline); border-radius: var(--r-l); padding: var(--s-l); display: flex; flex-direction: column; gap: var(--s-xs); }
.kv { display: flex; gap: var(--s-s); align-items: baseline; flex-wrap: wrap; }
.kv .etiquette { min-width: 92px; }

/* ---- États vides, feuilles, toasts ------------------------------------ */
.empty { padding: var(--s-huge) var(--s-l); text-align: center; color: var(--gaffer); display: flex; flex-direction: column; align-items: center; gap: var(--s-m); grid-column: 1 / -1; }
.empty img { width: 48px; opacity: .45; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(14, 14, 16, .7); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); display: grid; place-items: center; padding: var(--s-xl); z-index: 40; }
.sheet { width: min(720px, 100%); max-height: 90vh; overflow: auto; background: var(--cale); border: 1px solid var(--hairline); border-radius: var(--r-xl); padding: var(--s-xxl); }
.toast { position: fixed; bottom: calc(var(--s-xl) + var(--safe-b)); left: 50%; transform: translateX(-50%); background: var(--regie); border: 1px solid var(--separator); border-radius: var(--r-full); padding: 12px 20px; z-index: 120; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.toast.bad { border-color: var(--voyant); color: var(--voyant-text); }

/* ---- Navigateur de dossiers, tableaux --------------------------------- */
.picker { border: 1px solid var(--hairline); border-radius: var(--r-l); overflow: hidden; }
.picker-head { display: flex; align-items: center; gap: var(--s-s); padding: var(--s-s) var(--s-m); background: var(--regie); }
.picker-list { max-height: 320px; overflow: auto; }
.picker-item { display: flex; align-items: center; justify-content: space-between; gap: var(--s-s); width: 100%; text-align: left; border-radius: 0; background: transparent; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .95rem; padding: var(--s-s) var(--s-m); border-bottom: 1px solid var(--hairline); }
.picker-item:hover { background: var(--regie); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 600; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gaffer); padding: var(--s-xs) var(--s-s) var(--s-xs) 0; border-bottom: 1px solid var(--separator); white-space: nowrap; }
td { padding: var(--s-s) var(--s-s) var(--s-s) 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }

/* ---- Lecteur ----------------------------------------------------------- */
.player { position: fixed; inset: 0; z-index: 100; background: #000; color: var(--poussiere); overflow: hidden; outline: none; touch-action: manipulation; }
.player.idle { cursor: none; }
.player ~ .sheet-backdrop { z-index: 110; }   /* une feuille (raccourcis) ouverte depuis le lecteur passe devant lui */
.player-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-video[data-fit="cover"] { object-fit: cover; }
.player-video[data-fit="fill"] { object-fit: fill; }
.player-video::cue { background: rgba(14, 14, 16, .78); color: var(--poussiere); font-family: var(--font-sans); font-size: 1.15em; }
/* Sous-titres: taille et fond choisis dans le menu de réglages (data-sub-size et data-sub-bg sur le lecteur). */
.player[data-sub-size="s"] .player-video::cue { font-size: .85em; }
.player[data-sub-size="l"] .player-video::cue { font-size: 1.5em; }
.player[data-sub-size="xl"] .player-video::cue { font-size: 1.9em; }
.player[data-sub-bg="none"] .player-video::cue { background: transparent; text-shadow: 0 0 3px #000, 0 0 6px #000, 0 1px 3px #000; }
.player[data-sub-bg="solid"] .player-video::cue { background: #000; }
.player-top, .player-bar { position: absolute; left: 0; right: 0; z-index: 2; transition: opacity var(--dur-crossfade); }
.player.idle .player-top, .player.idle .player-bar { opacity: 0; pointer-events: none; }
.player-top { top: 0; display: flex; align-items: center; gap: var(--s-m); padding: var(--s-l) var(--s-xl) 76px; background: linear-gradient(to bottom, rgba(0, 0, 0, .85), rgba(0, 0, 0, .55) 45%, transparent); }
.player-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.player-title strong { font-family: var(--font-display); font-stretch: condensed; text-transform: uppercase; font-weight: 800; font-size: 1.4rem; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-bar { bottom: 0; padding: var(--s-xxxl) var(--s-xl) calc(var(--s-l) + var(--safe-b)); background: linear-gradient(to top, rgba(0, 0, 0, .78), transparent); display: flex; flex-direction: column; gap: var(--s-xs); }
.seek-row { display: flex; align-items: center; gap: var(--s-m); font-size: .85rem; }
.seek-row > .compteur { min-width: 46px; }
.seek-row > .compteur:last-child { text-align: right; }
.ctl-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-m); }
.pbtn { width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 50%; background: transparent; color: var(--poussiere); }
.pbtn:hover { background: rgba(237, 234, 227, .14); }
.pbtn.main { width: 52px; height: 52px; background: var(--halogene); color: var(--bitume); }
.pbtn.main:hover { background: #fffaee; }
.pbtn.small { width: 32px; height: 32px; }
.seek { position: relative; flex: 1; height: 28px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.seek-track { position: relative; width: 100%; height: 4px; border-radius: var(--r-full); background: rgba(237, 234, 227, .22); transition: height .12s; }
.seek:hover .seek-track, .seek:focus-visible .seek-track { height: 6px; }
.seek-buf, .seek-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; width: 0; }
.seek-buf { background: rgba(237, 234, 227, .28); }
.seek-fill { background: var(--halogene); }
.seek-knob { position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--halogene); box-shadow: 0 0 12px rgba(245, 239, 223, .6); transform: scale(0); transition: transform .12s; }
.seek:hover .seek-knob, .seek:focus-visible .seek-knob { transform: scale(1); }
.seek-tip { position: absolute; bottom: 26px; transform: translateX(-50%); padding: 3px 8px; border-radius: var(--r-full); background: var(--glass); font-size: .75rem; opacity: 0; pointer-events: none; }
.seek:hover .seek-tip { opacity: 1; }
.vol { width: 88px; min-height: 0; padding: 0; border: 0; background: transparent; accent-color: var(--halogene); }
.player-status { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-m); text-align: center; padding: var(--s-xl); pointer-events: none; }
.player-status button, .player-status .row { pointer-events: auto; }
.player-status.error p { max-width: 52ch; color: var(--gaffer); }
.player-status.error { background: rgba(14, 14, 16, .88); pointer-events: auto; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(237, 234, 227, .2); border-top-color: var(--halogene); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.player-menu { position: absolute; right: 0; bottom: calc(100% + 10px); width: min(320px, calc(100vw - 2 * var(--s-m))); max-height: 60vh; overflow: auto; z-index: 5; background: var(--glass); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); border: 1px solid var(--separator); border-radius: var(--r-l); padding: var(--s-xs); }
.menu-group { padding: var(--s-xs) 0; }
.menu-group > .etiquette { display: block; padding: var(--s-xs) var(--s-s); }
.menu-item { display: flex; width: 100%; justify-content: space-between; text-align: left; background: transparent; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .9rem; padding: 10px var(--s-s); border-radius: var(--r-m); min-height: 0; }
.menu-item:hover { background: rgba(237, 234, 227, .1); }
.menu-item[aria-checked="true"] { color: var(--halogene); }
/* Menu à deux niveaux: liste des réglages (libellé, valeur, chevron), puis une page par réglage. */
.player-menu :focus-visible { outline-offset: -2px; }
.player-menu .menu-item { line-height: 1.35; }   /* sans cela, overflow:hidden rogne les jambages (g, q, p) du libellé */
.menu-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-value { display: inline-flex; align-items: center; gap: 4px; min-width: 0; margin-left: var(--s-s); color: var(--gaffer); font-size: .85rem; }
.menu-back { font-weight: 700; }
.menu-sep { height: 1px; margin: var(--s-xs) var(--s-s); background: var(--separator); }
.menu-seg, .menu-step { display: flex; gap: 4px; padding: 0 var(--s-xs) var(--s-xs); }
.menu-seg button, .menu-step button { flex: 1; min-width: 0; min-height: 38px; padding: 0 6px; border-radius: var(--r-m); background: rgba(237, 234, 227, .08); text-transform: none; letter-spacing: 0; font-weight: 600; font-size: .85rem; }
.menu-seg button:hover, .menu-step button:hover { background: rgba(237, 234, 227, .16); }
.menu-seg button[aria-checked="true"] { background: var(--halogene); color: var(--bitume); }
.menu-step .menu-step-value { flex: 1.5; background: transparent; font-variant-numeric: tabular-nums; }
/* Retour visuel d'une commande (volume, saut, vitesse), proposition de reprise, informations de lecture. */
.player-osd { position: absolute; top: 18%; left: 50%; z-index: 3; transform: translateX(-50%); display: flex; align-items: center; gap: var(--s-s); padding: 12px 20px; border-radius: var(--r-full); background: var(--glass); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .18s; }
.player-osd.show { opacity: 1; }
.player-osd[data-side="-1"] { left: 20%; }
.player-osd[data-side="1"] { left: 80%; }
.player-chip { position: absolute; left: var(--s-xl); bottom: 150px; z-index: 4; display: flex; align-items: center; gap: var(--s-s); max-width: calc(100% - 2 * var(--s-xl)); padding: 6px 6px 6px var(--s-l); border-radius: var(--r-full); background: var(--glass); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); border: 1px solid var(--separator); font-size: .9rem; }
.player-chip .ghost { min-height: 34px; padding: 8px 14px; }
.player-info { position: absolute; left: var(--s-xl); top: 96px; z-index: 3; width: min(380px, calc(100% - 2 * var(--s-xl))); max-height: calc(100% - 260px); overflow: auto; padding: var(--s-m) var(--s-l); background: var(--glass); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); border: 1px solid var(--separator); border-radius: var(--r-l); font-size: .82rem; }
.info-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-xs); }
.info-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px var(--s-m); margin: 0; }
.info-list dt { color: var(--gaffer); }
.info-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.info-reasons { display: flex; flex-direction: column; gap: 2px; }
/* Même relief que les cartes et menus de l'interface (reflet et bord lumineux), mais le fond reste assez
   opaque (--glass) pour que le texte se lise sur une image claire. */
.player-menu, .player-info, .player-chip, .player-osd { background: var(--glass-hi), var(--glass); box-shadow: var(--glass-edge), 0 18px 50px rgba(0, 0, 0, .5); }
/* Diffusion (cast.js): bouton dans la barre et panneau « Lecture sur … » qui remplace l'image pendant un Chromecast.
   Le panneau passe sous la barre du haut (fermer le lecteur reste possible, la diffusion continue); la barre du bas,
   qui pilote la vidéo locale, est masquée tant qu'il est là. */
.cast-btn.on { color: var(--halogene); }
.cast-panel { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; padding: var(--s-xl); background: rgba(0, 0, 0, .86); }
.cast-card { width: min(440px, 100%); display: grid; gap: var(--s-m); text-align: center; }
.cast-device { display: inline-flex; gap: var(--s-xs); align-items: center; justify-content: center; margin: 0; color: var(--gaffer); }
.cast-title { margin: 0; font-family: var(--font-display); font-stretch: condensed; text-transform: uppercase; font-weight: 800; font-size: 1.6rem; line-height: 1.05; }
.cast-state { margin: 0; min-height: 1.2em; color: var(--gaffer); }
.cast-row { display: flex; gap: var(--s-m); align-items: center; justify-content: center; }
.cast-timeline { gap: var(--s-s); }
.cast-seek { flex: 1; min-height: 0; padding: 0; border: 0; background: transparent; accent-color: var(--halogene); }
.cast-time { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--gaffer); white-space: nowrap; }
.pbtn.cast-play { width: 64px; height: 64px; background: var(--halogene); color: var(--bitume); }
.cast-stop { justify-self: center; }
.cast-subs { flex-wrap: wrap; gap: var(--s-s); }
.cast-sub[aria-pressed="true"] { background: var(--halogene); color: var(--bitume); }
.player:has(.cast-panel) .player-bar, .player:has(.cast-panel) .player-ends, .player:has(.cast-panel) .player-mode { display: none; }
@media (max-width: 560px) {
  .pbtn.opt, .pbtn.jump { display: none; }
  /* Écran étroit: le menu s'ancre à la barre (et non au bouton) pour ne pas déborder à gauche. */
  .settings-wrap { position: static; }
  .player-menu { right: var(--s-m); bottom: 100%; }
}

/* ---- Responsive -------------------------------------------------------- */
/* Grands écrans: plus de colonnes plutôt que des affiches géantes (les grilles s'adaptent seules). */
@media (min-width: 1900px) { .rail-track { --cols: 8; } .rail-track.wide { --cols: 5; } }
@media (min-width: 2300px) { .rail-track { --cols: 10; } .rail-track.wide { --cols: 6; } }
@media (max-width: 1280px) { .rail-track { --cols: 6; } .rail-track.wide { --cols: 3; } }
@media (max-width: 1040px) { .rail-track { --cols: 5; } }
@media (max-width: 860px) {
  :root { --gutter: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .brand.compact { display: inline-flex; }
  .top { padding: var(--s-s) var(--gutter); gap: var(--s-s); }
  .user-name { display: none; }
  .user-btn { padding: 4px; }
  main { padding: var(--s-m) var(--gutter) calc(112px + var(--safe-b)); }
  .rail {
    display: flex; position: fixed; left: 50%; bottom: calc(6px + var(--safe-b)); transform: translateX(-50%); z-index: 30; gap: 4px; padding: 7px 8px;
    border-radius: var(--r-full); background: var(--glass); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: .5px solid rgba(245, 239, 223, .14); box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  }
  .rail-item { width: 54px; height: 56px; min-height: 0; padding: 4px 0; display: grid; place-items: center; align-content: center; gap: 3px; border-radius: 22px; background: transparent; color: var(--gaffer); text-decoration: none; transition: background var(--dur-crossfade), color var(--dur-crossfade); }
  .rail-item-label { font-size: .65rem; font-weight: 500; line-height: 1.1; letter-spacing: 0; text-transform: none; }
  .rail-item[aria-current="page"], .rail-item.on { background: var(--regie); color: var(--halogene); }
  .rail-section .rail-head .row { display: none; }
  .rail-track { --cols: 2.4; }
  .rail-track.wide { --cols: 1.35; }
  .hero { min-height: 420px; border-radius: var(--r-l); }
  .hero-body { padding: var(--s-xl) var(--s-l); }
  .detail-head { grid-template-columns: 1fr; gap: var(--s-l); }
  .detail-poster { max-width: 150px; }
  .detail-backdrop { top: -60px; height: 400px; }
  .ep { grid-template-columns: 112px minmax(0, 1fr) auto; gap: var(--s-s); }
  .grid-posters { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .vol { display: none; }
  .player-top { padding: var(--s-m) var(--s-m) var(--s-xxl); }
  .player-bar { padding: var(--s-xxl) var(--s-m) calc(var(--s-m) + var(--safe-b)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .shell[data-busy] .busy-bar { opacity: .6; background: var(--halogene); }
}

/* ---- Chargement, reconnexion, transitions ------------------------------ */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
main.enter { animation: rise var(--dur-crossfade) var(--ease-tap); }
.sk { background: linear-gradient(100deg, var(--cale) 30%, var(--regie) 50%, var(--cale) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-s); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sk-hero { height: clamp(340px, 54vh, 540px); border-radius: var(--r-xl); }
.sk-line { height: 12px; border-radius: var(--r-full); margin-top: 8px; }
.sk-line.tall { height: 30px; } .sk-line.pill { height: 30px; }
.sk-line.w30 { width: 30%; } .sk-line.w40 { width: 40%; } .sk-line.w50 { width: 50%; } .sk-line.w60 { width: 60%; } .sk-line.w80 { width: 80%; } .sk-line.w90 { width: 90%; } .sk-line.w120 { width: 120px; }
.sk-art { aspect-ratio: 2 / 3; border-radius: var(--r-m); } .sk-art-wide { aspect-ratio: 16 / 9; border-radius: var(--r-m); }
.sk-card { height: 110px; border-radius: var(--r-l); }
.sk-poster { width: min(240px, 100%); }
.sk-row { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 6 * var(--s-m)) / 7); gap: var(--s-m); overflow: hidden; }
.sk-cell.wide { }
.sk-row:has(.wide) { grid-auto-columns: calc((100% - 3 * var(--s-m)) / 4); }
.offline { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: var(--s-s); padding: 8px 8px 8px 16px; border-radius: var(--r-full); background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--voyant); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.offline button { min-height: 32px; padding: 8px 14px; }

/* ---- Menus, recherche instantanée, bibliothèque ------------------------ */
.ctx-menu { position: fixed; z-index: 70; min-width: 232px; background: var(--cale); border: 1px solid var(--separator); border-radius: var(--r-l); padding: var(--s-xs); box-shadow: 0 18px 50px rgba(0, 0, 0, .6); }
.ctx-menu .menu-item { color: var(--poussiere); }
.menu-item.danger { color: var(--voyant-text); }
a.menu-item { text-decoration: none; }
.popover .menu-item { color: var(--poussiere); }
.tile-more { position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--poussiere); opacity: 0; transform: scale(.9); }
.tile:hover .tile-more, .tile:focus-within .tile-more { opacity: 1; transform: none; }
.tile-more:hover { background: var(--halogene); color: var(--bitume); }
@media (hover: none) { .tile-more { opacity: .9; transform: none; width: 44px; height: 44px; right: 4px; bottom: 4px; } }
.rail-title.link { display: inline-flex; align-items: center; gap: 6px; }
.rail-title.link .icon { transition: transform var(--dur-tap) var(--ease-tap); }
.rail-title.link:hover .icon { transform: translateX(4px); }

.suggest { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 20; background: var(--cale); border: 1px solid var(--separator); border-radius: var(--r-l); padding: var(--s-xs); box-shadow: 0 18px 50px rgba(0, 0, 0, .6); }
.suggest-item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--s-s); align-items: center; padding: 6px var(--s-xs); border-radius: var(--r-m); text-decoration: none; }
.suggest-item .strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-item:hover, .suggest-item.active { background: var(--regie); }
.suggest-art .art { border-radius: 6px; }
.suggest-all { display: block; text-align: center; padding: 10px; color: var(--gaffer); text-decoration: none; border-top: 1px solid var(--hairline); margin-top: 4px; font-size: .85rem; }
.suggest-all:hover { color: var(--poussiere); }

.size { color: var(--gaffer); flex-direction: row; flex-wrap: nowrap; }
.size-slider { width: 110px; min-height: 0; padding: 0; border: 0; background: transparent; accent-color: var(--halogene); }
.size-slider.wide { width: 220px; }
.segmented.icons button { padding: 8px 12px; }
.az { position: fixed; right: 4px; top: 50%; transform: translateY(-50%); z-index: 4; display: flex; flex-direction: column; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: var(--r-full); padding: 6px 2px; }
.az button { min-height: 0; padding: 0; width: 22px; height: 17px; font-size: .62rem; letter-spacing: 0; background: transparent; color: var(--gaffer); border-radius: var(--r-full); }
.az button:hover { background: var(--halogene); color: var(--bitume); }
.tile, .lrow { scroll-margin-top: 96px; }
.lrows { display: flex; flex-direction: column; }
.lrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 64px 80px 96px 32px auto; gap: var(--s-m); align-items: center; padding: var(--s-xs) var(--s-xs); border-bottom: 1px solid var(--hairline); border-radius: var(--r-m); }
.lrow:hover { background: var(--cale); }
.lrow-thumb { position: relative; display: block; border-radius: var(--r-xs); overflow: hidden; }
.lrow-thumb .tile-progress { left: 3px; right: 3px; bottom: 3px; }
.lrow-title { display: flex; flex-direction: column; text-decoration: none; min-width: 0; }
.lrow-title .strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow-act { justify-content: flex-end; opacity: .0; }
.lrow:hover .lrow-act, .lrow:focus-within .lrow-act { opacity: 1; }
@media (hover: none) { .lrow-act { opacity: 1; } }
.badge.inline { position: static; margin: 0; }
.badge.disc.inline { background: var(--regie); }
.pref { display: flex; align-items: center; justify-content: space-between; gap: var(--s-l); padding: var(--s-s) 0; border-bottom: 1px solid var(--hairline); }
.pref > .stack { min-width: 0; flex: 1; }
.pref:last-child { border-bottom: 0; }
.lead-col { max-width: 760px; }
.preferences-page > .page-head, .preferences-page > .lead-col { max-width: 760px; margin-inline: auto; }
.switch { position: relative; width: 48px; height: 28px; min-height: 0; padding: 0; border-radius: var(--r-full); background: var(--regie); border: 1px solid var(--separator); flex: none; }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--gaffer); transition: transform var(--dur-tap) var(--ease-tap), background var(--dur-crossfade); }
.switch[aria-checked="true"] { background: var(--halogene); border-color: transparent; }
.switch[aria-checked="true"] .switch-knob { transform: translateX(20px); background: var(--bitume); }
.collapse { min-height: 36px; width: 36px; padding: 0; background: transparent; color: var(--gaffer); border: 1px solid var(--hairline); margin-top: auto; align-self: flex-start; }
.collapse:hover { color: var(--poussiere); }
.player-ends { color: var(--poussiere); opacity: .75; font-size: .85rem; white-space: nowrap; }
.next-card { position: absolute; right: var(--s-xl); bottom: 150px; z-index: 4; width: min(380px, calc(100% - 2 * var(--s-xl))); display: flex; flex-direction: column; gap: var(--s-s); padding: var(--s-l); background: var(--glass-hi), var(--glass); box-shadow: var(--glass-edge), 0 18px 50px rgba(0, 0, 0, .5); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); border: 1px solid var(--separator); border-radius: var(--r-xl); }
.next-card strong { font-family: var(--font-display); font-stretch: condensed; text-transform: uppercase; font-size: 1.25rem; line-height: 1.05; }
.next-card .compteur { opacity: .7; }

/* Barre latérale réduite (choix de l'utilisateur) et automatique sur tablette. */
.shell.collapsed {
  --side-w: 72px;   /* la colonne ET la barre (largeur fixe): sans cela la barre de 248 px recouvrait le contenu */
  grid-template-columns: 72px minmax(0, 1fr);
}
.shell.collapsed .side { padding-inline: 12px; align-items: center; }
.shell.collapsed .brand { padding: 0; }
.shell.collapsed .brand img { width: 44px; }
.shell.collapsed .brand .etiquette, .shell.collapsed .nav-label, .shell.collapsed .nav-item span { display: none; }
.shell.collapsed .nav-item { justify-content: center; padding: 11px; }
.shell.collapsed .nav-group + .nav-group { padding-top: var(--s-s); border-top: 1px solid var(--hairline); }
.shell.collapsed .collapse { align-self: center; }


@media (max-width: 1180px) { .az { display: none; } }
@media (max-width: 860px) {
  .size { display: none; }
  .lrow { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .lrow-col, .lrow-state { display: none; }
  .search-wrap { max-width: none; }
  .next-card { bottom: 120px; right: var(--s-m); }
  .player-ends { display: none; }
  .offline { width: calc(100% - 24px); }
}

/* ==== Verre liquide, dégradés, ambiance ================================================
   Le verre = fond translucide + flou saturé + liseré spéculaire (haut et gauche plus clairs) + reflet qui suit le
   pointeur (--lx / --ly, posés par js/fx.js). Le fond d'ambiance (.ambient) lui donne quelque chose à réfracter; sa teinte
   suit le titre affiché (--ambient-h). Sans GSAP, tout reste en CSS; repli opaque sans backdrop-filter
   ou avec prefers-reduced-transparency. Les sélecteurs du lecteur (.player*, .pbtn, .menu-seg…) ne sont pas touchés. */
:root {
  --halo-grad: linear-gradient(135deg, #fffdf7 0%, #f5efdf 46%, #e2cd98 100%);
  --halo-grad-hover: linear-gradient(135deg, #ffffff 0%, #fff8e6 48%, #ecd9a6 100%);
  --halo-glow: rgba(245, 239, 223, .34);
  --glass-hi: linear-gradient(135deg, rgba(255, 255, 255, .15) 0%, rgba(255, 255, 255, .04) 36%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, .06) 100%);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .3), inset 1px 0 0 rgba(255, 255, 255, .07), inset 0 -1px 0 rgba(255, 255, 255, .04), inset 0 0 26px rgba(255, 255, 255, .03);
  --ambient-h: 38;
}

.ambient {
  position: fixed; inset: -22vmax; z-index: -1; pointer-events: none; will-change: transform;
  background:
    radial-gradient(38vmax 38vmax at 74% 18%, hsl(var(--ambient-h) 64% 48% / .32), transparent 62%),
    radial-gradient(44vmax 44vmax at 12% 92%, hsl(calc(var(--ambient-h) + 190) 58% 36% / .36), transparent 64%),
    radial-gradient(30vmax 30vmax at 58% 60%, hsl(calc(var(--ambient-h) + 100) 52% 42% / .15), transparent 70%);
}
/* Écrans d'accès: l'aurore est plus présente, la carte de verre a de quoi réfracter. */
body:has(.gate) .ambient { filter: saturate(1.5) brightness(1.55); }

/* Surfaces de verre */
.side, .card, .sheet, .gate-card { position: relative; }
.side { position: sticky; }
.side {
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015) 42%), rgba(16, 16, 20, .5);
  -webkit-backdrop-filter: blur(34px) saturate(1.7); backdrop-filter: blur(34px) saturate(1.7);
  border-right: 1px solid rgba(255, 255, 255, .07); box-shadow: inset -1px 0 0 rgba(255, 255, 255, .04), 14px 0 44px rgba(0, 0, 0, .28);
}
.shell.scrolled .top {
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)), rgba(14, 14, 18, .5);
  -webkit-backdrop-filter: blur(26px) saturate(1.8); backdrop-filter: blur(26px) saturate(1.8);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .09), 0 12px 34px rgba(0, 0, 0, .28);
}
.search {
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .04)); border-color: rgba(255, 255, 255, .11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5);
}
.search:focus-within {
  background: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .06)); border-color: rgba(245, 239, 223, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 4px rgba(245, 239, 223, .07), 0 12px 44px -8px var(--halo-glow);
}
.card {
  background: var(--glass-hi), rgba(27, 27, 33, .58); border-color: rgba(255, 255, 255, .07);
  -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: var(--glass-edge), 0 12px 34px rgba(0, 0, 0, .26);
}
.card.plain { transition: background var(--dur-crossfade), transform var(--dur-tap) var(--ease-tap), box-shadow var(--dur-tap); }
a.card.plain:hover { background: var(--glass-hi), rgba(44, 44, 52, .66); transform: translateY(-3px); box-shadow: var(--glass-edge), 0 18px 44px rgba(0, 0, 0, .38); }
.sheet {
  background: var(--glass-hi), rgba(25, 25, 31, .68); border-color: rgba(255, 255, 255, .09);
  -webkit-backdrop-filter: blur(34px) saturate(1.8); backdrop-filter: blur(34px) saturate(1.8);
  box-shadow: var(--glass-edge), 0 40px 100px rgba(0, 0, 0, .6);
}
.sheet-backdrop { background: radial-gradient(80% 60% at 50% 38%, hsl(var(--ambient-h) 40% 22% / .34), rgba(8, 8, 10, .78)); }
/* .glass: la même surface pour tout panneau qui n'en a pas déjà une (utilitaire, ex. panneaux du lecteur). */
.glass { position: relative; border: 1px solid rgba(255, 255, 255, .1); }
.popover, .ctx-menu, .suggest, .glass {
  background: var(--glass-hi), rgba(24, 24, 30, .62); border-color: rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(30px) saturate(1.9); backdrop-filter: blur(30px) saturate(1.9);
  box-shadow: var(--glass-edge), 0 24px 70px rgba(0, 0, 0, .55);
}
.toast, .offline {
  background: var(--glass-hi), rgba(26, 26, 32, .66); border-color: rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(26px) saturate(1.8); backdrop-filter: blur(26px) saturate(1.8);
  box-shadow: var(--glass-edge), 0 16px 50px rgba(0, 0, 0, .5);
}
.toast.bad, .offline { border-color: rgba(229, 72, 77, .55); }
.gate { background: none; }
.gate-card {
  background: var(--glass-hi), rgba(24, 24, 30, .58); border-color: rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(36px) saturate(1.9); backdrop-filter: blur(36px) saturate(1.9);
  box-shadow: var(--glass-edge), 0 40px 110px rgba(0, 0, 0, .55), 0 0 90px -30px hsl(var(--ambient-h) 70% 55% / .5);
}
.picker { background: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .09); }
.picker-head { background: rgba(255, 255, 255, .07); }

/* Liseré spéculaire: un anneau de 1 px dont l'éclat suit le pointeur. */
.side::before, .card::before, .sheet::before, .popover::before, .ctx-menu::before, .suggest::before, .toast::before,
.gate-card::before, .rail::before, .glass::before, .shell.scrolled .top::before {
  content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(260px circle at var(--lx, 24%) var(--ly, -30%), rgba(255, 255, 255, .6), rgba(255, 255, 255, .13) 42%, rgba(255, 255, 255, .04) 72%, transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}

/* Navigation: pastille de verre qui glisse (js/fx.js), repli sur le fond de l'élément actif sans GSAP. */
.nav, .segmented, .rail { position: relative; }
.rail { position: fixed; }
.glider { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; pointer-events: none; z-index: 0; will-change: transform, width, height; }
.nav-item, .rail-item, .segmented button { position: relative; z-index: 1; }
.nav-item:hover { background: rgba(255, 255, 255, .07); }
.nav .glider {
  border-radius: var(--r-full); background: var(--glass-hi), rgba(255, 255, 255, .12); box-shadow: var(--glass-edge), 0 8px 22px rgba(0, 0, 0, .32);
  -webkit-backdrop-filter: blur(10px) saturate(1.8); backdrop-filter: blur(10px) saturate(1.8);
}
.nav.glided .nav-item[aria-current="page"], .nav.glided .nav-item[aria-current="page"]:hover { background: transparent; }
.rail { background: var(--glass-hi), rgba(22, 22, 28, .5); -webkit-backdrop-filter: blur(30px) saturate(2); backdrop-filter: blur(30px) saturate(2); box-shadow: var(--glass-edge), 0 14px 40px rgba(0, 0, 0, .45); }
.rail .glider {
  border-radius: var(--r-full); background: var(--glass-hi), rgba(255, 255, 255, .17); box-shadow: var(--glass-edge), 0 8px 24px rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(8px) saturate(2.2); backdrop-filter: blur(8px) saturate(2.2);
}
.rail.glided .rail-item[aria-current="page"], .rail.glided .rail-item.on { background: transparent; }
.segmented {
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); border-color: rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5);
}
.segmented .glider { border-radius: var(--r-full); background: var(--halo-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 8px 22px -6px var(--halo-glow); }
.segmented.glided button[aria-pressed="true"], .segmented.glided button[aria-pressed="true"]:hover { background: transparent; }
.segmented button:hover { background: rgba(255, 255, 255, .08); }

/* Boutons, pastilles, pastilles de couleur: l'halogène devient un dégradé chaud. */
button, .btn { background-image: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 72%); }
button.primary, .btn.primary {
  position: relative; overflow: hidden; background: var(--halo-grad); color: var(--bitume);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -1px 0 rgba(0, 0, 0, .08), 0 10px 26px -8px var(--halo-glow);
  transition: transform var(--dur-tap) var(--ease-tap), opacity var(--dur-tap) var(--ease-tap), box-shadow .35s;
}
button.primary:hover, .btn.primary:hover { background: var(--halo-grad-hover); box-shadow: inset 0 1px 0 #fff, 0 16px 38px -8px rgba(245, 239, 223, .55); }
button.primary::after, .btn.primary::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-130%); transition: transform .85s var(--ease-tap);
  background: linear-gradient(105deg, transparent 36%, rgba(255, 255, 255, .75) 50%, transparent 64%);
}
button.primary:hover::after, .btn.primary:hover::after { transform: translateX(130%); }
button.primary:disabled::after { display: none; }
button.ghost, .btn.ghost {
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)); border-color: rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); -webkit-backdrop-filter: blur(12px) saturate(1.5); backdrop-filter: blur(12px) saturate(1.5);
}
button.ghost:hover, .btn.ghost:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .05)); border-color: rgba(255, 255, 255, .26); }
.icon-btn { background: linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .03)); border-color: rgba(255, 255, 255, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13); }
.icon-btn.on { background: var(--halo-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 6px 18px -6px var(--halo-glow); }
.pill { background: linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .04)); border-color: rgba(255, 255, 255, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.pill.on { background: var(--halo-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), 0 6px 16px -6px var(--halo-glow); }
.pill.tech { background: transparent; box-shadow: none; }
.pill.bad { background: transparent; box-shadow: none; }
.badge.tag, .badge.count { background: var(--halo-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 4px 12px rgba(0, 0, 0, .35); }
.badge.disc { background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .06)), rgba(20, 20, 24, .5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.avatar { background: var(--halo-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 4px 14px -4px var(--halo-glow); }
.urow.off .avatar, .device-ico { background: rgba(255, 255, 255, .08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); }
.device.current .device-ico { background: var(--halo-grad); }
.progress > div { background: linear-gradient(90deg, #d8c38c, #fffaee); box-shadow: 0 0 12px var(--halo-glow); }
.switch[aria-checked="true"] { background: var(--halo-grad); }
.action-disc { background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03)); border-color: rgba(255, 255, 255, .13); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.action:hover .action-disc { background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .06)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 10px 26px -8px var(--halo-glow); }
.action[aria-pressed="true"] .action-disc { background: var(--halo-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 10px 26px -6px var(--halo-glow); }
.tile-play { background: var(--halo-grad); box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 6px rgba(255, 255, 255, .13), inset 0 1px 0 rgba(255, 255, 255, .8); }
.az button:hover { background: var(--halo-grad); }
input, select { background-color: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
input:focus, select:focus { box-shadow: 0 0 0 4px rgba(245, 239, 223, .07); }
input[type="checkbox"]:checked { background: var(--halo-grad); }
.chip { background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .04)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); }

/* Titres: dégradé clair vers pierre. SplitText pose .splitting le temps de l'animation (pas de dégradé sur des mots masqués). */
.leader, .carton { background: linear-gradient(180deg, #fff 6%, var(--poussiere) 50%, #a9a396 135%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.leader.splitting, .carton.splitting { background: none; -webkit-text-fill-color: var(--poussiere); }

/* Héros et fiche: la lumière du titre colore l'image. */
.hero::after {
  background:
    radial-gradient(70% 90% at 100% 0%, hsl(var(--ambient-h) 70% 52% / .26), transparent 60%),
    linear-gradient(to top, rgba(14, 14, 16, .92) 0%, rgba(14, 14, 16, .35) 45%, transparent 75%),
    linear-gradient(to right, rgba(14, 14, 16, .55), transparent 62%);
}
.hero { box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 30px 90px -30px hsl(var(--ambient-h) 70% 50% / .45); }
.detail-backdrop::after {
  background: radial-gradient(60% 80% at 100% 0%, hsl(var(--ambient-h) 65% 50% / .22), transparent 60%),
    linear-gradient(to right, rgba(14, 14, 16, .92) 0%, rgba(14, 14, 16, .6) 42%, rgba(14, 14, 16, .22) 100%);
}

/* Tuiles: reflet qui suit le pointeur, lueur de la couleur du titre; l'inclinaison 3D est pilotée par GSAP (.fx). */
.tile:hover { z-index: 3; }
.tile:hover .tile-frame, .tile:focus-within .tile-frame {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .22), 0 24px 50px -10px rgba(0, 0, 0, .6), 0 18px 46px -14px hsl(var(--hue, 38) 75% 55% / .55);
}
.tile-frame::before {
  content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s; mix-blend-mode: soft-light;
  background: radial-gradient(240px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .42), rgba(255, 255, 255, .07) 45%, transparent 70%);
}
.tile:hover .tile-frame::before, .tile:focus-within .tile-frame::before { opacity: 1; }
.fx .tile-frame { transition: box-shadow var(--dur-tap) var(--ease-tap); will-change: transform; }
.fx .tile:hover .tile-frame, .fx .tile:focus-within .tile-frame, .fx .tile:active .tile-frame { transform: none; }
.fx .detail-poster .art { will-change: transform; }
.fx .drawer .sheet { animation: none; }
.fx main.enter { animation: none; }

/* Repli opaque: pas de backdrop-filter, ou transparence réduite par l'utilisateur. */
@media (prefers-reduced-transparency: reduce) {
  .side, .card, .sheet, .popover, .ctx-menu, .suggest, .toast, .offline, .gate-card, .glass, .rail, .shell.scrolled .top, .search, .segmented, button.ghost, .btn.ghost, .action-disc, .glider {
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .side, .shell.scrolled .top, .rail { background: rgb(18, 18, 22); }
  .card, .sheet, .popover, .ctx-menu, .suggest, .toast, .offline, .gate-card, .glass { background: var(--cale); }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .side, .shell.scrolled .top, .rail { background: rgb(18, 18, 22); }
  .card, .sheet, .popover, .ctx-menu, .suggest, .toast, .offline, .gate-card, .glass { background: var(--cale); }
}

/* ---- Dialogues, comptes, appareils, raccourcis -------------------------- */
.noscript { padding: var(--s-xl); }
/* Tiroir « Plus » (petits écrans): feuille ancrée en bas. */
.sheet-backdrop.drawer { place-items: end center; padding: 0; }
.drawer .sheet { width: min(560px, 100%); max-height: 88vh; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: var(--s-l) var(--s-m) calc(var(--s-xl) + var(--safe-b)); gap: var(--s-l); animation: drawer-in var(--dur-tap) var(--ease-tap); }
@keyframes drawer-in { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-item { display: flex; justify-content: flex-start; align-items: center; gap: var(--s-m); width: 100%; min-height: 48px; padding: 10px var(--s-s); border-radius: var(--r-m); background: transparent; color: var(--poussiere); text-decoration: none; text-transform: none; letter-spacing: 0; font: 500 1rem/1.2 var(--font-sans); }
.drawer-item:hover, .drawer-item[aria-current="page"] { background: var(--regie); }
.drawer-item[aria-current="page"] { color: var(--halogene); }
.drawer-foot { border-top: 1px solid var(--hairline); padding-top: var(--s-s); }
.list-plain { display: flex; flex-direction: column; }
.setup-cmd { background: var(--regie); border-radius: var(--r-m); padding: 10px 14px; user-select: all; }
.sheet.narrow { width: min(460px, 100%); }
.sheet-sub { color: var(--gaffer); margin-top: calc(var(--s-xs) * -1); }
.device { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--s-m); align-items: center; padding: var(--s-s) 0; border-bottom: 1px solid var(--hairline); }
.device:last-child { border-bottom: 0; }
.device-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--regie); color: var(--gaffer); }
.device.current .device-ico { background: var(--halogene); color: var(--bitume); }
.device-name { font-weight: 600; display: flex; align-items: center; gap: var(--s-xs); flex-wrap: wrap; }
.pw-form { display: grid; gap: var(--s-m); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.pw-form .full { grid-column: 1 / -1; }
.urow { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: var(--s-m); align-items: center; padding: var(--s-s) 0; border-bottom: 1px solid var(--hairline); }
.urow:last-child { border-bottom: 0; }
.urow .avatar { width: 40px; height: 40px; font-size: 1.05rem; }
.urow.off .avatar { background: var(--regie); color: var(--gaffer); }
.urow.off .urow-name { color: var(--gaffer); }
.urow-pills { display: flex; gap: var(--s-xs); flex-wrap: wrap; justify-content: flex-end; align-items: center; }
kbd { font: 600 .75rem/1 var(--font-sans); letter-spacing: .04em; padding: 5px 8px; min-width: 26px; text-align: center; border-radius: 7px; background: var(--regie); border: 1px solid var(--separator); border-bottom-width: 2px; color: var(--poussiere); }
.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s-xxl); }
.shortcut { display: flex; justify-content: space-between; align-items: center; gap: var(--s-m); padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.shortcut .row { flex-wrap: nowrap; }
.player-mode { min-height: 0; background: rgba(14, 14, 16, .6); font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: var(--r-full); border: 1px solid var(--separator); color: var(--poussiere); white-space: nowrap; }
.player-mode:hover, .player-mode[aria-expanded="true"] { background: rgba(237, 234, 227, .16); }
@media (max-width: 860px) {
  .pw-form { grid-template-columns: minmax(0, 1fr); }
  .shortcuts { grid-template-columns: 1fr; }
  .urow { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .urow-pills { display: none; }
  .player-mode { display: none; }
}

/* ---- Demandes (Seerr) ------------------------------------------------- */
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-full); background: var(--halogene); color: var(--bitume); font-size: .7rem; font-weight: 700; display: inline-grid; place-items: center; }
.shell.collapsed .nav-count { display: none; }
.badge.req-state { padding: 4px 9px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--poussiere); }
.badge.req-state .etiquette { color: inherit; font-size: .6rem; }
.badge.req-state.library { background: var(--halogene); color: var(--bitume); }
.badge.req-state.blocked { background: rgba(14, 14, 16, .8); border: 1px solid var(--voyant); color: var(--voyant-text); }
.req-search { display: flex; gap: var(--s-s); align-items: center; max-width: 640px; margin-bottom: var(--s-xl); }
.req-search .search { flex: 1; }
.req-search input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 0; min-height: 42px; border-radius: 0; }
.req-more { padding-top: var(--s-xl); border-top: 1px solid var(--hairline); }
.req-list { display: flex; flex-direction: column; }
.req-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: var(--s-m); align-items: center; padding: var(--s-s) 0; border-bottom: 1px solid var(--hairline); }
.req-row:last-child { border-bottom: 0; }
.req-row.fresh { box-shadow: inset 3px 0 0 var(--halogene); padding-left: var(--s-s); }
.req-thumb .art { border-radius: var(--r-s); }
.req-main a { text-decoration: none; }
.req-main a:hover { color: var(--halogene); }
.req-act { justify-content: flex-end; }
.req-progress { display: flex; align-items: center; gap: var(--s-s); margin-top: 4px; }
.req-progress .progress { width: 160px; flex: none; }
.req-progress.wide { margin: 0 0 var(--s-m); }
.req-progress.wide .progress { width: min(320px, 50%); }
.pill.req-status.available { background: var(--halogene); border-color: transparent; color: var(--bitume); }
.pill.req-status.declined, .pill.req-status.failed { background: transparent; border-color: var(--voyant); color: var(--voyant-text); }
.req-seasons { margin: var(--s-m) 0 var(--s-l); max-width: 640px; border: 1px solid var(--hairline); border-radius: var(--r-l); background: rgba(26, 26, 30, .6); overflow: hidden; }
.req-season { display: flex; flex-direction: row; align-items: center; gap: var(--s-s); padding: 11px var(--s-m); border-bottom: 1px solid var(--hairline); cursor: pointer; text-align: left; }
.req-season:last-child { border-bottom: 0; }
.req-season.head { background: rgba(255, 255, 255, .03); }
.req-season.off { cursor: default; color: var(--gaffer); }
.req-ep-toggle { min-height: 30px; padding: 4px 10px; font-size: .82rem; gap: 4px; flex: none; }
.req-ep-toggle .icon { transition: transform .18s ease; }
.req-ep-toggle.open .icon { transform: rotate(180deg); }
.req-episodes { background: rgba(0, 0, 0, .22); border-bottom: 1px solid var(--hairline); }
.req-episodes[hidden] { display: none; }
.req-episode { padding-left: calc(var(--s-m) + 26px); border-bottom-color: rgba(255, 255, 255, .04); }
.req-episode:last-child { border-bottom: 0; }
.req-ep-num { flex: none; min-width: 2.6em; }
.req-ep-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-ep-note { margin: 0; padding: 10px var(--s-m) 10px calc(var(--s-m) + 26px); }
.req-banner { display: flex; align-items: center; gap: var(--s-s); flex-wrap: wrap; margin-bottom: var(--s-xl); padding: var(--s-s) var(--s-m); border-radius: var(--r-l); background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--separator); }
.req-banner > .icon { color: var(--halogene); }
.req-links { display: flex; flex-direction: column; }
.req-link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px) auto; gap: var(--s-m); align-items: center; padding: var(--s-s) 0; border-bottom: 1px solid var(--hairline); }
.req-link:last-child { border-bottom: 0; }
@media (max-width: 860px) {
  .req-row { grid-template-columns: 48px minmax(0, 1fr); }
  .req-row > .pill, .req-act { grid-column: 2; justify-self: start; }
  .req-progress .progress { width: 110px; }
  .req-link { grid-template-columns: minmax(0, 1fr); gap: var(--s-xs); }
  .req-search { max-width: none; }
}

/* Streaming experience: content leads, navigation stays quiet. */
.shell, .shell.collapsed { display: block; --gutter: clamp(20px, 4.5vw, 88px); }
.side { display: none; }
.top {
  min-height: 80px; padding: 16px var(--gutter); gap: 32px;
  background: linear-gradient(180deg, rgba(14,14,16,.97), rgba(14,14,16,.78));
}
.brand.compact { display: inline-flex; flex: none; }
.brand.compact img { width: 76px; }
.brand.compact .etiquette { font-size: .65rem; padding-bottom: 4px; }
.streaming-nav { display: flex; gap: 28px; align-items: center; flex: 1; }
.streaming-link { display: inline-flex; align-items: center; gap: 7px; padding: 12px 0; color: var(--gaffer); text-decoration: none; font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; }
.streaming-link:hover, .streaming-link[aria-current] { color: var(--poussiere); }
.streaming-link[aria-current] { border-color: var(--halogene); }
.top .search-wrap { flex: 0 1 270px; }
.top .search { background: rgba(26,26,30,.65); }
.top .user { margin-left: 0; }
.streaming-home { padding-top: 0; }
.streaming-home .hero {
  margin: 0 calc(-1 * var(--gutter)); border-radius: 0; box-shadow: none;
  min-height: clamp(480px, 68vh, 740px); isolation: isolate;
}
.streaming-home .hero::after {
  background: linear-gradient(0deg, var(--bitume), rgba(14,14,16,.14) 55%),
    linear-gradient(90deg, rgba(14,14,16,.93), rgba(14,14,16,.45) 48%, rgba(14,14,16,.05));
}
.streaming-home .hero-body { max-width: 850px; padding: 64px var(--gutter) 62px; }
.streaming-home .hero .leader { font-size: clamp(2.7rem, 5.2vw, 5.5rem); max-width: 14ch; line-height: 1; }
.streaming-home .hero .leader.long { font-size: clamp(2.5rem, 4.5vw, 4.7rem); }
.streaming-home .hero .leader.xlong { font-size: clamp(2rem, 3.6vw, 3.8rem); }
.streaming-home .hero .pills { margin: 20px 0 16px; }
.streaming-home .hero .pill { background: transparent; border: 0; box-shadow: none; padding: 0; gap: var(--s-xs); font-size: .9rem; color: var(--poussiere); }
.streaming-home .hero .pill + .pill::before { content: '·'; color: var(--gaffer); }
.hero-overview { font-size: 1.05rem; line-height: 1.6; }
.hero .big { min-height: 48px; border-radius: 8px; padding: 12px 24px; text-transform: none; letter-spacing: 0; }
.hero-detail { color: var(--poussiere); background: transparent; border: 0; min-height: 48px; font-size: .95rem; text-transform: none; letter-spacing: 0; }
.hero-detail:hover { background: rgba(255,255,255,.08); }
.rail-section { margin-top: 38px; scroll-margin-top: 104px; }
.rail-head { margin-bottom: 16px; }
.rail-title .etiquette { text-transform: none; font-size: clamp(1.1rem, 1.5vw, 1.4rem); letter-spacing: -.02em; font-weight: 700; }
.rail-head .rule { display: none; }
.rail-ctl { margin-left: auto; }
.rail-head .icon-btn { width: 44px; min-height: 44px; }
.rail-track { gap: 20px; --cols: 6; grid-auto-columns: calc((100% - (var(--cols) - 1) * 20px) / var(--cols)); }
.rail-track.wide { --cols: 4; }
.tile-art .art, .tile-frame { border-radius: 10px; }
.tile-title { font-size: 1rem; }
.tile-sub { line-height: 1.5; }
.tile:hover .tile-frame, .tile:focus-within .tile-frame { box-shadow: 0 0 0 2px var(--halogene), 0 12px 28px rgba(0,0,0,.4); }
.universe-nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 26px; }
.universe-nav > .etiquette { margin-right: 12px; }
.universe-chip { min-height: 44px; padding: 10px 20px; border-radius: 999px; background: var(--cale); color: var(--poussiere); text-transform: none; letter-spacing: 0; font-size: .9rem; }
.universe-chip:hover { background: var(--regie); }
.detail-backdrop { height: 660px; mask-image: linear-gradient(#000 55%, transparent); -webkit-mask-image: linear-gradient(#000 55%, transparent); }
.detail-head { padding-top: 60px; align-items: end; }
.detail-head .leader { max-width: 20ch; }
.detail .overview { max-width: 66ch; line-height: 1.65; }
@media (min-width: 1900px) { .rail-track { --cols: 8; } .rail-track.wide { --cols: 5; } }
@media (max-width: 1180px) {
  .top { gap: 20px; }
  .streaming-nav { gap: 16px; }
  .streaming-link > .icon { display: none; }
  .streaming-link .nav-count { margin-left: 0; }
  .top .search-wrap { flex-basis: 190px; }
  .user-name { display: none; }
  .rail-track { --cols: 5; }
  .rail-track.wide { --cols: 3; }
}
@media (max-width: 860px) {
  .top { min-height: 68px; gap: 16px; padding: 10px var(--gutter); }
  .streaming-nav { display: none; }
  .top .search-wrap { flex: 1; max-width: none; }
  .brand.compact img { width: 56px; }
  .brand.compact .etiquette { display: none; }
  .streaming-home .hero { min-height: 510px; }
  .streaming-home .hero-body { padding: 110px var(--gutter) 34px; }
  .streaming-home .hero .leader { font-size: clamp(2.6rem, 7vw, 4rem); max-width: 16ch; }
  .hero-overview { font-size: .95rem; -webkit-line-clamp: 2; }
  .rail-track { --cols: 4; gap: 14px; grid-auto-columns: calc((100% - (var(--cols) - 1) * 14px) / var(--cols)); }
  .rail-track.wide { --cols: 2.3; }
  .detail-head { padding-top: 35px; }
}
@media (max-width: 560px) {
  .top { gap: 10px; }
  .pref { flex-wrap: wrap; gap: var(--s-s); }
  .pref > .stack { flex-basis: 100%; }
  .pref > .pill-select, .pref > .size-slider.wide { width: 100%; min-width: 0; max-width: 100%; }
  .pref > button:not(.switch) { max-width: 100%; white-space: normal; }
  .top .search-input { font-size: .85rem; }
  .streaming-home .hero { min-height: 500px; }
  .streaming-home .hero::after { background: linear-gradient(0deg, var(--bitume), rgba(14,14,16,.24) 100%), linear-gradient(90deg, rgba(14,14,16,.45), transparent); }
  .streaming-home .hero-body { padding-top: 150px; }
  .hero .actions-row { gap: 8px; }
  .hero .big { flex: 1; padding: 12px 16px; }
  .hero-detail { padding: 8px 0; }
  .rail-track { --cols: 2.55; }
  .rail-track.wide { --cols: 1.3; }
  .rail-section { margin-top: 28px; }
  .universe-nav > .etiquette { width: 100%; }
  .universe-chip { font-size: .8rem; padding-inline: 16px; }
  .detail-head { padding-top: 24px; gap: var(--s-m); }
  .detail-poster { max-width: 100px; }
  .detail-poster.wide { max-width: 180px; }
  .device { grid-template-columns: 40px minmax(0, 1fr); }
  .device > button { grid-column: 2; justify-self: start; }
}
@media (min-width: 2300px) { .rail-track { --cols: 10; } .rail-track.wide { --cols: 6; } }
.detail-head { align-items: start; }
.detail-head .leader.xlong { max-width: none; }

/* ---------------------------------------------------------------- Demandes : étape réelle, langue, bande-annonce (ADR 0008) */
.req-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 4px var(--s-s); margin: 0 0 var(--s-s); padding: 0; }
.req-steps li { display: flex; align-items: center; gap: 6px; color: var(--gaffer); font-size: .8rem; }
.req-steps li + li::before { content: ""; width: 14px; height: 1px; background: var(--hairline); margin-right: 2px; }
.req-steps li.done { color: var(--poussiere); }
.req-steps li.done .dot { background: var(--poussiere); }
.req-steps li.now { color: var(--halogene); font-weight: 600; }
.req-steps li.now .dot { background: var(--halogene); box-shadow: 0 0 10px rgba(245, 239, 223, .5); }
.req-steps li.now.bad { color: var(--voyant-text); }
.req-steps li.now.bad .dot { background: var(--voyant); box-shadow: none; }
.req-msg { color: var(--poussiere); font-size: .9rem; }
.req-msg.bad { color: var(--voyant-text); }
.req-live { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--s-s); }
.req-live:empty { display: none; }
.req-row.has-problem { box-shadow: inset 3px 0 0 var(--voyant); padding-left: var(--s-s); }
.pill.req-status.problem { background: transparent; border-color: var(--voyant); color: var(--voyant-text); }
.pill.req-status.downloading, .pill.req-status.importing, .pill.req-status.queued { border-color: var(--halogene); color: var(--halogene); }
.req-options { display: flex; flex-direction: column; gap: var(--s-s); margin: 0 0 var(--s-m); max-width: 640px; }
.req-choice .segmented.wrap { flex-wrap: wrap; overflow: visible; border-radius: var(--r-l); }
.req-choice .segmented button { min-height: 44px; }
.trailer-sheet { width: min(1100px, 100%); padding: var(--s-l); }
.trailer-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-l); overflow: hidden; background: #000; }
.trailer-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pipeline-row { display: flex; align-items: flex-start; gap: var(--s-s); padding: var(--s-s) 0; border-bottom: 1px solid var(--hairline); }
.pipeline-row:last-of-type { border-bottom: 0; }
.pipeline-row .dot { margin-top: 7px; }
.dot.warn { background: var(--halogene); opacity: .55; }
@media (max-width: 720px) {
  .req-steps li .label { display: none; }
  .req-steps li.now .label { display: inline; }
  .trailer-sheet { padding: var(--s-s); }
}
.delete-scope { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; width: 100%; padding: var(--s-s) var(--s-m); border-radius: var(--r-l); }
.delete-scope.off { opacity: .6; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.catalog-error { padding: var(--s-l) 0; }
.streaming-home .hero.compact, .streaming-home .hero:has(.art-hero:not(.has-img)) { min-height: clamp(280px, 42vh, 390px); }
.streaming-home .hero.compact .hero-body, .streaming-home .hero:has(.art-hero:not(.has-img)) .hero-body { padding-top: 48px; padding-bottom: 40px; }
@media (max-width: 860px) {
  .streaming-home .hero.compact, .streaming-home .hero:has(.art-hero:not(.has-img)) { min-height: 320px; }
}

/* ==== Marqueurs et vignettes du lecteur (js/player-markers.js) ========================
   « Passer l'intro / le générique » au-dessus de la barre, à droite, comme Plex; aperçu de
   l'image au survol de la barre de position (planche de vignettes, une case par instant). */
.skip-marker { position: absolute; right: var(--s-xl); bottom: 150px; z-index: 4; min-height: 44px; padding: 10px 22px; border-radius: var(--r-full); border: 1px solid var(--separator); background: var(--glass-hi), var(--glass); box-shadow: var(--glass-edge), 0 18px 50px rgba(0, 0, 0, .5); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.skip-marker:hover, .skip-marker:focus-visible { background: var(--glass-hi), rgba(255, 255, 255, .22); }
/* Saut automatique (mode « auto ») : le bouton se remplit pendant --auto-ms puis saute. */
.skip-marker { overflow: hidden; isolation: isolate; }
.skip-marker.auto::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(255, 255, 255, .28); transform-origin: left; transform: scaleX(0); animation: skip-fill var(--auto-ms, 5s) linear forwards; }
@keyframes skip-fill { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .skip-marker.auto::before { animation: none; transform: scaleX(1); opacity: .5; } }
.seek-thumb { position: absolute; bottom: 58px; transform: translateX(-50%); border-radius: var(--r-m, 10px); border: 1px solid var(--separator); background-color: #000; background-repeat: no-repeat; box-shadow: 0 12px 34px rgba(0, 0, 0, .55); pointer-events: none; }
.seek:not(:hover) .seek-thumb { display: none; }
@media (max-width: 860px) {
  .skip-marker { bottom: 120px; right: var(--s-m); }
  .seek-thumb { transform: translateX(-50%) scale(.75); transform-origin: bottom center; }
}

/* ==== Bibliothèque complète (js/library.js) =============================================
   Filtres et tris, fiches de personne et de collection, distribution sur la fiche. */
.filters-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; border-radius: var(--r-full); }
.filters-btn .nav-count { margin-left: 2px; }
.active-filters-box:empty { display: none; }
.active-filters { margin: calc(-1 * var(--s-m)) 0 var(--s-xl); align-items: center; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
button.ghost.small { min-height: 32px; padding: 4px 12px; font-size: .8rem; }
.filter-sheet { gap: var(--s-l); }
.filter-group { display: flex; flex-direction: column; gap: var(--s-xs); }
.filter-selects { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s-m); }
.filter-selects .pill-select { width: 100%; }
.pill.toggle { cursor: pointer; }
.pill.toggle[aria-pressed="true"] { background: var(--halo-grad, var(--halogene)); border-color: transparent; color: var(--bitume); }
.pill.toggle[aria-pressed="true"] .muted { color: inherit; opacity: .7; }
a.pill { color: inherit; text-decoration: none; }
a.pill:hover, a.pill:focus-visible { border-color: var(--halogene); }

.person-photo { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 30% 25%, hsl(var(--hue, 220) 45% 38%), hsl(var(--hue, 220) 40% 16%)); color: rgba(255, 255, 255, .85); font-weight: 700; font-size: 1.4rem; }
.person-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.person-photo.big { width: clamp(110px, 16vw, 168px); flex-shrink: 0; font-size: 2.4rem; }
.person-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: inherit; text-decoration: none; min-width: 0; padding: 4px; border-radius: var(--r-l); }
.person-card .person-photo { width: min(100%, 132px); box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .6); }
.person-card .tile-title, .person-card .tile-sub { max-width: 100%; }
.person-card:hover .person-photo, .person-card:focus-visible .person-photo { outline: 2px solid var(--halogene); outline-offset: 2px; }
.person-head { display: flex; align-items: center; gap: var(--s-xl); margin: var(--s-l) 0 var(--s-xxl); }
.people-grid { display: grid; gap: var(--s-l) var(--s-m); grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.tile-sub.role { color: var(--poussiere, inherit); }
.collection-card { color: inherit; text-decoration: none; }
.library-head > .row { min-width: 0; max-width: 100%; }
.collection-head { margin-bottom: var(--s-xxl); }
.collections-search input { flex: 1; min-width: 0; max-width: 440px; }
.collection-request { display: inline-flex; align-items: center; gap: 4px; color: var(--halogene); margin-top: 4px; }
.tile.missing { opacity: .62; color: inherit; text-decoration: none; }
.tile.missing:hover, .tile.missing:focus-visible { opacity: 1; }
.crew .kv { display: grid; grid-template-columns: 140px 1fr; gap: var(--s-s); align-items: baseline; }
.crew-names .link { color: inherit; }
.pill.rating-age { font-weight: 700; }
@media (max-width: 720px) {
  .person-head { flex-direction: column; align-items: flex-start; gap: var(--s-m); }
  .crew .kv { grid-template-columns: 1fr; gap: 2px; }
}

/* ==== Télécommande (js/remote.js) =======================================================
   « Lire sur… » d'une fiche, puis un bandeau qui pilote la TV choisie, au-dessus de tout. */
.cast-to[hidden] { display: none; }
.remote-bar { position: fixed; left: 50%; bottom: var(--s-l, 16px); transform: translateX(-50%); z-index: 60; width: min(760px, calc(100vw - 32px));
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "info controls close" "progress progress progress";
  gap: 8px 16px; align-items: center; padding: 12px 16px; border-radius: var(--r-l, 18px); border: 1px solid var(--separator);
  background: var(--glass-hi), var(--glass); box-shadow: var(--glass-edge), 0 18px 50px rgba(0, 0, 0, .5);
  backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); }
.remote-info { grid-area: info; display: flex; gap: 12px; align-items: center; min-width: 0; }
.remote-info .stack { min-width: 0; }
.remote-controls { grid-area: controls; display: flex; gap: 4px; align-items: center; }
.remote-close { grid-area: close; }
.remote-progress { grid-area: progress; display: flex; gap: 12px; align-items: center; }
.remote-seek { flex: 1; accent-color: var(--halogene, #f5c46a); }
.remote-stop { display: inline-block; width: 14px; height: 14px; border-radius: 2px; background: currentColor; }
@media (max-width: 560px) {
  .remote-bar { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info close" "controls controls" "progress progress"; }
  .remote-controls { justify-content: center; }
}

/* Foyer : sélecteur de profil, pavé PIN, historique */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: var(--s-m); }
.profile-tile { display: flex; flex-direction: column; align-items: center; gap: var(--s-xs); padding: var(--s-m) var(--s-s); border-radius: 14px; background: transparent; border: 1px solid transparent; color: inherit; cursor: pointer; }
.profile-tile:hover, .profile-tile:focus-visible { background: rgba(255, 255, 255, .06); border-color: var(--hairline); }
.profile-tile.current { border-color: var(--halogene); }
.profile-tile.locked { opacity: .45; }
.profile-avatar { width: 72px; height: 72px; font-size: 1.8rem; }
.profile-name { font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.profile-meta { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; min-height: 1em; }
.pin-sheet { align-items: center; text-align: center; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: var(--s-s) 0; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(237, 234, 227, .5); }
.pin-dot.on { background: var(--halogene); border-color: var(--halogene); }
.pin-grid { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; justify-content: center; }
.pin-key { width: 72px; height: 56px; border-radius: 12px; font-size: 1.3rem; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; justify-content: center; }
.pin-key.ghost { font-size: .85rem; }
.history { display: grid; gap: 0; }
.history-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--s-m); align-items: center; padding: var(--s-s) 0; border-bottom: 1px solid var(--hairline); color: inherit; text-decoration: none; }
.history-row:last-child { border-bottom: 0; }
.history-row .art { border-radius: 8px; overflow: hidden; }
.history-row .art-wide { width: 64px; }
.lib-picks { padding-left: var(--s-m); }
.muted.small, p.small { font-size: .82rem; }
.pbtn.repeat { position: relative; }
.pbtn.repeat[aria-pressed="true"] { color: var(--halogene); }
.repeat-one { position: absolute; right: 4px; bottom: 4px; font-size: .6rem; font-weight: 700; line-height: 1; }

/* Listes de lecture */
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s-l); }
.pl-card { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; }
.pl-mosaic { aspect-ratio: 1; border-radius: 12px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; background: rgba(255, 255, 255, .05); }
.pl-mosaic.single { grid-template-columns: 1fr; }
.pl-mosaic img { width: 100%; height: 100%; object-fit: cover; }
.pl-empty { display: grid; place-items: center; color: var(--muted, rgba(237, 234, 227, .5)); }
.pl-card:hover .pl-mosaic, .pl-card:focus-visible .pl-mosaic { outline: 2px solid var(--halogene); outline-offset: 2px; }
.pl-row { display: grid; grid-template-columns: 28px 56px minmax(0, 1fr) auto; gap: var(--s-m); align-items: center; padding: var(--s-s) 0; border-bottom: 1px solid var(--hairline); }
.pl-row:last-child { border-bottom: 0; }
.pl-art { display: block; width: 56px; border-radius: 6px; overflow: hidden; }
.pl-text { color: inherit; text-decoration: none; min-width: 0; }
.pl-n { text-align: right; }
.icon.flip { transform: rotate(180deg); }
@media (max-width: 600px) { .pl-row { grid-template-columns: 48px minmax(0, 1fr) auto; } .pl-n { display: none; } }
.sub-line { align-items: center; gap: var(--s-s); padding: 4px 0; border-bottom: 1px solid var(--hairline); }
.sub-line:last-child { border-bottom: 0; }
.sub-results { max-height: 40vh; overflow: auto; }
.preroll { position: absolute; inset: 0; z-index: 30; background: #000; display: grid; }
.preroll-video { width: 100%; height: 100%; object-fit: contain; }
.preroll-label { position: absolute; left: 24px; top: 20px; display: flex; flex-direction: column; gap: 4px; text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
.preroll-skip { position: absolute; right: 24px; bottom: 28px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.bar { flex: 1; min-width: 4px; background: var(--halogene); border-radius: 3px 3px 0 0; opacity: .85; }
.stats-table { width: 100%; border-collapse: collapse; }
.stats-table td { padding: 6px 0; border-bottom: 1px solid var(--hairline); }
.stats-table td + td { text-align: right; padding-left: var(--s-m); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.chapter-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; }
.chapter-item { display: grid !important; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; }
.chapter-item img, .chapter-noimg { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: rgba(255, 255, 255, .06); display: block; }
.chapter-item[aria-checked="true"] img { outline: 2px solid var(--halogene); outline-offset: 1px; }

/* ---------------------------------------------------------------- Profils : avatars, « Qui regarde ? », gestion */
.avatar { position: relative; overflow: hidden; border-radius: 22%; }
.avatar-portrait { position: absolute; max-width: none; object-fit: fill; pointer-events: none; }
.avatar.tinted { color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 14px -6px rgba(0, 0, 0, .6); text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.avatar-glyph { font-size: 1.05em; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; text-shadow: none; }
.profile-avatar .avatar-glyph { font-size: 2.3rem; }
.profile-tile .profile-avatar { border-radius: 22%; transition: transform .18s ease, box-shadow .18s ease; }
.profile-tile:hover .profile-avatar, .profile-tile:focus-visible .profile-avatar { transform: scale(1.06); box-shadow: 0 0 0 3px var(--halogene); }
.profile-gate { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-l); padding: var(--s-xl) 16px; text-align: center; }
.profile-gate h1 { font-size: clamp(1.8rem, 4vw, 3rem); margin: 0; }
.gate-mark { width: 56px; height: 56px; opacity: .9; }
.gate-grid { width: min(860px, 100%); grid-template-columns: repeat(auto-fit, minmax(128px, 160px)); justify-content: center; }
.gate-grid .profile-avatar { width: 112px; height: 112px; font-size: 2.6rem; }
.gate-grid .profile-avatar .avatar-glyph { font-size: 3.4rem; }
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; max-height: 310px; overflow-y: auto; padding: 4px; }
.avatar-choice { padding: 4px; border-radius: 14px; background: transparent; border: 2px solid transparent; display: grid; place-items: center; }
.avatar-choice .avatar { width: 48px; height: 48px; border-radius: 22%; }
.avatar-choice[aria-checked="true"] { border-color: var(--halogene); background: rgba(255, 255, 255, .06); }
.avatar-choice-label { font-size: .68rem; line-height: 1.3; margin-top: 4px; max-width: 100%; overflow-wrap: anywhere; }
.avatar-preview { display: flex; align-items: center; gap: var(--s-m); }
.avatar-preview .avatar { width: 64px; height: 64px; border-radius: 22%; }
.avatar-preview .avatar-glyph { font-size: 2rem; }
.avatar-filters { display: flex; flex-wrap: wrap; gap: var(--s-s); }
.avatar-filters > * { flex: 1 1 150px; min-width: 0; }
.push-left { margin-right: auto; }

/* ---------------------------------------------------------------- Notes Rotten Tomatoes */
.rt-badges { display: inline-flex; gap: 6px; text-decoration: none; color: inherit; }
.rt-pill { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; font-weight: 600; }
.rt-icon { width: 16px; height: 16px; flex: none; }
a.rt-badges:hover .rt-pill, a.rt-badges:focus-visible .rt-pill { border-color: var(--halogene); }
.size-figure { display: flex; align-items: center; gap: var(--s-s); flex-wrap: wrap; }
.size-value { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.release-name { overflow-wrap: anywhere; font-family: ui-monospace, monospace; }
.sources-sheet { width: min(900px, 100%); }
.sheet-backdrop.sources { z-index: 121; }
.source-tools { display: flex; flex-wrap: wrap; gap: var(--s-s); }
.source-tools input { flex: 1 1 230px; min-width: 0; }
.source-list { max-height: 55dvh; overflow-y: auto; }
.source-row { display: flex; align-items: center; gap: var(--s-m); padding: var(--s-m); border: 1px solid var(--hairline); border-radius: var(--r-m); }
.source-row > .grow { min-width: 0; }
.source-list > .source-row { flex-shrink: 0; }
.source-row.off { opacity: .65; }
.source-size { white-space: nowrap; }
@media (max-width: 600px) {
  .sources-sheet { padding: var(--s-m); gap: var(--s-s); }
  .source-row { flex-wrap: wrap; }
  .source-row > .grow { flex-basis: 100%; }
  .source-row button { margin-left: auto; }
  .source-tools select { width: 100%; }
}
.avatar-choice .avatar-glyph { font-size: 1.55rem; }
.user-btn .avatar-glyph, .urow .avatar-glyph { font-size: 1.15rem; }
