/* =========================================================
   explore.css — page « Idées » (views/explore.js), peau V3 (contours 1 px, ombres douces courtes, rayons 8–10 px).
   Pièces propres à la vue : champ de recherche (+ compteur de recherches du jour .tp-ex-usage), onglets,
   barre (Filtres + compteur + aide), statut des scores, en-tête « Idées du moment », progression, avertissement,
   écran « quota atteint » (.tp-ex-limit), « Plus de résultats », échelle du score (popover).
   Cartes vidéo, tags, filtres, états vides, squelettes, popovers, apparitions (.tp-ani) : base.css / app.css.
   ========================================================= */

.tp-explore .tp-page-head { margin-bottom: 16px; }

/* ---------- Search field (+ daily counter) ---------- */
.tp-ex-search {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 760px; margin-bottom: 18px; padding: 12px;
  border: 1px solid var(--tp-line); border-radius: var(--tp-radius-xl); background: var(--tp-surface); box-shadow: var(--tp-shadow-pop);
}
.tp-ex-search__field { flex: 1 1 100%; min-width: 0; } /* the site's search bar, hero variant (searchbar.css) */
/* Hero (searchbar.css .tp-sbhero): the daily counter is centred under the bar */
.tp-ex-hero .tp-ex-usage { justify-content: center; }

/* Empty search, under the hero: free popular searches + « Voir les idées du moment » (no illustration, no text) */
.tp-ex-intro { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 4px 0 24px; }
.tp-ex-intro .tp-ytpop { margin-top: 0; }
.tp-ex-intro__actions { display: flex; justify-content: center; }

.tp-ex-usage {
  --tp-us: var(--tp-accent);
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; flex-basis: 100%; min-width: 0; padding: 0 4px;
  color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px;
}
.tp-ex-usage[hidden] { display: none; }
.tp-ex-usage__bar {
  position: relative; display: block; width: 72px; height: 8px; flex: none; overflow: hidden;
  border: 1px solid var(--tp-line); border-radius: 999px; background: var(--tp-bg-sunken);
}
.tp-ex-usage__bar > span {
  position: absolute; inset: 0; border-radius: inherit; background: var(--tp-us);
  transform: scaleX(0); transform-origin: left center; transition: transform 500ms var(--tp-ease-out), background-color 200ms var(--tp-ease);
}
.tp-ex-usage__text strong { color: var(--tp-text-strong); font-family: var(--tp-font); font-weight: 800; font-variant-numeric: tabular-nums; }
.tp-ex-usage__pro { font-size: 12px; }
.tp-ex-usage__pro .tp-icon { width: 13px; height: 13px; color: var(--tp-sun); }
.tp-ex-usage__pro[hidden] { display: none; }
.tp-ex-usage.is-warn { --tp-us: var(--tp-sun); color: var(--tp-sun-text); }
.tp-ex-usage.is-full { --tp-us: var(--tp-coral); color: var(--tp-coral-text); }
.tp-ex-usage.is-full .tp-ex-usage__text strong { color: var(--tp-coral-text); }
.tp-ex-usage.is-full .tp-ex-usage__pro { color: var(--tp-sun-text); }

/* ---------- Tabs ---------- */
.tp-ex-tabs { margin-bottom: 16px; }
.tp-ex-tabs .tp-tab .tp-icon { color: inherit; transition: transform 260ms var(--tp-spring); }
.tp-ex-tabs .tp-tab:hover .tp-icon { transform: scale(1.06); }
.tp-ex-tabs .tp-tab[aria-selected="true"] [data-icon], .tp-ex-tabs .tp-tab[aria-selected="true"] .tp-icon { color: var(--tp-sun); }

/* ---------- Bar: Filtres (left), count + score help (right) ---------- */
.tp-ex-bar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.tp-ex-bar__filters { flex: 1 1 320px; min-width: 0; }
.tp-ex-bar__side { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 16px; min-height: 32px; }
.tp-ex-count { color: var(--tp-text-subtle); }
.tp-ex-count strong { color: var(--tp-text-strong); font-family: var(--tp-font); font-weight: 800; font-variant-numeric: tabular-nums; }
.tp-ex-helpbtn { font-size: 12px; line-height: 16px; }
.tp-ex-helpbtn .tp-icon { width: 14px; height: 14px; }

