/* =========================================================
   compliance.css — conformité aux règles de YouTube et pages légales (docs/youtube-audit.md).

   Attribution   a.tp-ytattr(--compact) > .tp-ytattr__ext + (.tp-ytattr__text | img.tp-ytattr__logo)
                 (jamais l'élément le plus visible de la page : petit, discret, toujours cliquable vers YouTube)
   Liens légaux  nav.tp-legal(--sidebar|--settings) > ul.tp-legal__links + p.tp-legal__note
   Quota         .tp-ytprob(--compact) (quota du site, rythme, nouvelles recherches du compte, YouTube indisponible)
                 .tp-ytpop > .tp-ytpop__label + ul.tp-ytpop__list > a.tp-ytchip (.tp-ytchip__q, .tp-ytchip__tag)
                 .tp-sugg > .tp-sugg__row(--history, .is-active) > .tp-sugg__opt (.tp-sugg__icon, .tp-sugg__q > b.tp-sugg__done)
                   + .tp-sugg__remove (liste façon YouTube sous un champ [data-suggest-host] : historique + suggestions)
   Idées         .tp-ex-banner, .tp-ex-meta, .tp-ex-usage__free, .tp-ex-more__note
   Pages légales .tp-legal-page > __bar (+ __tabs, __lang) + article.tp-legal-doc + __back + __foot ; mark.tp-legal__todo
   Acceptation   .tp-modal--consent (sans bouton fermer) > .tp-consent ; .tp-auth__consent, .tp-auth__legal
   ========================================================= */

/* ---------- YouTube attribution ---------- */
.tp-ytattr {
  display: inline-flex; align-items: center; gap: 5px; flex: none; max-width: 100%; padding: 2px 8px; border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-pill); background: var(--tp-surface-2); color: var(--tp-text-subtle);
  font-size: 12px; line-height: 18px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: color var(--tp-dur) var(--tp-ease), border-color var(--tp-dur) var(--tp-ease);
}
.tp-ytattr:hover { color: var(--tp-text-strong); border-color: var(--tp-border-input); text-decoration: none; }
.tp-ytattr:focus-visible { outline: 2px solid var(--tp-accent-hover); outline-offset: 2px; }
.tp-ytattr__ext { width: 12px; height: 12px; flex: none; opacity: 0.8; }
.tp-ytattr__text { overflow: hidden; text-overflow: ellipsis; }
.tp-ytattr__logo { display: block; width: auto; height: 18px; }
/* Official logo, text --tp-ytlogo-h tall: only the transparent margin of the PNG is hidden (box set in ui.js). */
.tp-ytattr__logobox {
  /* 16px tall (14px compact): « Developed with » stays readable; the pill keeps the height of the text version. */
  --tp-ytlogo-h: 16px; --s: calc(var(--tp-ytlogo-h) / var(--yt-h));
  display: block; flex: none; overflow: hidden; width: calc(var(--yt-w) * var(--s)); height: calc(var(--yt-h) * var(--s));
  margin: 1px 0;
}
.tp-ytattr__logobox .tp-ytattr__logo {
  width: calc(var(--yt-iw) * var(--s)); max-width: none; height: auto;
  margin: calc(var(--yt-y) * var(--s) * -1) 0 0 calc(var(--yt-x) * var(--s) * -1);
}
.tp-ytattr--compact { padding: 1px 7px; font-size: 11px; line-height: 16px; }
.tp-ytattr--compact .tp-ytattr__logobox { --tp-ytlogo-h: 14px; margin: 1px 0; }

/* ---------- Legal links ---------- */
.tp-legal { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; color: var(--tp-text-subtlest); font-size: 12px; line-height: 17px; }
.tp-legal__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 12px; margin: 0; padding: 0; list-style: none; }
.tp-legal__links a { color: var(--tp-text-subtle); text-decoration: none; }
.tp-legal__links a:hover { color: var(--tp-text-strong); text-decoration: underline; text-underline-offset: 3px; }
.tp-legal__note { margin: 0; text-align: center; text-wrap: pretty; }
.tp-legal--sidebar { align-items: flex-start; padding: 2px 4px 0; }
.tp-legal--sidebar .tp-legal__links { justify-content: flex-start; gap: 0 10px; font-size: 11px; }
.tp-legal--settings { align-items: flex-start; margin: 12px 0 6px; }
.tp-legal--settings .tp-legal__links { justify-content: flex-start; }
.tp-sidebar__legal:empty { display: none; }

