/* =========================================================
   card.css — LeapViews : modale d'une carte (views/card.js), « document + production » (docs/SPEC-v3.md § 5,
   « Carte : document + production ») : pas d'étapes, une seule couleur d'accent, aucun encadré coloré, textes courts.

   .tp-modal.tp-cd-modal > .tp-cd-dialog (ui.openModal xl, en-tête par défaut masqué) > .tp-modal__body > .tp-cd
     .tp-cd__top     fil d'Ariane __crumbs (__crumb--board lien, __crumb--list sélecteur) · __robadge · __topsaved · « … » · ✕
     .tp-cd__main    colonne défilante > .tp-cd__inner (1 056 px au plus)
       __readonly, __archived (lignes simples)
       __head        __media (16:9 : __mediabox > __frame > __img | __mediaadd « Ajouter une vidéo de référence » ;
                     __thumbbtn « Miniature ▾ » posé dessus) + __headmain (__title, __ref, __props > __prop > __propk + __propv)
       __tabbar      collant : __tabs > __tab[aria-selected] (+ __tabn compteur discret)
       __pane--script  __write = __editcol (__tb : __fmt, __tbtn « Section », copier, télécharger, plein écran ·
                       __help · __paper > __editor + __stats collant) + __ai (panneau « Écrire avec l'IA », collant :
                       .tp-cdai__home | __brief | __out) ; __aibar (bouton du bas, écrans étroits)
       __pane--notes (description) · --checklist · --files (pièces jointes) · --comments
   Lecture seule (observateur) : .tp-cd-dialog.is-readonly masque tout [data-edit-only] ; .is-static = pastille non cliquable.
   Glisser-déposer : .tp-cd-dialog.tp-dropzone.is-dragover (calque, ui.dropZone).
   Mode plein écran : .tp-cd-dialog.is-focus (+ .tp-modal.tp-cd-focus). Moins de 900 px : plein écran, une colonne,
   le panneau IA s'ouvre en volet (.has-aisheet) depuis __aibar.
   ========================================================= */