/* ---------- Score progress / warnings ---------- */
.tp-ex-status, .tp-ex-progress {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 12px;
  color: var(--tp-text-subtle); font-size: 12px; line-height: 16px;
}
.tp-ex-status .tp-spinner { width: 12px; height: 12px; border-width: 2px; }
.tp-ex-status .tp-icon { width: 14px; height: 14px; }
.tp-ex-status.is-warn { color: var(--tp-sun-text); }
.tp-ex-status .tp-link, .tp-ex-notice .tp-link { font-size: inherit; }

.tp-ex-meter {
  position: relative; width: 120px; height: 10px; overflow: hidden;
  border: 1px solid var(--tp-line); border-radius: 999px; background: var(--tp-bg-sunken);
}
.tp-ex-meter > span {
  position: absolute; inset: 0; border-radius: inherit; background: var(--tp-mint);
  transform: scaleX(0); transform-origin: left center; transition: transform 260ms var(--tp-ease-out);
}

.tp-ex-notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 12px; padding: 8px 12px;
  border: 1px solid var(--tp-sun-edge); border-radius: var(--tp-radius); background: var(--tp-sun-bg); color: var(--tp-sun-text);
  animation: tp-pop-in 240ms var(--tp-spring);
}
.tp-ex-notice[hidden] { display: none; }
.tp-ex-notice .tp-icon { width: 16px; height: 16px; }
.tp-ex-notice span { flex: 1 1 240px; min-width: 0; }
.tp-ex-notice .tp-link { color: var(--tp-sun-text); text-decoration: underline; }
.tp-ex-notice .tp-link:hover { color: #fff; }

/* ---------- « Idées du moment » head ---------- */
.tp-ex-feedhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.tp-ex-feedhead__lead { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--tp-text-subtle); }
.tp-ex-feedhead__lead .tp-avstack > * { box-shadow: 0 0 0 2px var(--tp-bg); }
.tp-ex-feedhead__actions { display: flex; flex-wrap: wrap; gap: 4px; }
.tp-ex-feedhead__actions [data-refresh]:not([aria-disabled="true"]):hover .tp-icon { animation: tp-spin 600ms var(--tp-ease) 1; }
.tp-ex-feedhead__actions [data-refresh][aria-disabled="true"] .tp-icon { animation: tp-spin 1s linear infinite; }

/* ---------- Grid states + more ---------- */
.tp-ex-state:empty { display: none; }
.tp-ex-more { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 26px; }
.tp-ex-more .tp-spinner { width: 14px; height: 14px; }
.tp-ex-sentinel { width: 100%; height: 1px; }
.tp-ex-more__body { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 34px; }
.tp-ex-more__line { display: inline-flex; align-items: center; gap: 8px; color: var(--tp-text-subtle); font-size: 13px; font-weight: 600; }
.tp-ex-more__line.is-warn { color: var(--tp-warning); }
.tp-ex-more__line .tp-icon { width: 15px; height: 15px; flex: none; }
.tp-ex-end { max-width: 520px; color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px; text-align: center; }

/* ---------- Empty search: « Tendances » / « Tes chaînes » under the chips (showcase.js) ---------- */
.tp-ex-discover { margin-top: 8px; }
.tp-ex-discover[hidden] { display: none; }
.tp-ex-discover__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.tp-ex-discover__title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em; color: var(--tp-text-strong); }

/* ---------- Daily quota reached ---------- */
.tp-ex-limit .tp-empty__art { width: 128px; }
.tp-ex-limit .tp-empty__title { color: var(--tp-sun-text); }
.tp-ex-limit__note {
  display: flex; align-items: flex-start; justify-content: center; gap: 6px; max-width: 440px; margin: 2px auto 0;
  color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px;
}
.tp-ex-limit__note .tp-icon { width: 13px; height: 13px; margin-top: 2px; }

