/* ---------- Design tokens ---------- */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-hover: #fafafa;
  --border: #e5e5ea;
  --text: #1c1c1e;
  --text-secondary: #6e6e76;
  --text-tertiary: #9797a1;
  --accent: #4f46e5;
  --accent-contrast: #ffffff;
  --success: #16a34a;
  --success-bg: #eafaf0;

  --cat-gif: #8b5cf6;
  --cat-statics: #2563eb;
  --cat-videos: #ea580c;
  --cat-motion-design: #c026d3;
  --cat-ugc: #16a34a;
  --cat-ugc-ia: #0d9488;
  --cat-influence: #db2777;
  --cat-youtube: #dc2626;
  --cat-default: #64748b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.16);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --surface: #1c1c1f;
    --surface-hover: #232327;
    --border: #302f34;
    --text: #f2f2f3;
    --text-secondary: #a8a8ad;
    --text-tertiary: #77777d;
    --success-bg: #10281a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.breadcrumb a:hover { color: var(--text); }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab {
  padding: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
/* Selecteur d'espace (Picta / Picta x Walgreens), au-dessus des onglets :
   chaque espace est une bibliotheque totalement separee. */
.space-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.space-pill {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.space-pill:hover { color: var(--text); }
.space-pill.active {
  background: var(--accent);
  color: var(--accent-contrast);
}
.tab-badge {
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 28px;
}

/* ---------- Bandeau produits mis en avant ---------- */
.push-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 20px 24px 22px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
}

