@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Graphite (12/10) : gris graphite au lieu du noir, monochrome — la couleur ne sert qu'aux états */
  --bg: #18191b;
  --side: #1d1e21;
  --card: #222326;
  --card-hover: #28292d;
  --sunk: #141517;
  --wash: rgba(255,255,255,.04);
  --wash-strong: rgba(255,255,255,.07);
  --border: #2e2f33;
  --border-strong: #3a3b40;
  --accent: #ececee;
  --accent-2: #ececee;
  --accent-grad: var(--accent);
  --accent-hover: #ffffff;
  --accent-ink: #18191b;
  --text: #ececee;
  --text-dim: #9a9ba1;
  --text-faint: #66676d;
  --success: #4cc38a;
  --warning: #e5a33b;
  --danger: #e5636f;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: none;
  --shadow: 0 12px 32px -14px rgba(0,0,0,.55);
  --shadow-lg: 0 30px 70px -20px rgba(0,0,0,.65);
  --sidebar-w: 240px;
  --ease: cubic-bezier(.22,1,.36,1);
}

* { box-sizing: border-box; }

::selection { background: rgba(236,236,238,.22); color: #fff; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
}

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

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.10); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); background-clip: padding-box; }

:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 2px; border-radius: 6px; }

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--side);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -.01em;
  padding: 4px 10px 22px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-logo {
  height: 20px;
  width: 20px;
  display: block;
  flex-shrink: 0;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar nav a {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-weight: 500;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .15s var(--ease), color .15s var(--ease);
  position: relative;
}

.sidebar nav a svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; }

.sidebar nav a:hover { background: var(--card-hover); color: var(--text); }
.sidebar nav a:hover svg { opacity: 1; }
.sidebar nav a.active {
  background: var(--card);
  color: var(--text);
}
.sidebar nav a.active svg { opacity: 1; color: var(--text); }
.sidebar nav a.back-link { color: var(--text-faint); font-size: 12.5px; margin-bottom: 6px; }
.sidebar nav a.back-link:hover { color: var(--text-dim); }

.sidebar-section-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  padding: 16px 12px 6px;
}
.sidebar-section-label:first-of-type { padding-top: 4px; }

.sidebar .logout-form { padding: 6px 0 0; border-top: 1px solid var(--border); margin-top: 6px; }
.sidebar .logout-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-faint);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .15s, color .15s;
  margin-top: 6px;
}
.sidebar .logout-btn svg { width: 16px; height: 16px; }
.sidebar .logout-btn:hover { background: var(--card-hover); color: var(--text); }

/* Mobile topbar toggle */
.mobile-topbar { display: none; }

/* Main content */
.main {
  flex: 1;
  min-width: 0;
  padding: 32px 36px 64px;
  max-width: 1240px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.page-header p { margin: 5px 0 0; color: var(--text-dim); font-size: 13.5px; }

/* Horizontal settings tabs */
.settings-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}
.settings-tabs button {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.settings-tabs button:hover { color: var(--text); }
.settings-tabs button.active { color: var(--text); border-bottom-color: var(--text); }
.settings-panel { display: none; }
.settings-panel.active { display: block; }

/* Cards / grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* Menu d'actions par ligne (tableau des profils Brander) — un bouton ⋯ à la
   place d'une pile de boutons, pour économiser la largeur de colonne. */
/* Profile row expand ("▾ Détails" — photo/bio/lien/OneUp) */
.row-expand-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color .15s, transform .15s var(--ease), background .15s;
}
.row-expand-btn svg { width: 16px; height: 16px; }
.row-expand-btn:hover { color: var(--text); background: rgba(255,255,255,.045); }
.row-expand-btn.open { transform: rotate(180deg); color: var(--text); }
.profile-detail-row td { background: rgba(255,255,255,.015); padding: 16px 20px; }
.profile-detail { display: flex; gap: 20px; align-items: flex-start; }
.profile-detail-photo {
  width: 110px; height: 110px; flex-shrink: 0; border-radius: var(--radius-sm);
  overflow: hidden; background: rgba(255,255,255,.03); display: flex; align-items: center; justify-content: center;
}
.profile-detail-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-detail-fields { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.profile-detail-fields strong { color: var(--text-dim); font-weight: 600; margin-right: 4px; }

.row-menu { position: relative; display: inline-block; }
.row-menu-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 32px;
  height: 28px;
  line-height: 1;
  cursor: pointer;
  font-size: 15px;
}
.row-menu-btn:hover { border-color: var(--border-strong); }
.row-menu-list {
  display: none;
  /* fixed (positionné en JS, cf. positionRowMenu dans brander.js) plutôt
     qu'absolute : le conteneur du tableau a un overflow qui coupait le menu
     sur les dernières lignes. */
  position: fixed;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 170px;
  padding: 4px;
  z-index: 1000;
}
.row-menu.open .row-menu-list { display: block; }
.row-menu-list button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.row-menu-list button:hover { background: rgba(255,255,255,.06); }
.row-menu-note { padding: 6px 10px; color: var(--text-dim); font-size: 12px; }

/* Configuration groupée Brander : une bio + un lien par profil sélectionné,
   au lieu d'un seul champ partagé appliqué à tout le lot. */
.bulk-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.bulk-row:last-child { border-bottom: none; }
.bulk-row-name { font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.bulk-row-fields { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; align-items: start; }
.bulk-row-fields textarea { width: 100%; }
@media (max-width: 640px) { .bulk-row-fields { grid-template-columns: 1fr; } }
.bulk-row-photo { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.bulk-photo-thumb {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-dim);
  object-fit: cover;
  flex-shrink: 0;
}
.bulk-photo-thumb[data-empty] { background: transparent; }
.bulk-photo-thumb:not([data-empty]) { border-style: solid; border-color: var(--border); }

.stat-card { position: relative; overflow: hidden; }
.stat-card .label { color: var(--text-dim); font-size: 12.5px; margin-bottom: 10px; font-weight: 500; }
.stat-card .value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-card .value.success { color: var(--success); }
.stat-card .value.warning { color: var(--warning); }
.stat-card .value.accent { color: var(--text); }

.collection-description-view {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: 8px;
}
.collection-description-view .meta { margin: 0; max-width: 560px; }
.collection-description-view .btn { flex-shrink: 0; }
.collection-description-form { margin-top: 10px; max-width: 520px; }
.collection-description-form textarea { font-size: 13px; }

/* Media — collections */
.back-link-inline {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-faint); font-size: 12.5px; font-weight: 600;
  margin-bottom: 10px; transition: color .15s;
}
.back-link-inline svg { width: 14px; height: 14px; }
.back-link-inline:hover { color: var(--accent); }

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.collection-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.collection-card:hover { border-color: var(--border-strong); background: var(--card-hover); }

.collection-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  aspect-ratio: 1;
  background: var(--border);
}
.collection-preview .cp-tile { background: var(--sunk); overflow: hidden; }
.collection-preview .cp-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.collection-preview .cp-tile.cp-video { display: flex; align-items: center; justify-content: center; color: var(--text-faint); }
.collection-preview .cp-tile.cp-video svg { width: 22px; height: 22px; }
.collection-preview.cp-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
}
.collection-preview.cp-empty svg { width: 32px; height: 32px; opacity: .6; }

.collection-card-info {
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.collection-card-info .name { font-weight: 600; font-size: 13.5px; }
.collection-card-info .count { color: var(--text-dim); font-size: 12px; flex-shrink: 0; }

.collection-card .delete-collection-mini {
  position: absolute; top: 10px; right: 10px;
  opacity: 0; transition: opacity .15s;
}
.collection-card:hover .delete-collection-mini { opacity: 1; }

.collection-card-new {
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--border-strong);
  background: transparent;
  min-height: 100%;
}
.collection-card-new:hover { border-color: var(--border-strong); background: var(--wash); }
.collection-card-new .new-inner {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-dim); font-weight: 600; font-size: 13px;
  padding: 40px 16px;
  text-align: center;
}
.collection-card-new .new-inner svg { width: 26px; height: 26px; }
.collection-card-new:hover .new-inner { color: var(--accent); }
.collection-card-new .new-form { padding: 16px; display: none; flex-direction: column; gap: 10px; width: 100%; }
.collection-card-new.editing .new-inner { display: none; }
.collection-card-new.editing .new-form { display: flex; }
.collection-card-new.editing { cursor: default; }

/* Media */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255,255,255,.015);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(236,236,238,.06);
}
.dropzone .dz-icon { width: 34px; height: 34px; margin: 0 auto 10px; color: var(--text-dim); }
.dropzone.drag-over .dz-icon, .dropzone:hover .dz-icon { color: var(--accent); }
.dropzone .dz-title { font-weight: 600; font-size: 13.5px; margin-bottom: 3px; }
.dropzone .dz-hint { color: var(--text-faint); font-size: 12px; }
.dropzone input[type=file] { display: none; }
.dropzone .dz-files { margin-top: 12px; font-size: 12.5px; color: var(--accent); font-weight: 500; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 14px;
}
.media-tile {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}