/* ---------- Score scale (help popover) ---------- */
.tp-ex-scale { display: flex; flex-direction: column; gap: 8px; list-style: none; }
.tp-ex-scale li { display: flex; align-items: flex-start; gap: 8px; }
.tp-ex-scale .tp-tag { flex: none; min-width: 48px; height: 26px; justify-content: center; border: 1px solid transparent; border-radius: var(--tp-radius-sm); font-size: 14px; line-height: 24px; font-weight: 800; }
/* Same colours as the score tag of the video cards (app.css, .tp-vcard__tags .tp-tag--score) */
.tp-ex-scale .tp-tag--red { border-color: #a94c46; background: var(--tp-red); color: #0b0f17; }
.tp-ex-scale .tp-tag--orange { border-color: #a96f29; background: var(--tp-orange); color: #0b0f17; }
.tp-ex-scale .tp-tag--yellow { border-color: #987802; background: var(--tp-yellow); color: #0b0f17; }
.tp-ex-scale .tp-tag--gray { border-color: #4f5d78; background: #334057; color: #eaedf1; }
.tp-ex-scale__note { margin-top: 12px; color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px; }

/* ---------- Small screens ---------- */
@media (max-width: 599px) {
  .tp-ex-search { padding: 10px; border-radius: var(--tp-radius-lg); }
  .tp-ex-bar__side { justify-content: space-between; width: 100%; }
  .tp-ex-feedhead__lead .tp-avstack { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tp-ex-feedhead__actions [data-refresh] .tp-icon { animation: none !important; }
}

/* ---------- Channel page (#/chaine/<id>, views/channel.js): header, then the Ideas grid and filters ---------- */
.tp-chan-head { display: flex; align-items: center; gap: 16px 20px; margin-bottom: 22px; min-width: 0; }
.tp-chan-head[hidden] { display: none; }
.tp-chan-head__avatar { flex: none; display: block; width: 80px; height: 80px; border-radius: 50%; overflow: hidden; }
.tp-chan-head__avatar .tp-avatar { width: 80px; height: 80px; font-size: 26px; }
.tp-chan-head__info { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 auto; }
.tp-chan-head__skel { width: min(320px, 70%); height: 28px; }
.tp-chan-head__name { margin: 0; font-size: 26px; line-height: 32px; overflow-wrap: anywhere; }
.tp-chan-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 0; color: var(--tp-text-subtle); font-size: 14px; line-height: 20px; }
.tp-chan-head__sep { color: var(--tp-text-subtlest); }
.tp-chan-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
@media (max-width: 560px) {
  .tp-chan-head { align-items: flex-start; gap: 12px; }
  .tp-chan-head__avatar, .tp-chan-head__avatar .tp-avatar { width: 56px; height: 56px; font-size: 20px; }
  .tp-chan-head__name { font-size: 22px; line-height: 28px; }
}

/* Removed at the user's request (Idées page): quota line under the search bar, « Idées du moment » tab (so the
   one-tab row), « Comprendre le score ». The elements stay in the DOM for the code that updates them. */
.tp-explore .tp-ex-usage, .tp-explore .tp-ex-tabs, .tp-explore .tp-ex-helpbtn { display: none !important; }

/* ---------- 5 cards per row on a large screen, 4 on a computer (same columns as Idées de miniatures, thumbideas.css), 3, 2, then 1 when
   narrower; the « Colonnes » setting of the filters (.tp-vgrid--cols) and Shorts keep their own layout ---------- */
.tp-explore :is([data-panel], .tp-ex-panel) { container: tp-exgrid / inline-size; } /* every grid panel (Idées, page chaîne) */
.tp-explore .tp-ex-grid:not(.tp-vgrid--cols):not(.tp-vgrid--shorts) { grid-template-columns: minmax(0, 1fr); column-gap: 18px; }
@container tp-exgrid (min-width: 480px) { .tp-explore .tp-ex-grid:not(.tp-vgrid--cols):not(.tp-vgrid--shorts) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container tp-exgrid (min-width: 740px) { .tp-explore .tp-ex-grid:not(.tp-vgrid--cols):not(.tp-vgrid--shorts) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container tp-exgrid (min-width: 1000px) { .tp-explore .tp-ex-grid:not(.tp-vgrid--cols):not(.tp-vgrid--shorts) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container tp-exgrid (min-width: 1440px) { .tp-explore .tp-ex-grid:not(.tp-vgrid--cols):not(.tp-vgrid--shorts) { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* Nothing on the right of the bar (count hidden, help button removed): no empty row on phones */
.tp-explore .tp-ex-bar__side:not(:has(.tp-ex-count:not([hidden]))) { display: none; }

/* ---------- Modes under the bar (Vidéos | Miniatures | Chaînes): YouTube's filter chips ---------- */
.tp-ex-modes { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 16px; }
.tp-ex-mode {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 0; border-radius: 8px;
  background: var(--tp-gray-bg, #272727); color: var(--tp-text-strong, #f1f1f1); font: inherit; font-size: 14px; font-weight: 500;
  line-height: 20px; white-space: nowrap; cursor: pointer; transition: background-color 120ms var(--tp-ease);
}
.tp-ex-mode:hover { background: #3f3f3f; }
.tp-ex-mode:focus-visible { outline: 2px solid var(--tp-accent, #3ea6ff); outline-offset: 2px; }
.tp-ex-mode[aria-pressed="true"] { background: #f1f1f1; color: #0f0f0f; cursor: default; }
.tp-sbhero.is-compact .tp-ex-modes { margin-top: 12px; }
.tp-ex-modepanes > [hidden] { display: none !important; }

/* ---------- « Chaînes » mode (views/exchannels.js): YouTube's channel results ---------- */
.tp-exchs { max-width: 1000px; margin: 0 auto; }
.tp-exchs__title { margin: 0 0 8px; color: var(--tp-text-strong); font-size: 20px; font-weight: 700; line-height: 28px; }
.tp-exch-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.tp-exch { display: flex; align-items: center; gap: 16px 24px; padding: 16px 0; border-bottom: 1px solid var(--tp-line); min-width: 0; }
.tp-exch:last-child { border-bottom: 0; }
.tp-exch__avatar { flex: none; display: block; width: 96px; height: 96px; border-radius: 50%; overflow: hidden; }
.tp-exch__avatar .tp-avatar { width: 96px; height: 96px; font-size: 28px; }
.tp-exch__main { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; }
.tp-exch__name { color: var(--tp-text-strong); font-size: 18px; font-weight: 500; line-height: 26px; overflow-wrap: anywhere; text-decoration: none; }
.tp-exch__name:hover { text-decoration: underline; }
.tp-exch__meta { margin: 0; color: var(--tp-text-subtle); font-size: 13px; line-height: 18px; overflow-wrap: anywhere; }
.tp-exch__acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; flex: none; }
.tp-exch--skeleton .tp-exch__avatar { background: var(--tp-gray-bg, #272727); }
.tp-exch__sk { width: min(260px, 60%); height: 16px; border-radius: 6px; }
.tp-exch__sk--short { width: min(160px, 40%); height: 12px; }
@media (max-width: 720px) {
  .tp-exch { flex-wrap: wrap; gap: 12px 14px; }
  .tp-exch__avatar, .tp-exch__avatar .tp-avatar { width: 56px; height: 56px; font-size: 20px; }
  .tp-exch__main { flex: 1 1 calc(100% - 70px); }
  .tp-exch__name { font-size: 16px; line-height: 22px; }
  .tp-exch__acts { justify-content: flex-start; width: 100%; padding-left: 70px; }
}
/* Channel page (#/chaine/…): like the « Vidéos » tab of a YouTube channel, no avatar nor channel name under each video
   (always the same channel) */
.tp-chan .tp-ex-grid .tp-vcard__avatar,
.tp-chan .tp-ex-grid .tp-vcard__channel { display: none; }
