:root {
  /* Refonte "noir & rouge, site vidéo type YouTube" (direction hybride mobile
     retenue). L'accent est le rouge — plus de rose/violet. Les anciens
     composants (formulaires, admin) qui référencent --accent/--accent-2 se
     re-teintent donc automatiquement en rouge. */
  --bg: #050506;
  --bg-1: #08080a;
  --bg-2: #101013;
  --bg-3: #17171b;
  --surface: #131316;
  --surface-2: #1b1b20;
  --glass: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .05);
  --border: #26262e;
  --text: #f6f6f8;
  --muted: #a6a6b0;
  --text-mute: #6a6a74;
  --accent: #ff2233;        /* rouge principal (ex-rose) */
  --accent-2: #cc0000;      /* rouge profond (ex-violet) → dégradés rouge→rouge */
  --red: #ff2233;
  --red-2: #e50914;
  --red-3: #cc0000;
  --red-deep: #7a000f;
  --red-glow: rgba(255, 34, 51, .45);
  --ok: #25c469;
  --green-deep: #0d3a22;
  --warn: #fbbf24;
  --err: #ff4d4d;
  --radius: 16px;
  --radius-sm: 12px;
  --side-w: 248px;
  --topbar-h: 60px;
  --bottom-h: 64px;
  --shadow: 0 12px 34px rgba(0, 0, 0, .55);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }

/* Garantit que l'attribut HTML [hidden] masque TOUJOURS l'élément, même face
   à une règle de classe qui définit display:grid/flex/etc. (ex: .pw-del) —
   sans ça, un élément admin-only révélé/masqué via `el.hidden = ...` en JS
   peut rester visible à l'écran malgré `hidden === true`, alors que le style
   par défaut du navigateur pour [hidden] a une spécificité trop faible pour
   l'emporter sur une classe. Un seul bug ici suffit à exposer un bouton
   censé être réservé à l'admin (cas vécu : bouton supprimer visible viewer). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(229,9,20,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255,34,51,.07), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--red); color: #fff; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ─────────────── Barre supérieure ─────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px calc(14px + env(safe-area-inset-top, 0px));
  padding-top: max(14px, env(safe-area-inset-top, 0px));
  background: rgba(12, 12, 16, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand {
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 20px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand .dot { color: var(--accent); -webkit-text-fill-color: var(--accent); }
.spacer { flex: 1; }

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { background: #252531; }
.btn:active { transform: scale(.96); }
.btn-accent {
  border: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
}
.btn-ghost { background: transparent; }
.btn-danger { border-color: #4a2130; color: var(--err); background: #24141a; }

/* ─────────────── Galerie ─────────────── */
.wrap { max-width: 1200px; margin: 0 auto; padding: 16px; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(5, 1fr); } }

.tile {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .15s cubic-bezier(.2,.8,.2,1), border-color .15s ease;
}
.tile:active { transform: scale(.97); }
.tile-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.tile-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.78) 100%);
  pointer-events: none;
}
.tile-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,.38);
  border: 1.5px solid rgba(255,255,255,.85);
  display: grid; place-items: center;
  opacity: .92;
  transition: opacity .15s ease;
}
.tile-play svg { margin-left: 3px; }

/* Barre d'info en flex (pas de positionnement absolu superposé) : handle à
   gauche et badges à droite ne peuvent structurellement jamais se chevaucher,
   quelle que soit la longueur du pseudo — contrairement à l'ancien layout en
   couches empilées par coordonnées fixes. */
.tile-info {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  pointer-events: none;
}
.tile-info > * { pointer-events: auto; }
.tile-handle {
  font-size: 12px;
  font-weight: 600;
  color: #eee;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.tile-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}
.tile-badge {
  padding: 3px 7px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0,0,0,.6);
  color: #fff;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}
.tile-badge.live { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 80px 20px;
}
.empty h2 { color: var(--text); font-weight: 700; }

/* ─────────────── Lecteur (modal) ─────────────── */
.player {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0,0,0,.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top,0) 0 env(safe-area-inset-bottom,0);
}
.player.open { display: flex; }
.player video {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  background: #000;
  border-radius: 6px;
}
.player-close, .player-del {
  position: absolute;
  top: max(14px, env(safe-area-inset-top,0));
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.14);
  color: #fff;
  font-size: 20px;
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 2;
}
.player-close { right: 14px; }
.player-del { left: 14px; background: rgba(60,20,30,.7); font-size: 18px; }