/* Media lightbox (click a tile in the Media library to view it large) */
.lightbox-card { display: flex; gap: 20px; padding: 20px; }
.lightbox-media {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center;
  background: #000; border-radius: var(--radius-sm); overflow: hidden; max-height: 78vh;
}
.lightbox-media img, .lightbox-media video { max-width: 100%; max-height: 78vh; object-fit: contain; display: block; }
.lightbox-info { width: 260px; flex-shrink: 0; display: flex; flex-direction: column; }
.lightbox-info .dlg-message { white-space: pre-wrap; }
@media (max-width: 720px) {
  .lightbox-card { flex-direction: column; max-height: 90vh; overflow-y: auto; }
  .lightbox-info { width: auto; }
}
.media-tile:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.media-tile .thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--sunk);
  display: block;
}
.media-tile .thumb-video {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sunk);
  color: var(--text-dim);
}
.media-tile .thumb-video svg { width: 30px; height: 30px; }
/* Video poster frame (videoThumbHtml): image fills the tile, video icon stays on top */
.has-poster { position: relative; overflow: hidden; }
.has-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.has-poster svg { position: relative; z-index: 1; color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.7)); }
.media-tile .meta-row {
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.media-tile .tile-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.78) 100%);
  opacity: 0;
  transition: opacity .15s var(--ease);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 8px;
  gap: 6px;
}
.media-tile:hover .tile-overlay, .media-tile:focus-within .tile-overlay { opacity: 1; }
.media-tile.picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.media-tile.picked::after {
  content: "✓";
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.icon-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: rgba(34,35,38,.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
}
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }
.icon-btn.icon-btn-danger:hover { background: var(--danger); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  font-size: 13.5px;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { background: var(--card-hover); border-color: #4a4b51; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-success { background: rgba(76,195,138,.14); border-color: rgba(76,195,138,.35); color: var(--success); }
.btn-success:hover { background: rgba(76,195,138,.22); }
.btn-danger { background: rgba(229,99,111,.12); border-color: rgba(229,99,111,.3); color: var(--danger); }
.btn-danger:hover { background: rgba(229,99,111,.2); }
.btn-warning { background: rgba(229,163,59,.14); border-color: rgba(229,163,59,.32); color: var(--warning); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--wash-strong); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 15px 28px; font-size: 15.5px; border-radius: var(--radius-sm); }

/* Segmented control */
.segmented {
  position: relative;
  /* Grid, pas flex : dans un conteneur en taille auto (shrink-to-fit),
     "flex: 1" ne force PAS des largeurs égales — flex-grow ne distribue que
     l'espace EXCÉDENTAIRE, qui vaut zéro tant que le conteneur se contente
     de mesurer son propre contenu. Résultat mesuré : 100px vs 180px pour
     "Manual" / "Auto-fill from library" alors que le thumb assume un 50/50
     strict. grid-template-columns: 1fr 1fr résout ça nativement, même en
     taille auto (les deux colonnes s'alignent sur la plus large des deux). */
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  background: var(--sunk);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  overflow: hidden; /* le glow du thumb (box-shadow) débordait du contour arrondi sans ça */
}
.segmented .segmented-thumb {
  position: absolute;
  top: 3px; left: 3px; bottom: 3px;
  width: calc(50% - 3px);
  background: var(--card-hover);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--border-strong);
  transition: transform .25s var(--ease);
}
.segmented[data-value="auto"] .segmented-thumb,
.segmented[data-value="income"] .segmented-thumb { transform: translateX(100%); }
.segmented button {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap;
  transition: color .2s;
}
.segmented button.active { color: var(--text); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3.5px 10px 3.5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}
.badge { white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-success { background: rgba(76,195,138,.13); color: var(--success); }
.badge-warning { background: rgba(229,163,59,.13); color: var(--warning); }
.badge-danger { background: rgba(229,99,111,.13); color: var(--danger); }
.badge-accent { background: var(--wash-strong); color: var(--text); }
.badge-muted { background: rgba(154,155,161,.13); color: var(--text-dim); }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border-strong); border-radius: 999px; transition: background .15s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .15s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* Big agent toggle */
.agent-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.agent-toggle .status-text { font-size: 15px; font-weight: 700; }
.agent-toggle .status-text.running { color: var(--success); }
.agent-toggle .status-text.stopped { color: var(--danger); }

/* Tables / lists */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
th { color: var(--text-faint); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--wash); }
.table-wrap { overflow-x: auto; }

.activity-item, .account-item, .queue-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  transition: border-color .15s;
}
.activity-item:hover, .queue-item:hover { border-color: var(--border-strong); }

.activity-item .row1, .queue-item .row1 {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}

.meta { color: var(--text-dim); font-size: 12.5px; }
.comment-text { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; margin: 6px 0; font-size: 13.5px; line-height: 1.5; }
.reply-text { border-left: 2px solid var(--accent); padding-left: 10px; margin: 6px 0; font-size: 13.5px; color: var(--text); }

.account-item { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--card-hover);
  display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0;
  border: 1px solid var(--border);
}
.account-info { flex: 1; min-width: 0; }
.account-info .name { font-weight: 600; }
.account-info .sub { color: var(--text-dim); font-size: 12.5px; }
.account-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

select, input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=month], input[type=datetime-local], textarea {
  background: var(--sunk); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; font-size: 13.5px; width: 100%;
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
/* Sans ça, le picker natif (icône calendrier, flèches) reste rendu en clair par
   le navigateur — invisible/moche sur notre fond sombre, comme vu sur /finance. */
input[type=date], input[type=time], input[type=month] { color-scheme: dark; }
select:hover, input:hover, textarea:hover { border-color: var(--border-strong); }
select:focus, input:focus, textarea:focus {
  outline: none; border-color: #55565c; background: var(--sunk);
  box-shadow: 0 0 0 3px rgba(236,236,238,.06);
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 70px; }
label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 6px; font-weight: 500; }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.hint { color: var(--text-faint); font-size: 12px; margin-top: 6px; line-height: 1.5; }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
/* Account picker (Scheduler → Schedule): holds .account-group blocks, not flat tags directly
   — override the flex-row layout above so categories stack vertically instead of wrapping
   like pills. The .tag-list *inside* each group (the actual account pills) is unaffected. */
#scheduleAccountsPicker.tag-list { display: block; }
#scheduleAccountsPicker .account-group { margin: 14px 0; }
#scheduleAccountsPicker .account-group:first-child { margin-top: 0; }
.tag { background: rgba(255,255,255,.045); border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 6px; transition: border-color .15s, background .15s; }
.tag:hover { border-color: var(--border-strong); }
.tag button { background: none; border: none; color: var(--text-faint); cursor: pointer; font: inherit; padding: 0; line-height: 1; transition: color .15s; }
.tag button:hover { color: var(--danger); }

.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters select, .filters input { width: auto; min-width: 140px; }

.empty-state { text-align: center; padding: 56px 20px; color: var(--text-faint); }
.empty-state .es-icon { width: 34px; height: 34px; margin: 0 auto 12px; opacity: .5; }
.empty-state .es-title { font-size: 13.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 3px; }
.empty-state .es-sub { font-size: 12.5px; }

/* Logs */
.log-viewer {
  background: var(--sunk); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12px;
  max-height: 70vh; overflow-y: auto; white-space: pre-wrap; word-break: break-word; line-height: 1.7;
}
.log-line.INFO { color: var(--text-dim); }
.log-line.WARNING { color: var(--warning); }
.log-line.ERROR { color: var(--danger); }
.log-line.info { color: var(--text-dim); }
.log-line.warn { color: var(--warning); }
.log-line.err { color: var(--danger); }
.log-line.ok { color: var(--success); }

/* Bars chart (hourly) */
.bars {
  display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 10px;
}
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bars .bar { width: 100%; background: var(--accent-grad); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .bar-label { font-size: 9.5px; color: var(--text-faint); }

/* Finance — category breakdown (horizontal bars) */
.catbar-row { display: grid; grid-template-columns: 140px 1fr 90px; align-items: center; gap: 12px; padding: 7px 0; }
.catbar-label { font-size: 13px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catbar-track { background: rgba(255,255,255,.04); border-radius: 999px; height: 8px; overflow: hidden; }
.catbar-fill { height: 100%; border-radius: 999px; min-width: 2px; }
.catbar-fill.income { background: var(--success); }
.catbar-fill.expense { background: var(--warning); }
.catbar-amount { font-size: 13px; font-weight: 600; text-align: right; }

/* Finance — top row: $ ⇄ € converter (left) + URSSAF tax rate (right) */
.finance-top-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 22px;
}
.fx-widget {
  display: inline-flex; align-items: center; gap: 7px; background: var(--card);
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px 7px 12px;
  font-size: 13px;
}
.fx-widget .fx-icon { opacity: .8; }
.fx-widget input { width: 78px; padding: 5px 9px; text-align: right; font-size: 13px; }
.fx-widget input::-webkit-outer-spin-button,
.fx-widget input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fx-widget input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.fx-widget .fx-cur { color: var(--text-dim); font-weight: 700; }
.fx-widget .fx-eq { color: var(--text-faint); }
.fx-widget .fx-rate {
  margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--border);
  font-size: 11px; white-space: nowrap;
}
#taxRateWidget input { width: 52px; }

