/* =========================================================
   immersion.css — page Idées : sélecteur « Affichage | Immersion » (.tp-ex-view) et mode Immersion
   (views/immersion.js) : une idée à la fois, défilement vertical avec aimantation (scroll-snap), sur le fond de la page.
   Ordinateur : hauteur de la fenêtre (--imm-h, posée par le script) ; média 16:9 (Short : 9:16) le plus grand possible,
   colonne d'actions collée à sa droite, vignette + texte dessous, l'ensemble centré. Le lecteur YouTube intégré remplit
   le média ; hors survol, son interface tombe dans des bandes coupées (--imm-crop). Pendant un saut animé (.is-gliding) : pas d'aimantation (position recalée par
   le script à chaque image) ; les idées loin de la courante (.is-far) ne sont pas rendues. Téléphone (≤ 600 px) : plein
   écran par-dessus l'appli (html.tp-imm-open), une idée = 100dvh, média au centre exact de l'écran (rangées 1fr | média |
   1fr) ; vidéo longue en pleine largeur (infos et rangée d'actions dessous), Short avec ses actions à droite ; zones
   sûres respectées.
   ========================================================= */

/* ---------- Affichage | Immersion ---------- */
.tp-ex-view {
  display: flex; gap: 2px; width: max-content; margin: 0 0 8px auto; padding: 2px;
  border: 1px solid var(--tp-line); border-radius: var(--tp-radius-pill); background: var(--tp-surface);
}
.tp-ex-view__btn {
  min-height: 30px; padding: 0 14px; border: 0; border-radius: var(--tp-radius-pill); background: none; cursor: pointer;
  color: var(--tp-text-subtle); font: 600 13px/1 var(--tp-font); transition: background-color var(--tp-dur) var(--tp-ease), color var(--tp-dur) var(--tp-ease);
}
.tp-ex-view__btn:hover { color: var(--tp-text-strong); background: var(--tp-hover); }
.tp-ex-view__btn[aria-pressed="true"] { color: var(--tp-text-strong); background: var(--tp-surface-3); }
.tp-ex-view__btn:focus-visible { outline: 2px solid var(--tp-accent); outline-offset: 1px; }
.tp-explore.is-immersion > [data-hero], .tp-explore.is-immersion > [data-mode-host] { display: none; }