/* Rail d'action façon Reels/TikTok : le like devient un gros bouton rond sur
   le bord droit du lecteur, plutôt qu'inline dans le bandeau du bas. */
.player-like-rail {
  position: absolute;
  right: 14px;
  bottom: max(96px, calc(18px + env(safe-area-inset-bottom,0) + 78px));
  z-index: 2;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.14);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: #fff;
}
.player-like-rail.liked { color: var(--accent); background: rgba(255,59,107,.16); border-color: rgba(255,59,107,.4); }
.player-like-rail.liked svg { fill: var(--accent); stroke: var(--accent); }
.player-like-rail span { font-size: 11px; font-weight: 700; }

.player-meta {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom,0));
  left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ddd;
  font-size: 13px;
  pointer-events: none;
}
.player-meta a { pointer-events: auto; color: #fff; text-decoration: underline; opacity: .85; }
.player-channel-chip {
  display: inline-flex; align-items: center; gap: 6px;
  pointer-events: auto;
}
.player-channel-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ─────────────── Like ─────────────── */
.like-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: none;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 4px;
}
.like-btn svg { transition: transform .15s ease; }
.like-btn.liked { color: var(--accent); }
.like-btn.liked svg { fill: var(--accent); stroke: var(--accent); }
.like-btn:active svg { transform: scale(1.25); }

.tile-like {
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  border-radius: 999px;
  padding: 5px 9px;
}
.tile-like.liked { color: var(--accent); }
.tile-like.liked svg { fill: var(--accent); stroke: var(--accent); }
.tile-like span { font-size: 11px; }

/* ─────────────── Login ─────────────── */
.center {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.login-logo { display: block; width: 96px; height: auto; margin: 0 auto 14px; filter: drop-shadow(0 6px 18px var(--red-glow)); }
.card h1 {
  margin: 0 0 4px;
  font-size: 26px;
  letter-spacing: -.02em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.card p.sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=password], input[type=text], textarea, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 16px; /* 16px = pas de zoom auto iOS */
  outline: none;
  transition: border-color .15s ease;
}
select { appearance: none; -webkit-appearance: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent-2); }
.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
}
.user-row .u-name { font-weight: 700; }
.user-row .u-meta { color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .role-badge {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 7px; border-radius: 6px;
}
.role-badge.admin { background: #33290c; color: var(--warn); }
.role-badge.viewer { background: #1e2740; color: #93b4ff; }
.role-badge.inactive { background: #331419; color: var(--err); }

.storage-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width .3s ease;
}
.storage-legend {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.storage-legend strong { color: var(--text); }
.dot-used, .dot-free {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}
.dot-used { background: var(--accent); }
.dot-free { background: var(--surface-2); border: 1px solid var(--border); }

/* ─────────────── Modération ─────────────── */
.mod-card { padding: 16px; }
.mod-media {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 560px) {
  .mod-media { grid-template-columns: 2fr 3fr; align-items: start; }
}

/* ─────────────── Sous-nav admin ─────────────── */
.subnav {
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(12,12,16,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  margin: -1px 0 16px; /* colle sous la topbar, pas de double bordure visible */
}
.subnav .chip { position: relative; text-decoration: none; display: inline-block; }
.badge-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(255,255,255,.25);
}

/* ─────────────── Statistiques ─────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
}
.stat-card {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 14px;
}
.stat-card .stat-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat-card .stat-value { font-size: 18px; font-weight: 800; }
/* Variante "hero" : mêmes tokens que .stat-card, en plus grand — pour les
   chiffres de synthèse en tête de page (jamais mélangée aux petits chiffres
   du détail, qui restent .stat-card telles quelles). */
.stat-grid-hero { gap: 12px; }
.stat-card-hero { padding: 18px 16px; border: 1px solid var(--border); border-radius: 14px; }
.stat-card-hero .stat-value { font-size: 32px; }
.stat-card-hero .stat-value-sub { font-size: 16px; color: var(--muted); font-weight: 600; }
.stat-card-hero .stat-value-title { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-card-hero.clickable-row:hover { border-color: var(--accent); }

/* ─────────────── Frise chronologique (vidéos regardées, avec miniature) ─────────────── */
.watch-day-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; margin: 18px 0 6px; padding-left: 58px;
}
.watch-day-label:first-child { margin-top: 0; }
.watch-item {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 0;
  border-radius: 10px; text-decoration: none; color: inherit; cursor: pointer;
}
.watch-item:hover { background: var(--surface-2); }
/* Colonne d'heure façon axe de frise — la seule info numérique en évidence,
   tout le reste (miniature, titre) vient après. */
.watch-item-time {
  width: 40px; flex-shrink: 0; text-align: right;
  font-size: 13px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.watch-item-line { position: relative; width: 20px; align-self: stretch; flex-shrink: 0; }
.watch-item-line::before {
  content: ''; position: absolute; left: 9px; top: 0; bottom: -12px; width: 2px; background: var(--border);
}
.watch-item:last-child .watch-item-line::before { display: none; }
.watch-item-dot {
  position: absolute; left: 5px; top: 50%; transform: translateY(-50%);
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-1);
}
.watch-item-thumb {
  width: 88px; height: 54px; object-fit: cover; border-radius: 8px;
  background: var(--surface-2); flex-shrink: 0;
}
.watch-item-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.watch-item-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch-item-meta { font-size: 12px; color: var(--muted); }

.online-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); margin-right: 8px; box-shadow: 0 0 6px var(--ok);
}
.clickable-row { cursor: pointer; }
.clickable-row:active { opacity: .8; }

/* ─────────────── Hub admin ─────────────── */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 560px) { .hub-grid { grid-template-columns: repeat(3, 1fr); } }
.hub-card {
  position: relative;
  display: block;
  padding: 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color .15s ease, transform .1s ease;
}
.hub-card:active { transform: scale(.98); }
.hub-card-title { font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.hub-card-desc { font-size: 12.5px; color: var(--muted); }
.hub-card-badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
}

/* ─────────────── Chips (filtres catégorie/chaîne, sélecteurs) ─────────────── */
.chips-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 4px;
}
.chip {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.chip.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* Grille de sélection (étiquetage en masse) : réutilise .tile, ajoute un état sélectionné */
.tile.selectable { cursor: pointer; }
.tile.selected { outline: 3px solid var(--accent-2); outline-offset: -3px; }
.tile-check {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.5); border: 1.5px solid rgba(255,255,255,.7);
  display: grid; place-items: center; z-index: 2;
}
.tile.selected .tile-check { background: var(--accent-2); border-color: var(--accent-2); }
.tile-check svg { opacity: 0; }
.tile.selected .tile-check svg { opacity: 1; }