/* ---------- Dialog frame ---------- */
.tp-modal.tp-cd-modal { padding: 24px 16px; }
.tp-modal__dialog.tp-cd-dialog {
  --tp-cd-pad: 32px; --tp-cd-tabh: 49px;
  max-width: 1120px; height: calc(100vh - 48px); height: calc(100dvh - 48px); min-height: 480px; max-height: none;
  overflow: hidden; background: var(--tp-surface);
}
.tp-cd-dialog > .tp-modal__head { display: none; }
.tp-cd-dialog > .tp-modal__body { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.tp-cd { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.tp-cd__spacer { flex: 1; }

/* ---------- Top bar: « Tableau / Liste », Enregistré, …, ✕ ---------- */
.tp-cd__top { display: flex; align-items: center; gap: 4px; flex: none; height: 52px; padding: 0 12px 0 var(--tp-cd-pad); }
.tp-cd__crumbs {
  display: flex; flex: 1; align-items: center; gap: 6px; min-width: 0; overflow: hidden;
  color: var(--tp-text-subtlest); font-size: 13px; font-weight: 600; white-space: nowrap;
  /* Room for the focus rings inside the clipping box, without moving anything (padding + same negative margin). */
  margin: -4px; padding: 4px;
}
.tp-cd__crumb { min-width: 0; overflow: hidden; color: var(--tp-text-subtle); text-overflow: ellipsis; text-decoration: none; }
a.tp-cd__crumb:hover { color: var(--tp-text-strong); text-decoration: underline; text-underline-offset: 3px; }
.tp-cd__crumbsep { flex: none; color: var(--tp-text-subtlest); }
.tp-cd__crumb--list {
  display: inline-flex; align-items: center; gap: 2px; max-width: min(100%, 320px); height: 28px; margin-left: -6px; padding: 0 4px 0 6px;
  border: 0; border-radius: var(--tp-radius-sm); background: transparent; color: var(--tp-text-strong); font: inherit; font-weight: 700;
  transition: background-color var(--tp-dur) var(--tp-ease);
}
.tp-cd__crumb--list:hover:not(:disabled), .tp-cd__crumb--list[aria-expanded="true"] { background: var(--tp-hover-strong); }
.tp-cd__crumb--list .tp-icon { width: 14px; height: 14px; color: var(--tp-text-subtlest); }
.tp-cd__crumb--list:disabled { cursor: default; }
.tp-cd__crumb--list:disabled .tp-icon { display: none; }
.tp-cd__pilltext { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tp-cd__topsaved { margin: 0 8px 0 12px; color: var(--tp-text-subtlest); font-size: 13px; font-weight: 600; white-space: nowrap; }
.tp-cd__topsaved:empty { display: none; }
.tp-cd__topsaved[data-state="error"], .tp-cd__topsaved[data-state="syncerror"] { color: var(--tp-danger); }
.tp-cd__topsaved[data-state="conflict"] { color: var(--tp-warning); }
.tp-cd__robadge { margin-right: 4px; color: var(--tp-text-subtle); font-size: 12px; font-weight: 700; white-space: nowrap; }

/* ---------- Scrolling column ---------- */
.tp-cd__main { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.tp-cd__inner { max-width: 1120px; margin: 0 auto; padding: 0 var(--tp-cd-pad) 48px; }

/* ---------- Notices (read-only, archived): plain lines ---------- */
.tp-cd__readonly { margin-bottom: 12px; color: var(--tp-text-subtle); font-size: 13px; line-height: 18px; }
.tp-cd__archived {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; padding: 10px 12px;
  border: 1px solid var(--tp-border); border-radius: var(--tp-radius); color: var(--tp-text);
}
.tp-cd__archived > p { flex: 1; min-width: 160px; }
.tp-cd__archivedacts { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Header: big sharp thumbnail + title, reference, labels / due date / members ---------- */
.tp-cd__head { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 28px; padding: 4px 0 24px; }
.tp-cd__media { position: relative; align-self: start; min-width: 0; }
.tp-cd__mediabox { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--tp-radius); background: var(--tp-bg-sunken); }
.tp-cd__frame { position: absolute; inset: 0; display: block; background: #05070b; }
.tp-cd__frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px #ffffff14; pointer-events: none; }
.tp-cd__img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tp-cd__frame.is-fit .tp-cd__img { object-fit: contain; }
.tp-cd__frame--color { background: var(--tp-label, var(--tp-gray)); }
.tp-cd__mediaadd, .tp-cd__mediaempty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%;
  padding: 16px; border: 1px solid var(--tp-line); border-radius: inherit; background: var(--tp-surface-2); color: var(--tp-text-subtle); text-align: center;
  transition: background-color var(--tp-dur) var(--tp-ease), border-color var(--tp-dur) var(--tp-ease);
}
.tp-cd__mediaadd:hover, .tp-cd__mediaadd[aria-expanded="true"] { border-color: var(--tp-border-input); background: var(--tp-surface-3); }
.tp-cd__mediaaddt { color: var(--tp-text-strong); font-size: 15px; line-height: 22px; font-weight: 700; }
.tp-cd__mediaaddh { color: var(--tp-text-subtlest); font-size: 13px; }
.tp-cd__mediaempty { color: var(--tp-text-subtlest); font-size: 13px; font-weight: 600; }
.tp-cd__thumbbtn {
  position: absolute; right: 10px; bottom: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 13px;
  border: 0; border-radius: var(--tp-radius-pill); background: rgba(8, 11, 18, 0.82); color: #fff; font-size: 13px; font-weight: 700;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background-color var(--tp-dur) var(--tp-ease);
}
.tp-cd__thumbbtn:hover, .tp-cd__thumbbtn[aria-expanded="true"] { background: rgba(8, 11, 18, 0.95); }
.tp-cd__thumbbtn .tp-icon { width: 14px; height: 14px; }
.tp-cd__thumbbtn.is-running { cursor: progress; }
.tp-cd__media[data-kind="empty"] .tp-cd__thumbbtn { background: var(--tp-surface-3); }
.tp-cd__media[data-kind="empty"] .tp-cd__thumbbtn:hover { background: var(--tp-surface-3-hover); }

.tp-cd__headmain { display: flex; flex-direction: column; min-width: 0; padding-top: 2px; }
.tp-cd__title {
  width: 100%; margin: 0 0 0 -6px; padding: 0 6px; border: 0; border-radius: var(--tp-radius-sm); background: transparent;
  color: var(--tp-text-strong); font: 800 28px/36px var(--tp-font-display); letter-spacing: -0.02em; resize: none; overflow: hidden; overflow-wrap: anywhere;
  transition: background-color var(--tp-dur) var(--tp-ease);
}
.tp-cd__title:hover { background: var(--tp-hover); }
.tp-cd__title:focus { background: var(--tp-field-bg); box-shadow: inset 0 0 0 2px var(--tp-accent-hover); outline: none; }
.tp-cd__ref { margin-top: 8px; color: var(--tp-text-subtle); font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.tp-cd__refk { color: var(--tp-text-subtlest); }
.tp-cd__reft { color: var(--tp-text); font-weight: 600; text-decoration: none; }
.tp-cd__reft:hover { color: var(--tp-text-strong); text-decoration: underline; text-underline-offset: 3px; }
.tp-cd__refmeta { color: var(--tp-text-subtle); }
.tp-cd__refmore {
  height: 20px; margin-left: 2px; padding: 0 7px; border: 0; border-radius: var(--tp-radius-pill); background: var(--tp-surface-3);
  color: var(--tp-text-subtle); font-size: 12px; font-weight: 700; vertical-align: 1px;
}
.tp-cd__refmore:hover { background: var(--tp-surface-3-hover); color: var(--tp-text-strong); }
.tp-cd__ref .tp-ytattr {
  display: flex; width: fit-content; margin-top: 2px; padding: 0; border: 0; background: none; color: var(--tp-text-subtlest); font-size: 12px; font-weight: 600;
}
.tp-cd__ref .tp-ytattr:hover { color: var(--tp-text-strong); }
.tp-cd__props { display: flex; flex-wrap: wrap; gap: 14px 32px; margin-top: auto; padding-top: 18px; }
.tp-cd__prop { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tp-cd__propk { color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px; font-weight: 600; }
.tp-cd__propv { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 28px; }
.tp-cd__chips { display: contents; }
.tp-cd__label { max-width: 200px; border: 0; cursor: pointer; transition: filter var(--tp-dur) var(--tp-ease); }
.tp-cd__label:hover { filter: brightness(1.12); }
.tp-cd__label.tp-label--lg { min-width: 40px; height: 28px; padding: 0 11px; border-radius: var(--tp-radius-sm); font-size: 13px; line-height: 28px; font-weight: 700; }
.tp-cd__sq {
  display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--tp-radius-sm);
  background: var(--tp-surface-3); color: var(--tp-text-subtle); transition: background-color var(--tp-dur) var(--tp-ease), color var(--tp-dur) var(--tp-ease);
}
.tp-cd__sq:hover, .tp-cd__sq[aria-expanded="true"] { background: var(--tp-surface-3-hover); color: var(--tp-text-strong); }
.tp-cd__sq .tp-icon { width: 14px; height: 14px; }
.tp-cd__sq--round { border-radius: 50%; }
.tp-cd__dates { gap: 8px; }
.tp-cd__duecheck { width: 16px; height: 16px; margin: 0; flex: none; cursor: pointer; accent-color: var(--tp-accent); }
.tp-button.tp-cd__datebtn {
  --tp-btn-edge: transparent; --tp-btn-shadow: none; gap: 8px; min-height: 28px; height: 28px; padding: 0 10px 0 11px;
  border-radius: var(--tp-radius-sm); font-size: 13px; font-weight: 600;
}
.tp-cd__datebtn .tp-icon { width: 14px; height: 14px; color: var(--tp-text-subtlest); }
.tp-cd__duebadge { color: var(--tp-text-subtle); font-size: 12px; line-height: 16px; font-weight: 600; }
.tp-cd__duebadge--done { color: var(--tp-green-text); }
.tp-cd__duebadge--late { color: var(--tp-danger); }
.tp-cd__duebadge--soon { color: var(--tp-yellow-text); }
.tp-cd__members { gap: 4px; }
.tp-cd__member .tp-avatar { width: 28px; height: 28px; font-size: 11px; }

/* ---------- Tabs ---------- */
.tp-cd__tabbar {
  position: sticky; top: 0; z-index: 6; margin: 0 calc(-1 * var(--tp-cd-pad)); padding: 0 calc(var(--tp-cd-pad) - 10px);
  border-bottom: 1px solid var(--tp-border); background: var(--tp-surface);
}
.tp-cd__tabs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tp-cd__tabs::-webkit-scrollbar { display: none; }
.tp-cd__tab {
  position: relative; flex: none; display: inline-flex; align-items: baseline; gap: 5px; padding: 14px 10px; border: 0; background: none;
  color: var(--tp-text-subtle); font-size: 14px; line-height: 20px; font-weight: 700; white-space: nowrap; transition: color var(--tp-dur) var(--tp-ease);
}
.tp-cd__tab:hover { color: var(--tp-text-strong); }
.tp-cd__tab::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: transparent; }
.tp-cd__tab[aria-selected="true"] { color: var(--tp-text-strong); }
.tp-cd__tab[aria-selected="true"]::after { background: var(--tp-accent); }
.tp-cd__tab:focus-visible { outline: 2px solid var(--tp-accent-hover); outline-offset: -4px; border-radius: var(--tp-radius-sm); }
.tp-cd__tabn { color: var(--tp-text-subtlest); font-weight: 600; font-variant-numeric: tabular-nums; }
.tp-cd__tabn:empty { display: none; }
.tp-cd__pane { padding-top: 20px; }
.tp-cd__pane:focus { outline: none; }
.tp-cd__pane:focus-visible { outline: 2px solid var(--tp-accent-hover); outline-offset: 4px; border-radius: var(--tp-radius-sm); }
.tp-cd__hint { color: var(--tp-text-subtlest); font-size: 13px; line-height: 18px; }
.tp-cd__none { color: var(--tp-text-subtle); }
.tp-cd__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.tp-cd__edactions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.tp-cd__edhint { color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px; }

/* ---------- Script tab: the editor + « Écrire avec l'IA » ---------- */
.tp-cd__write { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.tp-cd__editcol { min-width: 0; }
.tp-cd__tb { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.tp-cd__fmt { display: inline-flex; flex: none; padding: 3px; border: 1px solid var(--tp-line); border-radius: var(--tp-radius-pill); background: var(--tp-field-bg); }
.tp-cd__fmtopt { position: relative; display: inline-flex; cursor: pointer; }
.tp-cd__fmtopt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tp-cd__fmtopt span {
  padding: 4px 12px; border-radius: var(--tp-radius-pill); 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-cd__fmtopt:hover span { color: var(--tp-text-strong); }
.tp-cd__fmtopt input:checked + span { background: var(--tp-surface-3); color: var(--tp-text-strong); }
.tp-cd__fmtopt input:focus-visible + span { outline: 2px solid var(--tp-accent-hover); outline-offset: 1px; }
.tp-cd__fmtopt input:disabled + span { cursor: default; }
.tp-cd__tbtn {
  display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px 0 10px; border: 0; border-radius: var(--tp-radius-sm);
  background: transparent; color: var(--tp-text); font-size: 13px; font-weight: 700; white-space: nowrap;
  transition: background-color var(--tp-dur) var(--tp-ease), color var(--tp-dur) var(--tp-ease);
}
.tp-cd__tbtn:hover, .tp-cd__tbtn[aria-expanded="true"] { background: var(--tp-hover-strong); color: var(--tp-text-strong); }
.tp-cd__tbtn .tp-icon { width: 15px; height: 15px; color: var(--tp-text-subtle); }
.tp-cd__help { margin: -2px 0 10px; color: var(--tp-text-subtle); font-size: 13px; line-height: 20px; }
.tp-cd__help .tp-link { font-size: 13px; }
.tp-cd__paper {
  position: relative; border: 1px solid var(--tp-line); border-radius: var(--tp-radius-lg); background: var(--tp-surface-2);
  transition: border-color var(--tp-dur) var(--tp-ease), box-shadow var(--tp-dur) var(--tp-ease);
}
.tp-cd__paper:hover { border-color: var(--tp-border-input); }
.tp-cd__paper:focus-within { border-color: var(--tp-accent-hover); box-shadow: inset 0 0 0 1px var(--tp-accent-hover); }
.tp-cd__editor {
  display: block; width: 100%; min-height: 420px; padding: 20px 28px 24px; border: 0; border-radius: var(--tp-radius-lg) var(--tp-radius-lg) 0 0;
  background: transparent; color: var(--tp-text-strong); font: 400 16px/27px var(--tp-font); resize: none; overflow: hidden;
}
.tp-cd__editor::placeholder { color: var(--tp-text-subtlest); opacity: 1; }
.tp-cd__editor:focus { outline: none; }
/*
 * Clean headings: the text is drawn by a mirror under the textarea (same font, size, padding and wrapping: the same
 * layout to the pixel); the textarea's own text is transparent, its caret and selection stay visible.
 */
.tp-cd__mirror {
  position: absolute; top: 0; left: 0; right: 0; z-index: 0; display: none; padding: 20px 28px 24px; overflow: hidden;
  color: #d6dcea; font: 400 16px/27px var(--tp-font); white-space: pre-wrap; overflow-wrap: break-word; word-break: normal;
  pointer-events: none; user-select: none;
}
.tp-cd__editor, .tp-cd__mirror { box-sizing: border-box; letter-spacing: normal; word-spacing: normal; text-indent: 0; text-transform: none; tab-size: 8; }
.tp-cd__paper.has-mirror .tp-cd__mirror { display: block; }
.tp-cd__paper.has-mirror .tp-cd__editor { position: relative; z-index: 1; color: transparent; caret-color: var(--tp-text-strong); }
.tp-cd__paper.has-mirror .tp-cd__editor::selection { color: transparent; background: rgba(47, 98, 240, 0.42); }
.tp-cdm__h { color: var(--tp-text-strong); -webkit-text-stroke: 0.45px currentColor; }
.tp-cdm__mk { color: rgba(214, 220, 234, 0.2); -webkit-text-stroke: 0; }
.tp-cdm__n { color: var(--tp-text-subtle); }
.tp-cdm__st { color: var(--tp-text-strong); -webkit-text-stroke: 0.4px currentColor; }
.tp-cdm__dash { color: var(--tp-text-subtlest); }
.tp-cdm__cue { color: var(--tp-text-subtle); }
.tp-cd__stats {
  position: sticky; bottom: 0; z-index: 2; padding: 0 28px; border-top: 1px solid var(--tp-border);
  border-radius: 0 0 var(--tp-radius-lg) var(--tp-radius-lg); background: var(--tp-surface-2);
}
.tp-cd__nums { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-height: 44px; padding: 10px 0; color: var(--tp-text-subtle); font-size: 13px; line-height: 18px; }
.tp-cd__nums strong { color: var(--tp-text-strong); font-weight: 700; }
.tp-cd__nums [data-dur] { cursor: help; }
.tp-cd__stats[data-level="over"] [data-dur] { color: var(--tp-warning); }
.tp-cd__keys { display: none; }
.tp-cd__saved { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--tp-text-subtlest); }
.tp-cd__saveddot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--tp-gray); }
.tp-cd__saved[data-state="pending"] .tp-cd__saveddot { background: var(--tp-text-subtle); animation: tp-pulse 1.2s ease-in-out infinite; }
.tp-cd__saved[data-state="saved"] .tp-cd__saveddot, .tp-cd__saved[data-state="rest"] .tp-cd__saveddot { background: var(--tp-success); }
.tp-cd__saved[data-state="error"], .tp-cd__saved[data-state="syncerror"] { color: var(--tp-danger); font-weight: 600; }
.tp-cd__saved[data-state="error"] .tp-cd__saveddot { background: var(--tp-danger); }
.tp-cd__saved[data-state="conflict"] { color: var(--tp-warning); font-weight: 600; }
.tp-cd__saved[data-state="conflict"] .tp-cd__saveddot { background: var(--tp-warning); }
.tp-cd__focusexit { display: none; margin-top: 12px; }
.tp-cd__conflict, .tp-cd__descconflict {
  display: flex; gap: 10px; margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--tp-border); border-left: 3px solid var(--tp-warning);
  border-radius: var(--tp-radius); color: var(--tp-text-strong);
}
.tp-cd__conflict > .tp-icon, .tp-cd__descconflict > .tp-icon { margin-top: 2px; color: var(--tp-warning); }
.tp-cd__aibar { display: none; }

/* ---------- « Écrire avec l'IA » ---------- */
.tp-cd__ai {
  position: sticky; top: calc(var(--tp-cd-tabh) + 20px); min-width: 0; max-height: calc(100vh - 48px - 52px - var(--tp-cd-tabh) - 40px);
  max-height: calc(100dvh - 48px - 52px - var(--tp-cd-tabh) - 40px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  /* The panel scrolls (overflow-y: auto, so it clips on every side): 4 px of room for the focus rings of its full-width
     buttons, given back by the negative margin so nothing moves. */
  margin: -4px; padding: 4px;
}
/*
 * An answer keeps its actions in view: the text box and the list of sources shrink (each scrolls) rather than pushing
 * the buttons out of the panel.
 */
.tp-cd__ai { display: flex; flex-direction: column; }
.tp-cd__ai > * { flex: none; }
.tp-cd__ai > .tp-cdai__out { display: flex; flex: 0 1 auto; flex-direction: column; min-height: 0; }
.tp-cdai__out > * { flex: none; }
.tp-cdai__out > .tp-cdai__md { flex: 0 4 auto; min-height: 96px; }
.tp-cdai__out > .tp-cdai__sources { display: flex; flex: 0 1 auto; flex-direction: column; min-height: 0; }
.tp-cdai__sources > ul { flex: 0 1 auto; min-height: 0; max-height: 220px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.tp-cdai__sources > ul[hidden] { display: none; }
.tp-cdai__head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.tp-cdai__title { flex: 1; color: var(--tp-text-strong); font-size: 16px; line-height: 22px; font-weight: 800; }
.tp-cdai__close { display: none; }
.tp-cdai__notice { margin-bottom: 12px; color: var(--tp-text-subtle); font-size: 13px; line-height: 20px; }
.tp-cdai__notice.is-warn { color: var(--tp-text); }
.tp-cdai__go[aria-disabled="true"] { cursor: not-allowed; }
.tp-cdai__or { margin: 16px 0 10px; color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px; font-weight: 600; }
.tp-cdai__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-cdai__chip {
  min-height: 32px; padding: 5px 13px; border: 1px solid #2c3850; border-radius: var(--tp-radius-pill); background: transparent;
  color: var(--tp-text-strong); font-size: 13px; line-height: 20px; font-weight: 700;
  transition: background-color var(--tp-dur) var(--tp-ease), border-color var(--tp-dur) var(--tp-ease), color var(--tp-dur) var(--tp-ease);
}
.tp-cdai__chip:hover { border-color: #3a4866; background: var(--tp-hover); }
.tp-cdai__chip[aria-disabled="true"] { border-color: var(--tp-line); color: var(--tp-text-subtlest); cursor: not-allowed; }
.tp-cdai__chip[aria-disabled="true"]:hover { background: transparent; }
.tp-cdai__ask { position: relative; margin-top: 16px; }
.tp-cdai__instr, .tp-cdai__briefin {
  display: block; width: 100%; min-height: 76px; padding: 10px 46px 10px 14px; border: 1px solid var(--tp-border-input); border-radius: var(--tp-radius);
  background: var(--tp-field-bg); color: var(--tp-text-strong); font: inherit; line-height: 20px; resize: none; overflow: hidden;
}
.tp-cdai__instr::placeholder, .tp-cdai__briefin::placeholder { color: var(--tp-text-subtlest); opacity: 1; }
.tp-cdai__instr:focus, .tp-cdai__briefin:focus { border-color: var(--tp-accent); box-shadow: 0 0 0 1px var(--tp-accent); outline: none; }
.tp-cdai__send {
  position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  background: var(--tp-accent); color: #fff; transition: background-color var(--tp-dur) var(--tp-ease);
}
.tp-cdai__send:hover { background: var(--tp-accent-fill-hover); }
.tp-cdai__send .tp-icon { width: 15px; height: 15px; }
.tp-cdai__send[aria-disabled="true"] { background: var(--tp-surface-3); color: var(--tp-text-subtlest); cursor: not-allowed; }
.tp-cdai__opts { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; color: var(--tp-text-subtle); font-size: 13px; line-height: 20px; }
.tp-cdai__optval { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-cdai__optedit { flex: none; font-size: 13px; }
.tp-cdai__idea { margin-top: 10px; color: var(--tp-text-subtle); font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.tp-cdai__idea:empty { display: none; }
.tp-cdai__ideak { color: var(--tp-text-subtlest); }
.tp-cdai__ideav { color: var(--tp-text); }
.tp-cdai__idea .tp-link, .tp-cdai__hist .tp-link { font-size: 13px; }
.tp-cdai__hist { margin-top: 6px; }
.tp-cdai__hint { margin-top: 10px; color: var(--tp-text); font-size: 13px; line-height: 19px; }
.tp-cdai__optpop .tp-field + .tp-field { margin-top: 0; }
.tp-cdai__len { display: flex; align-items: center; gap: 8px; color: var(--tp-text-subtle); }
.tp-cdai__len .tp-input { width: 96px; }
.tp-cdai__reset { align-self: flex-start; font-size: 12px; }
.tp-cdai__hitem { justify-content: space-between; }
.tp-cdai__htime { flex: none; color: var(--tp-text-subtlest); font-size: 12px; font-weight: 600; }

/* « Dis-moi ce que tu as en tête » */
.tp-cdai__brieft { display: block; color: var(--tp-text-strong); font-size: 15px; line-height: 22px; font-weight: 800; }
.tp-cdai__brieflead { margin: 4px 0 12px; color: var(--tp-text-subtle); font-size: 13px; line-height: 19px; }
.tp-cdai__briefin { min-height: 128px; padding-right: 14px; }
.tp-cdai__briefacts { margin-top: 12px; }
.tp-cdai__brieflinks { display: flex; justify-content: center; gap: 16px; margin-top: 10px; }
.tp-cdai__brieflinks .tp-link { font-size: 13px; }

/* An answer: research, live text, what to do with it */
.tp-cdai__outhead { display: flex; align-items: baseline; gap: 10px; }
.tp-cdai__outt { display: flex; flex: 1; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.tp-cdai__outt strong { color: var(--tp-text-strong); font-size: 15px; line-height: 22px; font-weight: 800; overflow-wrap: anywhere; }
.tp-cdai__outt span { color: var(--tp-text-subtlest); font-size: 13px; font-weight: 600; white-space: nowrap; }
.tp-cdai__outhead .tp-link { flex: none; font-size: 13px; }
.tp-cdai__research { margin-top: 12px; color: var(--tp-text-subtle); font-size: 13px; line-height: 19px; }
.tp-cdai__research > p { display: flex; align-items: center; gap: 8px; }
.tp-cdai__research.is-busy > p { color: var(--tp-text); font-weight: 600; }
.tp-cdai__queries { display: block; margin: 2px 0 0 22px; overflow: hidden; color: var(--tp-text-subtlest); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.tp-cdai__srcbtn {
  display: inline-flex; flex: none; align-self: flex-start; align-items: center; gap: 4px; padding: 0; border: 0; border-radius: var(--tp-radius-sm);
  background: none; color: var(--tp-text-subtle); font: inherit; font-weight: 600; cursor: pointer;
}
.tp-cdai__srcbtn:hover { color: var(--tp-text-strong); }
.tp-cdai__srcbtn:focus-visible { outline: 2px solid var(--tp-accent-hover); outline-offset: 2px; }
.tp-cdai__sources .tp-cdai__chev { width: 14px; height: 14px; transition: transform var(--tp-dur) var(--tp-ease); }
.tp-cdai__sources.is-open .tp-cdai__chev { transform: rotate(180deg); }
.tp-cdai__sources ul { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 2px; padding-right: 4px; list-style: none; }
.tp-cdai__nosearch { color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px; }
.tp-cdai__briefref { margin-top: 8px; font-size: 13px; line-height: 19px; }
.tp-cdai__briefref .tp-link { font-size: 13px; }
.tp-cdai__sources li { display: flex; flex-direction: column; min-width: 0; }
.tp-cdai__sources a { color: var(--tp-text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.tp-cdai__sources a:hover { color: var(--tp-text-strong); text-decoration: underline; text-underline-offset: 3px; }
.tp-cdai__sources li span { color: var(--tp-text-subtlest); font-size: 12px; }
.tp-cdai__thinking { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--tp-text-subtle); font-size: 13px; }
.tp-cdai__md {
  max-height: 60vh; max-height: 60dvh; margin-top: 12px; padding: 14px 16px; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--tp-line); border-radius: var(--tp-radius); background: var(--tp-field-bg); color: #dfe4ee; font-size: 14px; line-height: 22px;
}
.tp-cdai__md h3, .tp-cdai__md h4 { margin: 12px 0 2px; color: var(--tp-text-strong); font-size: 13px; line-height: 20px; font-weight: 800; }
.tp-cdai__md > :first-child { margin-top: 0; }
.tp-cdai__out[data-state="writing"] .tp-cdai__md > :last-child:not(ul):not(ol)::after,
.tp-cdai__out[data-state="writing"] .tp-cdai__md > :is(ul, ol):last-child > li:last-child::after {
  content: ""; display: inline-block; width: 7px; height: 14px; margin-left: 2px; vertical-align: -2px;
  background: var(--tp-accent); animation: tp-cd-blink 1s steps(2, start) infinite;
}
@keyframes tp-cd-blink { to { visibility: hidden; } }
.tp-cdai__note { margin-top: 8px; color: var(--tp-text-subtle); font-size: 12px; line-height: 16px; }
.tp-cdai__err { margin-top: 12px; }
.tp-cdai__err > p:first-child { color: var(--tp-danger-hover); font-size: 13px; line-height: 19px; }
.tp-cdai__acts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.tp-cdai__links { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 10px; margin-top: 10px; color: var(--tp-text-subtlest); font-size: 13px; }
.tp-cdai__links .tp-link { font-size: 13px; }

/* ---------- Notes (the description) ---------- */
.tp-cd__notes { max-width: 760px; }
.tp-cd__desctext { margin: 0 0 0 -10px; padding: 6px 10px; border-radius: var(--tp-radius-sm); color: var(--tp-text); font-size: 15px; line-height: 24px; cursor: pointer; }
.tp-cd__desctext:hover { background: var(--tp-hover); }
.tp-cd__notesedit { margin-top: 6px; }
.tp-cd__notesedit .tp-link { font-size: 13px; }
.tp-cd__descempty {
  display: block; width: 100%; min-height: 120px; padding: 14px 16px; border: 1px solid var(--tp-line); border-radius: var(--tp-radius-lg);
  background: var(--tp-surface-2); color: var(--tp-text-subtlest); text-align: left; vertical-align: top;
}
.tp-cd__descempty:hover { border-color: var(--tp-border-input); color: var(--tp-text-subtle); }
.tp-cd__descinput { min-height: 220px; padding: 14px 16px; font-size: 15px; line-height: 24px; resize: none; overflow: hidden; }
.tp-cd__draftnote { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; color: var(--tp-text-subtle); font-size: 13px; }
.tp-cd__draftnote > .tp-icon { display: none; }
.tp-cd__draftnote > span { flex: 1; min-width: 160px; }

/* ---------- Checklist / Files panes ---------- */
.tp-cd__pane--checklist, .tp-cd__pane--comments { max-width: 760px; }
.tp-cd__checklists > .tp-cd__cl + .tp-cd__cl { margin-top: 28px; }
.tp-cd__pane--checklist > .tp-cd__none { margin-bottom: 12px; }
.tp-cd__clnew { margin-top: 16px; gap: 6px; }
.tp-cd__fileshead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 16px; }
.tp-cd__fileshead .tp-button { gap: 6px; }
.tp-cd__refmore.is-icon { display: inline-grid; place-items: center; width: 24px; padding: 0; vertical-align: -5px; }
.tp-cd__refmore.is-icon .tp-icon { width: 14px; height: 14px; }

/* ---------- Rich links of the notes (« liens enrichis ») ----------
   Sizes measured on Atlassian's Smart Links (atlaskit smart-card, Trello card back, 2026-10) :
   inline 1 px border, radius 6 px, padding 2 px 4 px, icon 16 px, 14/20 text in the link colour ;
   card 1 px border, radius 8 px, padding 16 px, icon 24 px, title 14/16 600, text 12 px, preview on the right ;
   embed 1 px border, radius 8 px, padding 8 px, title row (icon 16 + title) then a 16:9 frame (radius 8 px). */
.tp-sl { --tp-sl-line: var(--tp-border-input, var(--tp-border)); }
.tp-sl--inline { display: inline; }
.tp-sl__chip {
  display: inline; padding: 2px 4px; border: 1px solid var(--tp-sl-line); border-radius: 6px; background: var(--tp-surface-2);
  color: var(--tp-accent); font-size: 14px; line-height: 20px; text-decoration: none; box-decoration-break: clone; -webkit-box-decoration-break: clone;
  overflow-wrap: anywhere; cursor: pointer; transition: background-color var(--tp-dur) var(--tp-ease), border-color var(--tp-dur) var(--tp-ease);
}
.tp-sl__chip:hover { background: var(--tp-hover); text-decoration: none; }
.tp-sl__chip:hover .tp-sl__t { text-decoration: underline; }
.tp-sl__ico { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px; margin-right: 4px; vertical-align: -3px; }
.tp-sl__ico img, .tp-sl__ico svg { width: 16px; height: 16px; max-width: none; border-radius: 2px; object-fit: contain; }
.tp-sl__ico .tp-icon { color: var(--tp-text-subtle); }
.tp-sl__ico--lg { width: 24px; height: 24px; margin-right: 0; }
.tp-sl__ico--lg img, .tp-sl__ico--lg svg { width: 24px; height: 24px; }
.tp-sl.is-loading .tp-sl__t, .tp-sl.is-loading .tp-sl__ct { color: var(--tp-text-subtle); }
.tp-sl.is-selected .tp-sl__chip, .tp-sl.is-selected .tp-sl__card, .tp-sl.is-selected.tp-sl--embed {
  border-color: var(--tp-accent); box-shadow: 0 0 0 1px var(--tp-accent);
}
/* Card (block) */
.tp-sl--card, .tp-sl--embed { display: block; max-width: 680px; margin: 8px 0; }
.tp-sl__card {
  display: flex; gap: 16px; padding: 16px; border: 1px solid var(--tp-sl-line); border-radius: 8px; background: var(--tp-surface-2);
  color: var(--tp-text); text-decoration: none; cursor: pointer; transition: background-color var(--tp-dur) var(--tp-ease);
}
.tp-sl__card:hover { background: var(--tp-hover); text-decoration: none; }
.tp-sl__cbody { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.tp-sl__chead { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tp-sl__ct {
  display: -webkit-box; min-width: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  color: var(--tp-accent); font-size: 14px; line-height: 18px; font-weight: 600;
}
.tp-sl__card:hover .tp-sl__ct { text-decoration: underline; }
.tp-sl__cdesc {
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  color: var(--tp-text-subtle); font-size: 12px; line-height: 16px;
}
.tp-sl__cfoot { display: flex; align-items: center; margin-top: auto; color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px; }
.tp-sl__cfoot > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-sl__cimg { flex: none; align-self: center; width: 168px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: var(--tp-surface-3); }
.tp-sl__cimg img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tp-sl__sk { display: block; width: 70%; height: 12px; border-radius: 4px; background: var(--tp-surface-3); }
/* Embed */
.tp-sl--embed:has(.tp-sl__frame) { padding: 8px; border: 1px solid var(--tp-sl-line); border-radius: 8px; background: var(--tp-surface-2); }
.tp-sl__ehead { display: flex; align-items: center; min-width: 0; padding: 0 0 8px; font-size: 14px; line-height: 20px; }
.tp-sl__et { min-width: 0; overflow: hidden; color: var(--tp-accent); text-overflow: ellipsis; white-space: nowrap; }
.tp-sl__frame { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: #000; cursor: pointer; }
.tp-sl__frame img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tp-sl__frame.is-short img { object-fit: contain; }
.tp-sl__play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; transform: translate(-50%, -50%); transition: filter var(--tp-dur) var(--tp-ease); }
.tp-sl__play svg { display: block; width: 100%; height: 100%; }
.tp-sl__frame:not(:hover) .tp-sl__play path:first-child { fill: #212121cc; }
.tp-sl__watch {
  position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: #000000b3; color: #fff; font-size: 13px; line-height: 18px; font-weight: 500;
}
.tp-sl__watch svg { width: 20px; height: 20px; }
.tp-sl__frame:hover { text-decoration: none; }
/* Toolbar under a selected link: « Inline ▾ | modifier · retirer · ouvrir | … » */
.tp-slbar {
  position: fixed; z-index: 440; display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm); background: var(--tp-surface-2); box-shadow: var(--tp-shadow-overlay); color: var(--tp-text);
  animation: tp-pop-in 160ms var(--tp-spring);
}
.tp-slbar__grp { position: relative; display: flex; }
.tp-slbar__sep { flex: none; width: 1px; height: 20px; margin: 0 4px; background: var(--tp-border); }
.tp-slbar__btn, .tp-slbar__mode {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 32px; min-width: 32px; padding: 0 6px; border: 0;
  border-radius: var(--tp-radius-xs, 4px); background: none; color: var(--tp-text); font-size: 14px; line-height: 20px; cursor: pointer;
  transition: background-color var(--tp-dur) var(--tp-ease);
}
.tp-slbar__mode { padding: 0 6px 0 10px; }
.tp-slbar__btn .tp-icon, .tp-slbar__mode .tp-icon { width: 16px; height: 16px; }
.tp-slbar__btn:hover, .tp-slbar__mode:hover, .tp-slbar__mode[aria-expanded="true"], .tp-slbar__btn[aria-expanded="true"] { background: var(--tp-hover-strong, var(--tp-hover)); }
.tp-slbar__menu {
  position: absolute; left: 0; top: calc(100% + 8px); min-width: 168px; padding: 6px 0; border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm); background: var(--tp-surface-2); box-shadow: var(--tp-shadow-overlay);
}
.tp-slbar__menu--end { left: auto; right: 0; min-width: 200px; }
.tp-slbar.is-above .tp-slbar__menu { top: auto; bottom: calc(100% + 8px); }
.tp-slbar__opt { justify-content: space-between; }
.tp-slbar__check { width: 16px; height: 16px; color: var(--tp-accent) !important; }
.tp-slform { display: flex; flex-direction: column; gap: 12px; }
.tp-slform .tp-field__error { color: var(--tp-danger); font-size: 12px; }

/* ---------- Attachments: section at the bottom of the card (like Trello) ----------
   Measured on a public Trello card (2026-10) : title 14/20 bold with a 20 px icon in a 28 px gutter, 32 px high ;
   « Liens » / « Fichiers » 12/20 600, 8 px under, 20 px between groups ; a link row 28 px (6 px 8 px) ;
   a file row 48 px : thumbnail 64×48 (radius 4, extension in bold), 12 px gap, name 14/20 bold, « Ajouté… » 12/20. */
.tp-cdattsec { max-width: 760px; margin-top: 32px; padding-top: 4px; }
.tp-cdattsec[hidden] { display: none; }
.tp-cdattsec__head { display: flex; align-items: center; min-height: 32px; margin-bottom: 12px; }
.tp-cdattsec__ico { display: inline-flex; flex: none; width: 28px; color: var(--tp-text-subtle); }
.tp-cdattsec__ico .tp-icon { width: 20px; height: 20px; }
.tp-cdattsec__title { flex: 1; min-width: 0; margin: 0; padding: 6px 0; color: var(--tp-text-strong); font-size: 14px; line-height: 20px; font-weight: 700; }
.tp-cdattsec__add { flex: none; }
.tp-cdattsec > .tp-cdatt__list, .tp-cdattsec > .tp-cdatt__group, .tp-cdattsec > .tp-cd__none, .tp-cdattsec > .tp-cdattsec__all { margin-left: 28px; }
.tp-cdattsec .tp-cdatt__group + .tp-cdatt__group { margin-top: 20px; }
.tp-cdattsec .tp-cdatt__glabel { margin: 0 0 8px; color: var(--tp-text); font-size: 12px; line-height: 20px; font-weight: 600; }
.tp-cdattsec__all { margin-top: 12px; }
.tp-cdattsec .tp-cdatt__list { gap: 4px; }
.tp-cdattsec .tp-cdatt { gap: 12px; padding: 4px; margin: 0 -4px; border-radius: var(--tp-radius-sm); }
.tp-cdattsec .tp-cdatt__thumb { width: 64px; height: 48px; border: 0; border-radius: 4px; }
.tp-cdatt__extn { color: var(--tp-text-subtle); font-size: 14px; line-height: 20px; font-weight: 700; letter-spacing: 0.02em; }
.tp-cdattsec .tp-cdatt__body { gap: 0; padding-top: 0; }
.tp-cdattsec .tp-cdatt__name { font-size: 14px; line-height: 20px; font-weight: 700; }
.tp-cdattsec .tp-cdatt__meta { line-height: 20px; }
.tp-cdattsec .tp-cdatt__acts { gap: 0 12px; margin-top: 0; }
/* Links: one framed list, each row = rich chip + date + actions */
.tp-cdatt__list--links { gap: 0 !important; overflow: hidden; border: 1px solid var(--tp-border-input, var(--tp-border)); border-radius: 6px; background: var(--tp-surface-2); }
.tp-cdattsec .tp-cdatt--link { align-items: center; flex-wrap: wrap; gap: 2px 12px; min-height: 28px; margin: 0; padding: 4px 8px; border-radius: 0; }
.tp-cdattsec .tp-cdatt--link + .tp-cdatt--link { border-top: 1px solid var(--tp-border); }
.tp-sl--row { flex: 1 1 220px; min-width: 0; }
.tp-sl--row .tp-sl__chip {
  display: flex; align-items: center; padding: 0; border: 0; background: none; font-size: 14px; line-height: 20px;
}
.tp-sl--row .tp-sl__chip:hover { background: none; }
.tp-sl--row .tp-sl__ico { margin-right: 8px; vertical-align: 0; }
.tp-sl--row .tp-sl__t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-cdatt__lside { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin-left: auto; }
.tp-cdatt--link .tp-cdatt__acts { margin: 0; }

/* ---------- Reference videos popover ---------- */
.tp-cdrp { display: flex; flex-direction: column; gap: 10px; }
.tp-cdrp__list { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; list-style: none; }
.tp-cdrp__row { display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: var(--tp-radius-sm); }
.tp-cdrp__row:hover { background: var(--tp-hover); }
.tp-cdrp__thumb { flex: none; width: 80px; height: 45px; overflow: hidden; border-radius: var(--tp-radius-xs); background: #000; }
.tp-cdrp__thumb img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tp-cdrp__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.tp-cdrp__title {
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--tp-text-strong); font-size: 13px; line-height: 18px; font-weight: 600; text-decoration: none;
}
.tp-cdrp__title:hover { text-decoration: underline; text-underline-offset: 3px; }
.tp-cdrp__meta { overflow: hidden; color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.tp-cdrp__acts { display: flex; flex: none; gap: 2px; }
.tp-cdrp__acts [aria-pressed="true"] { color: var(--tp-accent-hover); }
.tp-cdrp__rm:hover { color: var(--tp-danger); }
.tp-cdrp__src { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 0 4px; color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px; }
.tp-cdrp__src .tp-cdrefs__src { margin-left: 0; }
.tp-cdrp .tp-button { gap: 6px; }
.tp-cd__listname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-cd__listcheck { flex: none; color: var(--tp-accent-hover) !important; }
.tp-menu__item.is-current { color: var(--tp-text-strong); }
.tp-cdpub__edit { margin-top: 10px; }
.tp-cdpub__edit .tp-link { font-size: 13px; }

/* Checklists */
.tp-cd__sechead { display: flex; align-items: center; gap: 12px; min-height: 28px; margin-bottom: 8px; }
.tp-cd__clhead { flex-wrap: wrap; row-gap: 6px; }
.tp-cd__cltitle { flex: 1; min-width: 120px; color: var(--tp-text-strong); font-size: 16px; line-height: 24px; font-weight: 800; }
.tp-cd__cltitlebtn {
  max-width: 100%; margin-left: -6px; padding: 2px 6px; border: 0; border-radius: var(--tp-radius-sm); background: none;
  color: inherit; font: inherit; text-align: left; overflow-wrap: anywhere;
}
.tp-cd__cltitlebtn:hover { background: var(--tp-hover); }
.tp-cd__clactions { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; }
.tp-cd__clrename { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 200px; }
.tp-cd__clrename .tp-input { flex: 1; min-width: 140px; }
.tp-cd__progress { display: flex; align-items: center; gap: 10px; margin: 2px 0 8px; }
.tp-cd__pct { width: 36px; flex: none; color: var(--tp-text-subtle); font-size: 12px; line-height: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tp-cd__bar { flex: 1; height: 4px; overflow: hidden; border-radius: 2px; background: var(--tp-surface-3); }
.tp-cd__bar > span { display: block; height: 100%; border-radius: 2px; background: var(--tp-accent); transition: width 150ms var(--tp-ease); }
.tp-cd__progress.is-done .tp-cd__bar > span { background: var(--tp-success); }
.tp-cd__items { display: flex; flex-direction: column; gap: 2px; list-style: none; }
.tp-cd__item { position: relative; display: flex; align-items: flex-start; gap: 4px; min-height: 36px; border-radius: var(--tp-radius-sm); }
.tp-cd__item:hover { background: var(--tp-hover); }
.tp-cd__itemcheck { flex: none; width: 18px; height: 18px; margin: 9px 6px 0 6px; cursor: pointer; accent-color: var(--tp-accent); }
.tp-cd__itemtext {
  flex: 1; min-width: 0; padding: 8px 6px; border: 0; border-radius: var(--tp-radius-sm); background: none; color: var(--tp-text-strong);
  font: inherit; font-size: 15px; line-height: 20px; text-align: left; overflow-wrap: anywhere; white-space: pre-wrap; cursor: pointer;
}
.tp-cd__item.is-done .tp-cd__itemtext { color: var(--tp-text-subtlest); text-decoration: line-through; }
.tp-cd__itemmore { margin: 5px 4px 0 0; opacity: 0; }
.tp-cd__item:hover .tp-cd__itemmore, .tp-cd__item:focus-within .tp-cd__itemmore, .tp-cd__itemmore[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .tp-cd__itemmore { opacity: 1; } }
.tp-cd__item.is-editing { display: block; padding: 4px 0; background: none; }
.tp-cd__itemform { min-width: 0; }
.tp-cd__itemta { min-height: 56px; resize: none; overflow: hidden; }
.tp-cd__alldone { margin-bottom: 4px; color: var(--tp-text-subtle); font-size: 13px; }
.tp-cd__clfoot { margin-top: 6px; }

/* ---------- Safe Markdown ---------- */
.tp-cdmd { color: var(--tp-text); overflow-wrap: anywhere; }
.tp-cdmd > :first-child { margin-top: 0; }
.tp-cdmd > :last-child { margin-bottom: 0; }
.tp-cdmd p, .tp-cdmd ul, .tp-cdmd ol, .tp-cdmd blockquote { margin: 0 0 8px; }
.tp-cdmd h3 { margin: 16px 0 6px; font-size: 15px; line-height: 20px; }
.tp-cdmd h4 { margin: 12px 0 4px; color: var(--tp-text-strong); font-size: 14px; line-height: 20px; }
.tp-cdmd ul, .tp-cdmd ol { padding-left: 20px; }
.tp-cdmd li + li { margin-top: 2px; }
.tp-cdmd blockquote { padding-left: 10px; border-left: 1px solid var(--tp-border-input); color: var(--tp-text-subtle); }
.tp-cdmd hr { margin: 12px 0; }
.tp-cdmd code { padding: 1px 4px; border-radius: var(--tp-radius-sm); background: var(--tp-surface-3); }
.tp-cdmd__cue { color: var(--tp-text-subtle); font-style: italic; }
.tp-cdmd__sep { display: flex; align-items: center; gap: 8px; margin: 16px 0 10px; color: var(--tp-green-text); font-size: 12px; line-height: 16px; font-weight: 600; }
.tp-cdmd__sep::before, .tp-cdmd__sep::after { content: ""; flex: 1; height: 1px; background: var(--tp-border); }

/* ---------- Comments + activity ---------- */
.tp-cdcm { display: flex; flex-direction: column; gap: 14px; }
.tp-cdcm__head { font-size: 13px; }
.tp-cdcm__composer { display: flex; gap: 8px; }
.tp-cdcm__box { flex: 1; min-width: 0; }
.tp-cdcm__input { min-height: 36px; resize: none; overflow: hidden; }
.tp-cdcm__composer:not(.is-open) .tp-cdcm__input { height: 36px; cursor: text; }
.tp-cdcm__composer.is-open .tp-cdcm__input { min-height: 72px; }
.tp-cdcm__actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.tp-cdcm__tip { color: var(--tp-text-subtlest); font-size: 12px; }
.tp-cdcm__avatar {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--tp-blue-bg); color: var(--tp-blue-text);
}
.tp-cdcm__avatar--activity { background: var(--tp-surface-3); color: var(--tp-text-subtle); }
.tp-cdcm__feed { display: flex; flex-direction: column; gap: 14px; list-style: none; }
.tp-cdcm__item { display: flex; gap: 8px; }
.tp-cdcm__main { flex: 1; min-width: 0; }
.tp-cdcm__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px; }
.tp-cdcm__meta strong { color: var(--tp-text-strong); font-size: 14px; line-height: 20px; }
.tp-cdcm__text { margin-top: 4px; padding: 8px 12px; border: 1px solid var(--tp-border); border-radius: var(--tp-radius); background: var(--tp-surface); }
.tp-cdcm__acts { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--tp-text-subtlest); font-size: 12px; }
.tp-cdcm__acts .tp-link { font-size: 12px; text-decoration: underline; }
.tp-cdcm__edit { margin-top: 4px; }
.tp-cdcm__atext { color: var(--tp-text); }
.tp-cdcm__item--activity .tp-cdcm__meta { margin-top: 2px; }
.tp-cdcm__empty { padding: 12px 0; color: var(--tp-text-subtle); text-align: center; }

/* ---------- Popover contents ---------- */
.tp-cdpop { display: flex; flex-direction: column; gap: 10px; }
.tp-cdpop .tp-field + .tp-field { margin-top: 0; }
.tp-cdpop__h { margin-top: 4px; }
.tp-cdpop__muted { color: var(--tp-text-subtle); font-size: 12px; line-height: 16px; }
.tp-cdpop__none { color: var(--tp-text-subtle); font-size: 13px; }
.tp-cdpop__labels { display: flex; flex-direction: column; gap: 4px; list-style: none; }
.tp-cdpop__lrow { display: flex; align-items: center; gap: 4px; }
.tp-cdpop__lcheck { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
.tp-cdpop__lcheck input { width: 16px; height: 16px; margin: 0 4px; flex: none; cursor: pointer; }
.tp-label.tp-cdpop__lbar {
  flex: 1; min-width: 0; height: 32px; padding: 0 12px; border-radius: var(--tp-radius-sm); font-size: 14px; line-height: 32px; font-weight: 500;
  transition: filter var(--tp-dur) var(--tp-ease);
}
.tp-cdpop__lcheck:hover .tp-cdpop__lbar { filter: brightness(1.12); }
.tp-cdpop__preview { display: flex; justify-content: center; margin: 0 -12px; padding: 20px 12px; background: var(--tp-bg-sunken); }
.tp-cdpop__preview .tp-label { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-cdpop__colors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.tp-cdpop__color {
  display: grid; place-items: center; height: 32px; padding: 0; border: 0; border-radius: var(--tp-radius-sm);
  background: var(--tp-label, var(--tp-gray)); color: transparent; transition: filter var(--tp-dur) var(--tp-ease);
}
.tp-cdpop__color:hover { filter: brightness(1.12); }
.tp-cdpop__color[aria-checked="true"], .tp-cdpop__color[aria-pressed="true"] {
  color: #1d2125; box-shadow: 0 0 0 2px var(--tp-surface-2), 0 0 0 4px var(--tp-accent-hover);
}
.tp-cdpop__split { justify-content: space-between; margin-top: 4px; }
.tp-cdpop__date { display: flex; flex-direction: column; gap: 4px; }
.tp-cdpop__dt { display: flex; gap: 6px; }
.tp-cdpop__dt input[type="date"] { flex: 1.4; min-width: 0; }
.tp-cdpop__dt input[type="time"] { flex: 1; min-width: 0; }
.tp-cdpop__row { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 8px; }
.tp-cdpop__keep { display: flex; flex-direction: column; }
.tp-cdpop__copytitle { min-height: 56px; resize: none; }
.tp-cdpop__thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tp-cdpop__thumb {
  position: relative; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; border: 0; border-radius: var(--tp-radius-sm);
  background: var(--tp-surface-3); color: var(--tp-text); font-size: 11px;
}
.tp-cdpop__thumb img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tp-cdpop__thumb:hover img { filter: brightness(1.1); }
.tp-cdpop__thumb[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--tp-surface-2), 0 0 0 4px var(--tp-accent-hover); }

/* =========================================================
   V3 — lecture seule, raccourcis, membres, vidéo publiée, pièces jointes, glisser-déposer, Miniature IA
   ========================================================= */

/* ---------- Read-only (observer) ---------- */
.tp-cd-dialog.is-readonly [data-edit-only] { display: none !important; }
.tp-cd-dialog.is-readonly .tp-cd__saved, .tp-cd-dialog.is-readonly .tp-cd__topsaved { display: none; }
/* An observer never adds a reference: no empty 16:9 slot, the title takes the width. */
.tp-cd-dialog.is-readonly:not(.has-media) .tp-cd__media { display: none; }
.tp-cd-dialog.is-readonly:not(.has-media) .tp-cd__head { grid-template-columns: minmax(0, 1fr); }
.tp-cd__robadge { color: var(--tp-text-subtle); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tp-cd .is-static { cursor: default; }
.tp-cd__label.is-static:hover, .tp-cd__datebtn.is-static:hover { filter: none; background: var(--tp-surface-3); }
.tp-cd__desctext.is-static { cursor: default; }
.tp-cd__desctext.is-static:hover { background: none; }
.tp-cd__cltitlebtn.is-static:hover, .tp-cd__itemtext.is-static { background: none; cursor: default; }
.tp-cd-dialog.is-readonly .tp-cd__title { cursor: default; }
.tp-cd-dialog.is-readonly .tp-cd__title:hover { background: none; }
.tp-cd-dialog.is-readonly .tp-cd__done[aria-disabled="true"] { cursor: default; opacity: 0.75; }
.tp-cd-dialog.is-readonly .tp-cd__done[aria-disabled="true"]:hover { border-color: var(--tp-text-subtle); color: transparent; }

.tp-cd__pro { margin-left: 6px; color: var(--tp-text-subtle); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- Members ---------- */
.tp-cd__members { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tp-cd__member {
  display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  transition: transform 180ms var(--tp-spring);
}
.tp-cd__member:hover { transform: translateY(-1px); }
.tp-cd__member:focus-visible { outline: 2px solid var(--tp-accent-hover); outline-offset: 2px; }
.tp-cd__member.is-static { cursor: default; }
.tp-cd__member.is-static:hover { transform: none; }
.tp-cd__memberadd { border-radius: 50%; width: 32px; height: 32px; }

.tp-cdpop__members { display: flex; flex-direction: column; gap: 2px; list-style: none; }
.tp-cdpop__member {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 5px 8px; border: 1px solid transparent;
  border-radius: var(--tp-radius-sm); background: none; color: var(--tp-text); text-align: left;
  transition: background-color var(--tp-dur) var(--tp-ease), border-color var(--tp-dur) var(--tp-ease);
}
.tp-cdpop__member:hover { background: var(--tp-hover-strong); color: var(--tp-text-strong); }
.tp-cdpop__member.is-on { border-color: var(--tp-accent-edge); background: var(--tp-selected); color: var(--tp-text-strong); }
.tp-cdpop__mname { flex: 1; min-width: 0; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.tp-cdpop__mrole { flex: none; color: var(--tp-text-subtlest); font-size: 12px; }
.tp-cdpop__mcheck { flex: none; color: var(--tp-accent-hover); opacity: 0; transform: scale(0.6); transition: opacity var(--tp-dur) var(--tp-ease), transform 220ms var(--tp-spring); }
.tp-cdpop__member.is-on .tp-cdpop__mcheck { opacity: 1; transform: scale(1); }
.tp-cdpop__sep { height: 2px; margin: 2px 0; border-radius: 2px; background: var(--tp-border); }
.tp-cdconnect__list { display: flex; flex-direction: column; gap: 8px; list-style: none; }
.tp-cdconnect__list li { display: flex; gap: 8px; color: var(--tp-text); font-size: 13px; line-height: 18px; }
.tp-cdconnect__list .tp-icon { flex: none; margin-top: 1px; color: var(--tp-sun); }

/* ---------- Published video ---------- */
.tp-cdpub { display: flex; gap: 12px; }
.tp-cdpub__thumb {
  flex: none; width: 160px; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--tp-line); border-radius: var(--tp-radius-sm);
  background: var(--tp-bg-sunken);
}
.tp-cdpub__thumb img { width: 100%; height: 100%; max-width: none; object-fit: cover; transition: transform 300ms var(--tp-ease-out); }
.tp-cdpub__thumb:hover img { transform: scale(1.05); }
.tp-cdpub__body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.tp-cdpub__title {
  display: -webkit-box; overflow: hidden; color: var(--tp-text-strong); font-weight: 800; line-height: 20px;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere;
}
.tp-cdpub__title:hover { color: #fff; }
.tp-cdpub__title .tp-icon { display: inline-block; width: 13px; height: 13px; margin-left: 4px; vertical-align: -1px; color: var(--tp-text-subtle); }
/* Disabled segmented choice (read-only): never show the native-looking control under the label */
.tp-cd .tp-seg__opt input:disabled { opacity: 0; cursor: default; }
.tp-cd .tp-seg__opt input:disabled + span { cursor: default; }
.tp-cd .tp-seg__opt:has(input:disabled):hover span { background: var(--tp-surface-3); color: var(--tp-text); }
.tp-cd .tp-seg__opt:has(input:disabled:checked):hover span { background: var(--tp-accent); color: var(--tp-accent-text); }
.tp-cd .tp-seg__opt:has(input:disabled):active span { transform: none; box-shadow: var(--tp-shadow-raised); }
.tp-cdpub__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tp-cdpub__url { color: var(--tp-text-subtlest); font-size: 12px; overflow-wrap: anywhere; }
.tp-cdpub__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; }
.tp-cdpub__checking { display: inline-flex; align-items: center; gap: 6px; color: var(--tp-text-subtle); font-size: 12px; }

/* ---------- Attachments: files, links, uploads ---------- */
.tp-cdatt__group + .tp-cdatt__group, .tp-cdatt__list + .tp-cdatt__group { margin-top: 14px; }
.tp-cdatt__glabel {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--tp-text-subtle); font-size: 12px; line-height: 16px; font-weight: 800;
}
.tp-cdatt__glabel .tp-icon { width: 14px; height: 14px; }
.tp-cdatt__list { display: flex; flex-direction: column; gap: 8px; list-style: none; }
.tp-cdatt__list[data-transfers]:not([hidden]) { margin-bottom: 12px; }
.tp-cdatt {
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 6px; border-radius: var(--tp-radius);
  transition: background-color var(--tp-dur) var(--tp-ease);
}
.tp-cdatt:hover { background: var(--tp-hover); }
.tp-cdatt:not(.tp-cdatt--transfer) { animation: tp-pop-in 260ms var(--tp-spring) both; }
.tp-cdatt__thumb {
  position: relative; display: grid; place-items: center; flex: none; width: 112px; height: 72px; padding: 0; overflow: hidden;
  border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); background: var(--tp-surface-3); color: inherit; cursor: pointer;
}
.tp-cdatt__thumb img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tp-cdatt__thumb .tp-fileicon { box-shadow: none; }
.tp-cdatt__thumb--image { background: #070a10; }
.tp-cdatt__play {
  position: absolute; right: 6px; bottom: 6px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: #000a; color: #fff;
}
.tp-cdatt__play .tp-icon { width: 12px; height: 12px; }
.tp-cdatt--transfer .tp-cdatt__thumb { cursor: default; }
.tp-cdatt__body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; padding-top: 2px; }
.tp-cdatt__title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.tp-cdatt__name {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 0; border: 0; background: none;
  color: var(--tp-text-strong); font: inherit; font-weight: 800; text-align: left; overflow-wrap: anywhere; cursor: pointer;
}
.tp-cdatt__name:hover { color: #fff; text-decoration: underline; }
.tp-cdatt__name.is-static { cursor: default; }
.tp-cdatt__name.is-static:hover { text-decoration: none; color: var(--tp-text-strong); }
.tp-cdatt__ext { flex: none; width: 13px; height: 13px; color: var(--tp-text-subtle); }
.tp-cdatt__badge {
  display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 800;
}
.tp-cdatt__badge .tp-icon { width: 12px; height: 12px; }
.tp-cdatt__badge--cover, .tp-cdatt__badge--ai { background: var(--tp-surface-3); color: var(--tp-text-subtle); }
.tp-cdatt__badge .tp-icon { display: none; }
.tp-cdatt__meta { color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px; overflow-wrap: anywhere; }
.tp-cdatt__err { display: flex; align-items: flex-start; gap: 5px; color: var(--tp-coral-text); }
.tp-cdatt__err .tp-icon { flex: none; width: 14px; height: 14px; margin-top: 1px; }
.tp-cdatt__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin-top: 2px; }
.tp-cdatt__act {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 0; border: 0; background: none; color: var(--tp-text-subtle);
  font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.tp-cdatt__act .tp-icon { width: 13px; height: 13px; }
.tp-cdatt__act:hover { color: var(--tp-text-strong); text-decoration: underline; }
.tp-cdatt__act--danger:hover { color: var(--tp-danger); }
.tp-cdatt__act--pro { color: var(--tp-sun-text); }
.tp-cdatt__progress { position: relative; height: 8px; margin: 4px 0 2px; overflow: hidden; border: 1px solid var(--tp-line); border-radius: 999px; background: var(--tp-surface-3); box-sizing: content-box; }
.tp-cdatt__progress > span {
  display: block; width: 0; height: 100%; border-radius: inherit;
  background: repeating-linear-gradient(-45deg, var(--tp-mint) 0 8px, #4cc596 8px 16px); background-size: 22.6px 100%;
  transition: width 160ms linear; animation: tp-cd-stripes 700ms linear infinite;
}
.tp-cdatt__progress > span.is-indeterminate { width: 100%; opacity: 0.6; }
@keyframes tp-cd-stripes { to { background-position: 22.6px 0; } }
.tp-cdatt--transfer.is-waiting .tp-cdatt__progress > span { width: 0; }
.tp-cdatt--transfer.is-error { background: #4f23201f; }
.tp-cdatt__cancel { flex: none; margin-top: 2px; }
.tp-cdattsec .tp-cd__none { margin-bottom: 4px; }

/* Drop overlay over the whole card (ui.dropZone adds .tp-dropzone / .is-dragover) */
.tp-cd-dialog.tp-dropzone.is-dragover::after {
  inset: 8px; z-index: 80; padding: 96px 24px 24px; border: 2px dashed var(--tp-mint); border-radius: var(--tp-radius-xl);
  background-color: #0f2e24f0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235ad9a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4'/%3E%3Cpath d='m6 10 6-6 6 6'/%3E%3Cpath d='M4 20h16'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center calc(50% - 36px); background-size: 56px 56px;
  font-size: 20px; animation: tp-pop-in 200ms var(--tp-spring), tp-cd-drop 1.1s ease-in-out 200ms infinite;
}
@keyframes tp-cd-drop {
  0%, 100% { background-position: center calc(50% - 36px); border-color: var(--tp-mint); }
  50% { background-position: center calc(50% - 46px); border-color: var(--tp-mint-text); }
}

/* ---------- Comments: author avatars ---------- */
.tp-cdcm__avatar--user { background: none; }
.tp-cdcm__avatar--user .tp-avatar, .tp-cdcm__avatar--user .tp-icon { width: 32px; height: 32px; }
.tp-cdcm__avatar--user > .tp-icon { width: 18px; height: 18px; }
.tp-cdcm__meta strong.is-gone { color: var(--tp-text-subtle); font-style: italic; }

/* ---------- « Miniature IA » window ---------- */
.tp-cdthumb { display: flex; flex-direction: column; gap: 18px; }
.tp-cdthumb__lead { color: var(--tp-text); }
.tp-cdthumb__lead strong { color: var(--tp-sun-text); }
.tp-cdthumb__step { display: flex; flex-direction: column; gap: 8px; }
.tp-cdthumb__h { display: flex; align-items: center; gap: 8px; color: var(--tp-text-strong); font-family: var(--tp-font); font-size: 16px; line-height: 22px; font-weight: 800; }
.tp-cdthumb__num {
  display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border: 1px solid var(--tp-sun-edge); border-radius: 50%;
  background: var(--tp-sun); color: #2b2104; font-size: 13px; font-weight: 700; box-shadow: var(--tp-shadow-raised);
}
.tp-cdthumb__opt { color: var(--tp-text-subtlest); font-family: var(--tp-font); font-size: 12px; font-weight: 600; }
.tp-cdthumb__hint, .tp-cdthumb__counter { color: var(--tp-text-subtle); font-size: 12px; line-height: 16px; }
.tp-cdthumb__counter { text-align: right; }
.tp-cdthumb__empty { padding: 10px 12px; border-radius: var(--tp-radius-sm); background: var(--tp-surface-3); color: var(--tp-text); font-size: 13px; }
.tp-cdthumb__bases { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tp-cdthumb__base, .tp-cdthumb__asset {
  position: relative; display: grid; place-items: center; padding: 0; overflow: hidden; border: 1px solid var(--tp-line);
  border-radius: var(--tp-radius-md); background: var(--tp-surface-3); color: var(--tp-text-subtle); cursor: pointer;
  box-shadow: var(--tp-shadow-raised); transition: transform 180ms var(--tp-spring), border-color var(--tp-dur) var(--tp-ease), box-shadow 120ms var(--tp-ease);
}
.tp-cdthumb__base { aspect-ratio: 16 / 9; }
.tp-cdthumb__asset { aspect-ratio: 1 / 1; }
.tp-cdthumb__base img, .tp-cdthumb__asset img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tp-cdthumb__base:hover, .tp-cdthumb__asset:hover { transform: translateY(-1px); }
.tp-cdthumb__base:focus-visible, .tp-cdthumb__asset:focus-visible { outline: 2px solid var(--tp-accent-hover); outline-offset: 2px; }
.tp-cdthumb__base[aria-checked="true"], .tp-cdthumb__asset[aria-pressed="true"] {
  border-color: var(--tp-sun); box-shadow: 0 0 0 2px var(--tp-sun-edge), var(--tp-shadow-pop);
}
.tp-cdthumb__asset[aria-disabled="true"] { cursor: not-allowed; opacity: 0.45; }
.tp-cdthumb__asset[aria-disabled="true"]:hover { transform: none; }
.tp-cdthumb__tick {
  position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--tp-line);
  border-radius: 50%; background: var(--tp-sun); color: #2b2104; opacity: 0; transform: scale(0.4);
  transition: opacity var(--tp-dur) var(--tp-ease), transform 260ms var(--tp-spring);
}
.tp-cdthumb__tick .tp-icon { width: 12px; height: 12px; stroke-width: 3; }
.tp-cdthumb__base[aria-checked="true"] .tp-cdthumb__tick, .tp-cdthumb__asset[aria-pressed="true"] .tp-cdthumb__tick { opacity: 1; transform: scale(1); }
.tp-cdthumb__kind {
  position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px); padding: 1px 7px; overflow: hidden; border-radius: 999px;
  background: #000b; color: #fff; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap;
}
.tp-cdthumb__base--add, .tp-cdthumb__asset--add {
  gap: 4px; align-content: center; border-style: dashed; border-color: var(--tp-border-input); background: none; box-shadow: none;
  font-size: 12px; font-weight: 700; text-align: center;
}
.tp-cdthumb__base--add:hover, .tp-cdthumb__asset--add:hover { border-color: var(--tp-mint-edge); color: var(--tp-mint-text); }
.tp-cdthumb__base--add .tp-icon, .tp-cdthumb__asset--add .tp-icon { width: 20px; height: 20px; }
.tp-cdthumb__asset--add span { padding: 0 6px; }
.tp-cdthumb__asset--ph { cursor: default; box-shadow: none; }
.tp-cdthumb .is-uploading { gap: 8px; align-content: center; padding: 10px; cursor: progress; }
.tp-cdthumb__upbar { display: block; width: 80%; height: 6px; overflow: hidden; border-radius: 999px; background: var(--tp-surface); }
.tp-cdthumb__upbar > span { display: block; height: 100%; border-radius: inherit; background: var(--tp-mint); transition: width 160ms linear; }
.tp-cdthumb__assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.tp-cdthumb__assetserr { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--tp-coral-text); font-size: 13px; }
.tp-cdthumb__refrow { display: flex; gap: 8px; }
.tp-cdthumb__refrow .tp-input { flex: 1; min-width: 0; }
.tp-cdthumb__count {
  align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: var(--tp-surface-3); color: var(--tp-text-subtle); font-size: 12px; font-weight: 700;
}
.tp-cdthumb__count.is-full { background: var(--tp-sun-bg); color: var(--tp-sun-text); }
.tp-cdthumb__instr { min-height: 84px; resize: vertical; }
.tp-cdthumb__examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tp-cdthumb__exlabel { color: var(--tp-text-subtle); font-size: 12px; }
.tp-cdthumb__ex {
  padding: 3px 10px; border: 1px solid var(--tp-line); border-radius: 999px; background: var(--tp-surface-3); color: var(--tp-text);
  font-size: 12px; font-weight: 600; transition: background-color var(--tp-dur) var(--tp-ease), transform 160ms var(--tp-spring);
}
.tp-cdthumb__ex:hover { background: var(--tp-surface-3-hover); color: var(--tp-text-strong); transform: translateY(-1px); }
.tp-cdthumb__consent { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--tp-line); border-radius: var(--tp-radius); background: var(--tp-surface); font-weight: 700; }
.tp-cdthumb__consent input { margin-top: 2px; }
.tp-cdthumb__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.tp-cdthumb__via { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--tp-text-subtle); font-size: 12px; }
.tp-cdthumb__via .tp-icon { width: 14px; height: 14px; color: var(--tp-sun); }
.tp-cdthumb__btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }

.tp-cdthumb--job { gap: 14px; }
.tp-cdthumb__steps { display: flex; flex-wrap: wrap; gap: 8px 6px; list-style: none; }
.tp-cdthumb__stepi {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid var(--tp-line); border-radius: 999px;
  background: var(--tp-surface); color: var(--tp-text-subtlest); font-size: 12px; font-weight: 700;
}
.tp-cdthumb__dot { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--tp-surface-3); }
.tp-cdthumb__dot .tp-icon { width: 12px; height: 12px; stroke-width: 3; }
.tp-cdthumb__stepi.is-done { color: var(--tp-mint-text); }
.tp-cdthumb__stepi.is-done .tp-cdthumb__dot { background: var(--tp-mint); color: #0c2a1f; animation: tp-pop-in 240ms var(--tp-spring); }
.tp-cdthumb__stepi.is-current { border-color: var(--tp-sun-edge); background: var(--tp-sun-bg); color: var(--tp-sun-text); }
.tp-cdthumb__stepi.is-error { border-color: var(--tp-coral-edge); color: var(--tp-coral-text); }
.tp-cdthumb__stepi.is-error .tp-cdthumb__dot { background: var(--tp-coral); color: #2a0f0b; }
.tp-cdthumb__msg { color: var(--tp-text-strong); font-family: var(--tp-font); font-size: 17px; line-height: 24px; font-weight: 800; }
.tp-cdthumb__time { color: var(--tp-text-subtlest); font-family: var(--tp-font); font-size: 13px; font-weight: 600; }
.tp-cdthumb__note { color: var(--tp-text-subtle); font-size: 13px; }
.tp-cdthumb__results { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tp-cdthumb__result { display: flex; flex-direction: column; gap: 8px; margin: 0; animation: tp-spring-in 320ms var(--tp-spring) both; }
.tp-cdthumb__shot, .tp-cdthumb__ph {
  display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; border: 1px solid var(--tp-line); border-radius: var(--tp-radius-md);
  background: #070a10; box-shadow: var(--tp-shadow-pop); cursor: zoom-in;
}
.tp-cdthumb__ph { cursor: default; box-shadow: none; }
.tp-cdthumb__shot img { width: 100%; height: 100%; max-width: none; object-fit: cover; transition: transform 300ms var(--tp-ease-out); }
.tp-cdthumb__shot:hover img { transform: scale(1.04); }
.tp-cdthumb__result.is-cover .tp-cdthumb__shot { border-color: var(--tp-mint); }
.tp-cdthumb__result figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; color: var(--tp-text-subtle); font-size: 12px; }
.tp-cdthumb__added { display: inline-flex; align-items: center; gap: 4px; color: var(--tp-mint-text); font-weight: 700; }
.tp-cdthumb__added .tp-icon { width: 14px; height: 14px; }
.tp-cdthumb__added.is-off { color: var(--tp-text-subtle); }
.tp-cdthumb__racts { display: inline-flex; align-items: center; gap: 4px; }
.tp-cdthumb__iscover { display: inline-flex; align-items: center; gap: 4px; color: var(--tp-mint-text); font-weight: 700; }
.tp-cdthumb__iscover .tp-icon { width: 14px; height: 14px; }
.tp-cdthumb__result--wait figcaption { justify-content: flex-start; }

@media (max-width: 599px) {
  .tp-cdatt__thumb { width: 84px; height: 56px; }
  .tp-cdpub { flex-direction: column; }
  .tp-cdpub__thumb { width: 100%; }
  .tp-cdthumb__bases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tp-cdthumb__assets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tp-cdthumb__refrow { flex-direction: column; }
  .tp-cdthumb__btns { width: 100%; }
  .tp-cdthumb__btns > * { flex: 1 1 auto; }
}

/* ---------- Plein écran (focus): only the script and its AI panel ---------- */
.tp-modal.tp-cd-focus { padding: 0; }
.tp-modal__dialog.tp-cd-dialog.is-focus { max-width: none; height: 100vh; height: 100dvh; min-height: 0; border-radius: 0; box-shadow: none; }
.tp-cd-dialog.is-focus .tp-cd__top,
.tp-cd-dialog.is-focus .tp-cd__head,
.tp-cd-dialog.is-focus .tp-cd__tabbar,
.tp-cd-dialog.is-focus .tp-cd__readonly,
.tp-cd-dialog.is-focus .tp-cd__archived,
.tp-cd-dialog.is-focus .tp-cdattsec { display: none; }
.tp-cd-dialog.is-focus .tp-cd__inner { max-width: 1240px; padding-top: 24px; }
.tp-cd-dialog.is-focus .tp-cd__pane { padding-top: 0; }
.tp-cd-dialog.is-focus .tp-cd__editor, .tp-cd-dialog.is-focus .tp-cd__mirror { font-size: 17px; line-height: 29px; }
.tp-cd-dialog.is-focus .tp-cd__ai { top: 24px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); }
.tp-cd-dialog.is-focus .tp-cd__focusexit { display: inline-flex; }

/* ---------- Medium widths: a narrower thumbnail ---------- */
@media (max-width: 1099px) {
  .tp-cd__head { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 24px; }
  .tp-cd__write { grid-template-columns: minmax(0, 1fr) 272px; gap: 28px; }
}

/* ---------- Narrow screens: full screen, one column, the AI panel as a sheet ---------- */
@media (max-width: 899px) {
  .tp-modal.tp-cd-modal { padding: 0; }
  .tp-modal__dialog.tp-cd-dialog { --tp-cd-pad: 16px; align-self: flex-start; max-width: none; height: auto; min-height: 100%; overflow: visible; border-radius: 0; }
  .tp-cd-dialog > .tp-modal__body, .tp-cd { flex: 1 0 auto; min-height: auto; overflow: visible; }
  .tp-cd__top { position: sticky; top: 0; z-index: 8; padding: 0 6px 0 16px; background: var(--tp-surface); }
  .tp-cd__topsaved { display: none; }
  .tp-cd__main { overflow: visible; }
  .tp-cd__inner { padding-bottom: 0; }
  /* Last block of the card on a phone: room under « Afficher toutes les pièces jointes » for its focus ring. */
  .tp-cdattsec { padding-bottom: 8px; }
  .tp-cd__head { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-bottom: 18px; }
  .tp-cd__media { margin: 0 -16px; }
  .tp-cd__mediabox { border-radius: 0; }
  .tp-cd__title { font-size: 22px; line-height: 28px; }
  .tp-cd__ref { margin-top: 6px; }
  .tp-cd__props { gap: 12px 20px; padding-top: 14px; }
  .tp-cd__tabbar { top: 52px; }
  .tp-cd__tab { padding: 12px 10px; }
  .tp-cd__write { display: block; }
  .tp-cd__tb { flex-wrap: wrap; gap: 2px 4px; }
  .tp-cd__tb .tp-icon-btn { width: 32px; height: 32px; }
  .tp-cd__fmtopt span { padding: 4px 10px; }
  .tp-cd__editor { min-height: 320px; padding: 16px 18px 20px; font-size: 16px; line-height: 26px; }
  .tp-cd__mirror { padding: 16px 18px 20px; font-size: 16px; line-height: 26px; }
  .tp-cd__stats { position: static; padding: 0 18px; }
  .tp-cd__pane { padding-bottom: 24px; }
  .tp-cd__pane--script { padding-bottom: 0; }
  /* The panel opens over the card (« Écrire avec l'IA » under the script); ✕ or Échap bring the card back. */
  .tp-cd__ai { display: none; }
  .tp-cd-dialog.has-aisheet .tp-cd__ai {
    position: fixed; inset: 0; z-index: 30; display: flex; max-height: none; margin: 0; padding: 12px 16px 24px; overflow-y: auto; background: var(--tp-surface);
    animation: tp-sheet-in 220ms var(--tp-ease-out) both;
  }
  /* The opening animation (transform, kept by fill-mode) would make the dialog the box of « position: fixed »: off while the sheet is open. */
  .tp-modal__dialog.tp-cd-dialog.has-aisheet { animation: none; transform: none; }
  .tp-cdai__close { display: inline-grid; }
  .tp-cdai__md { max-height: none; }
  .tp-modal.tp-cd-sideopen { overflow: hidden; }
  .tp-cd__aibar {
    position: sticky; bottom: 0; z-index: 7; display: block; margin: 16px -16px 0; padding: 12px 16px 16px;
    border-top: 1px solid var(--tp-border); background: var(--tp-surface);
  }
  .tp-cd__aibar .tp-button { min-height: 44px; }
  .tp-cd-dialog[data-cd-tab]:not([data-cd-tab="script"]) .tp-cd__aibar { display: none; }
  .tp-modal__dialog.tp-cd-dialog.is-focus { height: auto; min-height: 100%; }
  .tp-cd-dialog.is-focus .tp-cd__inner { padding-top: 16px; }
}
@media (max-width: 599px) {
  .tp-cd__crumb--board { max-width: 40%; }
  .tp-cd__tb { flex-wrap: nowrap; }
  .tp-cd__tbtn > span { display: none; }
  .tp-cd__tb .tp-cd__spacer { display: none; }
  .tp-cd__item.is-editing { padding-left: 0; }
}

/* « Lien public » de la carte (menu Actions) */
.tp-cdpublink__list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 10px; }
.tp-cdpublink__row { display: flex; gap: 6px; align-items: center; }
.tp-cdpublink__row .tp-input { flex: 1; min-width: 0; }
.tp-cdpublink .tp-check { margin: 4px 0 10px; }

/* =========================================================
   Panneau « Miniature » (views/cardmini.js) : remplace la colonne de la carte (.tp-cd__main[hidden]).
   .tp-cdmini > __head (__back « Carte » + __tabs > __tab.is-on) + __body > __pane(.is-in)
     Idées   __search (champ + bouton) · __state · __grid > __tile(.is-ref, .is-added, .is-sk) > __shot + __cap (__ttl, __meta)
     Tester  __test (__pick > __zone(.has-img, .is-new) + __choices ; __fields > __title, __alert(.is-warn|.is-error),
             __row (__seg > __segbtn.is-on, Mélanger, liens), __status) + __stage (aperçu tester.css .tp-pv-fit) + __foot
     IA      __ai (formulaire .tp-cdthumb intégré) | __gate (une phrase + un bouton)
   Pas de décor : les miniatures sont l'élément principal ; survol = léger soulèvement + contour d'accent.
   ========================================================= */
.tp-cd__main[hidden] { display: none; }
.tp-cdmini { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.tp-cdmini[hidden] { display: none; }
.tp-cdmini__head {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; flex: none;
  padding: 4px var(--tp-cd-pad) 14px; background: var(--tp-surface);
}
.tp-cdmini__back {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 8px; border: 0; border-radius: var(--tp-radius-pill);
  background: transparent; color: var(--tp-text-subtle); font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background-color var(--tp-dur) var(--tp-ease), color var(--tp-dur) var(--tp-ease);
}
.tp-cdmini__back:hover { background: var(--tp-hover); color: var(--tp-text-strong); }
.tp-cdmini__back:focus-visible { outline: 2px solid var(--tp-accent-hover); outline-offset: 2px; }
.tp-cdmini__back .tp-icon { width: 18px; height: 18px; transition: transform var(--tp-dur) var(--tp-ease); }
.tp-cdmini__back:hover .tp-icon { transform: translateX(-2px); }
.tp-cdmini__tabs { display: flex; gap: 8px; min-width: 0; margin: 0 auto; padding-right: 76px; }
.tp-cdmini__tab {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px 0 14px; border: 0; border-radius: var(--tp-radius-pill);
  background: var(--tp-surface-3); color: var(--tp-text-strong); font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background-color var(--tp-dur) var(--tp-ease), color var(--tp-dur) var(--tp-ease), transform 120ms var(--tp-ease);
}
.tp-cdmini__tab .tp-icon { width: 18px; height: 18px; }
.tp-cdmini__tab:hover { background: var(--tp-surface-3-hover, var(--tp-hover-strong)); }
.tp-cdmini__tab:active { transform: scale(0.97); }
.tp-cdmini__tab.is-on { background: var(--tp-text-strong); color: var(--tp-surface); }
.tp-cdmini__tab:focus-visible { outline: 2px solid var(--tp-accent-hover); outline-offset: 2px; }
.tp-cdmini__body { flex: 1 0 auto; width: 100%; max-width: 1120px; margin: 0 auto; padding: 4px var(--tp-cd-pad) 40px; }
.tp-cdmini__pane.is-in { animation: tp-cdmini-in 180ms var(--tp-ease-out) both; }
@keyframes tp-cdmini-in { from { opacity: 0; transform: translateY(6px); } }
.tp-cdmini__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 18px; color: var(--tp-text-subtlest); font-size: 12px; line-height: 16px; }
.tp-cdmini__foot[hidden] { display: none; }

/* ----- Idées ----- */
.tp-cdmini__search {
  display: flex; align-items: center; gap: 8px; max-width: 720px; margin: 0 auto 22px; padding: 4px 4px 4px 16px;
  border: 1px solid var(--tp-border-input); border-radius: var(--tp-radius-pill); background: var(--tp-field-bg);
  transition: border-color var(--tp-dur) var(--tp-ease);
}
.tp-cdmini__search:focus-within { border-color: var(--tp-accent); }
.tp-cdmini__searchic { display: grid; place-items: center; flex: none; color: var(--tp-text-subtle); }
.tp-cdmini__searchic .tp-icon { width: 18px; height: 18px; }
.tp-cdmini__q { flex: 1; min-width: 0; height: 40px; padding: 0; border: 0; background: transparent; color: var(--tp-text-strong); font: inherit; font-size: 16px; }
.tp-cdmini__q:focus { outline: none; }
.tp-cdmini__search .tp-button { flex: none; border-radius: var(--tp-radius-pill); }
.tp-cdmini__state:empty { display: none; }
.tp-cdmini__empty { margin: 32px 0; color: var(--tp-text-subtle); text-align: center; font-size: 14px; }
.tp-cdmini__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px 16px; }
.tp-cdmini__grid:empty { display: none; }
.tp-cdmini__tile {
  display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer;
  transition: transform 160ms var(--tp-ease-out);
}
.tp-cdmini__shot {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--tp-radius); background: var(--tp-surface-3);
  box-shadow: 0 0 0 0 transparent; transition: box-shadow 160ms var(--tp-ease-out);
}
.tp-cdmini__shot img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tp-cdmini__tile:not(.is-sk):hover { transform: translateY(-3px); }
.tp-cdmini__tile:not(.is-sk):hover .tp-cdmini__shot, .tp-cdmini__tile[aria-expanded="true"] .tp-cdmini__shot { box-shadow: 0 0 0 2px var(--tp-accent); }
.tp-cdmini__tile:active { transform: translateY(-1px) scale(0.985); }
.tp-cdmini__tile:focus-visible { outline: none; }
.tp-cdmini__tile:focus-visible .tp-cdmini__shot { box-shadow: 0 0 0 2px var(--tp-accent-hover); }
.tp-cdmini__tile.is-ref .tp-cdmini__shot { box-shadow: 0 0 0 2px var(--tp-text-strong); }
.tp-cdmini__tile.is-added .tp-cdmini__shot { animation: tp-cdmini-added 420ms var(--tp-ease-out); }
@keyframes tp-cdmini-added { 40% { transform: scale(1.03); } }
.tp-cdmini__cap { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 0 2px; }
.tp-cdmini__ttl {
  display: -webkit-box; overflow: hidden; color: var(--tp-text-strong); font-size: 14px; line-height: 20px; font-weight: 600;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere;
}
.tp-cdmini__meta { overflow: hidden; color: var(--tp-text-subtle); font-size: 12px; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
.tp-cdmini__inref { display: inline-flex; align-items: center; gap: 4px; color: var(--tp-text-strong); font-weight: 600; }
.tp-cdmini__inref .tp-icon { width: 14px; height: 14px; color: var(--tp-accent); }
.tp-cdmini__tile.is-sk { cursor: default; }
.tp-cdmini__skl { height: 12px; margin-top: 2px; border-radius: 4px; }
.tp-cdmini__skl--s { width: 55%; }

/* ----- Tester ----- */
.tp-cdmini__test { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px 24px; align-items: start; margin-bottom: 20px; }
.tp-cdmini__pick, .tp-cdmini__fields { min-width: 0; }
.tp-cdmini__zone {
  position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; padding: 0; overflow: hidden;
  border: 1px dashed var(--tp-border); border-radius: var(--tp-radius); 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), transform 140ms var(--tp-ease-out);
}
.tp-cdmini__zone:hover { border-color: var(--tp-accent); color: var(--tp-text-strong); }
.tp-cdmini__zone:active { transform: scale(0.985); }
.tp-cdmini__zone:focus-visible { outline: 2px solid var(--tp-accent-hover); outline-offset: 2px; }
.tp-cdmini__zone.has-img { border-style: solid; border-color: transparent; background: #000; }
.tp-cdmini__zone img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tp-cdmini__zone.is-new img { animation: tp-cdmini-pop 260ms var(--tp-ease-out); }
@keyframes tp-cdmini-pop { from { opacity: 0; transform: scale(0.96); } }
.tp-cdmini__zoneempty { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px; text-align: center; font-size: 13px; line-height: 18px; }
.tp-cdmini__zoneempty .tp-icon { width: 24px; height: 24px; margin-bottom: 6px; }
.tp-cdmini__zoneempty b { color: var(--tp-text-strong); font-size: 14px; font-weight: 600; }
.tp-cdmini__zoneempty small { color: var(--tp-text-subtlest); font-size: 12px; }
.tp-cdmini__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.75); color: #fff; font-size: 12px; line-height: 18px; font-weight: 600; opacity: 0; transition: opacity var(--tp-dur) var(--tp-ease);
}
.tp-cdmini__zonechange .tp-icon { width: 13px; height: 13px; }
.tp-cdmini__zone:hover .tp-cdmini__zonechange, .tp-cdmini__zone:focus-visible .tp-cdmini__zonechange { opacity: 1; }
@media (hover: none) { .tp-cdmini__zonechange { opacity: 1; } }
.tp-cdmini__choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tp-cdmini__choices:empty { display: none; }
.tp-cdmini__choice {
  width: 64px; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; border: 0; border-radius: 6px; background: #000; opacity: 0.6; cursor: pointer;
  transition: opacity var(--tp-dur) var(--tp-ease), transform 140ms var(--tp-ease-out);
}
.tp-cdmini__choice img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tp-cdmini__choice:hover { opacity: 1; transform: translateY(-2px); }
.tp-cdmini__choice.is-on { opacity: 1; outline: 2px solid var(--tp-accent); outline-offset: 1px; }
.tp-cdmini__choice:focus-visible { opacity: 1; outline: 2px solid var(--tp-accent-hover); outline-offset: 2px; }
.tp-cdmini__label { display: block; margin-bottom: 6px; color: var(--tp-text-subtle); font-size: 12px; line-height: 16px; font-weight: 600; }
.tp-cdmini__title { min-height: 0; resize: none; font-size: 17px; line-height: 24px; font-weight: 600; }
.tp-cdmini__alert { display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 0; color: var(--tp-text-subtle); font-size: 13px; line-height: 18px; }
.tp-cdmini__alert:empty { display: none; }
.tp-cdmini__alert .tp-icon { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.tp-cdmini__alert.is-error { color: var(--tp-danger-hover); }
.tp-cdmini__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 14px; }
.tp-cdmini__seg { display: inline-flex; padding: 3px; border-radius: var(--tp-radius-pill); background: var(--tp-surface-3); }
.tp-cdmini__segbtn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px 0 11px; border: 0; border-radius: var(--tp-radius-pill);
  background: transparent; color: var(--tp-text-subtle); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background-color var(--tp-dur) var(--tp-ease), color var(--tp-dur) var(--tp-ease);
}
.tp-cdmini__segbtn .tp-icon { width: 16px; height: 16px; }
.tp-cdmini__segbtn:hover { color: var(--tp-text-strong); }
.tp-cdmini__segbtn.is-on { background: var(--tp-text-strong); color: var(--tp-surface); }
.tp-cdmini__segbtn:focus-visible { outline: 2px solid var(--tp-accent-hover); outline-offset: 1px; }
.tp-cdmini [data-test-shuffle].is-spinning .tp-icon { animation: tp-spin 460ms var(--tp-ease-out) 1; }
.tp-cdmini__links { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; margin-left: auto; }
.tp-cdmini__links .tp-link { font-size: 13px; }
.tp-cdmini__links .tp-link[hidden] { display: none; }
.tp-cdmini__links .tp-link .tp-icon { width: 14px; height: 14px; }
.tp-cdmini__status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; color: var(--tp-text-subtle); font-size: 13px; line-height: 18px; }
.tp-cdmini__status:empty { display: none; }
.tp-cdmini__status .tp-icon { width: 15px; height: 15px; flex: none; }
.tp-cdmini__stage { display: flex; justify-content: center; min-width: 0; min-height: 200px; }

/* ----- Créer avec l'IA ----- */
.tp-cdmini__ai { max-width: 760px; margin: 0 auto; }
.tp-cdmini__gate { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 48px auto; text-align: center; }
.tp-cdmini__gatet { max-width: 420px; color: var(--tp-text); font-size: 15px; line-height: 22px; }

@media (max-width: 899px) {
  .tp-cdmini { overflow: visible; }
  .tp-cdmini__head { top: 52px; flex-wrap: wrap; gap: 8px; padding: 8px 16px 12px; }
  /* The row scrolls (overflow-x: auto): 4 px of room for the focus rings of the pills, given back by the negative margin. */
  .tp-cdmini__tabs { width: calc(100% + 8px); margin: -4px; padding: 4px; overflow-x: auto; scrollbar-width: none; }
  .tp-cdmini__tabs::-webkit-scrollbar { display: none; }
  .tp-cdmini__body { padding: 4px 16px 32px; }
  .tp-cdmini__test { grid-template-columns: minmax(0, 1fr); }
  .tp-cdmini__pick { max-width: 420px; }
  .tp-cdmini__grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .tp-cdmini__pane.is-in, .tp-cdmini__tile.is-added .tp-cdmini__shot, .tp-cdmini__zone.is-new img { animation: none; }
  .tp-cdmini__tile:not(.is-sk):hover, .tp-cdmini__tile:active, .tp-cdmini__choice:hover { transform: none; }
}

/* =========================================================
   Mise en page « colonne de propriétés » (choix du 31/10/2026, maquette 3) :
   .tp-cd__body = __main (travail : titre, Script · Notes · Checklist, puis __below = Pièces jointes | Commentaires,
   visibles dès l'ouverture) + __side (colonne fixe : « Miniature » + Générer · Tester · Idées · …, propriétés,
   « Référence »). Le script est borné en hauteur (il défile dans son cadre) pour que pièces jointes et commentaires
   restent sur le premier écran ; le plein écran garde toute la hauteur.
   ========================================================= */
.tp-modal__dialog.tp-cd-dialog { max-width: 1440px; }
.tp-cd__body { display: grid; flex: 1; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: minmax(0, 1fr); min-height: 0; border-top: 1px solid var(--tp-border); }
.tp-cd__body[hidden] { display: none; }
.tp-cd__inner { max-width: none; padding: 8px var(--tp-cd-pad) 40px; container: tp-cdwork / inline-size; }
.tp-cd__head { display: block; padding: 20px 0 8px; }

/* The script scrolls in its frame (words, duration and « Enregistré » stay at its bottom). */
.tp-cd__paper { max-height: max(280px, calc(100vh - 500px)); max-height: max(280px, calc(100dvh - 500px)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
/* The frame fills the screen; attachments stay in view under it. */
.tp-cd__editor { min-height: max(240px, calc(100vh - 548px)); min-height: max(240px, calc(100dvh - 548px)); }

/* Attachments | comments, side by side under the work area. */
.tp-cd__below { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--tp-border); }
.tp-cd__below .tp-cdattsec { max-width: none; margin-top: 0; padding-top: 0; }
.tp-cdattsec__n { margin-left: 2px; color: var(--tp-text-subtlest); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Side column. */
.tp-cd__side { min-width: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 24px 20px 32px; border-left: 1px solid var(--tp-border); }
.tp-cd__sidesec[hidden] { display: none; }
.tp-cd__sidek { margin: 0 0 10px; color: var(--tp-text-subtle); font-size: 13px; line-height: 18px; font-weight: 600; }
.tp-cd__thumbacts { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.tp-cd__thumbacts .tp-button { flex: 1 1 auto; gap: 6px; padding: 0 10px; }
.tp-cd__thumbacts .tp-button .tp-icon { width: 16px; height: 16px; }
.tp-cd__gen.is-running { cursor: progress; }
.tp-cd__thumbmore { flex: none; }
.tp-cd__side .tp-cd__props { flex-direction: column; flex-wrap: nowrap; gap: 6px; margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--tp-border); }
.tp-cd__side .tp-cd__prop { flex-direction: row; align-items: flex-start; gap: 12px; }
.tp-cd__side .tp-cd__prop[hidden] { display: none; }
.tp-cd__side .tp-cd__propk { flex: none; width: 88px; padding-top: 6px; color: var(--tp-text-subtle); font-size: 13px; line-height: 16px; }
.tp-cd__side .tp-cd__propv { flex: 1; min-width: 0; }
.tp-cd__sidesec--ref, .tp-cd__sidesec--cm { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--tp-border); }
.tp-cd__sidesec--cm .tp-cdcm { gap: 12px; }
.tp-cd__sidesec--cm .tp-cdcm__avatar { width: 28px; height: 28px; }
.tp-cd__sidesec--cm .tp-cdcm__feed { gap: 12px; }
.tp-cd__sideref { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.tp-cd__refthumb { position: relative; flex: none; width: 120px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: var(--tp-bg-sunken); }
.tp-cd__refthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tp-cd__refbody { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tp-cd__sideref .tp-cd__reft {
  display: -webkit-box; overflow: hidden; color: var(--tp-text-strong); font-size: 13px; line-height: 18px; font-weight: 700;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}
.tp-cd__sideref .tp-cd__refmeta { color: var(--tp-text-subtle); font-size: 12px; line-height: 16px; }
.tp-cd__refacts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.tp-cd__refacts .tp-cd__refmore { margin: 0; }
.tp-cd__refacts .tp-ytattr { display: inline-flex; padding: 0; border: 0; background: none; color: var(--tp-text-subtlest); font-size: 12px; font-weight: 600; }
.tp-cd__refadd {
  display: inline-flex; align-items: center; gap: 6px; width: 100%; min-height: 40px; padding: 8px 12px; border: 1px dashed var(--tp-border-input);
  border-radius: var(--tp-radius); background: transparent; color: var(--tp-text); font-size: 13px; font-weight: 700; text-align: left;
  transition: background-color var(--tp-dur) var(--tp-ease), border-color var(--tp-dur) var(--tp-ease);
}
.tp-cd__refadd:hover, .tp-cd__refadd[aria-expanded="true"] { border-color: var(--tp-text-subtle); background: var(--tp-hover); }
.tp-cd__refadd .tp-icon { width: 16px; height: 16px; color: var(--tp-text-subtle); }

/* Plein écran: only the script. */
.tp-cd-dialog.is-focus .tp-cd__body { grid-template-columns: minmax(0, 1fr); border-top: 0; }
.tp-cd-dialog.is-focus .tp-cd__side, .tp-cd-dialog.is-focus .tp-cd__below { display: none; }
.tp-cd-dialog.is-focus .tp-cd__inner { max-width: 1240px; }
.tp-cd-dialog.is-focus .tp-cd__paper { max-height: none; overflow: visible; }

@media (max-width: 1279px) {
  .tp-cd__body { grid-template-columns: minmax(0, 1fr) 300px; }
  .tp-cd__side { padding: 20px 16px 28px; }
  .tp-cd__write { grid-template-columns: minmax(0, 1fr) 272px; gap: 28px; }
}
/* « Générer » (script toolbar): its options open in a dropdown under it, never spread next to the script. */
.tp-cd__write { display: block; position: relative; }
.tp-cd__ai { display: none; }
.tp-cd .tp-cd__tb .tp-button.tp-cd__genscript { --tp-btn-bg: var(--tp-accent); --tp-btn-bg-hover: var(--tp-accent-fill-hover); --tp-btn-fg: var(--tp-accent-text); --tp-btn-edge: transparent; gap: 6px; margin-left: 6px; padding: 0 10px 0 12px; font-weight: 600; }
.tp-cd__genscript .tp-icon { width: 16px; height: 16px; }
.tp-cd__genscript[aria-expanded="true"] .tp-icon:last-child { transform: rotate(180deg); }
@media (min-width: 900px) {
  .tp-cd-dialog.has-aisheet .tp-cd__ai {
    position: absolute; top: 40px; right: 0; z-index: 20; display: flex; width: min(380px, 100%);
    max-height: max(320px, calc(100vh - 340px)); max-height: max(320px, calc(100dvh - 340px)); margin: 0; padding: 14px 16px 16px;
    overflow-y: auto; border: 1px solid var(--tp-border); border-radius: 12px; background: #212121; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    animation: tp-cd-drop 140ms var(--tp-ease-out) both;
  }
  .tp-cd-dialog.has-aisheet .tp-cdai__close { display: inline-grid; }
  .tp-cd-dialog.is-focus.has-aisheet .tp-cd__ai { top: 40px; }
}
@keyframes tp-cd-drop { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .tp-cd-dialog.has-aisheet .tp-cd__ai { animation: none; } }
/*
 * Narrow screens: one column. The two columns melt into one list (display: contents) so the order can be chosen:
 * notices, thumbnail + its buttons, title, properties, reference, then the tabs, attachments and comments.
 */
@media (max-width: 899px) {
  .tp-cd__body { display: flex; flex: 1 0 auto; flex-direction: column; padding: 0 16px 16px; border-top: 0; }
  .tp-cd__main, .tp-cd__inner, .tp-cd__side { display: contents; }
  .tp-cd__readonly, .tp-cd__archived { order: -5; }
  .tp-cd__readonly { margin-top: 12px; }
  .tp-cd__sidesec:first-child { order: -4; }
  .tp-cd__head { order: -3; }
  .tp-cd__side .tp-cd__props, .tp-cd__sidesec--ref { order: -2; }
  .tp-cd__side .tp-cd__props { margin-top: 4px; }
  .tp-cd__sidesec--ref { margin-bottom: 8px; }
  .tp-cd__sidesec--cm { order: 1; margin-bottom: 8px; }
  .tp-cd__editor { min-height: 320px; }
  .tp-cd__sidesec:first-child .tp-cd__sidek { display: none; }
  .tp-cd__media { margin: 0 -16px; }
  .tp-cd__thumbacts .tp-button { min-height: 40px; }
  .tp-cd__head { padding-top: 12px; }
  .tp-cd__paper { max-height: none; overflow: visible; }
  .tp-cd__below { margin-top: 20px; }
}
/* « Générer » : the one accent button of the card (blue, as the selected menu). */
.tp-cd .tp-cd__thumbacts .tp-button.tp-cd__gen { --tp-btn-bg: var(--tp-accent); --tp-btn-bg-hover: var(--tp-accent-fill-hover); --tp-btn-fg: var(--tp-accent-text); --tp-btn-edge: transparent; font-weight: 600; }
.tp-cd__refacts .tp-ytattr { flex: 1 1 100%; min-width: 0; white-space: normal; text-align: left; }
/* Phone: the script toolbar keeps « Générer » in view; copy and download are left out (the text can still be selected). */
@media (max-width: 599px) {
  .tp-cd__tb [data-copy], .tp-cd__tb [data-download] { display: none; }
  .tp-cd .tp-cd__tb .tp-button.tp-cd__genscript { margin-left: auto; padding: 0 10px; }
  .tp-cd__tb .tp-cd__fmtopt span { padding: 4px 8px; }
  .tp-cd__genscript .tp-icon:last-child { display: none; }
}
