/* =========================================================
   tester.css — Testeur titre + miniature (#/testeur, views/tester.js).

   Page   .tp-tester > .tp-page-head (+ .tp-tester__back) · .tp-tester__missing
          section.tp-tester__input (zone de dépôt) > .tp-tester__thumbcol (.tp-tester__label, button.tp-tester__zone(.has-img)
            > .tp-tester__zoneempty | img + .tp-tester__zonechange ; .tp-tester__choices > .tp-tester__choice(.is-on))
          + .tp-tester__titlecol (.tp-tester__title, .tp-tester__under > .tp-tester__alert(.is-ok|.is-warn|.is-error)
            + .tp-tester__acts)
          section.tp-tester__preview > .tp-tester__bar (.tp-tester__switch, .tp-tester__status(.is-warn), .tp-tester__more)
            + .tp-tester__kw (Réglages de l'aperçu, replié : .tp-tester__mine > .tp-tester__field ×2, form.tp-tester__kwform)
            + .tp-tester__stage + .tp-tester__attr
   Aperçu .tp-pv-fit(--desktop|--search|--mobile) > .tp-pv(--desktop|--search|--mobile, .is-loading) : cadre à taille
          réelle (grille d'accueil de 1160 px, liste de recherche de 784 px ou téléphone de 410 px) réduit par
          transform: scale(). Rendu partagé avec le panneau « Miniature » de la carte (assets/js/thumbpreview.js). Thème
          sombre seulement. Mesures de YouTube (rea) ; ta vidéo ([data-mine]) est une carte comme les autres, sans cadre ni
          étiquette. Aucun logo, aucune barre de recherche ni navigation de YouTube ; les autres vidéos sont des liens
          vers YouTube (.tp-pv__link), attribution .tp-tester__attr sous l'aperçu (compliance.css).
          IMPORTANT : polices et largeurs des titres (.tp-pv__title) = constantes CONTEXTS de thumbpreview.js (alerte
          mesurée) : ordinateur 500 16px/22px sur 288 px · mobile 400 14px/17.5px sur 278 px.
   ========================================================= */

/* ---------- Head ---------- */
.tp-tester__back { font-size: 13px; }
.tp-tester__back .tp-icon { width: 15px; height: 15px; }
.tp-tester__missing {
  display: flex; align-items: flex-start; gap: 8px; margin: -8px 0 14px; color: var(--tp-danger-hover); font-size: 13px; line-height: 18px; font-weight: 600;
}
.tp-tester__missing[hidden] { display: none; }
.tp-tester__missing .tp-icon { width: 15px; height: 15px; flex: none; margin-top: 1px; }

/* ---------- Input: thumbnail + title ---------- */
.tp-tester__input {
  display: grid; grid-template-columns: 256px minmax(0, 1fr); gap: 16px 22px; align-items: start; padding: 16px;
  border: 1px solid var(--tp-border); border-radius: var(--tp-radius-lg); background: var(--tp-surface);
}
.tp-tester__input.tp-dropzone.is-dragover { border-color: var(--tp-mint); }
.tp-tester__thumbcol, .tp-tester__titlecol { min-width: 0; }
.tp-tester__titlecol { display: flex; flex-direction: column; }
.tp-tester__label { display: block; margin-bottom: 6px; color: var(--tp-text-subtle); font-size: 12px; line-height: 16px; font-weight: 700; }

.tp-tester__zone {
  position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; padding: 0; overflow: hidden;
  border: 1px dashed var(--tp-border-input); border-radius: var(--tp-radius-md); background: var(--tp-field-bg); color: var(--tp-text-subtle);
  cursor: pointer; transition: border-color var(--tp-dur) var(--tp-ease), background-color var(--tp-dur) var(--tp-ease), color var(--tp-dur) var(--tp-ease);
}
.tp-tester__zone:hover { border-color: var(--tp-accent); background: var(--tp-hover); color: var(--tp-text-strong); }
.tp-tester__zone:focus-visible { outline: 2px solid var(--tp-accent-hover); outline-offset: 2px; }
.tp-tester__zone.has-img { border-style: solid; border-color: var(--tp-border); background: #000000; }
.tp-tester__zone img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tp-tester__zoneempty { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 16px; text-align: center; font-size: 13px; line-height: 18px; }
.tp-tester__zoneempty .tp-icon { width: 22px; height: 22px; margin-bottom: 4px; }
.tp-tester__zoneempty b { color: var(--tp-text-strong); font-weight: 700; }
.tp-tester__zoneempty small { color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px; }
.tp-tester__zonechange {
  position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.72); color: #ffffff; font-size: 12px; line-height: 18px; font-weight: 700;
  opacity: 0; transition: opacity var(--tp-dur) var(--tp-ease);
}
.tp-tester__zonechange .tp-icon { width: 13px; height: 13px; }
.tp-tester__zone:hover .tp-tester__zonechange, .tp-tester__zone:focus-visible .tp-tester__zonechange { opacity: 1; }
@media (hover: none) { .tp-tester__zonechange { opacity: 1; } }