/* Finance — 6 KPI tiles: fixed 3×3 grid (2 rows of 3) rather than auto-fit's variable wrap.
   Compound selector (learned from the .fin-modal/.dlg-card mixup) so this reliably
   beats the base .grid rule regardless of source order. */
.grid.finance-kpi-grid { grid-template-columns: repeat(3, 1fr); }
.finance-kpi-grid .stat-card .value { font-size: 24px; }
.finance-kpi-grid .stat-card .meta { margin-top: 6px; min-height: 1.4em; }
.finance-kpi-grid .stat-card.clickable { cursor: pointer; transition: border-color .15s var(--ease), transform .15s var(--ease); }
.finance-kpi-grid .stat-card.clickable:hover { border-color: var(--border-strong); background: var(--card-hover); }
@media (max-width: 720px) {
  .grid.finance-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Finance — Entry/Categories/Recurring popups (top-right buttons)
   Compound selector (not just .fin-modal) so this reliably beats .dlg-card's own
   max-width/width further down the file, regardless of source order. */
.dlg-card.fin-modal { max-width: 760px; width: 94vw; max-height: 85vh; overflow-y: auto; text-align: left; }
.fin-modal .account-item:last-child { margin-bottom: 0; }

/* Scripts */
.script-brief {
  white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.6;
  color: var(--text-dim); margin: 0;
}
.gen-order-badge {
  position: absolute; top: 6px; left: 6px; z-index: 2; background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; line-height: 1; padding: 4px 6px; border-radius: 999px;
  min-width: 10px; text-align: center;
}

/* Scripts: several media per step */
.step-thumbs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.gen-steps { display: flex; flex-direction: column; gap: 6px; }
.gen-step {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px;
}
.gen-step.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.gen-step-label { font-size: 12.5px; font-weight: 600; min-width: 52px; }
.gen-step-media { cursor: pointer; display: inline-flex; }
.gen-step-media:hover { opacity: .6; }

.toast {
  position: fixed; bottom: 22px; right: 22px; background: rgba(40,41,45,.97);
  backdrop-filter: blur(12px); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 13px 18px; font-size: 13.5px; font-weight: 500; z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: toast-in .25s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.toast.success { border-color: rgba(76,195,138,.4); color: var(--success); }
.toast.error { border-color: rgba(229,99,111,.4); color: var(--danger); }

.dlg-overlay {
  position: fixed; inset: 0; background: rgba(10,10,12,.6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 300;
  animation: dlg-fade .15s var(--ease);
}
.dlg-card {
  background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 22px; max-width: 380px; width: 100%;
  animation: dlg-pop .15s var(--ease);
}
.dlg-title { font-weight: 700; font-size: 16px; margin-bottom: 8px; color: var(--text); }
.dlg-message { color: var(--text-dim); font-size: 13.5px; line-height: 1.55; white-space: pre-line; }
.dlg-input {
  width: 100%; margin-top: 14px; padding: 10px 12px; font: inherit; color: var(--text);
  background: rgba(255,255,255,.04); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.dlg-input:focus { outline: none; border-color: var(--accent); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@keyframes dlg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dlg-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.section-title { font-size: 14.5px; font-weight: 700; margin: 30px 0 14px; letter-spacing: -.005em; }
.section-title:first-child { margin-top: 0; }

/* Hub (post-login landing page) */
.hub-shell { min-height: 100vh; }
.hub-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px; border-bottom: 1px solid var(--border);
  background: rgba(29,30,33,.92); backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 10;
}
.hub-topbar .brand { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 9px; letter-spacing: -.01em; }
.hub-topbar .actions { display: flex; align-items: center; gap: 10px; }
.hub-topbar .logout-form { display: inline; }

.hub-main { max-width: 920px; margin: 0 auto; padding: 52px 28px 60px; }
.hub-main h1 { font-size: 26px; margin: 0 0 6px; font-weight: 800; letter-spacing: -.02em; }
.hub-main .hub-sub { color: var(--text-dim); font-size: 13.5px; margin: 0 0 34px; }

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.agent-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
  display: block;
  position: relative;
  overflow: hidden;
}
.agent-card::before {
  content: "";
  position: absolute; inset: 0;
  display: none;
}
.agent-card:hover { border-color: var(--border-strong); background: var(--card-hover); }
.agent-card:hover::before { opacity: 1; }
.agent-card .icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 16px; position: relative;
}
.agent-card .name { font-weight: 700; font-size: 15.5px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; position: relative; }
.agent-card .desc { color: var(--text-dim); font-size: 12.5px; line-height: 1.55; position: relative; }

.agent-card.disabled {
  border-style: dashed;
  opacity: .5;
  cursor: default;
  pointer-events: none;
}
.agent-card.disabled:hover { transform: none; box-shadow: none; border-color: var(--border); }

/* Media — top-level category picker (Threads posting/profile vs. OnlyFans sales content,
   two intentionally separate media pools). Logo only, faded until hovered — no label text,
   the two marks are distinct enough on their own. */
.media-category-picker {
  display: flex; flex-wrap: wrap; gap: 28px; justify-content: center; align-items: center;
  min-height: 44vh; padding: 40px 0;
}
.media-category-card {
  background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 200px; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.media-category-card:hover { border-color: var(--border-strong); background: var(--card-hover); }
.media-category-card .mcc-logo {
  width: 72px; height: 72px; color: var(--text-dim); opacity: .5;
  transition: opacity .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.media-category-card:hover .mcc-logo { opacity: 1; color: var(--text); transform: scale(1.08); }

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    display: none;
    width: 100%; height: auto; position: fixed; inset: 0; z-index: 100; overflow-y: auto;
  }
  .sidebar.open { display: flex; }
  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; background: rgba(29,30,33,.96); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
  }
  .mobile-topbar .brand { font-weight: 700; display: flex; align-items: center; gap: 8px; }
  .mobile-topbar button { background: rgba(255,255,255,.04); border: 1px solid var(--border-strong); color: var(--text); border-radius: var(--radius-sm); padding: 8px 12px; font: inherit; }
  .main { padding: 20px 16px 50px; }
  .field-row { grid-template-columns: 1fr; }
  .hub-topbar { padding: 14px 16px; flex-wrap: wrap; gap: 10px; }
  .hub-main { padding: 28px 16px 50px; }
}

/* Changelog — rendu du Markdown converti côté serveur (app/routes/dashboard.py) */
.markdown-body { line-height: 1.65; color: var(--text); max-width: 780px; }
.markdown-body h1 { font-size: 22px; font-weight: 800; margin: 0 0 14px; }
.markdown-body h2 {
  font-size: 18px; font-weight: 700; margin: 34px 0 12px;
  padding-top: 20px; border-top: 1px solid var(--border);
}
.markdown-body h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.markdown-body h3 { font-size: 15px; font-weight: 700; margin: 20px 0 8px; color: var(--text); }
.markdown-body h4 { font-size: 13.5px; font-weight: 700; margin: 16px 0 6px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; }
.markdown-body p { margin: 0 0 12px; color: var(--text-dim); font-size: 14px; }
.markdown-body ul, .markdown-body ol { margin: 0 0 14px; padding-left: 22px; color: var(--text-dim); font-size: 14px; }
.markdown-body li { margin-bottom: 6px; }
.markdown-body li > ul, .markdown-body li > ol { margin-top: 6px; margin-bottom: 0; }
.markdown-body strong { color: var(--text); font-weight: 700; }
.markdown-body code {
  background: rgba(255,255,255,.06); border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 6px; font-size: 12.5px; font-family: ui-monospace, "SF Mono", Consolas, monospace; color: var(--text);
}
.markdown-body pre { background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto; margin: 0 0 14px; }
.markdown-body pre code { background: none; border: none; padding: 0; }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.markdown-body a { color: var(--accent); text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body table { border-collapse: collapse; width: 100%; margin: 0 0 14px; font-size: 13.5px; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; color: var(--text-dim); }
.markdown-body th { color: var(--text); font-weight: 700; background: rgba(255,255,255,.03); }
.markdown-body blockquote { margin: 0 0 14px; padding: 2px 14px; border-left: 3px solid var(--border-strong); color: var(--text-faint); }

/* Collapsible category groups — base look shared by the Accounts page and the
   Scheduler's account picker: chevron + clickable label, no card chrome by default
   (the picker's groups hold small pill tags, a card would be overkill there). */
.account-group summary {
  cursor: pointer; list-style: none;
  font-size: 14.5px; font-weight: 700; letter-spacing: -.005em;
  display: flex; align-items: center; gap: 8px;
}
.account-group summary::-webkit-details-marker { display: none; }
.account-group summary::before {
  content: "▸"; color: var(--text-faint); font-size: 12px; transition: transform .15s var(--ease);
}
.account-group[open] summary::before { transform: rotate(90deg); }
.account-group summary:hover { color: var(--accent); }

/* Accounts page specifically: each category is its own card (header + divided rows)
   instead of a bare label sitting above a stack of separately-boxed account cards —
   less visual noise than repeating the card chrome on every single row. */
#accountsList .account-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 14px;
  overflow: hidden;
}
#accountsList .account-group summary {
  padding: 15px 18px;
  transition: background .15s;
}
#accountsList .account-group summary:hover { background: rgba(255,255,255,.03); color: var(--text); }
#accountsList .account-group[open] summary { border-bottom: 1px solid var(--border); }
#accountsList .account-group .account-item {
  background: none; border: none; border-radius: 0; margin-bottom: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