/* ---------- Immersion (ordinateur) ---------- */
.tp-imm { --imm-h: 640px; --imm-act-w: 72px; --imm-gap: 14px; --imm-info-h: 104px; --imm-thumb-w: 160px; position: relative; }
.tp-imm[hidden] { display: none; }
.tp-imm__back { display: none; }
.tp-imm__feed {
  position: relative; height: var(--imm-h); overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; container-type: inline-size;
  scroll-snap-type: y mandatory; scrollbar-width: none; background: var(--tp-bg); color: var(--tp-text);
}
.tp-imm__feed::-webkit-scrollbar { display: none; }
.tp-imm__feed.is-gliding { scroll-snap-type: none; }
.tp-imm__feed:focus, .tp-imm__feed:focus-visible { outline: none; } /* pas de cadre : le flux se fond dans la page */
.tp-imm__item {
  /* Média : la hauteur disponible (moins le texte dessous) donne la taille, la largeur du panneau la limite. */
  --imm-media-h: calc(var(--imm-h) - var(--imm-info-h) - 44px);
  --imm-media-w: min(calc(100cqw - 2 * (var(--imm-act-w) + var(--imm-gap))), calc(var(--imm-media-h) * 16 / 9));
  position: relative; box-sizing: border-box; display: grid; grid-template-columns: var(--imm-media-w) var(--imm-act-w);
  grid-template-rows: auto auto; justify-content: center; align-content: center; gap: 12px var(--imm-gap);
  height: 100%; padding: 16px 0; scroll-snap-align: start; scroll-snap-stop: always;
}
.tp-imm__item.is-far { content-visibility: auto; }
.tp-imm__item.is-short { --imm-thumb-w: 120px; --imm-media-w: min(calc(100cqw - 2 * (var(--imm-act-w) + var(--imm-gap))), calc(var(--imm-media-h) * 9 / 16)); }
.tp-imm__item:focus { outline: none; }
.tp-imm__item.is-noped :is(.tp-imm__info, .tp-imm__actions, .tp-imm__img) { opacity: 0.35; transition: opacity var(--tp-dur-slow) var(--tp-ease); }
.tp-imm__stage {
  position: relative; grid-column: 1; grid-row: 1; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 12px; background: var(--tp-surface); user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.tp-imm__item.is-short .tp-imm__stage { aspect-ratio: 9 / 16; }
/* Miniature entière (jamais recadrée) tant que le lecteur charge. */
.tp-imm__img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.tp-imm__img--none { background: var(--tp-surface-3); }
/* Vidéo que le lecteur refuse ici après tous les essais : la miniature reste, avec ce mot et un lien vers YouTube. */
.tp-imm__na {
  position: absolute; left: 50%; bottom: 16px; max-width: calc(100% - 32px); margin: 0; padding: 8px 14px; transform: translateX(-50%);
  border-radius: 8px; background: rgba(0, 0, 0, 0.75); color: #fff; font: 500 14px/1.4 var(--tp-font); text-align: center;
}
.tp-imm__na a { color: inherit; text-decoration: underline; }
/* Ordinateur : lecteur toujours plus haut que le cadre de --imm-crop en haut et en bas (jamais redimensionné) ; YouTube
   cale la vidéo au centre (elle remplit le cadre) et pose titre, boutons et barre dans ces bandes, coupées par le cadre.
   140 px suffisent de 960 à 1440 px de large. */
.tp-imm__item { --imm-crop: 0px; }
@media (hover: hover) and (pointer: fine) {
  .tp-imm__item { --imm-crop: max(140px, calc(var(--imm-media-w) * 0.12)); }
}
.tp-imm__player {
  position: absolute; left: 0; top: calc(-1 * var(--imm-crop)); width: 100%; height: calc(100% + 2 * var(--imm-crop));
  border: 0; background: transparent; opacity: 0; pointer-events: none; transition: opacity 240ms var(--tp-ease);
}
.tp-imm__stage.is-live .tp-imm__player { opacity: 1; pointer-events: auto; }
/* Couche transparente sur la vidéo (ordinateur) : le lecteur ne reçoit jamais la souris (aucune interface YouTube) ;
   commandes de LeapViews au survol seulement. Au-dessus du lecteur, ajouté après elle. */
.tp-imm__hit { position: absolute; inset: 0; z-index: 1; display: none; cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  .tp-imm__stage.is-live .tp-imm__hit { display: block; }
}
.tp-imm__bar {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  padding: 32px 10px 6px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.65)); color: #fff; cursor: default;
  opacity: 0; transition: opacity 120ms var(--tp-ease);
}
.tp-imm__hit:hover .tp-imm__bar, .tp-imm__hit:focus-within .tp-imm__bar { opacity: 1; }
.tp-imm__track {
  position: relative; flex: 1 0 100%; height: 14px; margin-bottom: 2px; cursor: pointer; touch-action: none;
}
.tp-imm__track::before, .tp-imm__fill {
  content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.3);
  transition: height 120ms var(--tp-ease), top 120ms var(--tp-ease);
}
.tp-imm__fill { background: #f00; transform: scaleX(0); transform-origin: left; transition: transform 250ms linear, height 120ms var(--tp-ease), top 120ms var(--tp-ease); }
.tp-imm__track:hover::before, .tp-imm__track:hover .tp-imm__fill { top: 4px; height: 6px; }
.tp-imm__track:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }
.tp-imm__vbtn {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: #fff; cursor: pointer;
}
.tp-imm__vbtn:hover { background: rgba(255, 255, 255, 0.15); }
.tp-imm__vbtn:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.tp-imm__vbtn .tp-icon { width: 22px; height: 22px; }
.tp-imm__vbtn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tp-imm__time { margin: 0 8px 0 6px; font: 500 13px/1 var(--tp-font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-imm__vbtn[data-imm-act="full"] { margin-left: auto; }
/* Plein écran (bouton des commandes) : la vidéo occupe l'écran, mêmes bandes coupées. */
.tp-imm__stage:fullscreen { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; background: #000; --imm-crop: max(140px, 12vw); }
.tp-imm__burst {
  position: absolute; left: 50%; top: 50%; width: 112px; height: 112px; color: var(--tp-coral);
  opacity: 0; transform: translate(-50%, -50%) scale(0.4); pointer-events: none;
}
.tp-imm__stage.is-live .tp-imm__burst { display: none; }
.tp-imm__burst .tp-icon { width: 100%; height: 100%; fill: currentColor; stroke: none; }
.tp-imm__burst.is-on { animation: tp-imm-burst 700ms var(--tp-ease-out) both; }
@keyframes tp-imm-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  55% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.tp-imm__below { display: contents; }
.tp-imm__info {
  grid-column: 1; grid-row: 2; align-self: start; display: grid; grid-template-columns: var(--imm-thumb-w) minmax(0, 1fr);
  align-items: start; column-gap: 12px; min-width: 0;
}
.tp-imm__text { display: grid; gap: 6px; min-width: 0; }
/* Vignette (la vidéo joue : la miniature reste visible ici) ; clic = agrandie, copier / télécharger au survol. */
.tp-imm__thumb { position: relative; width: var(--imm-thumb-w); aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: var(--tp-surface); }
.tp-imm__thumbbtn { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.tp-imm__thumbbtn img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tp-imm__thumbbtn:focus-visible { outline: none; }
.tp-imm__thumb:has(.tp-imm__thumbbtn:focus-visible) { outline: 2px solid var(--tp-text-strong); outline-offset: 2px; }
.tp-imm__thumb .tp-tsave { top: 4px; right: 4px; gap: 4px; }
.tp-imm__thumb .tp-tsave__btn { width: 26px; height: 26px; }
.tp-imm__thumb .tp-tsave__btn .tp-icon { width: 14px; height: 14px; }
.tp-imm__thumb:hover .tp-tsave, .tp-imm__thumb:focus-within .tp-tsave { opacity: 1; transform: none; }
@media (hover: none) { .tp-imm__thumb .tp-tsave { display: none; } }
.tp-imm__title { margin: 0; font: 700 18px/24px var(--tp-font-display); color: var(--tp-text-strong); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tp-imm__title a { color: inherit; text-decoration: none; }
.tp-imm__title a:hover { text-decoration: underline; }
.tp-imm__channel { display: inline-flex; align-items: center; gap: 8px; width: max-content; max-width: 100%; color: var(--tp-text); font-weight: 600; font-size: 14px; text-decoration: none; }
a.tp-imm__channel:hover span { text-decoration: underline; }
.tp-imm__channel span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Ligne « ×N  vues • date » : texte simple, comme sous une carte (app.css .tp-vcard__line). */
:is(.tp-imm__info, .tp-imm__over) .tp-vcard__line { gap: 4px 8px; color: var(--tp-text-subtle); font-size: 14px; line-height: 20px; }
:is(.tp-imm__info, .tp-imm__over) .tp-vcard__line > .tp-tag:not(.tp-tag--score):not([data-action]) {
  height: auto; gap: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--tp-text-subtle);
  font-size: 14px; line-height: 20px; font-weight: 400; white-space: nowrap; animation: none;
}
:is(.tp-imm__info, .tp-imm__over) .tp-vcard__line > .tp-tag:not(.tp-tag--score) .tp-icon { display: none; }
:is(.tp-imm__info, .tp-imm__over) .tp-vcard__line > .tp-tag:not(.tp-tag--score):not([data-action]):has(+ .tp-tag:not(.tp-tag--score):not([data-action])) { margin-right: -4px; }
:is(.tp-imm__info, .tp-imm__over) .tp-vcard__line > .tp-tag:not(.tp-tag--score):not([data-action]):has(+ .tp-tag:not(.tp-tag--score):not([data-action]))::after { content: "•"; margin-left: 4px; }
:is(.tp-imm__info, .tp-imm__over) .tp-vcard__line > .tp-tag.tp-tag--score { height: 20px; padding: 0 6px; font-size: 13px; line-height: 20px; font-weight: 700; }

/* Actions collées au média, alignées sur son bas (comme sur TikTok). */
.tp-imm__actions {
  grid-column: 2; grid-row: 1; align-self: end; display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.tp-imm__act {
  display: flex; flex-direction: column; align-items: center; gap: 5px; width: var(--imm-act-w); padding: 0; border: 0; background: none;
  color: var(--tp-text); font: 600 12px/14px var(--tp-font); text-align: center; text-decoration: none; cursor: pointer;
}
.tp-imm__act > .tp-icon {
  box-sizing: content-box; width: 22px; height: 22px; padding: 13px; border-radius: 50%; background: var(--tp-surface-3);
  transition: background-color var(--tp-dur) var(--tp-ease), transform 200ms var(--tp-ease-out);
}
.tp-imm__act:hover > .tp-icon { background: var(--tp-surface-3-hover); }
.tp-imm__act:focus-visible { outline: none; }
.tp-imm__act:focus-visible > .tp-icon, .tp-imm__act--avatar:focus-visible .tp-avatar { outline: 2px solid var(--tp-text-strong); outline-offset: 2px; }
.tp-imm__act span { color: var(--tp-text-subtle); }
.tp-imm__act--avatar { display: none; }
.tp-imm__act--like[aria-pressed="true"] > .tp-icon { color: var(--tp-coral); fill: var(--tp-coral); }
.tp-imm__act[data-imm-act="sound"][aria-pressed="true"] > .tp-icon { color: var(--tp-accent); }
.tp-imm__act.is-on > .tp-icon { color: var(--tp-mint); }
.tp-imm__act.is-pop > .tp-icon { animation: tp-imm-pop 260ms var(--tp-ease-out); }
@keyframes tp-imm-pop { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }

.tp-imm__item--tail { display: flex; align-items: center; justify-content: center; }
.tp-imm__tail { display: grid; justify-items: center; gap: 12px; max-width: 420px; text-align: center; color: var(--tp-text); }
.tp-imm__tail .tp-empty { color: inherit; }
.tp-imm__end { margin: 0; color: var(--tp-text-subtle); }
.tp-imm__spin {
  width: 28px; height: 28px; border: 3px solid var(--tp-surface-3-hover); border-top-color: var(--tp-text-strong); border-radius: 50%;
  animation: tp-imm-spin 800ms linear infinite;
}
@keyframes tp-imm-spin { to { transform: rotate(360deg); } }

/* ---------- Téléphone : plein écran, façon Shorts ---------- */
@media (max-width: 600px) {
  .tp-ex-view { margin: 0 auto 10px; }
  html.tp-imm-open, html.tp-imm-open body { overflow: hidden; overscroll-behavior: none; }
  html.tp-imm-open .tp-imm { position: fixed; inset: 0; z-index: 170; background: var(--tp-bg); }
  html.tp-imm-open .tp-imm__feed { height: 100vh; height: 100dvh; }
  html.tp-imm-open .tp-imm__back {
    position: fixed; z-index: 2; top: calc(8px + env(safe-area-inset-top)); left: calc(8px + env(safe-area-inset-left));
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
    background: none; color: var(--tp-text-strong); cursor: pointer;
  }
  html.tp-imm-open .tp-imm__back .tp-icon { width: 26px; height: 26px; }
  html.tp-imm-open .tp-imm__back:focus-visible { outline: 2px solid var(--tp-text-strong); outline-offset: -2px; }
  .tp-imm { --imm-act-w: 56px; --imm-gap: 8px; --imm-thumb-w: 120px; --imm-below: 124px; }
  /* Média au centre exact de l'écran : rangées 1fr | média | 1fr ; infos et actions dans la rangée du bas. */
  .tp-imm__item, .tp-imm__item.is-short {
    height: 100vh; height: 100dvh; padding: 0; gap: 0;
    grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr); align-content: stretch;
  }
  .tp-imm__stage { grid-row: 2; }
  .tp-imm__info { column-gap: 10px; }
  .tp-imm__text { gap: 4px; }
  /* Vidéo longue : pleine largeur ; vignette + texte, puis la rangée d'actions (icônes seules), dessous. */
  .tp-imm__item:not(.is-short) { grid-template-columns: minmax(0, 1fr); }
  .tp-imm__item:not(.is-short) .tp-imm__stage { grid-column: 1; border-radius: 0; }
  .tp-imm__item:not(.is-short) .tp-imm__below {
    grid-row: 3; grid-column: 1; display: flex; flex-direction: column; gap: 14px; min-height: 0;
    padding: 12px calc(12px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(12px + env(safe-area-inset-left));
  }
  .tp-imm__item:not(.is-short) .tp-imm__actions { flex-direction: row; align-self: stretch; justify-content: space-between; align-items: center; gap: 4px; }
  .tp-imm__item:not(.is-short) .tp-imm__act { width: auto; }
  .tp-imm__item:not(.is-short) .tp-imm__act > span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  /* Short : au centre, ses actions à droite (alignées sur son bas), infos dessous. */
  .tp-imm__item.is-short {
    --imm-media-w: min(calc(100cqw - 2 * (var(--imm-act-w) + var(--imm-gap))), calc((100dvh - 2 * var(--imm-below)) * 9 / 16));
    grid-template-columns: minmax(0, 1fr) var(--imm-media-w) minmax(0, 1fr);
  }
  .tp-imm__item.is-short .tp-imm__stage { grid-column: 2; }
  /* Sur les rangées 1-2 : la colonne, plus haute que le Short, ne grandit pas la rangée du média (centre exact). */
  .tp-imm__item.is-short .tp-imm__actions { grid-row: 1 / 3; grid-column: 3; align-self: end; justify-self: start; margin-left: var(--imm-gap); }
  .tp-imm__item.is-short .tp-imm__info {
    grid-row: 3; grid-column: 1 / -1; align-self: start;
    padding: 12px calc(12px + env(safe-area-inset-right)) 0 calc(12px + env(safe-area-inset-left));
  }
  .tp-imm__title { font-size: 16px; line-height: 21px; }
  .tp-imm__channel .tp-avatar { display: none; }
  .tp-imm__channel { font-size: 15px; }
  .tp-imm__actions { gap: 12px; }
  .tp-imm__act { gap: 3px; font-size: 12px; }
  .tp-imm__act > .tp-icon { width: 24px; height: 24px; padding: 10px; }
  .tp-imm__act--avatar { display: flex; }
  .tp-imm__act--avatar .tp-avatar { width: 40px; height: 40px; }
  .tp-imm__burst { width: 96px; height: 96px; }
}
@media (max-width: 600px) and (max-height: 700px) {
  .tp-imm__actions { gap: 8px; }
  .tp-imm__act span { font-size: 11px; }
  .tp-imm__act > .tp-icon { padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .tp-imm__burst.is-on, .tp-imm__act.is-pop > .tp-icon { animation: none; }
  .tp-imm__spin { animation-duration: 2s; }
}

/* ---------- Volume : curseur dans les commandes sur la vidéo, et au survol du bouton « Son » de la colonne ---------- */
.tp-imm__vol {
  -webkit-appearance: none; appearance: none; flex: none; width: 72px; height: 4px; margin: 0 8px 0 2px; padding: 0;
  border-radius: 2px; background: linear-gradient(to right, #fff var(--imm-vol, 100%), rgba(255, 255, 255, 0.3) var(--imm-vol, 100%));
  cursor: pointer;
}
.tp-imm__vol::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
.tp-imm__vol::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
.tp-imm__vol:focus-visible { outline: 2px solid #fff; outline-offset: 5px; }
.tp-imm__soundbox { position: relative; display: flex; justify-content: center; }
.tp-imm__volpop { position: absolute; left: 100%; top: 50%; z-index: 3; display: none; padding-left: 6px; transform: translateY(-50%); }
.tp-imm__volbubble {
  display: grid; place-items: center; padding: 14px 10px; border: 1px solid var(--tp-line); border-radius: var(--tp-radius-pill);
  background: var(--tp-surface-3); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.tp-imm__vol--v {
  writing-mode: vertical-lr; direction: rtl; width: 4px; height: 96px; margin: 0;
  background: linear-gradient(to top, var(--tp-text-strong) var(--imm-vol, 100%), var(--tp-surface-3-hover) var(--imm-vol, 100%));
}
.tp-imm__vol--v::-webkit-slider-thumb { background: var(--tp-text-strong); }
.tp-imm__vol--v::-moz-range-thumb { background: var(--tp-text-strong); }
.tp-imm__vol--v:focus-visible { outline-color: var(--tp-text-strong); }
@media (hover: hover) and (pointer: fine) {
  .tp-imm__soundbox:hover .tp-imm__volpop, .tp-imm__soundbox:focus-within .tp-imm__volpop { display: block; animation: tp-imm-pop-in 120ms var(--tp-ease-out); }
}
@keyframes tp-imm-pop-in { from { opacity: 0; transform: translate(-4px, -50%); } }

/* ---------- Formats : Tout · Shorts · Vidéos longues ---------- */
.tp-imm__formats {
  display: flex; gap: 2px; width: max-content; margin: 0 auto 8px; padding: 2px;
  border: 1px solid var(--tp-line); border-radius: var(--tp-radius-pill); background: var(--tp-surface);
}
.tp-imm__fmt {
  min-height: 30px; padding: 0 14px; border: 0; border-radius: var(--tp-radius-pill); background: none; cursor: pointer;
  color: var(--tp-text-subtle); font: 600 13px/1 var(--tp-font); transition: background-color var(--tp-dur) var(--tp-ease), color var(--tp-dur) var(--tp-ease);
}
.tp-imm__fmt:hover { color: var(--tp-text-strong); background: var(--tp-hover); }
.tp-imm__fmt[aria-pressed="true"] { color: var(--tp-text-strong); background: var(--tp-surface-3); }
.tp-imm__fmt:focus-visible { outline: 2px solid var(--tp-accent); outline-offset: 1px; }

/* ---------- Mode « Shorts » : comme YouTube Shorts ---------- */
.tp-imm__over, .tp-imm__nav { display: none; }
.tp-imm.is-shorts .tp-imm__item {
  --imm-media-h: calc(var(--imm-h) - 32px);
  --imm-media-w: min(calc(100cqw - 2 * (var(--imm-act-w) + var(--imm-gap))), calc(var(--imm-media-h) * 9 / 16));
  grid-template-rows: auto;
}
.tp-imm.is-shorts .tp-imm__info { display: none; }
.tp-imm.is-shorts .tp-imm__stage { background: #000; }
/* Chaîne, titre et chiffres posés en bas de la vidéo (au-dessus des commandes ; la barre de position reste cliquable dessous). */
.tp-imm.is-shorts .tp-imm__over {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: grid; gap: 8px; padding: 56px 14px 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.62)); color: #fff; pointer-events: none;
}
.tp-imm__over a { pointer-events: auto; color: inherit; text-decoration: none; }
.tp-imm__over-ch { display: inline-flex; align-items: center; gap: 8px; width: max-content; max-width: 100%; font: 600 14px/20px var(--tp-font); }
.tp-imm__over-ch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.tp-imm__over-ch:hover span, .tp-imm__over-title a:hover { text-decoration: underline; }
.tp-imm__over-title {
  margin: 0; font: 600 15px/20px var(--tp-font); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tp-imm__over .tp-vcard__line, .tp-imm__over .tp-vcard__line > .tp-tag:not(.tp-tag--score):not([data-action]) { color: rgba(255, 255, 255, 0.85); font-size: 13px; }
/* Commandes : lecture, son, volume et temps en haut ; barre de position fine tout en bas, toujours visible. */
.tp-imm__bar--top { top: 0; bottom: auto; padding: 8px 8px 32px; background: linear-gradient(rgba(0, 0, 0, 0.55), transparent); }
.tp-imm__track--edge { position: absolute; left: 0; right: 0; bottom: -4px; z-index: 3; margin: 0; }
.tp-imm__track--edge::before, .tp-imm__track--edge .tp-imm__fill { top: 6px; height: 3px; border-radius: 0; }
.tp-imm__track--edge:hover::before, .tp-imm__track--edge:hover .tp-imm__fill { top: 4px; height: 5px; }
/* Flèches ↑ ↓ à droite, comme sur YouTube Shorts (ordinateur). */
@media (hover: hover) and (pointer: fine) {
  .tp-imm.is-shorts .tp-imm__nav {
    position: absolute; right: 8px; bottom: 50%; z-index: 2; display: flex; flex-direction: column; gap: 12px; transform: translateY(50%);
  }
}
.tp-imm__navbtn {
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  background: var(--tp-surface-3); color: var(--tp-text-strong); cursor: pointer; transition: background-color var(--tp-dur) var(--tp-ease);
}
.tp-imm__navbtn:hover { background: var(--tp-surface-3-hover); }
.tp-imm__navbtn:focus-visible { outline: 2px solid var(--tp-text-strong); outline-offset: 2px; }
.tp-imm__navbtn .tp-icon { width: 24px; height: 24px; }

@media (max-width: 600px) {
  /* Formats en haut au centre, par-dessus le flux (comme les onglets d'une appli de vidéos courtes). */
  html.tp-imm-open .tp-imm__formats {
    position: fixed; z-index: 2; top: calc(10px + env(safe-area-inset-top)); left: 50%; margin: 0; transform: translateX(-50%);
    border-color: transparent; background: rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  html.tp-imm-open .tp-imm__fmt { color: rgba(255, 255, 255, 0.75); }
  html.tp-imm-open .tp-imm__fmt[aria-pressed="true"] { color: #fff; background: rgba(255, 255, 255, 0.2); }
  .tp-imm__volpop { display: none !important; }
  /* Shorts : la vidéo occupe l'écran, actions à droite et infos en bas posées dessus. */
  .tp-imm.is-shorts .tp-imm__item { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .tp-imm.is-shorts .tp-imm__stage { grid-row: 1; grid-column: 1; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
  .tp-imm.is-shorts .tp-imm__below { display: contents; }
  .tp-imm.is-shorts .tp-imm__actions {
    grid-row: 1; grid-column: 1; z-index: 3; align-self: end; justify-self: end; flex-direction: column;
    margin: 0 calc(6px + env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) 0;
  }
  .tp-imm.is-shorts .tp-imm__act { width: var(--imm-act-w); }
  .tp-imm.is-shorts .tp-imm__act > span { position: static; width: auto; height: auto; clip-path: none; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
  .tp-imm.is-shorts .tp-imm__act > .tp-icon { background: rgba(0, 0, 0, 0.35); color: #fff; }
  .tp-imm.is-shorts .tp-imm__over { padding: 64px calc(var(--imm-act-w) + 18px) calc(24px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left)); }
}