.featured-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px 32px;
}
@media (max-width: 640px) {
  .featured-products { grid-template-columns: 1fr; }
}
.featured-group-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.featured-table { width: 100%; border-collapse: collapse; }
.featured-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  padding: 0 0 6px;
  border-bottom: 1px solid var(--border);
}
.featured-table th:last-child { text-align: right; }
.featured-table td {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.featured-table tr:last-child td { border-bottom: none; }
.featured-count {
  text-align: right;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.featured-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
a.featured-name:hover { color: var(--accent); text-decoration: underline; }
.featured-name-plain { color: var(--text-secondary); font-weight: 500; }
.featured-banner-note {
  font-size: 12px;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  margin-bottom: 16px;
}
.featured-banner-note strong { color: var(--accent); }

/* ---------- Buttons / inputs ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface-hover); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn:disabled { opacity: 0.7; cursor: default; }
.btn-primary:hover:disabled { filter: none; }

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.input, select.input {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
}

.searchbar {
  flex: 1;
  min-width: 160px;
  max-width: 320px;
}

/* ---------- Stat pills ---------- */
.stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.stat-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  min-width: 110px;
  box-shadow: var(--shadow-sm);
}
.stat-pill .value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.stat-pill .label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

a.stat-pill {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
a.stat-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

/* ---------- Category badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  color: white;
  text-decoration: none;
  white-space: nowrap;
}
.badge .swatch { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.85); }

.badge-gif { background: var(--cat-gif); }
.badge-statics { background: var(--cat-statics); }
.badge-videos { background: var(--cat-videos); }
.badge-motion-design { background: var(--cat-motion-design); }
.badge-ugc { background: var(--cat-ugc); }
.badge-ugc-ia { background: var(--cat-ugc-ia); }
.badge-influence { background: var(--cat-influence); }
.badge-youtube { background: var(--cat-youtube); }
.badge-default { background: var(--cat-default); }

.badge-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ---------- Top concepts (home) ---------- */
.top-concepts {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}
.top-concepts-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 14px;
}
.top-concepts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.top-concept-row {
  display: grid;
  grid-template-columns: 24px 1fr 140px 90px 44px;
  align-items: center;
  gap: 14px;
  padding: 7px 6px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.top-concept-row:hover { background: var(--surface-hover); }
.top-concept-rank {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-align: center;
}
.top-concept-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-concept-track {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  display: block;
}
.top-concept-fill {
  display: block;
  height: 100%;
  background: var(--success);
  border-radius: 999px;
}
.top-concept-count {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.top-concept-pct {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

/* ---------- Concept grid (home) ---------- */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.concept-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: block;
}
.concept-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.concept-thumb {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--surface-hover), var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.concept-thumb img, .concept-thumb video {
  width: 100%; height: 100%; object-fit: cover;
}
.concept-thumb .placeholder-icon {
  font-size: 34px;
  opacity: 0.35;
}

.concept-body { padding: 16px 18px 18px; }

.concept-title {
  font-size: 15.5px;
  font-weight: 600;
  margin: 0 0 3px;
  letter-spacing: -0.01em;
}

.concept-total {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.concept-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.progress-track {
  height: 5px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 999px;
}
.progress-label {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* ---------- Concept detail sections ---------- */
.category-section { margin-bottom: 36px; }

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.category-header h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}
.category-count { font-size: 13px; color: var(--text-secondary); }

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.asset-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.15s ease, opacity 0.15s ease;
}
.asset-card:hover { box-shadow: var(--shadow-md); }
/* Voile "deja utilisee" sur le contenu de la vignette, sauf le badge
   "Variante disponible" : une variante encore inutilisee doit rester bien
   visible meme quand la crea de base est cochee. */
.asset-card.is-used .asset-thumb > *:not(.variant-badge) { opacity: 0.5; }
.asset-card.is-used .asset-filename,
.asset-card.is-used .asset-sub { opacity: 0.6; }

.asset-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.perf-rank {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: rgba(0,0,0,.55);
  border-radius: 4px;
  padding: 2px 6px;
}
.meta-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: white;
  background: rgba(0,0,0,.55);
  border-radius: 4px;
  padding: 2px 6px;
}
.meta-badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
}
.meta-badge.meta-active::before { background: var(--success); }
.meta-badge-stacked { top: 27px; }
.asset-thumb img, .asset-thumb video {
  width: 100%; height: 100%; object-fit: cover;
}
.asset-thumb .file-icon { font-size: 30px; opacity: 0.4; }
.asset-thumb-169 { aspect-ratio: 16 / 9; }

.asset-meta { padding: 8px 10px 10px; }
.asset-filename {
  font-size: 11.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-sub {
  font-size: 10.5px;
  color: var(--text-tertiary);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ratio-pills {
  display: flex;
  gap: 4px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.ratio-pill {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

.variant-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  color: white;
  background: var(--accent);
  border-radius: 4px;
  padding: 2px 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.adjust-stats {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.adjust-stats span {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}
.adjust-stats span strong {
  font-weight: 700;
  color: var(--text);
}
.asset-card.is-used .adjust-stats { opacity: 1; }
.modal-adjust-stats { margin: 4px 0 12px; }
.modal-adjust-stats span { font-size: 12px; padding: 3px 8px; }
.modal-kpi-row { display: flex; gap: 6px; flex-wrap: wrap; }
.modal-kpi-row span.meta-status { display: inline-flex; align-items: center; gap: 4px; }
.modal-kpi-row span.meta-status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
}
.modal-kpi-row span.meta-status.meta-active::before { background: var(--success); }

.used-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}
.used-toggle input { display: none; }
.used-toggle .box {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  transition: all 0.15s ease;
}
.used-toggle input:checked + .box {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
}

.modal-preview {
  width: 100%;
  height: 320px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-preview img, .modal-preview video { width: 100%; height: 100%; object-fit: contain; }

.modal-body { padding: 18px 20px 20px; }
.modal-title { font-size: 15px; font-weight: 600; margin: 0 0 2px; word-break: break-word; }
.modal-title-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.modal-copy-name { padding: 3px 10px; font-size: 12px; flex-shrink: 0; }
.modal-path { font-size: 11.5px; color: var(--text-tertiary); margin-bottom: 16px; word-break: break-all; }

.field-row { margin-bottom: 12px; }
.field-row label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.field-row input:not([type="checkbox"]), .field-row textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  gap: 10px;
}
.modal-footer-actions { flex-wrap: wrap; }

/* Cote a cote (apercu + infos) des que l'ecran le permet : evite le scroll
   vertical desormais frequent avec les KPIs Adjust/Meta + le graphique
   hebdo, en utilisant la largeur plutot que d'empiler indefiniment. Rend
   .modal-wide (ex-cas particulier YouTube) inutile, la largeur par defaut
   suffit maintenant. */
@media (min-width: 720px) {
  /* Taille de fiche stable quel que soit le format affiche (9:16, 4:5,
     1:1) : hauteur minimale d'un 9:16 sur 300px de large, les formats
     plus courts sont centres sur fond noir au lieu de faire retrecir la
     fiche quand on change de format. */
  .modal {
    max-width: 900px;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    min-height: min(534px, 88vh);
  }
  .modal-preview {
    width: 300px;
    flex-shrink: 0;
    height: auto;
    align-self: stretch;
  }
  .modal-preview img, .modal-preview video { max-height: 88vh; }
  .modal-body {
    flex: 1;
    min-width: 0;
    max-height: 88vh;
    overflow-y: auto;
  }
  .modal-footer-actions { flex-wrap: nowrap; }
}

.used-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}
.empty-state .icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Apercu "rendu Meta" (maquette iPhone) ---------- */
.phone-frame {
  position: relative;
  width: 300px;
  height: 702px;
  background: linear-gradient(155deg, #4b4b4e, #1a1a1c 55%, #2c2c2e);
  border-radius: 54px;
  padding: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 1.5px rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}
.phone-frame::before,
.phone-frame::after {
  content: "";
  position: absolute;
  left: -3px;
  width: 3px;
  background: #232325;
  border-radius: 2px 0 0 2px;
}
.phone-frame::before { top: 108px; height: 32px; }
.phone-frame::after { top: 152px; height: 58px; }

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #f0f2f5;
  border-radius: 42px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.phone-dynamic-island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 86px;
  height: 24px;
  background: #000;
  border-radius: 14px;
  z-index: 10;
}
.phone-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: #000;
  background: #fff;
}
.phone-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 10px;
  background: #fff;
}
.phone-search {
  flex: 1;
  background: #f0f2f5;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: #65676b;
}
.phone-feed {
  flex: 1;
  overflow-y: auto;
  background: #e9ebee;
}
.creapost-card { background: #fff; }
.creapost-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}
.creapost-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b7ff5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.creapost-header-text { flex: 1; min-width: 0; }
.creapost-page-name { font-size: 12.5px; font-weight: 600; color: #050505; line-height: 1.3; }
.creapost-sponsored { font-size: 11px; color: #65676b; }
.creapost-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #000;
  overflow: hidden;
}
.creapost-media img, .creapost-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.creapost-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.creapost-linkpreview {
  padding: 9px 12px;
  border-bottom: 1px solid #e4e6eb;
  background: #f7f8fa;
}
.creapost-linkpreview .domain {
  font-size: 10.5px;
  color: #65676b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.creapost-linkpreview .headline { font-size: 13.5px; font-weight: 600; color: #050505; margin-top: 2px; }
.creapost-linkpreview .desc { font-size: 12px; color: #65676b; margin-top: 1px; }
.creapost-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 11.5px;
  color: #65676b;
}
.creapost-action-btn {
  background: #e4e6eb;
  color: #050505;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
}
.creapost-engagement {
  display: flex;
  justify-content: space-around;
  padding: 7px 8px;
  border-top: 1px solid #e4e6eb;
  font-size: 12px;
  color: #65676b;
}
.phone-tabbar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0 6px;
  border-top: 1px solid #e4e6eb;
  background: #fff;
  font-size: 15px;
}
.phone-home-indicator {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 116px;
  height: 4px;
  background: #000;
  border-radius: 2px;
  opacity: 0.85;
}

/* ---------- Apercu "pub YouTube" (maquette iPhone, theme sombre) ---------- */
.phone-screen-dark {
  background: #0f0f0f;
}
.phone-screen-dark .phone-statusbar {
  background: #0f0f0f;
  color: #fff;
}
.yt-video-area {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  flex-shrink: 0;
  overflow: hidden;
}
.yt-video-area img, .yt-video-area video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.yt-ad-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 3px;
}
.yt-skip-btn {
  appearance: none;
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f0f0f;
  font-size: 11px;
  font-weight: 700;
  border: none;
  padding: 6px 12px;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}
.yt-info {
  padding: 12px 14px;
  color: #f1f1f1;
  overflow-y: auto;
  flex: 1;
}
.yt-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 10px;
}
.yt-channel-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}
.yt-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b7ff5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
  flex-shrink: 0;
}
.yt-channel-meta { flex: 1; min-width: 0; }
.yt-channel-name { font-size: 12.5px; font-weight: 600; }
.yt-views { font-size: 10.5px; color: #aaa; margin-top: 1px; }
.yt-subscribe {
  appearance: none;
  background: #fff;
  color: #0f0f0f;
  font-size: 11.5px;
  font-weight: 700;
  border: none;
  padding: 7px 15px;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}
.yt-actions {
  display: flex;
  gap: 18px;
  font-size: 10.5px;
  color: #e0e0e0;
  padding-top: 10px;
  border-top: 1px solid #272727;
}
.yt-actions span { display: flex; flex-direction: column; align-items: center; gap: 3px; }

/* ---------- Responsive (mobile) ---------- */
@media (max-width: 640px) {
  .page { padding: 20px 14px 48px; }
  .topbar-inner { padding: 12px 14px; gap: 10px; }
  .brand { font-size: 15px; }
  h1 { font-size: 21px; }
  .tabs { flex-wrap: wrap; gap: 14px; }

  .stats-row { gap: 8px; }
  .stat-pill { min-width: 0; flex: 1 1 calc(50% - 8px); padding: 10px 12px; }

  /* Les colonnes en largeurs fixes ne tiennent pas sur mobile : on retire
     la barre de progression et le compte pour ne garder que l'essentiel
     (rang, nom, pourcentage). */
  .top-concept-row { grid-template-columns: 18px 1fr 42px; }
  .top-concept-track, .top-concept-count { display: none; }

  .modal-backdrop { padding: 10px; }
  .modal { max-width: 100%; }
  .modal-preview, .modal-preview img, .modal-preview video { max-height: 240px; }

  .modal-footer { flex-wrap: wrap; }
  .modal-footer > div { width: 100%; justify-content: center; }
}