#accountsList .account-group .account-item:last-child { border-bottom: none; }
#accountsList .account-group .account-item:hover { background: rgba(255,255,255,.015); }

/* Schedule batch progress ("12/32" bar, Scheduler → Schedule) */
.schedule-progress {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.schedule-progress-bar {
  flex: 1; height: 8px; border-radius: 999px;
  background: var(--sunk); border: 1px solid var(--border);
  overflow: hidden;
}
.schedule-progress-fill {
  height: 100%; width: 0%;
  background: var(--accent-grad);
  border-radius: 999px;
  transition: width .25s var(--ease);
}
.schedule-progress-label {
  font-size: 12.5px; font-weight: 600; color: var(--text-dim);
  min-width: 52px; text-align: right; font-variant-numeric: tabular-nums;
}

/* Changelog — un bloc dépliable par jour, plutôt qu'un seul long scroll */
.changelog-day { max-width: 780px; padding: 0; overflow: hidden; }
.changelog-day summary {
  cursor: pointer; list-style: none;
  padding: 14px 18px; display: flex; align-items: center; gap: 10px;
}
.changelog-day summary::-webkit-details-marker { display: none; }
.changelog-day summary::before {
  content: "▸"; color: var(--text-faint); font-size: 12px; transition: transform .15s var(--ease);
}
.changelog-day[open] summary::before { transform: rotate(90deg); }
.changelog-day summary:hover strong { color: var(--accent); }
.changelog-day-body { padding: 0 18px 18px; border-top: 1px solid var(--border); }
.changelog-day-body h3:first-child { margin-top: 16px; }
.changelog-day-body h3 {
  font-size: 14px; font-weight: 700; color: var(--text);
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}

/* Bouton flottant — bouton "📜 Changelog" en bas à droite du hub */
.floating-changelog-btn {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border-strong);
  color: var(--text); font-size: 13px; font-weight: 600;
  text-decoration: none; box-shadow: var(--shadow);
  transition: transform .15s var(--ease), border-color .15s;
}
.floating-changelog-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.floating-btns {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  display: flex; gap: 10px; align-items: center;
}
.floating-btns .floating-changelog-btn { position: static; cursor: pointer; font-family: inherit; }
.floating-btns .floating-changelog-btn[hidden] { display: none; }
.floating-btns button:disabled { opacity: .6; cursor: wait; transform: none; }
.claude-rc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted, #888); }
#claudeRcBtn.on .claude-rc-dot { background: var(--success); box-shadow: 0 0 0 3px rgba(76,195,138,.15); }