.tag-bar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px)); /* au-dessus de la barre d'onglets mobile */
  z-index: 45;
  padding: 12px 16px;
  background: rgba(12,12,16,.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}
.tag-bar[hidden] { display: none; }
.tag-bar .chips-row { flex: 1; }
@media (min-width: 1024px) { .tag-bar { bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); left: var(--side-w); } }

/* Badge chaîne sur une vignette galerie */
.tile-channel {
  position: absolute;
  left: 8px; top: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  /* background définie inline en JS (couleur d'identité stable par chaîne) */
  border: 1.5px solid rgba(255,255,255,.55);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  z-index: 2;
}
.review-banner {
  display: block;
  text-align: center;
  margin-bottom: 16px;
  text-decoration: none;
}
.review-banner[hidden] { display: none; }
.btn-block { width: 100%; padding: 13px; font-size: 15px; }
.msg { font-size: 13px; margin-top: 12px; min-height: 18px; }
.msg.err { color: var(--err); }
.msg.ok { color: var(--ok); }

/* ─────────────── Admin ─────────────── */
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 18px;
}
.admin-card h2 { margin: 0 0 6px; font-size: 17px; }
.admin-card .hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }

.results { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
}
.result .tag {
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.tag.added { background: #10321f; color: var(--ok); }
.tag.skipped { background: #33290c; color: var(--warn); }
.tag.duplicate { background: #1e2740; color: #93b4ff; }
.tag.error { background: #331419; color: var(--err); }
.tag.queued { background: #20202c; color: var(--muted); }
.tag.processing { background: #241a33; color: #c4a0ff; display: inline-flex; align-items: center; gap: 6px; }
.result .u { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

.spin {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sp .7s linear infinite;
  display: inline-block;
  vertical-align: -3px;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════════════════
   REFONTE "NOIR & ROUGE" — shell type YouTube (sidebar + topbar + barre du bas)
   Injecté par shell.js sur toutes les pages. Classes préfixées .app- pour ne
   pas entrer en collision avec les composants historiques de l'admin.
   ══════════════════════════════════════════════════════════════════════════ */
svg { display: block; }
.ic { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-sm { width: 18px; height: 18px; }
.ic-lg { width: 26px; height: 26px; }

/* ---- SIDEBAR (desktop ≥1024px) ---- */
.app-sidebar {
  display: none;
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w); z-index: 40;
  background: linear-gradient(180deg, #0b0b0d, #050506);
  border-right: 1px solid var(--line);
  padding: 14px 10px 24px; overflow-y: auto;
}
.app-brand { display: flex; align-items: center; gap: 10px; padding: 8px 10px 16px; text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; flex: none;
  display: block; object-fit: contain;
  filter: drop-shadow(0 4px 12px var(--red-glow));
}
.brand-name { font-weight: 800; font-size: 21px; letter-spacing: .5px; color: var(--text); }
.brand-name b { color: var(--red); }
.brand-tag { font-size: 9px; font-weight: 800; letter-spacing: 1.5px; color: var(--red); border: 1px solid var(--red-deep); background: rgba(255,34,51,.08); padding: 2px 6px; border-radius: 6px; margin-left: auto; }

.nav-label { font-size: 11px; font-weight: 800; letter-spacing: 1.4px; color: var(--text-mute); text-transform: uppercase; padding: 14px 14px 8px; display: flex; align-items: center; gap: 8px; }
.nav-label.admin { color: var(--red); }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 12px;
  color: var(--muted); font-size: 14.5px; font-weight: 600; width: 100%; text-align: left;
  position: relative; transition: background .15s, color .15s; text-decoration: none; cursor: pointer;
  border: none; background: none;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, rgba(255,34,51,.16), rgba(255,34,51,.03)); color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 20%; bottom: 20%; width: 3px; border-radius: 3px; background: var(--red); box-shadow: 0 0 12px var(--red-glow); }
.nav-item .nav-badge { margin-left: auto; font-size: 11px; font-weight: 800; background: var(--red); color: #fff; padding: 1px 7px; border-radius: 20px; }
.nav-item .nav-badge.grey { background: #333; }
.chan-dot { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; }
.nav-sep { height: 1px; background: var(--line); margin: 12px 12px; }
.admin-box { border: 1px solid var(--red-deep); background: linear-gradient(180deg, rgba(255,34,51,.05), transparent); border-radius: 14px; padding: 6px; margin-top: 6px; }

/* ---- TOP BAR (shell) ---- */
.app-topbar {
  position: sticky; top: 0; z-index: 35; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: rgba(6,6,8,.82); backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.app-topbar .m-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.app-topbar .m-brand .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.app-topbar .m-brand .brand-name { font-size: 19px; }
.app-search {
  flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 16px; border-radius: 22px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--muted);
  transition: border-color .15s, box-shadow .15s;
}
.app-search:focus-within { border-color: var(--red-3); box-shadow: 0 0 0 3px rgba(255,34,51,.14); }
.app-search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14.5px; }
.app-search input::placeholder { color: var(--text-mute); }
.top-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); position: relative; transition: background .15s, color .15s; border: none; background: none; cursor: pointer; }
.icon-btn:hover { background: var(--bg-3); color: #fff; }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: linear-gradient(145deg, #3a3a42, #17171b); border: 1.5px solid var(--red-3); box-shadow: 0 0 14px -4px var(--red-glow); cursor: pointer; }

/* ---- MAIN column ---- */
.main { padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); min-height: 100dvh; }

/* ---- BOTTOM TAB BAR (mobile <1024px) ---- */
.app-bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: flex; align-items: stretch;
  background: rgba(8,8,10,.9); backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-top: 1px solid var(--line);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-mute); font-size: 10.5px; font-weight: 700; position: relative; transition: color .15s; text-decoration: none; border: none; background: none; cursor: pointer; }
.tab.active { color: #fff; }
.tab.active .tab-ic { color: var(--red); }
.tab.active .tab-ic svg { filter: drop-shadow(0 0 8px var(--red-glow)); }
.tab-ic { position: relative; display: grid; place-items: center; }
.tab-fab .tab-ic { width: 46px; height: 36px; border-radius: 12px; background: linear-gradient(145deg, var(--red), var(--red-3)); color: #fff; box-shadow: 0 8px 20px -8px var(--red-glow); margin-top: -6px; }
.tab.active::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 3px; border-radius: 3px; background: var(--red); box-shadow: 0 0 10px var(--red-glow); }
.tab-fab.active::before { display: none; }

/* ---- CATEGORY CHIPS (home) ---- */
.app-chips {
  position: sticky; top: var(--topbar-h); z-index: 30;
  display: flex; gap: 9px; padding: 12px 14px; overflow-x: auto; scrollbar-width: none;
  background: linear-gradient(180deg, rgba(5,5,7,.95), rgba(5,5,7,.6)); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.app-chips::-webkit-scrollbar { display: none; }
.app-chip {
  flex: none; padding: 8px 15px; border-radius: 20px; font-size: 13px; font-weight: 700; white-space: nowrap;
  background: var(--bg-3); color: var(--muted); border: 1px solid var(--line); transition: all .15s; cursor: pointer;
}
.app-chip:hover { background: var(--surface-2); color: #fff; }
.app-chip.active { background: linear-gradient(145deg, var(--red), var(--red-3)); color: #fff; border-color: transparent; box-shadow: 0 6px 18px -8px var(--red-glow); }

/* ---- Bandeau contexte (chaîne/favoris) ---- */
.ctx-banner { display: flex; align-items: center; gap: 10px; margin: 14px 14px 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.ctx-banner .ctx-clear { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-3); cursor: pointer; }

/* ---- SECTION HEAD ---- */
.sec-head { display: flex; align-items: center; gap: 10px; padding: 20px 16px 6px; }
.sec-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.sec-head .k { width: 5px; height: 18px; border-radius: 3px; background: var(--red); box-shadow: 0 0 10px var(--red-glow); }

/* ---- GRILLE VERTICALE 9:16 ---- */
.vgrid { display: grid; gap: 14px 12px; padding: 8px 14px 30px; grid-template-columns: repeat(2, 1fr); }

/* ---- Pagination (grille filtrée / "tout voir" / historique) ---- */
.pager {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px;
  padding: 6px 14px 34px;
}
.pager-nums { display: flex; align-items: center; gap: 4px; }
.pager-num, .pager-arrow {
  min-width: 34px; height: 34px; padding: 0 6px; border-radius: 10px;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.pager-num:hover, .pager-arrow:hover { background: var(--surface-2); }
.pager-num.active {
  background: linear-gradient(145deg, var(--red), var(--red-3)); color: #fff; border-color: transparent;
}
.pager-arrow:disabled { opacity: .3; cursor: default; background: var(--bg-3); }
.pager-ellipsis { color: var(--text-mute); font-size: 13px; padding: 0 2px; }
.pager-info { font-size: 12.5px; font-weight: 700; color: var(--text-mute); white-space: nowrap; }
.pager-size {
  appearance: none; -webkit-appearance: none;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  padding: 8px 30px 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a6a6b0' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px;
}
@media (min-width: 1024px) { .pager { padding: 6px 22px 40px; } }
.vcard { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.vthumb {
  position: relative; aspect-ratio: 9/16; border-radius: var(--radius); overflow: hidden;
  background: var(--g, linear-gradient(145deg, #1a1a1d, #0a0a0b)); border: 1px solid var(--line);
  transition: transform .18s, box-shadow .18s;
}
.vcard:hover .vthumb { transform: translateY(-3px); box-shadow: 0 16px 34px -18px #000, 0 0 0 1px rgba(255,34,51,.35); }
.vthumb-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.vthumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.5), transparent 45%); pointer-events: none; }
.vthumb .play-hint { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .18s; z-index: 3; }
.vcard:hover .vthumb .play-hint { opacity: 1; }
.vthumb .play-hint span { width: 52px; height: 52px; border-radius: 50%; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); }
.vthumb .play-hint span::before { content: ""; border-left: 15px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; margin-left: 4px; }
.dur { position: absolute; bottom: 8px; right: 8px; z-index: 4; font-size: 11px; font-weight: 800; background: rgba(0,0,0,.72); padding: 2px 7px; border-radius: 6px; letter-spacing: .4px; color: #fff; }
.thumb-like { position: absolute; top: 6px; right: 6px; z-index: 4; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.4); backdrop-filter: blur(4px); color: #fff; transition: transform .15s; border: none; cursor: pointer; }
.thumb-like:hover { transform: scale(1.12); }
.thumb-like.on { color: var(--red); }
.thumb-like.on svg { fill: var(--red); stroke: var(--red); }
.chan-tag { position: absolute; top: 8px; left: 8px; z-index: 4; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; border: 1.5px solid rgba(255,255,255,.55); text-shadow: 0 1px 2px rgba(0,0,0,.4); text-decoration: none; }
.vmeta { display: flex; gap: 9px; padding: 9px 2px 0; }
.chan-av { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; border: 1px solid var(--line); }
.vmeta-txt { min-width: 0; flex: 1; }
.vcard-title { font-size: 13.5px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard-sub { font-size: 12px; color: var(--text-mute); margin-top: 3px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-mute); display: inline-block; }

/* ---- LECTEUR PLEIN ÉCRAN + RAIL D'ACTIONS ---- */
.vplayer { position: fixed; inset: 0; z-index: 60; background: #000; display: none; }
.vplayer.open { display: flex; align-items: center; justify-content: center; }
.vplayer-wrap { position: relative; width: 100%; height: 100dvh; max-width: 480px; display: flex; align-items: center; justify-content: center; }
@media (min-width: 1024px) { .vplayer-wrap { height: calc(100dvh - 40px); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px -30px #000; } }
.vplayer video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.pw-back { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; z-index: 6; width: 42px; height: 42px; border-radius: 50%; background: rgba(0,0,0,.45); backdrop-filter: blur(6px); display: grid; place-items: center; border: 1px solid rgba(255,255,255,.14); color: #fff; cursor: pointer; }
.pw-del { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 62px; z-index: 6; width: 42px; height: 42px; border-radius: 50%; background: rgba(60,0,10,.55); backdrop-filter: blur(6px); display: grid; place-items: center; border: 1px solid rgba(255,255,255,.14); color: #fff; cursor: pointer; }
.pw-meta { position: absolute; left: 16px; right: 84px; bottom: max(28px, calc(env(safe-area-inset-bottom) + 20px)); z-index: 6; pointer-events: none; }
.pw-meta .chan { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pw-meta .chan .chan-dot { width: 26px; height: 26px; }
.pw-meta .chan b { font-size: 14px; font-weight: 800; color: #fff; }
.pw-meta p { font-size: 13px; line-height: 1.35; color: rgba(255,255,255,.92); text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.rail { position: absolute; right: 10px; bottom: max(28px, calc(env(safe-area-inset-bottom) + 20px)); z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.rail-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; color: #fff; border: none; background: none; cursor: pointer; }
.rail-btn .rb { width: 50px; height: 50px; border-radius: 50%; background: rgba(20,20,22,.55); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.14); display: grid; place-items: center; transition: transform .15s, background .15s; }
.rail-btn:hover .rb { transform: scale(1.08); background: rgba(40,40,44,.7); }
.rail-btn span { font-size: 11px; font-weight: 800; text-shadow: 0 1px 4px #000; }
.rail-btn.liked .rb { background: rgba(255,34,51,.18); border-color: var(--red); }
.rail-btn.liked svg { fill: var(--red); stroke: var(--red); }
.rail-btn.liked span { color: var(--red); }
.rail-btn.pop .rb, .thumb-like.pop { animation: likepop .32s ease; }
@keyframes likepop { 0% { transform: scale(1); } 40% { transform: scale(1.32); } 100% { transform: scale(1); } }

/* ---- Empty state (home) ---- */
.vempty { text-align: center; color: var(--muted); padding: 80px 20px; }
.vempty h2 { color: var(--text); font-weight: 800; margin-bottom: 6px; }

/* ---- RESPONSIVE shell ---- */
@media (min-width: 560px) { .vgrid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .vgrid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) {
  .app-sidebar { display: block; }
  .app-bottombar { display: none; }
  .main { margin-left: var(--side-w); padding-bottom: 0; }
  .app-topbar .m-brand { display: none; }
  .app-topbar { padding-left: 22px; }
  .vgrid { grid-template-columns: repeat(4, 1fr); gap: 18px 16px; padding: 10px 22px 40px; }
  .app-chips { padding: 14px 22px; }
  .sec-head { padding: 22px 24px 6px; }
  .ctx-banner { margin: 16px 22px 0; }
}
@media (min-width: 1280px) { .vgrid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1600px) { .vgrid { grid-template-columns: repeat(6, 1fr); } }

/* ---- Menu compte (dropdown topbar / barre du bas) ---- */
.app-menu {
  position: fixed; z-index: 70; min-width: 220px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 50px -20px #000, 0 0 0 1px rgba(255,255,255,.03); padding: 8px;
}
.app-menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.app-menu-name { font-weight: 800; font-size: 14px; }
.app-menu-role { font-size: 11.5px; color: var(--text-mute); font-weight: 700; }
.app-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 12px; border-radius: 10px; color: var(--text); font-size: 14px; font-weight: 700; background: none; border: none; cursor: pointer; }
.app-menu-item:hover { background: var(--bg-3); color: var(--red); }

/* ══════════════════════════════════════════════════════════════════════════
   ACCUEIL EN ÉTAGÈRES — atelier navigation/IA (base "Étagères Netflix/Spotify"
   + greffes ciblées : bulle Reprendre, apparition douce au scroll, sheen au
   survol, rebond du cœur déjà présent). Voir scratchpad/redesign2/synthese2.txt.
   ══════════════════════════════════════════════════════════════════════════ */

/* ---- Mini-sommaire collant ("jump-to") ---- */
.jumpnav {
  position: sticky; top: var(--topbar-h); z-index: 30;
  display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto; scrollbar-width: none;
  background: linear-gradient(180deg, rgba(5,5,7,.95), rgba(5,5,7,.7)); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.jumpnav::-webkit-scrollbar { display: none; }
.jump-pill {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 20px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap; color: var(--muted);
  background: var(--bg-3); border: 1px solid var(--line); cursor: pointer; transition: all .15s;
}
.jump-pill:hover { color: #fff; background: var(--surface-2); }
.jump-pill.active { background: linear-gradient(145deg, var(--red), var(--red-3)); color: #fff; border-color: transparent; }
.jump-pill .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
@media (min-width: 1024px) { .jumpnav { padding: 10px 22px; } }

/* ---- Étagères horizontales ---- */
#shelves { padding-bottom: 30px; }
.shelf {
  padding-top: 6px;
  opacity: 0; transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}
.shelf.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .shelf { opacity: 1; transform: none; transition: none; } }

.shelf-head { display: flex; align-items: center; gap: 10px; padding: 18px 14px 10px; }
.shelf-head h2 { font-size: 15.5px; font-weight: 800; letter-spacing: -.1px; }
.shelf-head .k { width: 4px; height: 16px; border-radius: 3px; background: var(--red); box-shadow: 0 0 8px var(--red-glow); flex: none; }
.shelf-head .see-all { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.shelf-head .see-all:hover { color: #fff; }
@media (min-width: 1024px) { .shelf-head { padding: 20px 22px 10px; } }

.shelf-row {
  display: flex; gap: 12px; padding: 2px 14px 6px; overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.shelf-row::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) { .shelf-row { padding: 2px 22px 6px; } }

.scard { flex: none; width: 128px; cursor: pointer; scroll-snap-align: start; -webkit-tap-highlight-color: transparent; }
@media (min-width: 640px) { .scard { width: 150px; } }
.sthumb {
  position: relative; aspect-ratio: 9/16; border-radius: 13px; overflow: hidden;
  background: var(--g, linear-gradient(145deg, #1a1a1d, #0a0a0b)); border: 1px solid var(--line);
  transition: transform .18s, box-shadow .18s;
}
.scard:hover .sthumb { transform: translateY(-3px); box-shadow: 0 14px 28px -16px #000, 0 0 0 1px rgba(255,34,51,.3); }
.sthumb-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.sthumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.5), transparent 45%); pointer-events: none; }
.sdur { position: absolute; bottom: 6px; right: 6px; z-index: 3; font-size: 10px; font-weight: 800; background: rgba(0,0,0,.72); padding: 2px 6px; border-radius: 5px; color: #fff; }
.sresume { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.25); z-index: 3; }
.sresume b { display: block; height: 100%; background: var(--red); }
.scard-title { font-size: 12px; font-weight: 700; margin-top: 7px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scard-sub { font-size: 11px; color: var(--text-mute); margin-top: 2px; }

/* ---- Sheen au survol des miniatures (greffe "Plaisir", sans blur) ---- */
.vthumb, .sthumb { position: relative; }
.vthumb::before, .sthumb::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.10) 50%, transparent 60%);
  background-size: 220% 220%; background-position: 120% -20%;
  transition: background-position .55s ease;
}
.vcard:hover .vthumb::before, .scard:hover .sthumb::before { background-position: -20% 120%; }
@media (prefers-reduced-motion: reduce) { .vthumb::before, .sthumb::before { display: none; } }

/* ---- Bulle "Reprendre" flottante ---- */
.reprendre-bubble {
  position: fixed; right: 18px; bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px) + 18px);
  z-index: 40; display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 999px;
  background: linear-gradient(145deg, var(--red), var(--red-3)); color: #fff; border: none; cursor: pointer;
  box-shadow: 0 14px 34px -10px var(--red-glow), 0 0 0 1px rgba(255,255,255,.08);
  animation: rb-in .3s ease; max-width: min(78vw, 320px);
}
@keyframes rb-in { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
.reprendre-bubble .rb-ic { width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.25); display: grid; place-items: center; flex: none; }
.reprendre-bubble .rb-ic svg { fill: #fff; stroke: #fff; width: 15px; height: 15px; margin-left: 1px; }
.reprendre-bubble .rb-txt { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; text-align: left; }
.reprendre-bubble .rb-txt b { font-size: 12px; font-weight: 800; letter-spacing: .2px; }
.reprendre-bubble .rb-txt span { font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
@media (min-width: 1024px) { .reprendre-bubble { bottom: 22px; } }

/* ---- Navigation contextuelle du lecteur (précédent/suivant) ---- */
.pw-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.4); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer;
  transition: background .15s, transform .15s;
}
.pw-nav:hover { background: rgba(0,0,0,.6); }
.pw-nav:active { transform: translateY(-50%) scale(.92); }
.pw-nav-prev { left: 12px; }
.pw-nav-next { right: 12px; }
@media (min-width: 1024px) { .pw-nav-prev { left: 18px; } .pw-nav-next { right: 18px; } }
.pw-context { font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--red); margin-bottom: 6px; text-shadow: 0 1px 6px rgba(0,0,0,.7); }

/* ---- Mode Soirée (bascule compte, persistée en localStorage) ---- */
html.evening body { filter: brightness(.86) saturate(.92); }
html.evening .red-glow, html.evening { --red-glow: rgba(255,34,51,.24); }
html.evening .app-topbar, html.evening .app-sidebar, html.evening .app-bottombar { background-color: rgba(0,0,0,.97); }

/* ---- Page chaîne enrichie (bannière + panneau admin contextualisé) ---- */
.channel-hero {
  margin: 14px 14px 0; border-radius: 18px; overflow: hidden;
  background: linear-gradient(120deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
}
.ch-hero-in { display: flex; align-items: center; gap: 14px; padding: 18px; }
.ch-hero-av {
  width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 20px; font-weight: 800; color: #fff; border: 2px solid rgba(255,255,255,.18);
  box-shadow: 0 0 22px -6px var(--red-glow);
}
.ch-hero-txt { min-width: 0; flex: 1; }
.ch-hero-txt h1 { font-size: 18px; font-weight: 800; letter-spacing: -.2px; }
.ch-hero-txt p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.ch-hero-admin { display: flex; gap: 10px; padding: 0 18px 16px; flex-wrap: wrap; }
.ch-hero-admin .stat {
  flex: 1; min-width: 120px; background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.ch-hero-admin .stat .lab { font-size: 10.5px; font-weight: 700; color: var(--text-mute); text-transform: uppercase; letter-spacing: .6px; }
.ch-hero-admin .stat .num { font-size: 17px; font-weight: 800; margin-top: 3px; }
@media (min-width: 1024px) { .channel-hero { margin: 16px 22px 0; } }

/* ---- Switch "Mode Soirée" dans le menu compte ---- */
.app-menu-item .menu-toggle {
  margin-left: auto; width: 34px; height: 20px; border-radius: 20px; flex: none;
  background: var(--bg-3); border: 1px solid var(--line); position: relative; transition: background .15s, border-color .15s;
}
.app-menu-item .menu-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #888; transition: transform .15s, background .15s;
}
.app-menu-item .menu-toggle.on { background: var(--red-deep); border-color: var(--red-3); }
.app-menu-item .menu-toggle.on::after { transform: translateX(14px); background: #fff; }

/* ---- Confirm/alert maison (fiable, remplace window.confirm/alert natifs) ---- */
.pf-dlg-overlay {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px); padding: 20px;
}
.pf-dlg {
  width: 100%; max-width: 380px; background: var(--surface, #131316); border: 1px solid var(--line, rgba(255,255,255,.08));
  border-radius: 16px; padding: 22px 20px; box-shadow: 0 30px 70px -20px #000;
}
.pf-dlg-msg { font-size: 14.5px; line-height: 1.5; color: var(--text, #f6f6f8); margin: 0 0 14px; white-space: pre-line; }
.pf-dlg-input {
  width: 100%; box-sizing: border-box; margin: 0 0 18px; padding: 11px 13px; border-radius: 10px;
  background: var(--bg-3, #17171b); border: 1px solid var(--line, rgba(255,255,255,.08));
  color: var(--text, #f6f6f8); font-size: 14.5px; font-family: inherit;
}
.pf-dlg-input:focus { outline: none; border-color: var(--red-3, #cc0000); }
.pf-dlg-actions { display: flex; justify-content: flex-end; gap: 10px; }