.tp-tester__choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tp-tester__choices:empty { display: none; }
.tp-tester__choice {
  position: relative; width: 58px; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; border: 1px solid var(--tp-border); border-radius: 6px;
  background: #000000; opacity: 0.65; cursor: pointer; transition: opacity var(--tp-dur) var(--tp-ease);
}
.tp-tester__choice img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tp-tester__choice:hover { opacity: 1; }
.tp-tester__choice.is-on { opacity: 1; outline: 2px solid var(--tp-accent); outline-offset: 1px; }
.tp-tester__choice:focus-visible { opacity: 1; outline: 2px solid var(--tp-accent-hover); outline-offset: 2px; }

.tp-tester__title { min-height: 0; resize: none; font-size: 16px; line-height: 22px; font-weight: 600; }
.tp-tester__under { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.tp-tester__alert { display: flex; align-items: flex-start; gap: 7px; flex: 1 1 240px; min-width: 0; margin: 0; color: var(--tp-text-subtle); font-size: 13px; line-height: 18px; font-weight: 600; }
.tp-tester__alert:empty { display: none; }
.tp-tester__alert .tp-icon { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.tp-tester__alert.is-ok .tp-icon { color: var(--tp-success); }
.tp-tester__alert.is-warn { color: var(--tp-sun-text); }
.tp-tester__alert.is-warn .tp-icon { color: var(--tp-sun); }
.tp-tester__alert.is-error { color: var(--tp-danger-hover); }
.tp-tester__acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 14px; margin-left: auto; }
.tp-tester__acts .tp-link { font-size: 13px; }
.tp-tester__acts .tp-link[hidden] { display: none; }
.tp-tester__acts .tp-link .tp-icon { width: 14px; height: 14px; }
.tp-tester [data-shuffle].is-spinning .tp-icon { animation: tp-spin 460ms var(--tp-ease-out) 1; }

/* ---------- Preview bar ---------- */
.tp-tester__preview { min-width: 0; margin-top: 22px; }
.tp-tester__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 12px; }
.tp-tester__switch { display: inline-flex; flex: none; padding: 3px; border: 1px solid var(--tp-border); border-radius: var(--tp-radius-md); background: var(--tp-bg-sunken); }
.tp-tester__switch label { position: relative; display: inline-flex; }
.tp-tester__switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tp-tester__switch span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 12px; border-radius: 7px;
  color: var(--tp-text-subtle); font-size: 13px; line-height: 20px; font-weight: 700; white-space: nowrap;
  transition: background-color var(--tp-dur) var(--tp-ease), color var(--tp-dur) var(--tp-ease);
}
.tp-tester__switch .tp-icon { width: 16px; height: 16px; }
.tp-tester__switch label:hover span { color: var(--tp-text-strong); }
.tp-tester__switch input:checked + span { background: var(--tp-surface-3); color: var(--tp-text-strong); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.tp-tester__switch input:focus-visible + span { outline: 2px solid var(--tp-accent-hover); outline-offset: 1px; }

.tp-tester__status { display: flex; align-items: flex-start; gap: 7px; flex: 1 1 220px; min-width: 0; margin: 0; color: var(--tp-text-subtlest); font-size: 13px; line-height: 18px; }
.tp-tester__status .tp-icon { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.tp-tester__status .tp-spinner { flex: none; margin-top: 2px; }
.tp-tester__status .tp-link { font-size: 13px; }
.tp-tester__status.is-warn { color: var(--tp-text-subtle); }
.tp-tester__status.is-warn .tp-icon { color: var(--tp-sun); }

.tp-tester__more {
  display: inline-flex; align-items: center; gap: 4px; flex: none; margin-left: auto; padding: 4px 0; border: 0; background: none;
  color: var(--tp-text-subtle); font-size: 13px; line-height: 18px; font-weight: 700; cursor: pointer;
}
.tp-tester__more:hover { color: var(--tp-text-strong); text-decoration: underline; text-underline-offset: 3px; }
.tp-tester__more:focus-visible { outline: 2px solid var(--tp-accent-hover); outline-offset: 2px; border-radius: 4px; }
.tp-tester__more .tp-icon { width: 14px; height: 14px; transition: transform var(--tp-dur) var(--tp-ease); }
.tp-tester__more[aria-expanded="true"] .tp-icon { transform: rotate(180deg); }

.tp-tester__kw {
  display: grid; gap: 10px; margin: 0 0 12px; padding: 10px 12px;
  border: 1px solid var(--tp-border); border-radius: var(--tp-radius); background: var(--tp-surface);
}
.tp-tester__kw[hidden] { display: none; }
.tp-tester__mine { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.tp-tester__field { display: inline-flex; align-items: center; gap: 8px; color: var(--tp-text-subtle); font-size: 13px; line-height: 18px; font-weight: 600; }
.tp-tester__field .tp-input { width: 120px; }
.tp-tester__field .tp-select { width: auto; }
.tp-tester__kwform { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.tp-tester__kw .tp-search { flex: 1 1 220px; max-width: 420px; }
.tp-tester__kwhint { flex: 1 1 100%; margin: 0; color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px; }
.tp-tester__kwhint .tp-link { font-size: 12px; }

.tp-tester__stage { display: flex; justify-content: center; min-width: 0; min-height: 240px; }

/* ---------- Realistic preview: YouTube's own measures (rea, 2026-10-11, dark theme), no logo, no navigation ---------- */
.tp-pv-fit { position: relative; flex: none; overflow: hidden; border-radius: 12px; box-shadow: 0 0 0 1px var(--tp-border), 0 12px 32px rgba(0, 0, 0, 0.3); }
.tp-pv-fit--mobile { overflow: visible; border-radius: 46px; box-shadow: none; }
.tp-pv {
  --pv-font: Roboto, Arial, "Helvetica Neue", sans-serif;
  --pv-bg: #0f0f0f; --pv-text: #f1f1f1; --pv-sub: #aaaaaa; --pv-ph: #272727; --pv-ph2: #3a3a3a;
  position: absolute; top: 0; left: 0; transform-origin: 0 0; background: var(--pv-bg); color: var(--pv-text);
  font-family: var(--pv-font); font-size: 14px; line-height: 20px; font-weight: 400; letter-spacing: normal; text-align: left;
  -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none;
}
.tp-pv--desktop { width: 1160px; }
.tp-pv--search { width: 784px; }
.tp-pv--mobile { width: 410px; background: transparent; }
.tp-pv h3, .tp-pv p { margin: 0; }
.tp-pv .tp-icon { width: 24px; height: 24px; stroke-width: 1.8; }

/* Avatars, thumbnails, duration */
.tp-pv__avatar { display: block; flex: none; border-radius: 50%; object-fit: cover; background: var(--pv-ph); }
.tp-pv__avatar--ini, .tp-pv .tp-avatar--fallback {
  display: grid; place-items: center; border: 0; background: var(--c, #5f6b7a); color: #ffffff; font-family: var(--pv-font); font-size: 14px; font-weight: 500; line-height: 1;
}
.tp-pv__thumb { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: var(--pv-ph); }
.tp-pv__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tp-pv__nothumb {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; margin: 10px; border: 2px dashed var(--pv-ph2); border-radius: 10px;
  color: var(--pv-sub); font-size: 15px; font-weight: 500;
}
.tp-pv__nothumb .tp-icon { width: 32px; height: 32px; }
.tp-pv__dur {
  position: absolute; right: 8px; bottom: 8px; padding: 1px 4px; border-radius: 4px; background: rgba(0, 0, 0, 0.6); color: #ffffff;
  font-size: 12px; line-height: 18px; font-weight: 500;
}
.tp-pv__title {
  display: -webkit-box; overflow: hidden; color: var(--pv-text); overflow-wrap: anywhere; word-break: normal;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.tp-pv__meta { overflow: hidden; color: var(--pv-sub); text-overflow: ellipsis; white-space: nowrap; }
/* « 12 k vues • il y a 2 heures »: the dot is a ::before with 4 px on each side, as on YouTube */
.tp-pv__dots > span + span::before { content: "•"; margin: 0 4px; }
.tp-pv__menu { display: grid; place-items: center; flex: none; color: var(--pv-text); }
.tp-pv__link { color: inherit; text-decoration: none; }
.tp-pv__link:hover { color: inherit; }
/* Titles clip (2 lines, overflow: hidden): a title link puts its focus ring on the title box itself. */
.tp-pv__title > .tp-pv__link:focus-visible { outline: none; }
.tp-pv__title:has(> .tp-pv__link:focus-visible) { outline: 2px solid var(--tp-accent-hover); outline-offset: 2px; border-radius: 4px; }
.tp-pv__link--thumb { display: block; }

/* Placeholders (only before the first videos arrive) */
.tp-pv__bar { display: block; width: 100%; height: 14px; margin-bottom: 8px; border-radius: 4px; background: var(--pv-ph); }
.tp-pv__bar--short { width: 60%; }
.tp-pv .is-placeholder .tp-pv__avatar { width: 36px; height: 36px; }
.tp-pv.is-loading .is-placeholder .tp-pv__thumb, .tp-pv.is-loading .is-placeholder .tp-pv__bar, .tp-pv.is-loading .is-placeholder .tp-pv__avatar {
  background: linear-gradient(90deg, var(--pv-ph) 0%, var(--pv-ph2) 50%, var(--pv-ph) 100%); background-size: 200% 100%; animation: tp-shimmer 1.3s linear infinite;
}

/* Home grid (desktop): 3 × 360 px, gaps 16 px / 32 px, thumbnail radius 12, avatar 36, title 16/22 500, meta 14/20 */
.tp-pv__grid { display: grid; grid-template-columns: repeat(3, 360px); column-gap: 16px; row-gap: 32px; padding: 24px 24px 32px; }
.tp-pv__item { position: relative; width: 360px; }
.tp-pv__item .tp-pv__thumb { border-radius: 12px; }
.tp-pv__item .tp-pv__details { display: flex; align-items: flex-start; margin-top: 12px; }
.tp-pv__item .tp-pv__avatar { width: 36px; height: 36px; margin-right: 12px; }
.tp-pv__item .tp-pv__text { width: 288px; flex: none; }
.tp-pv__item .tp-pv__title { margin-bottom: 4px; font-size: 16px; line-height: 22px; max-height: 44px; font-weight: 500; }
.tp-pv__item .tp-pv__meta { font-size: 14px; line-height: 20px; }
.tp-pv__item .tp-pv__menu { width: 24px; height: 24px; visibility: hidden; } /* shown on hover only on YouTube */

/* Search results (list): thumbnail 360 px on the left, text column of the same width; title 18/26 400, meta 12/18,
   channel row 24 px avatar (padding 12 px 0), description 12/18 on 2 lines, ⋮ always visible */
.tp-pv__list { display: flex; flex-direction: column; gap: 16px; padding: 16px 24px 24px; }
.tp-pv__sitem { position: relative; display: flex; align-items: flex-start; gap: 16px; }
.tp-pv__sitem > .tp-pv__thumb, .tp-pv__sitem > .tp-pv__link--thumb { width: 360px; flex: none; }
.tp-pv__sitem .tp-pv__thumb { border-radius: 12px; }
.tp-pv__stext { flex: 1; min-width: 0; }
.tp-pv__shead { display: flex; align-items: flex-start; }
.tp-pv__sitem .tp-pv__title { flex: 1; min-width: 0; font-size: 18px; line-height: 26px; max-height: 52px; font-weight: 400; }
.tp-pv__sitem .tp-pv__menu { width: 40px; height: 24px; margin-left: 8px; }
.tp-pv__sitem .tp-pv__meta { font-size: 12px; line-height: 18px; }
.tp-pv__schan { display: flex; align-items: center; padding: 12px 0; color: var(--pv-sub); font-size: 12px; line-height: 18px; }
.tp-pv__schan .tp-pv__avatar { width: 24px; height: 24px; margin-right: 8px; font-size: 10px; }
.tp-pv__schan span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-pv__sdesc {
  display: -webkit-box; overflow: hidden; max-height: 36px; margin: 0 0 8px; color: var(--pv-sub); font-size: 12px; line-height: 18px;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.tp-pv__sitem.is-placeholder .tp-pv__thumb { width: 360px; flex: none; }

/* Phone (m.youtube.com): full-width thumbnail without radius, avatar 40, title 14/17.5 400, « Chaîne • vues • date » 12 px, ⋮ 48 px */
.tp-pv__phone {
  display: flex; flex-direction: column; width: 410px; height: 840px; overflow: hidden; border: 10px solid #07090b; border-radius: 46px;
  background: var(--pv-bg); box-shadow: 0 0 0 1px #2a3038, 0 16px 40px rgba(0, 0, 0, 0.4);
}
.tp-pv__status { display: flex; align-items: center; justify-content: space-between; height: 44px; flex: none; padding: 0 28px; color: var(--pv-text); font-size: 15px; font-weight: 600; }
.tp-pv__statusicons { display: flex; gap: 5px; }
.tp-pv__statusicons i { display: block; width: 16px; height: 10px; border-radius: 3px; background: var(--pv-text); opacity: 0.85; }
.tp-pv__statusicons i:last-child { width: 24px; }
.tp-pv__feed { flex: 1; overflow-y: auto; scrollbar-width: none; }
.tp-pv__feed::-webkit-scrollbar { display: none; }
.tp-pv__mitem { position: relative; margin-bottom: 12px; }
.tp-pv__mitem .tp-pv__thumb { width: 390px; }
.tp-pv__mitem .tp-pv__details { display: flex; align-items: flex-start; min-height: 82px; margin-top: 4px; padding-left: 12px; }
.tp-pv__mitem .tp-pv__avatar { width: 40px; height: 40px; margin: 8px 12px 0 0; font-size: 15px; }
.tp-pv__mitem .tp-pv__text { flex: 1; min-width: 0; padding-top: 8px; }
.tp-pv__mitem .tp-pv__title { margin-bottom: 3px; font-size: 14px; line-height: 17.5px; max-height: 35px; font-weight: 400; }
.tp-pv__mitem .tp-pv__meta { display: -webkit-box; max-height: 36px; font-size: 12px; line-height: 14px; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tp-pv__mitem .tp-pv__menu { width: 48px; height: 48px; }
.tp-pv__mitem.is-placeholder .tp-pv__avatar { width: 40px; height: 40px; }

/* ---------- Responsive ---------- */
@media (max-width: 699px) {
  .tp-tester__input { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 12px; }
  .tp-tester__thumbcol { max-width: 360px; }
  .tp-tester__preview { margin-top: 18px; }
  .tp-tester__bar { gap: 8px 12px; }
  .tp-tester__status { order: 3; flex-basis: 100%; }
}

/* ---------- Testeur at full width, like YouTube (thumbpreview.js full: true) ----------
   Home: the page's real width, YouTube's columns (3 → 6 as the room grows), the filter chips stuck at the top, no
   frame and no scaling: the page scrolls and more videos come (views/tester.js PAGE_MORE). Search: the results list at
   YouTube's width (1096 px at most). The phone keeps its frame. */
.tp-pv-fit--full { flex: 1 1 auto; width: 100%; overflow: visible; border-radius: 0; box-shadow: none; }
.tp-pv--full { position: relative; width: 100%; background: transparent; container: tp-pvfull / inline-size; }
.tp-pv--full.tp-pv--search { max-width: 1096px; margin: 0 auto; }
.tp-pv--full .tp-pv__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; row-gap: 40px; padding: 12px 0 32px; }
@container tp-pvfull (min-width: 900px) { .tp-pv--full .tp-pv__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container tp-pvfull (min-width: 1240px) { .tp-pv--full .tp-pv__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container tp-pvfull (min-width: 1600px) { .tp-pv--full .tp-pv__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@container tp-pvfull (min-width: 1960px) { .tp-pv--full .tp-pv__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tp-pv--full .tp-pv__item { width: auto; min-width: 0; }
.tp-pv--full .tp-pv__item .tp-pv__text { flex: 1 1 auto; width: auto; min-width: 0; padding-right: 24px; }
.tp-pv--full .tp-pv__item .tp-pv__menu { position: absolute; right: -8px; }
.tp-pv--full .tp-pv__list { padding: 12px 0 32px; }
/* Filter chips (look only): « Tout » white, the others #272727, 32 px high, radius 8, 14 px 500, as on YouTube */
.tp-pv__chips {
  position: sticky; top: 0; z-index: 2; display: flex; gap: 12px; padding: 12px 0; overflow: hidden; background: var(--tp-bg, #0f0f0f);
  white-space: nowrap;
}
.tp-pv__chip {
  display: inline-flex; flex: none; align-items: center; height: 32px; padding: 0 12px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.1); color: #f1f1f1; font-size: 14px; line-height: 20px; font-weight: 500;
}
.tp-pv__chip.is-on { background: #f1f1f1; color: #0f0f0f; }
.tp-tester__sentinel { height: 1px; }