/* Crop tool (temporary) */
.crop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.crop-toolbar[hidden] { display: none; }
.crop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.crop-tile { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.crop-tile.ready { cursor: pointer; transition: border-color .15s var(--ease); }
.crop-tile.ready:hover { border-color: var(--accent); }
.crop-tile canvas, .crop-placeholder { display: block; width: 100%; aspect-ratio: 1; }
.crop-placeholder { display: flex; align-items: center; justify-content: center; padding: 12px; text-align: center; color: var(--text-faint); font-size: 12.5px; }
.crop-tile-meta { padding: 8px 10px; }
.crop-name { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crop-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; min-height: 18px; }
.crop-remove { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.crop-tile:hover .crop-remove { opacity: 1; }
@media (hover: none) { .crop-remove { opacity: 1; } }
.dlg-card.crop-editor { max-width: 92vw; width: auto; text-align: left; }
.crop-stage { position: relative; display: inline-block; margin-top: 8px; user-select: none; touch-action: none; line-height: 0; }
/* Image darkened, the crop box re-shows it at full brightness (background set in cropper.js) */
.crop-stage img { display: block; max-width: min(84vw, 900px); max-height: 66vh; filter: brightness(.4); }
.crop-box { position: absolute; border: 2px solid #fff; background-repeat: no-repeat; cursor: move; touch-action: none; }
.crop-handle { position: absolute; width: 14px; height: 14px; background: #fff; border-radius: 2px; touch-action: none; }
.crop-handle-nw { left: -8px; top: -8px; cursor: nwse-resize; }
.crop-handle-ne { right: -8px; top: -8px; cursor: nesw-resize; }
.crop-handle-sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.crop-handle-se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.crop-editor-controls { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.crop-editor-controls .crop-zoom { flex: 1; }
.crop-upscaled { color: var(--warning); }
.crop-tile canvas { cursor: pointer; }
.crop-tile.ready { cursor: default; }
.crop-caption { margin-top: 8px; }
.crop-caption textarea { min-height: 0; font-size: 12px; line-height: 1.45; padding: 7px 9px; resize: vertical; }
.crop-caption-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.crop-caption-err { font-size: 11.5px; color: var(--danger); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crop-caption-ai { margin-left: auto; flex-shrink: 0; }

/* Settings → Security journals (login attempts, visitors) */
.journal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.journal-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.journal-check { display: flex; align-items: center; gap: 6px; margin: 0; cursor: pointer; }
.journal-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.journal-scroll { overflow-x: auto; max-height: 560px; overflow-y: auto; }
.journal-table td { vertical-align: top; }
.journal-paths code { font-size: 11px; word-break: break-all; }

/* Hub — accueil en 4 groupes (Agence / Instagram / Threads / OnlyFans), logos seuls comme le
   sélecteur de catégorie de Media ; au clic, la grille des outils du groupe (templates/hub.html). */
.hub-group-picker {
  display: flex; gap: 24px; justify-content: center; align-items: center; flex-wrap: nowrap;
  min-height: 60vh; padding: 20px 0;
}
.hub-group-card {
  background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 200px; flex: 0 1 200px; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.hub-group-card:hover { border-color: var(--border-strong); background: var(--card-hover); }
.hub-group-card .hgc-logo {
  width: 84px; height: 84px; color: var(--text-dim); opacity: .55;
  transition: opacity .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.hub-group-card .hgc-img { width: 150px; height: auto; opacity: .7; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.hub-group-card:hover .hgc-logo { opacity: 1; color: var(--text); transform: scale(1.08); }
.hub-group-card:hover .hgc-img { opacity: 1; transform: scale(1.06); }
@media (max-width: 900px) {
  .hub-group-picker { flex-wrap: wrap; gap: 14px; }
  .hub-group-card { flex: 0 1 calc(50% - 14px); width: auto; }
  .hub-group-card .hgc-logo { width: 56px; height: 56px; }
  .hub-group-card .hgc-img { width: 100px; }
}

/* GeeLark — éditeur de parcours (chaîne de blocs façon Scratch) */
.gl-editor { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.gl-palette { position: sticky; top: 16px; }
.gl-pal-block { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; cursor: pointer;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); border-left-width: 4px; border-radius: 10px;
  padding: 9px 11px; margin-bottom: 7px; color: var(--text); font: inherit; transition: border-color .15s, transform .15s; }
.gl-pal-block:hover { border-color: var(--accent); transform: translateX(2px); }
.gl-pal-block .gl-pal-icon { width: 26px; display: grid; place-items: center; color: var(--text-dim); }
.gl-pal-block .gl-pal-icon svg, .gl-block-head .gl-ic svg { width: 16px; height: 16px; }
.gl-block-head .gl-ic { display: grid; place-items: center; color: var(--text-dim); }
.gl-pal-block.gl-rpa { border-left-color: var(--accent); }
.gl-pal-block.gl-wait { border-left-color: var(--warning); }
.gl-chain { display: flex; flex-direction: column; gap: 0; }
.gl-block { position: relative; background: rgba(255,255,255,.035); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 12px; padding: 12px 14px 12px 16px; cursor: grab; }
.gl-block.gl-wait { border-left-color: var(--warning); }
.gl-block.dragging { opacity: .4; }
.gl-block.drop-before { box-shadow: 0 -3px 0 0 var(--accent); }
.gl-block.drop-after { box-shadow: 0 3px 0 0 var(--accent); }
.gl-block-head { display: flex; align-items: center; gap: 10px; }
.gl-block-head .gl-idx { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.gl-block-head .gl-title { font-weight: 700; flex: 1; }
.gl-block-head .gl-tools button { background: none; border: 1px solid var(--border); color: var(--text-dim); border-radius: 6px; padding: 2px 7px; cursor: pointer; font-size: 12px; margin-left: 4px; }
.gl-block-head .gl-tools button:hover { color: var(--text); border-color: var(--border-strong); }
.gl-block-body { margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.gl-block-body label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); }
.gl-block-body input, .gl-block-body select { font: inherit; }
.gl-link { display: flex; justify-content: center; color: var(--text-faint); font-size: 18px; line-height: 1; padding: 4px 0; }
@media (max-width: 900px) { .gl-editor { grid-template-columns: 1fr; } .gl-palette { position: static; } }

/* GeeLark — réserves / contenu : cartes dépliables avec compteur, dépôt texte ou fichiers */
.gl-reserve-head { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: none; color: var(--text); font: inherit; cursor: pointer; padding: 4px 0; text-align: left; gap: 12px; }
.gl-reserve-head .gl-caret { transition: transform .15s; }
.gl-reserve.open .gl-reserve-head .gl-caret { transform: rotate(180deg); }
.gl-reserve-body { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 14px; }
.gl-import textarea { width: 100%; font-family: ui-monospace, monospace; font-size: 12.5px; }
.gl-import-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0 14px; }
.gl-caption-wrap { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 3px; }
.gl-caption { width: 100%; resize: vertical; min-height: 64px; font: inherit; line-height: 1.4; white-space: pre-wrap; }
.gl-content-tile .gl-caption-wrap { min-width: 0; }
.gl-content-tile .gl-caption { min-height: 52px; font-size: 12.5px; box-sizing: border-box; }
.gl-caption-count { align-self: flex-end; font-size: 11px; }
.gl-content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gl-content-tile { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.03); font-size: 12px; }
.gl-content-tile .gl-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--sunk); }
.gl-content-tile .gl-thumb-video { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 30px; background: var(--sunk); }
.gl-content-tile .gl-tile-body { padding: 8px 9px; }
.gl-content-tile .gl-tile-body input { width: 100%; font-size: 12px; margin-top: 4px; }
.gl-content-tile.used { opacity: .55; }

/* GeeLark — « En direct » : journal + visionneuse GeeLark en iframe */
.gl-live-grid { display: grid; grid-template-columns: 560px minmax(0, 1fr); gap: 16px; align-items: start; }
.gl-live-grid .log-viewer { max-height: 1000px; }
.gl-viewer-wrap { touch-action: none; overscroll-behavior: contain; }
.gl-live-screen iframe { width: 100%; height: 1000px; border: 1px solid var(--border); border-radius: 10px; background: #000; display: block; }
@media (max-width: 1100px) { .gl-live-grid { grid-template-columns: 1fr; } }
/* mode agrandi : la carte prend toute la fenêtre, le téléphone à la hauteur de l'écran, le journal à côté */
.gl-live-full { position: fixed; inset: 12px; z-index: 60; margin: 0 !important; overflow: auto; background: var(--bg, #0b0d12); box-shadow: 0 0 0 100vmax rgba(0,0,0,.6); }
.gl-live-full .gl-live-grid { grid-template-columns: auto minmax(0, 1fr); }
.gl-live-full .gl-live-screen { width: calc((100vh - 170px) / 2 + 90px); }
.gl-live-full .gl-live-screen iframe { height: calc(100vh - 120px); width: 100%; }
.gl-live-full .log-viewer { max-height: calc(100vh - 80px); }

.gl-pal-block.gl-manual { border-color: color-mix(in srgb, #e0a53a 55%, var(--border)); }
.gl-block.gl-manual { border-left: 3px solid #e0a53a; }
.gl-block.gl-manual textarea { width: 100%; min-height: 56px; resize: vertical; }
.gl-group-chip { cursor: pointer; }

/* GeeLark : contrôle avant lancement */
.gl-preflight { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.gl-pf { padding: 4px 8px; border-radius: 6px; }
.gl-pf-warn { background: color-mix(in srgb, var(--warning, #d29922) 12%, transparent); }
.gl-pf-block { background: color-mix(in srgb, var(--danger, #f85149) 14%, transparent); }

/* ---------------------------------------------------------------------------
   Graphite (12/10) : barre latérale commune de l'accueil et des pages générales
   (templates/_sidebar.html), cartes d'outils de l'accueil
   --------------------------------------------------------------------------- */
.gr { display: flex; min-height: 100vh; }
.gr a { color: inherit; text-decoration: none; }
.gr-side { width: 240px; flex: none; background: var(--side); border-right: 1px solid var(--border); padding: 20px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.gr-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; padding: 4px 10px 22px; letter-spacing: -.01em; }
.gr-brand img { width: 20px; height: 20px; }
.gr-label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; padding: 14px 10px 6px; }
.gr-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--text-dim); font: inherit; font-size: 13.5px; background: none; border: 0; cursor: pointer; text-align: left; }
.gr-item:hover { background: var(--card-hover); color: var(--text); }
.gr-item.on { background: var(--card); color: var(--text); }
.gr-item:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 1px; }
.gr-item:disabled { opacity: .6; cursor: default; }
.gr-item svg { width: 16px; height: 16px; flex: none; }
.gr-item .n { margin-left: auto; font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.gr-push { margin-top: auto; }
.gr-claude { display: flex; gap: 4px; }
.gr-claude .gr-item { flex: 1; }
.gr-claude .gr-open { flex: none; width: auto; }
.gr-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex: none; }
#claudeRcBtn.on .gr-dot { background: var(--success); box-shadow: 0 0 0 3px rgba(76,195,138,.15); }
.gr-side form { margin: 0; }
.gr-main { flex: 1; min-width: 0; padding: 56px 64px 72px; }
.gr-inner { max-width: 960px; }
.gr-main h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 6px; }
.gr-sub { color: var(--text-dim); margin: 0 0 32px; font-size: 13.5px; }
.gr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.gr-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; transition: background .15s, border-color .15s; display: block; }
.gr-card:hover { background: var(--card-hover); border-color: var(--border-strong); }
.gr-card:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 2px; }
.gr-card .top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.gr-card .ic { width: 32px; height: 32px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); display: grid; place-items: center; flex: none; }
.gr-card .ic svg { width: 16px; height: 16px; color: var(--text); }
.gr-card .name { font-weight: 600; }
.gr-card .space { margin-left: auto; font-size: 11.5px; color: var(--text-faint); }
.gr-card .desc { color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.gr-card .badge { font-size: 10.5px; font-weight: 500; padding: 1px 7px; border-radius: 999px; }
.gr-tag { font-size: 10.5px; color: var(--text-dim); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; }
.gr-card .badge { text-transform: none; letter-spacing: 0; }
@media (max-width: 760px) {
  /* téléphone : la barre latérale devient une rangée compacte en haut */
  .gr { flex-direction: column; }
  .gr-side { width: auto; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 16px; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .gr-brand { width: 100%; padding: 2px 4px 8px; }
  .gr-label, .gr-push, .gr-item .n { display: none; }
  #grSpaces, .gr-side form, .gr-claude { display: contents; }
  .gr-item { width: auto; padding: 6px 10px; background: var(--card); }
  .gr-main { padding: 24px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { .gr-card { transition: none; } }
/* pages générales (Comptes, Médias, Réglages, Changelog, Finance, Scripts, Crop) dans la mise en page à barre latérale */
.gr-main .hub-main { max-width: 1040px; margin: 0; padding: 0; }
/* « on » = Claude allumé (point vert), pas la page courante */
.gr-side #claudeRcBtn.on { background: none; color: var(--text-dim); }
.gr-side #claudeRcBtn.on:hover { background: var(--card-hover); color: var(--text); }
/* Accueil : outils épinglés (étoile) */
.gr-cell { position: relative; }
.gr-cell .gr-card { height: 100%; padding-right: 48px; }
.gr-star { position: absolute; top: 14px; right: 12px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--text-faint); cursor: pointer; }
.gr-star svg { width: 16px; height: 16px; fill: none; }
.gr-star:hover { background: var(--wash-strong); color: var(--text); }
.gr-star[aria-pressed="true"] { color: var(--warning); }
.gr-star[aria-pressed="true"] svg { fill: currentColor; }
.gr-star:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 1px; }
.gr-empty { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 28px 24px; max-width: 520px; }
.gr-empty p { margin: 0 0 6px; }
.gr-empty .meta { margin: 0; }
/* contrôle avant lancement : pastille de couleur au lieu d'un emoji */
.gl-pf::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--success); }
.gl-pf-warn::before { background: var(--warning); }
.gl-pf-block::before { background: var(--danger); }
/* ---------------------------------------------------------------------------
   GeeLark — Parc : un téléphone = une carte en forme de téléphone (12/10)
   --------------------------------------------------------------------------- */
.gl-phone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.gl-phone { display: flex; flex-direction: column; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 12px; }
.gl-phone-busy { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); }
.gl-phone-frame { background: var(--sunk); border: 1px solid var(--border-strong); border-radius: 22px; padding: 8px 8px 10px; }
.gl-phone-notch { width: 46px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 2px auto 8px; }
.gl-phone-status { display: flex; align-items: center; gap: 6px; margin: 0 4px 8px; font-size: 11.5px; color: var(--text-dim); }
.gl-phone-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex: none; }
.gl-phone-on .gl-phone-dot { background: var(--success); box-shadow: 0 0 0 3px rgba(76,195,138,.15); }
.gl-phone-starting .gl-phone-dot { background: var(--warning); }
.gl-phone-run { color: var(--success); }
.gl-phone-screen { display: block; aspect-ratio: 9 / 15; border-radius: 14px; overflow: hidden; background: #0f1012; border: 1px solid var(--border); }
.gl-phone-screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.gl-phone-off .gl-phone-screen img { filter: grayscale(.6) brightness(.5); }
a.gl-phone-screen:hover { border-color: var(--border-strong); }
.gl-phone-blank { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-faint); font-size: 12px; }
.gl-phone-info { display: grid; gap: 5px; padding: 0 4px; }
.gl-phone-name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.gl-phone-account { font-size: 13px; }
.gl-phone-last { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.gl-phone-proxy { display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 2px 0; }
.gl-phone-proxy select { font-size: 12px; padding: 2px 6px; height: auto; min-width: 0; flex: 1; }
.gl-phone-proxy input[type=text] { font-size: 12px; padding: 2px 6px; height: auto; min-width: 0; flex: 1; }
.gl-phone-hold { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; margin-bottom: 2px; }
.gl-phone-hold .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.gl-phone-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding: 0 2px 2px; }
.page-header .account-actions select { width: auto; }
/* Réserves : la carte « Contenu » contient les 4 cases de contenu */
.gl-content-body .gl-reserve { background: var(--sunk); }

/* GeeLark Réglages : plage, écart, chauffe quotidienne (12/10) */
.gl-set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.gl-lane-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
@media (max-width: 760px) { .gl-set-grid { grid-template-columns: 1fr; } }
input[type=number].gl-num { width: 68px; display: inline-block; padding: 5px 8px; }
.gl-daily-phones { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 12px; max-height: 260px; overflow: auto; }
.gl-daily-phones label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.gl-daily-plan { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; }
.gl-daily-plan select { width: auto; }

/* Parc : cocher des téléphones et leur assigner un parcours (12/10) */
.gl-phone-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gl-pick { display: inline-flex; cursor: pointer; }
.gl-pick input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.gl-launchbar { position: sticky; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 14px; padding: 10px 14px; box-shadow: 0 8px 28px rgba(0,0,0,.35); }
.gl-launchbar[hidden] { display: none; }
.gl-launchbar select { width: auto; min-width: 200px; flex: 1 1 200px; max-width: 360px; }
#glLaunchCount { font-weight: 600; }

/* GeeLark Planning (12/10) */
.pl-nav { align-items: center; gap: 10px; }
.pl-wrap { overflow-x: auto; }
.pl-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 860px; }
.pl-table th, .pl-table td { border-bottom: 1px solid var(--border); vertical-align: top; padding: 8px; }
.pl-table thead th { font-size: 12px; font-weight: 600; color: var(--text-dim); text-align: left; text-transform: none; }
.pl-table thead th:first-child, .pl-phone { width: 150px; }
.pl-table .pl-phone { text-align: left; font-weight: 600; font-size: 13px; text-transform: none; letter-spacing: normal; color: var(--text); }
.pl-table thead th { text-transform: none; letter-spacing: normal; }
.pl-phone .meta { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-cell { height: 64px; }
.pl-cell + .pl-cell, .pl-table thead th + th { border-left: 1px solid var(--border); }
.pl-today { background: var(--wash); }
.pl-past { opacity: .55; }
.pl-chip { display: flex; align-items: center; gap: 6px; width: 100%; margin-bottom: 4px; padding: 4px 7px; font: inherit; font-size: 12px; color: var(--text);
  background: var(--sunk); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; text-align: left; }
.pl-chip:hover { border-color: var(--border-strong); }
.pl-chip-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.pl-dot { width: 7px; height: 7px; border-radius: 50%; margin-left: auto; flex: none; background: var(--text-dim); }
.pl-queued .pl-dot, .pl-running .pl-dot { background: var(--warning); }
.pl-done .pl-dot { background: var(--success); }
.pl-failed .pl-dot { background: var(--danger); }
.pl-add { width: 100%; padding: 2px; font: inherit; color: var(--text-dim); background: none; border: 1px dashed transparent; border-radius: 8px; cursor: pointer; opacity: 0; }
.pl-cell:hover .pl-add, .pl-add:focus-visible { opacity: 1; border-color: var(--border-strong); }
@media (hover: none) { .pl-add { opacity: 1; border-color: var(--border); } }
.dlg-card.pl-dlg { max-width: 640px; max-height: calc(100vh - 40px); overflow-y: auto; }
.pl-form, .pl-story { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.pl-form label, .pl-story label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); }
.pl-story .pl-check { flex-direction: row; align-items: center; gap: 6px; align-self: end; padding-bottom: 8px; }
.pl-story[hidden], .pl-story label[hidden] { display: none; }
@media (max-width: 560px) { .pl-form, .pl-story { grid-template-columns: 1fr; } }
.pl-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; }
.pl-pick { position: relative; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--sunk); cursor: pointer; aspect-ratio: 9 / 16; max-width: 100%; }
.pl-pick img, .pl-pick video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.pl-pick span { position: absolute; left: 4px; bottom: 4px; font-size: 10.5px; padding: 1px 5px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; }
.pl-pick.on { border-color: var(--accent); }
.dlg-overlay[hidden], .pl-dlg .btn[hidden] { display: none; }
.pl-picker > .meta { grid-column: 1 / -1; }
input[type=datetime-local] { color-scheme: dark; }
.gl-phone-account a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border-strong); }
.gl-phone-account a:hover { border-bottom-color: var(--text); }

/* En direct : le cadre de droite est le journal, dit clairement (12/10) */
.gl-live-log-title { margin-bottom: 6px; height: 36px; display: flex; align-items: center; }
.gl-live-log .log-viewer:empty::before { content: "En attente des premières lignes : elles s'affichent ici pendant un passage (allumage, étapes, résultat)."; color: var(--text-dim); font-family: inherit; }

/* Parc : fenêtre « Lancer un parcours » (12/10) */
.dlg-card.gl-run-dlg { max-width: 560px; max-height: calc(100vh - 40px); overflow-y: auto; }
.gl-run-dlg .gl-run-field { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; font-size: 12px; color: var(--text-dim); }
#glRunSteps { margin-top: 6px; }

/* Éditeur de parcours : ordre aléatoire (12/10) */
.gl-chain-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.gl-shuffle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.gl-shuffle input { accent-color: var(--accent); }
.gl-shuffle-hint { margin: -6px 0 14px; }

/* GeeLark File d'attente (12/10) */
.q-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 900px) { .q-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.q-stat { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.q-stat-v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.q-stat .meta { overflow-wrap: anywhere; }
.q-day { font-weight: 600; font-size: 13.5px; margin: 18px 0 8px; }
.q-card { padding: 4px 16px; margin-bottom: 8px; }
.q-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.q-row:last-child { border-bottom: 0; }
.q-time { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.q-time strong { font-size: 15px; }
.q-state { text-align: right; }
.q-running .q-time strong { color: var(--warning); }
.q-force { margin-top: 4px; font-size: 11.5px; padding: 2px 10px; }
.q-gap { font-size: 11.5px; color: var(--text-dim); padding: 6px 0 6px 106px; border-bottom: 1px dashed var(--border); }
.q-hold { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.q-hold:last-child { border-bottom: 0; }
@media (max-width: 560px) { .q-row { grid-template-columns: 64px minmax(0, 1fr); } .q-state { grid-column: 2; text-align: left; } .q-gap { padding-left: 78px; } }

/* ── Studio (16/10) : références, générateur de prompts, persona ── */
.st-persona-pick { padding: 2px 2px 8px; }
.st-persona-pick select { padding: 8px 10px; font-size: 13px; }
.st-persona-tag { color: var(--text-faint); font-size: 11.5px; margin-top: 6px; line-height: 1.4; }
.st-num { width: 24px; height: 24px; flex: none; border-radius: 999px; background: var(--wash-strong); border: 1px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.st-cat { margin-bottom: 18px; }
.st-cat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.st-cat-title { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 2px; }
.st-cat-title .meta { font-size: 12px; }
.st-ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.st-ref { position: relative; aspect-ratio: 3 / 4; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--sunk); cursor: pointer; transition: border-color .15s var(--ease), transform .15s var(--ease); }
.st-ref:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.st-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-ref-note { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 11px; line-height: 1.35; text-align: left; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.78)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st-drop { aspect-ratio: 3 / 4; padding: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; }
.st-drop .dz-icon { width: 26px; height: 26px; margin-bottom: 8px; }
.st-lightbox .lightbox-info { width: 300px; }
.st-lb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

.st-gen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .st-gen { grid-template-columns: minmax(0, 1fr); } }
.st-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.st-chip { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--sunk); color: var(--text-dim); font-size: 12.5px; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.st-chip:hover { border-color: var(--border-strong); color: var(--text); }
.st-chip input { margin: 0; accent-color: var(--accent); }
.st-chip:has(input:checked) { color: var(--text); border-color: var(--accent); background: var(--wash-strong); }
.st-chip-blue:has(input:checked) { border-color: #60a5fa; background: rgba(96,165,250,.12); }
.st-chip-red:has(input:checked) { border-color: #f87171; background: rgba(248,113,113,.12); }
.st-chip-both:has(input:checked) { border-color: #60a5fa; border-right-color: #f87171; border-bottom-color: #f87171; background: linear-gradient(90deg, rgba(96,165,250,.12), rgba(248,113,113,.12)); }
.st-check { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; cursor: pointer; }
.st-check input { margin: 0; accent-color: var(--accent); }
.st-gen-actions { display: flex; gap: 10px; }
.st-result { margin-bottom: 24px; }
.st-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.st-result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.st-warn { font-size: 12.5px; color: var(--warning); background: rgba(229,163,59,.1); border-radius: var(--radius-sm); padding: 7px 10px; margin-bottom: 8px; }
.st-attach { font-size: 13px; margin-bottom: 10px; }
.st-attach ol { margin: 6px 0 0; padding-left: 20px; }
.st-attach li { margin: 2px 0; }
.st-prompt { margin: 0; background: var(--sunk); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; min-height: 120px; }
.st-hist { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.st-hist.st-fav { border-color: var(--border-strong); }
.st-hist-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-hist-text { font-size: 13px; color: var(--text-dim); margin: 6px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st-hist-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-left: -8px; }
.st-mode { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: var(--wash-strong); color: var(--text-dim); }
.st-mode-blue { background: rgba(96,165,250,.14); color: #60a5fa; }
.st-mode-red { background: rgba(248,113,113,.14); color: #f87171; }
.st-mode-both { background: linear-gradient(90deg, rgba(96,165,250,.16), rgba(248,113,113,.16)); color: var(--text); }

.st-sec { margin-bottom: 18px; }
.st-sec-head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 14px; }
.st-sec-head .meta { font-size: 12px; line-height: 1.5; }
.st-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.st-row { display: grid; gap: 8px; align-items: center; }
.st-row-cat { grid-template-columns: 24px minmax(110px, 1fr) 130px minmax(160px, 2.2fr) auto; }
.st-row-mode { grid-template-columns: minmax(110px, 1fr) 120px minmax(160px, 2.4fr) auto; }
.st-row-decor { grid-template-columns: minmax(110px, 1fr) 170px minmax(160px, 2fr) auto; }
.st-row-tool { grid-template-columns: minmax(140px, 1.2fr) 170px minmax(160px, 2fr) auto; }
.st-row input, .st-row select { padding: 8px 10px; font-size: 13px; }
.st-row-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.st-row-btns { display: flex; gap: 2px; }
.st-row-btns .icon-btn:disabled { opacity: .3; cursor: default; }
@media (max-width: 760px) { .st-row-cat, .st-row-mode, .st-row-decor, .st-row-tool { grid-template-columns: 1fr; } }
.st-mono { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12.5px; line-height: 1.55; }
.st-savebar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); }

/* Studio phase 2 : production (kanban), fiche reel, idées, bibliothèque */
.st-filters input[type=search] { background: var(--sunk); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; font-size: 13.5px; min-width: 220px; flex: 1; max-width: 340px; }
.st-filters .meta { align-self: center; }
.st-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(178px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.main:has(.st-board) { max-width: none; }
.st-col { background: var(--sunk); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 200px; transition: border-color .15s, background .15s; }
.st-col.drag-over { border-color: var(--accent); background: var(--wash); }
.st-col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; font-size: 13px; }
.st-col-body { display: flex; flex-direction: column; gap: 8px; }
.st-col-empty { color: var(--text-faint); font-size: 12px; text-align: center; padding: 18px 0; }
.st-quick { min-height: 54px; font-size: 13px; margin-bottom: 10px; padding: 8px 10px; }
.st-card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; cursor: grab; transition: border-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease), opacity .15s; }
.st-card:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.st-card.dragging { opacity: .4; }
.st-card-media { margin: -10px -10px 8px; aspect-ratio: 9 / 12; overflow: hidden; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: #000; }
.st-card-media img, .st-card-media video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.st-card-title { font-size: 13px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.st-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.st-date { font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.st-late { color: var(--danger); }
.st-card-has { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.st-card-has span { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-faint); }
.st-card-has span.on { color: var(--text); border-color: var(--border-strong); background: var(--wash-strong); }
.st-card-build { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--text-dim); text-decoration: none; border-bottom: 1px solid var(--border-strong); }
.st-card-build:hover { color: var(--text); }
.st-reel-banner { font-size: 13px; background: var(--wash-strong); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 16px; }
.st-reel-banner a { color: var(--text); }

.dlg-card.fin-modal.st-reel-dlg { max-width: 980px; max-height: calc(100vh - 32px); }
.st-reel-top { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.st-reel-top .st-reel-title { font-size: 17px; font-weight: 600; padding: 9px 12px; }
.st-reel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .st-reel-grid { grid-template-columns: 1fr; } }
.st-reel-part { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 14px; min-width: 0; }
.st-part-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.st-part-head > span { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.st-part-head a.btn { cursor: pointer; }
.st-gl-row { margin-top: 10px; }
.st-gl-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.st-gl-actions > span:last-child { display: flex; gap: 6px; margin-left: auto; }
.st-reel-media { margin-top: 10px; border-radius: var(--radius-sm); transition: outline-color .15s; outline: 1.5px dashed transparent; }
.st-reel-media.drag-over { outline-color: var(--accent); }
.st-reel-media.st-busy { opacity: .5; pointer-events: none; }
.st-reel-media img, .st-reel-media video { width: 100%; max-height: 360px; object-fit: contain; background: #000; border-radius: var(--radius-sm); display: block; }
.st-media-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.st-media-actions label.btn { margin: 0; cursor: pointer; }
.st-reel-drop { padding: 22px 12px; }
.st-tags { margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.st-tag-group { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.st-tag-group > .meta { font-size: 11.5px; min-width: 76px; }
.st-tag { font: inherit; font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-faint); cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.st-tag:hover { color: var(--text); border-color: var(--border-strong); }
.st-tag.on { color: var(--text); border-color: var(--accent); background: var(--wash-strong); }
.st-tag-tools { display: flex; gap: 4px; align-items: center; }
.st-reel-actions { justify-content: flex-end; align-items: center; }
.st-reel-actions .btn-danger { margin-right: auto; }

.dlg-card.fin-modal.st-ideas-dlg { max-width: 720px; }
.st-ideas-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.st-idea { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; color: var(--text); font-weight: 400; }
.st-idea:has(input:checked) { border-color: var(--border-strong); background: var(--wash); }
.st-idea input { margin-top: 3px; accent-color: var(--accent); }
.st-idea > span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st-idea-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.st-idea-text { font-size: 13px; color: var(--text-dim); line-height: 1.45; }

.st-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; align-items: start; }
.st-lib-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: border-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease); }
.st-lib-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.st-lib-media { aspect-ratio: 9 / 16; background: #000; }
.st-lib-media.st-lib-nomedia { aspect-ratio: auto; height: 110px; }
.st-lib-media img, .st-lib-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-media-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 12px; background: var(--sunk); }
.st-lib-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.st-lib-info .meta { font-size: 11.5px; }
.st-lib-caption { font-size: 12px; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Studio : copier un reel */
.dlg-card.fin-modal.st-copy-dlg { max-width: 640px; }
.st-copy-drop { margin: 6px 0 16px; padding: 26px 16px; }
.st-copy-status { margin-right: auto; }
.st-source-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px; align-items: start; }
.st-source-body video { width: 100%; max-height: 356px; background: #000; border-radius: var(--radius-sm); }
.st-analysis { margin: 0; white-space: pre-wrap; font: inherit; font-size: 12.5px; line-height: 1.55; color: var(--text-dim); max-height: 356px; overflow-y: auto; }
@media (max-width: 640px) { .st-source-body { grid-template-columns: 1fr; } }

/* Studio : légendes */
.st-captool { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.st-captool-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.st-captool-row select { width: auto; min-width: 130px; padding: 8px 10px; font-size: 13px; }
.st-captool input[type=text] { padding: 8px 10px; font-size: 13px; }
.st-capres { display: flex; flex-direction: column; gap: 8px; }
.st-capres:empty { display: none; }
.st-capopt { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--sunk); }
.st-capopt-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.st-capopt-head > span { display: flex; gap: 4px; }
.st-capopt-text { white-space: pre-wrap; font-size: 13px; line-height: 1.5; }

/* Studio : veille (21/10) */
.st-ext { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.st-ext-key { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; background: var(--sunk); border-radius: var(--radius-sm); }
.st-ext-key code { font-size: 13px; overflow-wrap: anywhere; }
.st-ext-steps { margin: 12px 0 0; padding-left: 18px; color: var(--text-dim); font-size: 13px; line-height: 1.6; }
.st-watch-card { cursor: default; }
.st-watch-card:hover { transform: none; }
.st-watch .st-lib-media { position: relative; cursor: pointer; }
.st-watch-play { position: absolute; inset: auto auto 10px 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.st-watch-play svg { width: 14px; height: 14px; }
.st-watch-author { color: var(--text); font-weight: 500; font-size: 13px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.st-watch-author:hover { text-decoration: underline; }
.st-watch-audio { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-watch-note { width: 100%; box-sizing: border-box; resize: vertical; min-height: 32px; font: inherit; font-size: 12px; padding: 6px 8px; background: var(--sunk); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.st-watch-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.st-watch-del { color: var(--text-faint); }

/* Studio : zéro fichier sur le disque (21/10) — essais, références à copier, reel en cours */
.st-ref-wrap { position: relative; }
.st-ref-wrap .st-ref { width: 100%; }
.st-ref-copy { position: absolute; right: 6px; top: 6px; padding: 3px 8px; font: inherit; font-size: 11px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.6); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s var(--ease); }
.st-ref-wrap:hover .st-ref-copy, .st-ref-copy:focus-visible { opacity: 1; }
@media (hover: none) { .st-ref-copy { opacity: 1; } }
.st-attach { margin-top: 10px; }
.st-attach-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.st-attach-group { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.st-attach-n { font-size: 11px; font-weight: 600; color: var(--text); }
.st-attach-group .meta { font-size: 11px; }
.st-attach-imgs { display: flex; gap: 4px; flex-wrap: wrap; }
.st-attach-imgs img { width: 44px; height: 58px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); cursor: copy; }
.st-attach-imgs img:hover { border-color: var(--accent); }
.st-trials { margin-top: 10px; }
.st-trials-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-trials-row { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 2px; }
.st-trial { position: relative; flex: none; width: 54px; height: 72px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: #000; }
.st-trial img, .st-trial video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.st-trial.on { border-color: var(--text); cursor: default; }
.st-trial:not(.on) { opacity: .7; }
.st-trial:not(.on):hover { opacity: 1; }
.st-trial-x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; padding: 0; line-height: 16px; font-size: 13px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; opacity: 0; }
.st-trial:hover .st-trial-x { opacity: 1; }
@media (hover: none) { .st-trial-x { opacity: 1; } }
.st-cur-btn { flex: none; white-space: nowrap; }
.st-cur-btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.st-card-current { border-color: var(--text) !important; }
.st-card-cur { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text); margin-bottom: 4px; }
.st-reel-grid.st-grid-single { grid-template-columns: minmax(0, 1fr); }
.st-swap-how { margin-bottom: 8px; }
[data-attach-swap] { margin-top: 10px; }
.st-swap-changes:not(:empty) { margin-top: 6px; }
.st-audio { width: 100%; display: block; }
.st-audio-trials { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.st-audio-trial { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--radius-sm); border: 1px solid transparent; position: relative; }
.st-audio-trial.on { border-color: var(--border-strong); }
.st-audio-trial audio { flex: 1; min-width: 0; height: 32px; }
.st-audio-x { position: static; opacity: 1; flex: none; }
.st-final-how { margin-bottom: 4px; }

/* Médiathèque : catégorie d'une collection (25/10) */
.collection-category-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.collection-category-row select { width: auto; }

/* Veille Threads (25/10) */
.veille-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.veille-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.veille-card.copied { opacity: .75; }
.veille-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.veille-head a { font-weight: 600; text-decoration: none; color: var(--text); }
.veille-text { white-space: pre-wrap; font-size: 14px; line-height: 1.45; max-height: 180px; overflow: auto; }
.veille-images { display: flex; gap: 6px; flex-wrap: wrap; }
.veille-images img { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; cursor: zoom-in; border: 1px solid var(--border); }
.veille-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.veille-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.dlg-overlay[hidden] { display: none !important; }
.veille-copy-modal .check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-dim); margin: 6px 0; }
.veille-copy-modal .check input { margin-top: 3px; }

/* Studio → Photos Threads (25/10) */
.st-photo { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--card); }
.st-photo.has-prompt { border-color: var(--border-strong); }
.st-photo-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.st-photo .st-prompt { min-height: 0; font-size: 12px; }
.st-photo-post { font-size: 13px; color: var(--text); background: var(--sunk); border-radius: var(--radius-sm); padding: 8px 10px; white-space: pre-wrap; }
.st-photo ol { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--text-dim); }

/* Studio v2 (25/10) : sous-niches et DA dans Persona, options repliées du Générateur */
.st-row-sub, .st-row-da { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.st-row-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-row-line input[type="text"] { flex: 1; min-width: 160px; }
.st-row-sub textarea, .st-row-da textarea { width: 100%; }
.st-gen-more { margin: 4px 0 12px; }
.st-gen-more summary { cursor: pointer; color: var(--text-dim); font-size: 13px; margin-bottom: 8px; }

/* Threads v2 (25/10) : page Posts */
.tp-layout { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .tp-layout { grid-template-columns: 1fr; } }
.tp-list { display: flex; flex-direction: column; gap: 8px; }
.tp-card { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); cursor: pointer; }
.tp-card:hover { border-color: var(--border-strong); }
.tp-card.tp-ready { border-left: 3px solid var(--accent); }
.tp-card.tp-posted { opacity: .7; }
.tp-card.tp-failed { border-left: 3px solid #f87171; }
.tp-card-body { min-width: 0; flex: 1; }
.tp-card-text { font-size: 13px; line-height: 1.4; max-height: 3.9em; overflow: hidden; white-space: pre-wrap; }
.tp-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex: none; }
.tp-thumb-video { display: flex; align-items: center; justify-content: center; background: var(--sunk); font-size: 10px; color: var(--text-dim); }
.tp-err { color: #f87171; }
.tp-cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tp-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1100px) { .tp-week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tp-day { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 6px; background: var(--card); }
.tp-day.tp-today { border-color: var(--accent); }
.tp-day-head { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.tp-day .tp-card { padding: 6px 8px; }
.tp-day .tp-card-text { max-height: 2.8em; font-size: 12px; }
.tp-empty { text-align: center; }
.tp-media-preview img, .tp-media-preview video { max-height: 220px; max-width: 100%; border-radius: 8px; }
.tp-media-picker { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; margin-top: 8px; }
.tp-coll { margin-bottom: 10px; }
.tp-coll-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tp-pick { width: 72px; height: 72px; padding: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--sunk); cursor: pointer; }
.tp-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tp-pick:hover { border-color: var(--accent); }
.tp-actions { flex-wrap: wrap; }
.tp-modal textarea { width: 100%; }

/* ── Gestion (27/10) : créatrices, paiements, réglages ── */
.gm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.gm-card { cursor: pointer; display: flex; flex-direction: column; gap: 12px; transition: transform .12s, border-color .12s; }
.gm-card:hover, .gm-card:focus-visible { transform: translateY(-1px); border-color: var(--accent); outline: none; }
.gm-card-top { display: flex; align-items: center; gap: 12px; }
.gm-card-id { flex: 1; min-width: 0; }
.gm-card-name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--wash-strong); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px; flex-shrink: 0; }
.gm-avatar-lg { width: 48px; height: 48px; font-size: 19px; }
.gm-card-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 13px; }
.gm-card-facts > div { display: flex; justify-content: space-between; gap: 8px; }
.gm-card-facts .lbl, .gm-info-row .lbl { color: var(--text-dim); font-size: 12.5px; }
.gm-card-foot { border-top: 1px solid var(--border); padding-top: 10px; }
.gm-smtp-note { background: rgba(229,163,59,.12); border: 1px solid rgba(229,163,59,.3); color: var(--warning); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px; font-size: 13.5px; }
.gm-smtp-note a { color: inherit; font-weight: 600; margin-left: 6px; }
.gm-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.gm-spacer { flex: 1; }
.gm-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 8px 0 14px; cursor: pointer; }
.gm-check input { width: auto; margin: 0; }
.dlg-card.fin-modal.gm-dlg { max-width: 640px; }
.dlg-card.fin-modal.gm-dlg-wide { max-width: 1040px; max-height: calc(100vh - 32px); }
.gm-sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.gm-tabs { margin-bottom: 16px; }
.gm-info { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
.gm-info-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.gm-info-row span:last-child { text-align: right; word-break: break-word; }
.gm-notes { margin-top: 14px; padding: 12px 14px; background: var(--wash); border-radius: var(--radius-sm); font-size: 13.5px; white-space: normal; }
.gm-upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.gm-upload select, .gm-upload input[type=text] { flex: 1; min-width: 140px; }
.gm-upload input[type=file] { flex: 2; min-width: 200px; font-size: 13px; }
.gm-row-actions { text-align: right; min-width: 260px; }
.gm-row-actions .btn { margin: 1px 0 1px 2px; padding: 5px 8px; }
.gm-amount { font-size: 20px; font-weight: 600; letter-spacing: -.02em; padding: 8px 0; font-variant-numeric: tabular-nums; }
.gm-settings { display: flex; flex-direction: column; gap: 18px; max-width: 980px; }
.gm-settings .card > .meta { margin: -4px 0 14px; }
.gm-h2 { margin: 0 0 6px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.gm-tpl { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; }
.gm-tpl-title { font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 720px) {
  .gm-info { grid-template-columns: 1fr; }
  .gm-card-facts { grid-template-columns: 1fr; }
  .gm-row-actions { white-space: normal; }
}