/* ---------- Quota / YouTube problems ---------- */
.tp-ytprob {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--tp-sun-edge);
  border-radius: var(--tp-radius-lg); background: var(--tp-sun-bg); color: var(--tp-text);
}
.tp-ytprob[data-yt-problem="down"] { border-color: var(--tp-coral-edge); background: var(--tp-coral-bg); }
.tp-ytprob__icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: rgba(0, 0, 0, 0.25); color: var(--tp-sun-text); }
.tp-ytprob[data-yt-problem="down"] .tp-ytprob__icon { color: var(--tp-coral-text); }
.tp-ytprob__icon .tp-icon { width: 16px; height: 16px; }
.tp-ytprob__body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.tp-ytprob__title { color: var(--tp-text-strong); font-size: 15px; line-height: 21px; font-weight: 800; }
.tp-ytprob__text { margin: 0; color: var(--tp-text); font-size: 14px; line-height: 20px; text-wrap: pretty; }
.tp-ytprob__when { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--tp-sun-text); font-size: 13px; line-height: 18px; font-weight: 700; }
.tp-ytprob__when .tp-icon { width: 14px; height: 14px; flex: none; }
.tp-ytprob__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.tp-ytprob--compact { padding: 10px 12px; gap: 10px; }
.tp-ytprob--compact .tp-ytprob__title { font-size: 14px; }
.tp-ytprob--compact .tp-ytprob__text { font-size: 13px; line-height: 18px; }
.tp-empty + .tp-ytpop, .tp-ytprob .tp-ytpop { margin-top: 4px; }
.tp-ex-state > .tp-ytprob { max-width: 760px; margin: 8px auto 0; }

/* Free popular searches (« instantané ») */
.tp-ytpop { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 14px auto 0; max-width: 760px; }
.tp-ytprob .tp-ytpop { align-items: flex-start; margin: 4px 0 0; }
.tp-ytpop__label { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--tp-text-subtle); font-size: 12px; line-height: 16px; font-weight: 700; }
.tp-ytpop__label .tp-icon { width: 13px; height: 13px; color: var(--tp-sun); }
.tp-ytpop__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tp-ytprob .tp-ytpop__list { justify-content: flex-start; }
.tp-ytchip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 4px 6px 4px 12px; border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-pill); background: var(--tp-surface); color: var(--tp-text-strong); font-size: 13px; line-height: 18px;
  font-weight: 600; text-decoration: none; transition: border-color var(--tp-dur) var(--tp-ease), background-color var(--tp-dur) var(--tp-ease);
}
.tp-ytchip:hover { border-color: var(--tp-accent); background: var(--tp-hover); color: var(--tp-text-strong); text-decoration: none; }
.tp-ytchip:focus-visible { outline: 2px solid var(--tp-accent-hover); outline-offset: 2px; }
.tp-ytchip__q { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-ytchip__tag {
  flex: none; padding: 0 6px; border-radius: var(--tp-radius-pill); background: var(--tp-mint-bg); color: var(--tp-mint-text);
  font-size: 10px; line-height: 16px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase;
}

/* Search field list (Idées, Accueil): recent searches + popular ones, laid out like YouTube's list (compliance.bindSuggest) */
[data-suggest-host] { position: relative; }
.tp-sugg {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; display: flex; flex-direction: column;
  max-height: min(80vh, 600px); padding: 8px 0; overflow-y: auto; scrollbar-width: none;
  border: 1px solid var(--tp-border); border-radius: 12px; background: var(--tp-surface-2); box-shadow: var(--tp-shadow-overlay);
  text-align: left;
}
.tp-sugg::-webkit-scrollbar { display: none; }
.tp-sugg[hidden] { display: none; }
.tp-sugg__row {
  display: flex; flex: none; align-items: center; justify-content: space-between; height: 44px; margin: 0 8px; padding: 0 16px;
  border-radius: 8px; color: var(--tp-text-strong); cursor: pointer;
}
.tp-sugg__row:hover, .tp-sugg__row.is-active { background: var(--tp-hover); }
.tp-sugg__opt { display: flex; flex: 1 1 auto; align-items: center; min-width: 0; padding-right: 8px; }
.tp-sugg__icon { flex: none; width: 20px; height: 20px; margin-right: 14px; }
.tp-sugg__q { min-width: 0; overflow: hidden; font-size: 16px; line-height: 20px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.tp-sugg__done { font-weight: 600; }
.tp-sugg__remove {
  flex: none; padding: 0; border: 0; background: none; color: var(--tp-accent); font: inherit; font-size: 13px; line-height: 20px; cursor: pointer;
}
.tp-sugg__remove:hover, .tp-sugg__row.is-active .tp-sugg__remove { text-decoration: underline; }

/* ---------- Ideas ---------- */
.tp-ex-banner { margin: 0 0 14px; }
.tp-ex-banner[hidden] { display: none; }
.tp-ex-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: -4px 0 12px; color: var(--tp-text-subtlest); font-size: 12px; line-height: 18px; }
.tp-ex-meta[hidden] { display: none; }
.tp-ex-meta__sep { color: var(--tp-text-disabled); }
.tp-ex-meta__instant { display: inline-flex; align-items: center; gap: 4px; color: var(--tp-mint-text); font-weight: 700; }
.tp-ex-meta__instant .tp-icon { width: 13px; height: 13px; }
.tp-ex-usage__free { color: var(--tp-text-subtlest); font-weight: 500; }
.tp-ex-more__note { margin: 6px 0 0; color: var(--tp-text-subtlest); font-size: 12px; line-height: 17px; text-align: center; }

/* ---------- Legal pages (#/confidentialite, #/conditions) ---------- */
.tp-legal-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding: 0 16px 28px; }
.tp-legal-page__bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; width: min(100%, 860px); margin: 0 auto; padding: 18px 0 14px;
  border-bottom: 1px solid var(--tp-line);
}
.tp-legal-page__bar .tp-brand { flex: none; }
.tp-legal-page__tabs { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }
.tp-legal-page__tab {
  padding: 5px 12px; border-radius: var(--tp-radius-pill); color: var(--tp-text-subtle); font-size: 14px; line-height: 20px; font-weight: 700; text-decoration: none;
}
.tp-legal-page__tab:hover { background: var(--tp-hover); color: var(--tp-text-strong); text-decoration: none; }
.tp-legal-page__tab.is-current { background: var(--tp-surface-3); color: var(--tp-text-strong); }
.tp-legal-page__lang { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.tp-legal-page__lang .tp-link { font-size: 12px; }
.tp-legal-page__lang [aria-pressed="true"] { font-weight: 800; }
.tp-legal-doc { width: min(100%, 860px); margin: 0 auto; padding: 24px 0 8px; color: var(--tp-text); font-size: 15px; line-height: 24px; }
.tp-legal-doc__head h1 { margin: 0; color: var(--tp-text-strong); font-family: var(--tp-font-display); font-size: 32px; line-height: 40px; font-weight: 800; }
.tp-legal-doc__updated { margin: 6px 0 18px; color: var(--tp-text-subtlest); font-size: 13px; }
.tp-legal-doc__intro { margin: 0 0 12px; text-wrap: pretty; }
.tp-legal-doc__toc { margin: 18px 0 8px; padding: 12px 16px; border: 1px solid var(--tp-border); border-radius: var(--tp-radius); background: var(--tp-surface); }
.tp-legal-doc__toc ol { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 2px 18px; margin: 0; padding: 0; list-style: none; }
.tp-legal-doc__toc a { color: var(--tp-text-subtle); font-size: 13px; line-height: 22px; text-decoration: none; }
.tp-legal-doc__toc a:hover { color: var(--tp-text-strong); text-decoration: underline; }
.tp-legal-doc__sec { padding-top: 18px; scroll-margin-top: 16px; }
.tp-legal-doc__sec h2 { margin: 0 0 8px; color: var(--tp-text-strong); font-size: 19px; line-height: 26px; font-weight: 800; }
.tp-legal-doc__sec h2:focus { outline: none; }
.tp-legal-doc__sec p { margin: 0 0 10px; text-wrap: pretty; }
.tp-legal-doc__list { margin: 0 0 10px; padding-left: 22px; }
.tp-legal-doc__list li { margin-bottom: 4px; }
.tp-legal-doc a { color: var(--tp-accent-hover); overflow-wrap: anywhere; }
.tp-legal-doc strong { color: var(--tp-text-strong); }
.tp-legal__todo {
  padding: 0 4px; border-radius: 4px; background: var(--tp-sun-bg); color: var(--tp-sun-text); font-weight: 700; outline: 1px dashed var(--tp-sun-edge);
}
.tp-legal-page__back { width: min(100%, 860px); margin: 14px auto 0; }
.tp-legal-page__foot {
  display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(100%, 860px); margin: 24px auto 0; padding-top: 16px;
  border-top: 1px solid var(--tp-line);
}
@media (max-width: 599px) {
  .tp-legal-doc { font-size: 15px; line-height: 23px; }
  .tp-legal-doc__head h1 { font-size: 26px; line-height: 32px; }
  .tp-legal-page__tabs { order: 3; flex-basis: 100%; }
}

/* ---------- Acceptance ---------- */
.tp-modal--consent .tp-modal__close { display: none; }
.tp-consent { display: flex; flex-direction: column; gap: 14px; }
.tp-consent__check, .tp-auth__consent .tp-check { align-items: flex-start; gap: 10px; color: var(--tp-text); font-size: 13px; line-height: 19px; }
.tp-consent__check input, .tp-auth__consent .tp-check input { width: 16px; height: 16px; margin-top: 2px; }
.tp-consent a, .tp-auth__consent a { color: var(--tp-accent-hover); font-weight: 600; }
.tp-auth__consent { margin-top: 2px; }
.tp-auth__legal { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; }

/* ---------- Sources next to YouTube content ---------- */
.tp-hsec__side { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; }
.tp-hsec__side [hidden] { display: none; }
.tp-an-hero__source, .tp-trk-source { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 6px 0 0; color: var(--tp-text-subtlest); font-size: 12px; line-height: 17px; }
.tp-cdrefs__src { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: 4px; color: var(--tp-text-subtlest); }
.tp-pub__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; flex: none; padding: 6px 12px; border-top: 1px solid var(--tp-line); background: var(--tp-bg); }
.tp-pub__foot .tp-legal { flex-direction: row; }
.tp-pubcard__hrow .tp-ytattr { margin-left: auto; }
.tp-ex-feedhead__actions .tp-ytattr { align-self: center; }
.tp-tester__attr { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; margin: 12px 0 0; color: var(--tp-text-subtlest); font-size: 12px; line-height: 17px; text-align: center; }
.tp-tester__attr[hidden] { display: none; }
.tp-fd-feed .tp-section__head .tp-ytattr { margin-left: 4px; }

/* Home: « Aléatoire » without a free popular search */
.tp-hero__random.is-off { color: #909090; cursor: help; }
.tp-hero__random.is-off .tp-icon { transform: none; }
.tp-mock__score--green { background: var(--tp-green-bg); color: var(--tp-green-text); }

/* Analysis: similar channels found on a click (mode conforme) */
.tp-an-ask {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border: 1px dashed var(--tp-border);
  border-radius: var(--tp-radius-lg); background: var(--tp-surface);
}
.tp-an-ask__text { margin: 0; max-width: 720px; color: var(--tp-text); font-size: 14px; line-height: 21px; }
.tp-an-ask__note { margin: 0; color: var(--tp-text-subtlest); font-size: 12px; line-height: 17px; }
