/* =============================================
   NANO BANANA — Design System
   ============================================= */
.tab-panel {
  display: none !important;
  overflow: hidden;
}
.tab-panel.active {
  display: block !important;
}
#tab-analyse.active {
  display: flex !important;
  height: calc(100vh - 184px); /* header 60 + nav 72 + sous-onglets 52 */
  overflow: hidden;
}

:root {
  --accent: #d4f000;
  --accent-dim: rgba(212, 240, 0, 0.15);
  --accent-glow: rgba(212, 240, 0, 0.35);
  --bg: #080809;
  --bg-panel: rgba(14, 14, 16, 0.92);
  --bg-card: rgba(22, 22, 26, 0.9);
  --bg-input: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.07);
  --border-accent: rgba(212, 240, 0, 0.3);
  --text: #f0f0f0;
  --text-muted: #666;
  --text-dim: #999;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.6);
  /* Pile de polices façon Instagram (système, épurée, sans chargement réseau) */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Space Mono', Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

/* ── ACCESSIBILITY ── */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── BACKGROUND ── */
.bg-grid {
  display: none; /* carrés de fond retirés à la demande */
}
.bg-glow {
  position: fixed; top: -200px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 400px; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse, rgba(212,240,0,0.06) 0%, transparent 70%);
}

/* ── HEADER ── */
.header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  background: rgba(8,8,9,0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.5rem; line-height: 1; filter: drop-shadow(0 0 8px rgba(212,240,0,0.5)); }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-nano { font-size: 0.65rem; font-weight: 500; color: var(--text-muted); letter-spacing: 0.12em; text-transform: uppercase; }
.logo-banana { font-size: 1.05rem; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.logo-badge {
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.06em;
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  color: var(--accent); padding: 2px 8px; border-radius: 20px;
}

.header-right { display: flex; align-items: center; gap: 12px; }

.btn-ghost {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); font-family: var(--font); font-size: 0.8rem;
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.api-status {
  font-size: 0.72rem; font-weight: 600; padding: 4px 10px; border-radius: 20px;
  display: flex; align-items: center; gap: 5px;
}
.api-status.offline { color: #555; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); }
.api-status.online  { color: var(--accent); background: var(--accent-dim); border: 1px solid var(--border-accent); }

/* ── LAYOUT ── */
.app-layout {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 240px 380px 1fr;
  gap: 20px;
  padding: 28px 24px 40px;
  max-width: 1540px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
}

/* ── PANELS ── */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(20px);
  display: flex; flex-direction: column; gap: 18px;
  align-self: start;
}

.panel-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
}
.panel-num {
  font-family: var(--mono);
  font-size: 0.65rem; color: var(--accent); opacity: 0.8;
}

/* ── DROP ZONE ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  min-height: 260px;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.drop-zone.drag-over { box-shadow: 0 0 24px var(--accent-glow); }

.drop-content {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 24px; text-align: center;
}
.drop-icon { color: var(--text-muted); margin-bottom: 4px; }
.drop-text { font-size: 0.95rem; font-weight: 500; color: var(--text-dim); }
.drop-sub { font-size: 0.8rem; color: var(--text-muted); }
.drop-formats { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; font-family: var(--mono); }

.btn-upload {
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  color: var(--accent); font-family: var(--font); font-size: 0.82rem; font-weight: 600;
  padding: 8px 20px; border-radius: 8px; cursor: pointer;
  transition: all 0.2s;
}
.btn-upload:hover { background: rgba(212,240,0,0.25); box-shadow: 0 0 12px var(--accent-glow); }

/* ── IMAGE PREVIEW ── */
.preview-container {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.preview-container img {
  width: 100%; height: 100%; object-fit: contain;
  border-radius: 10px;
}
.preview-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 14px; opacity: 0;
  transition: all 0.2s;
}
.preview-container:hover .preview-overlay {
  opacity: 1; background: rgba(0,0,0,0.45);
}
.btn-change {
  display: flex; align-items: center; gap: 6px;
  background: rgba(8,8,9,0.9); border: 1px solid var(--border-accent);
  color: var(--accent); font-family: var(--font); font-size: 0.78rem; font-weight: 600;
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  transition: all 0.2s;
}
.btn-change:hover { background: var(--accent); color: #000; }

/* ── IMG INFO ── */
.img-info {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.img-info-row { display: flex; justify-content: space-between; align-items: center; }
.info-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.info-val { font-size: 0.8rem; font-family: var(--mono); color: var(--text-dim); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── ANALYZE BUTTON ── */
.btn-analyze {
  width: 100%; padding: 14px 20px;
  background: var(--accent); color: #000;
  border: none; border-radius: var(--radius); cursor: pointer;
  font-family: var(--font); font-size: 0.9rem; font-weight: 700;
  transition: all 0.25s; position: relative; overflow: hidden;
}
.btn-analyze:not(:disabled):hover {
  box-shadow: 0 0 24px var(--accent-glow), 0 4px 16px rgba(0,0,0,0.4);
  transform: translateY(-1px);
}
.btn-analyze:disabled {
  background: rgba(212,240,0,0.2); color: rgba(212,240,0,0.4); cursor: not-allowed;
}
.btn-analyze-inner { display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-loader { display: flex; align-items: center; justify-content: center; gap: 10px; }

.spinner {
  width: 16px; height: 16px; border: 2px solid rgba(0,0,0,0.3);
  border-top-color: #000; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── MODEL / DETAIL ── */
.model-selector, .detail-selector { display: flex; flex-direction: column; gap: 7px; }
.model-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.model-select {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 0.82rem;
  padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer;
  outline: none; transition: border-color 0.2s;
}
.model-select:focus { border-color: var(--accent); }
.model-select option { background: #111; }

.detail-pills { display: flex; gap: 6px; }
.detail-pill {
  flex: 1; padding: 7px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-muted); font-family: var(--font);
  font-size: 0.78rem; cursor: pointer; transition: all 0.2s;
}
.detail-pill.active {
  background: var(--accent-dim); border-color: var(--border-accent); color: var(--accent);
}
.detail-pill:hover:not(.active) { border-color: rgba(212,240,0,0.2); color: var(--text-dim); }

/* ── RIGHT PANEL HEADER ── */
.panel-header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.panel-actions { display: flex; align-items: center; gap: 8px; }

.btn-icon {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-dim); font-family: var(--font); font-size: 0.75rem; font-weight: 500;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
  transition: all 0.2s;
}
.btn-icon:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-icon:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-icon-accent { background: var(--accent-dim); border-color: var(--border-accent); color: var(--accent); }
.btn-icon-accent:hover:not(:disabled) { background: rgba(212,240,0,0.2); box-shadow: 0 0 10px var(--accent-glow); }

.view-toggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.view-btn {
  display: flex; align-items: center; justify-content: center;
  padding: 6px 10px; background: transparent; border: none;
  color: var(--text-muted); cursor: pointer; transition: all 0.2s;
}
.view-btn.active { background: var(--accent-dim); color: var(--accent); }
.view-btn:hover:not(.active) { background: rgba(255,255,255,0.04); }

/* ── EMPTY STATE ── */
.empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 60px 20px; text-align: center;
  min-height: 400px;
}
.empty-icon { font-size: 3rem; opacity: 0.3; animation: float 3s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.empty-sub { font-size: 0.82rem; color: var(--text-muted); max-width: 280px; line-height: 1.6; }

/* ── FORM VIEW ── */
.form-view { display: flex; flex-direction: column; gap: 10px; }

.json-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.2s;
}
.json-section:hover { border-color: rgba(255,255,255,0.12); }

.section-header {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; cursor: pointer;
  user-select: none; transition: background 0.2s;
}
.section-header:hover { background: rgba(255,255,255,0.03); }

.section-icon { font-size: 1rem; line-height: 1; }
.section-label { font-size: 0.88rem; font-weight: 600; flex: 1; }
.section-key {
  font-family: var(--mono); font-size: 0.68rem;
  color: var(--accent); opacity: 0.6; background: var(--accent-dim);
  padding: 2px 7px; border-radius: 4px;
}
.chevron { color: var(--text-muted); transition: transform 0.25s; flex-shrink: 0; }
.section-header.collapsed .chevron { transform: rotate(-90deg); }

.section-body { padding: 0 16px 16px; }
.section-body.hidden { display: none; }

/* ── FIELD GRID ── */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.field-item { display: flex; flex-direction: column; gap: 5px; }
.field-item label {
  font-size: 0.7rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.field-item input, .field-item select, .field-item textarea {
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 0.82rem;
  padding: 8px 10px; border-radius: 8px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.field-item input:focus, .field-item select:focus, .field-item textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(212,240,0,0.1);
}
.field-item select option { background: #111; }

/* ── TAG LISTS ── */
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; min-height: 32px; }

.tag {
  display: flex; align-items: center; gap: 5px;
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  color: var(--accent); font-size: 0.75rem; font-weight: 500;
  padding: 4px 10px; border-radius: 20px;
  animation: tagIn 0.2s ease-out;
}
@keyframes tagIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }

.tag-remove {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 0.9rem; line-height: 1; padding: 0; opacity: 0.5;
  transition: opacity 0.15s;
}
.tag-remove:hover { opacity: 1; }

.tags-compact .tag { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); color: var(--text-dim); }

.tag-add-row { display: flex; gap: 8px; align-items: center; }
.tag-input {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 0.82rem;
  padding: 8px 12px; border-radius: 8px; outline: none;
  transition: border-color 0.2s;
}
.tag-input:focus { border-color: var(--accent); }

.btn-add {
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  color: var(--accent); font-family: var(--font); font-size: 0.78rem; font-weight: 600;
  padding: 8px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  transition: all 0.2s;
}
.btn-add:hover { background: rgba(212,240,0,0.22); }

/* ── COLOR PALETTE ── */
.palette-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; min-height: 36px; }

.color-swatch {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 10px 4px 6px;
  animation: tagIn 0.2s ease-out;
}
.swatch-dot { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.15); flex-shrink: 0; }
.swatch-label { font-size: 0.72rem; font-family: var(--mono); color: var(--text-dim); }
.swatch-remove {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 0.85rem; padding: 0; transition: color 0.15s;
}
.swatch-remove:hover { color: var(--text); }

.color-picker-input {
  width: 36px; height: 36px; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; padding: 2px;
  background: var(--bg-input);
}
.color-hex { max-width: 130px; }

/* ── NOTES ── */
.notes-textarea {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 0.82rem;
  padding: 10px 12px; border-radius: var(--radius-sm); outline: none;
  resize: vertical; line-height: 1.6;
  transition: border-color 0.2s;
}
.notes-textarea:focus { border-color: var(--accent); }

/* ── RAW JSON VIEW ── */
.raw-view { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.raw-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.raw-label { font-size: 0.75rem; font-family: var(--mono); color: var(--text-muted); }
.btn-ghost-sm {
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  color: var(--accent); font-family: var(--font); font-size: 0.75rem; font-weight: 600;
  padding: 5px 12px; border-radius: 6px; cursor: pointer; transition: all 0.2s;
}
.btn-ghost-sm:hover { background: rgba(212,240,0,0.22); }

.raw-textarea {
  flex: 1; width: 100%; min-height: 500px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: #a8ff78; font-family: var(--mono); font-size: 0.8rem; line-height: 1.7;
  padding: 16px; border-radius: var(--radius); outline: none; resize: vertical;
  transition: border-color 0.2s;
}
.raw-textarea:focus { border-color: var(--accent); }

/* ── MODAL ── */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); }
.modal-box {
  position: relative; z-index: 1;
  background: #111113; border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; width: 440px; max-width: 95vw;
  box-shadow: var(--shadow);
  animation: slideUp 0.25s ease-out;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; font-size: 1rem; font-weight: 600;
}
.modal-close {
  background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--text); }
.modal-desc { font-size: 0.82rem; color: var(--text-dim); line-height: 1.6; margin-bottom: 18px; }
.modal-desc strong { color: var(--accent); }
.input-group { display: flex; gap: 8px; margin-bottom: 14px; }
.input-group input {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); font-family: var(--mono); font-size: 0.82rem;
  padding: 10px 12px; border-radius: 8px; outline: none;
  transition: border-color 0.2s;
}
.input-group input:focus { border-color: var(--accent); }
.btn-primary {
  background: var(--accent); color: #000; font-family: var(--font);
  font-size: 0.82rem; font-weight: 700; border: none;
  padding: 10px 18px; border-radius: 8px; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.btn-primary:hover { box-shadow: 0 0 14px var(--accent-glow); }
.modal-link {
  display: block; font-size: 0.78rem; color: var(--accent); text-decoration: none;
  opacity: 0.7; transition: opacity 0.2s;
}
.modal-link:hover { opacity: 1; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: #1a1a1e; border: 1px solid var(--border);
  color: var(--text); font-size: 0.82rem; font-weight: 500;
  padding: 12px 22px; border-radius: 30px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 300; white-space: nowrap;
  animation: toastIn 0.3s ease-out;
}
.toast.hidden { display: none; }
.toast.success { border-color: var(--border-accent); color: var(--accent); }
.toast.error { border-color: rgba(255,80,80,0.4); color: #ff6b6b; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ── UTILITIES ── */
.hidden { display: none !important; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .app-layout { grid-template-columns: 1fr; padding: 16px; }
  .panel-history { display: none; }
  .field-grid { grid-template-columns: 1fr; }
  .header { padding: 0 16px; }
}

/* ── PROVIDER TABS (modal) ── */
.provider-tabs {
  display: flex; gap: 6px; margin-bottom: 18px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px;
}
.provider-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 12px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-muted);
  font-family: var(--font); font-size: 0.82rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.provider-tab.active {
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid var(--border-accent);
}
.provider-tab:hover:not(.active) { color: var(--text-dim); background: rgba(255,255,255,0.04); }

.provider-panel { display: flex; flex-direction: column; gap: 12px; }
.provider-panel.hidden { display: none; }

/* ── QUOTA TIP ── */
.quota-tip {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(255, 180, 0, 0.07); border: 1px solid rgba(255, 180, 0, 0.2);
  border-radius: 8px; padding: 10px 12px;
  font-size: 0.78rem; color: var(--text-dim); line-height: 1.5;
}
.quota-tip a { color: #ffb400; }
.quota-tip-green {
  background: rgba(0, 200, 100, 0.07); border-color: rgba(0, 200, 100, 0.2);
}
.quota-tip-green a { color: #00c864; }

/* ── FULL-WIDTH SAVE BUTTON ── */
.btn-save-full {
  width: 100%; padding: 12px; margin-top: 6px;
  font-size: 0.88rem;
}

/* ── INPUT GROUP single-input variant ── */
.input-group input { width: 100%; }

/* ── USAGE COUNTER ── */
.usage-counter {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 600; color: var(--accent);
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  padding: 5px 12px; border-radius: 20px;
}

/* ── CREDIT BADGE ── */
.credit-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 600; color: var(--text-dim);
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 20px;
  cursor: help;
}
.credit-badge svg { color: var(--accent); }
.credit-badge #credit-amount { color: var(--text); }

/* ── HISTORY SIDEBAR ── */
.panel-history {
  align-self: stretch;
  max-height: calc(100vh - 120px);
  position: sticky; top: 80px;
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px 14px;
}
.panel-history .panel-title { gap: 8px; }
.history-count {
  font-family: var(--mono); font-size: 0.65rem;
  background: var(--accent-dim); color: var(--accent);
  padding: 2px 8px; border-radius: 12px; margin-left: auto;
}
.history-list {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  min-height: 100px;
}
.history-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 30px 10px; text-align: center;
  color: var(--text-muted); font-size: 0.78rem;
}
.history-empty span { font-size: 1.5rem; opacity: 0.4; }
.history-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,0.02); border: 1px solid transparent;
  transition: all 0.2s; position: relative;
}
.history-item:hover { background: rgba(255,255,255,0.05); border-color: var(--border); }
.history-item.active { background: var(--accent-dim); border-color: var(--border-accent); }
.history-thumb {
  width: 40px; height: 40px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--border); flex-shrink: 0;
}
.history-meta { flex: 1; min-width: 0; }
.history-name {
  font-size: 0.72rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-date {
  font-size: 0.62rem; color: var(--text-muted); font-family: var(--mono);
}
.history-model {
  font-size: 0.58rem; color: var(--accent); opacity: 0.7;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-delete {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,0.6); border: none; color: var(--text-muted);
  width: 18px; height: 18px; border-radius: 50%; font-size: 0.65rem;
  cursor: pointer; display: none; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.history-item:hover .history-delete { display: flex; }
.history-delete:hover { color: #ff6b6b; background: rgba(255,80,80,0.2); }
.btn-clear-history {
  width: 100%; justify-content: center; font-size: 0.72rem;
  padding: 7px; margin-top: auto;
}

/* ── PRICING MODAL ── */
.modal-pricing-box { width: 720px; max-width: 95vw; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pricing-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 18px; text-align: center;
  display: flex; flex-direction: column; gap: 14px; position: relative;
  transition: all 0.25s;
}
.pricing-card:hover { border-color: rgba(255,255,255,0.15); transform: translateY(-2px); }
.pricing-card.featured {
  border-color: var(--border-accent);
  background: linear-gradient(135deg, rgba(212,240,0,0.04), rgba(212,240,0,0.01));
  box-shadow: 0 0 30px rgba(212,240,0,0.06);
}
.pricing-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #000; font-size: 0.6rem; font-weight: 800;
  padding: 3px 12px; border-radius: 20px; letter-spacing: 0.08em;
}
.pricing-tier { font-size: 1rem; font-weight: 700; color: var(--text); }
.pricing-price { font-size: 2rem; font-weight: 800; color: var(--accent); }
.pricing-price span { font-size: 0.8rem; font-weight: 400; color: var(--text-muted); }
.pricing-features {
  list-style: none; text-align: left; display: flex; flex-direction: column; gap: 8px;
  font-size: 0.78rem; color: var(--text-dim); flex: 1;
}
.pricing-features .dim { color: var(--text-muted); opacity: 0.5; }
.btn-plan {
  width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-muted);
  font-family: var(--font); font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.btn-plan-accent {
  background: var(--accent); color: #000; border-color: var(--accent);
}
.btn-plan-accent:hover { box-shadow: 0 0 16px var(--accent-glow); }
.active-plan { opacity: 0.5; cursor: default; }
@media (max-width: 600px) { .pricing-grid { grid-template-columns: 1fr; } }

/* ── AUTH BUTTON ── */
.btn-auth-login {
  display: flex; align-items: center; gap: 6px;
  background: var(--accent); color: #000; border: none;
  font-family: var(--font); font-size: 0.78rem; font-weight: 700;
  padding: 7px 16px; border-radius: 8px; cursor: pointer;
  transition: all 0.25s; white-space: nowrap;
}
.btn-auth-login:hover { box-shadow: 0 0 16px var(--accent-glow); transform: translateY(-1px); }

/* ── USER MENU ── */
.user-menu { position: relative; }
.user-avatar-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  padding: 4px 12px 4px 4px; border-radius: 30px; cursor: pointer;
  color: var(--text); font-family: var(--font); transition: all 0.2s;
}
.user-avatar-btn:hover { border-color: var(--accent); background: rgba(255,255,255,0.08); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--accent);
  background: var(--bg-card);
}
.user-name { font-size: 0.78rem; font-weight: 600; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── USER DROPDOWN ── */
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #111113; border: 1px solid var(--border);
  border-radius: 12px; min-width: 220px; padding: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  z-index: 300; animation: slideUp 0.2s ease-out;
}
.dropdown-header { padding: 10px 12px; }
.dropdown-email { font-size: 0.75rem; color: var(--text-dim); display: block; overflow: hidden; text-overflow: ellipsis; }
.dropdown-plan {
  display: inline-block; margin-top: 4px;
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--accent-dim); color: var(--accent); border: 1px solid var(--border-accent);
  padding: 2px 8px; border-radius: 12px;
}
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Stats (quota / crédits / API) regroupées dans le menu déroulant */
.dropdown-stats {
  display: flex; gap: 6px; padding: 6px 8px 10px;
}
.dd-stat {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 4px; text-align: center;
}
.dd-stat-value { font-size: 0.78rem; font-weight: 700; color: var(--text); }
.dd-stat-label { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }

/* Statut pipeline déplacé dans le dropdown */
.dropdown-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 10px 10px;
}
.dropdown-status-row .tab-status-item {
  flex: 1;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 4px;
}
#api-status.dd-stat-value { padding: 0; background: none; border: none; }
#api-status.dd-stat-value.online { color: var(--accent); }
#api-status.dd-stat-value.offline { color: var(--text-muted); }

.dropdown-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: none; color: var(--text-dim);
  font-family: var(--font); font-size: 0.8rem; padding: 9px 12px;
  border-radius: 8px; cursor: pointer; transition: all 0.15s;
}
.dropdown-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.dropdown-logout:hover { color: #ff6b6b; }

/* ── AUTH MODAL ── */
.modal-auth-box { width: 400px; }
.auth-tabs {
  display: flex; gap: 4px; margin-bottom: 18px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px;
}
.auth-tab {
  flex: 1; padding: 9px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-muted);
  font-family: var(--font); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.auth-tab.active { background: var(--accent-dim); color: var(--accent); }
.auth-tab:hover:not(.active) { color: var(--text-dim); }
.auth-panel { display: flex; flex-direction: column; gap: 10px; }
.auth-panel.hidden { display: none; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--text-muted); font-size: 0.75rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.oauth-buttons { display: flex; gap: 10px; }
.btn-oauth {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border-radius: 10px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 0.82rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.btn-oauth:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }
.auth-error {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px;
  background: rgba(255,80,80,0.08); border: 1px solid rgba(255,80,80,0.2);
  color: #ff6b6b; font-size: 0.78rem; text-align: center;
}
.auth-error.hidden { display: none; }

/* ── CHECKOUT MODAL ── */
.modal-checkout-box { width: 460px; }
.checkout-summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; margin-bottom: 16px;
  background: var(--bg-card); border: 1px solid var(--border-accent);
  border-radius: 10px;
}
.checkout-plan-name { font-size: 0.9rem; font-weight: 700; color: var(--accent); }
.checkout-plan-price { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.checkout-plan-price span { font-size: 0.7rem; color: var(--text-muted); font-weight: 400; }

/* Pay tabs */
.pay-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px;
}
.pay-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 6px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-muted);
  font-family: var(--font); font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.pay-tab.active { background: var(--accent-dim); color: var(--accent); }
.pay-tab:hover:not(.active) { color: var(--text-dim); background: rgba(255,255,255,0.04); }

/* Pay panels */
.pay-panel { display: flex; flex-direction: column; gap: 12px; }
.pay-panel.hidden { display: none; }
.pay-desc { font-size: 0.8rem; color: var(--text-dim); line-height: 1.5; }
.pay-secure {
  text-align: center; font-size: 0.68rem; color: var(--text-muted);
  padding-top: 4px;
}
.btn-pay-main { font-size: 0.9rem; padding: 14px; }

/* Crypto address */
.crypto-address-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}
.crypto-addr {
  flex: 1; font-family: var(--mono); font-size: 0.7rem; color: var(--accent);
  word-break: break-all; line-height: 1.4;
}
.btn-copy-addr {
  background: none; border: none; cursor: pointer; font-size: 1rem;
  opacity: 0.6; transition: opacity 0.15s;
}
.btn-copy-addr:hover { opacity: 1; }
.crypto-amount {
  font-size: 0.82rem; color: var(--text-dim); text-align: center;
  padding: 6px 0;
}
.crypto-amount strong { color: var(--accent); font-size: 1rem; }
.crypto-note { font-size: 0.68rem; color: var(--text-muted); }

/* Crypto buttons */
.btn-crypto {
  width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.04); color: var(--text);
  font-family: var(--font); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s;
}
.btn-crypto:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }
.btn-metamask { border-color: rgba(226,118,27,0.3); }
.btn-metamask:hover { background: rgba(226,118,27,0.08); border-color: rgba(226,118,27,0.5); }
.btn-phantom { border-color: rgba(171,159,242,0.3); }
.btn-phantom:hover { background: rgba(171,159,242,0.08); border-color: rgba(171,159,242,0.5); }

/* Network toggle */
.crypto-network-toggle { display: flex; gap: 6px; }
.net-pill {
  flex: 1; padding: 7px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-muted); font-family: var(--font);
  font-size: 0.72rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
  text-align: center;
}
.net-pill.active { background: var(--accent-dim); border-color: var(--border-accent); color: var(--accent); }

/* Pricing footer */
.pricing-footer { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.payment-methods-strip {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-size: 0.72rem; color: var(--text-muted);
}
.pay-icons { display: flex; gap: 8px; font-size: 1.1rem; opacity: 0.6; }

/* ══════════════════════════════════════════════════
   NANO BANANA — MODULE 1 STYLES
   Publisher · Preview · Generation UI
   ══════════════════════════════════════════════════ */

/* ── EXTENDED LAYOUT (4 columns) ── */
.app-layout-extended {
  grid-template-columns: 220px 340px 320px 260px;
  max-width: 1700px;
}
@media (max-width: 1400px) {
  .app-layout-extended { grid-template-columns: 200px 340px 1fr; }
  .panel-preview { display: none; }
}
@media (max-width: 1100px) {
  .app-layout-extended { grid-template-columns: 1fr; }
  .panel-history, .panel-preview { display: none; }
}

/* ── NB MODE BADGE ── */
.nb-mode-badge {
  font-family: var(--mono); font-size: 0.58rem; font-weight: 700;
  padding: 2px 7px; border-radius: 10px; letter-spacing: 0.08em;
  margin-left: auto;
}
.nb-mode-mock {
  background: rgba(255,180,0,0.12); border: 1px solid rgba(255,180,0,0.3);
  color: #ffb400;
}
.nb-mode-live {
  background: rgba(0,200,100,0.12); border: 1px solid rgba(0,200,100,0.3);
  color: #00c864;
}

/* ── GENERATED IMAGE WRAP ── */
.gen-image-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-input);
  border: 1px solid var(--border);
  min-height: 220px;
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 9 / 14;
}

.gen-image-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; padding: 24px; text-align: center;
}
.gen-empty-icon { font-size: 2.5rem; opacity: 0.3; }
.gen-image-empty p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }
.gen-empty-sub { font-size: 0.7rem; color: var(--text-muted); opacity: 0.6; line-height: 1.5; }

.gen-image-result {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── GENERATION PROGRESS OVERLAY ── */
.gen-progress-overlay {
  position: absolute; inset: 0;
  background: rgba(8, 8, 9, 0.88);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
}
.gen-progress-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 24px; width: 100%;
}
.gen-spinner-ring {
  width: 48px; height: 48px;
  border: 3px solid rgba(212,240,0,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.gen-progress-bar-wrap {
  width: 100%; height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px; overflow: hidden;
}
.gen-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), rgba(212,240,0,0.6));
  border-radius: 4px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px var(--accent-glow);
}
.gen-progress-msg {
  font-size: 0.8rem; color: var(--text-dim);
  text-align: center; line-height: 1.4;
}
.gen-progress-pct {
  font-family: var(--mono); font-size: 1.2rem; font-weight: 700;
  color: var(--accent);
}

/* ── PROMPT PREVIEW ── */
.gen-prompt-preview {
  background: rgba(212,240,0,0.04);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.gen-prompt-label {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--accent); opacity: 0.7;
}
.gen-prompt-text {
  font-size: 0.72rem; color: var(--text-dim);
  font-family: var(--mono); line-height: 1.6;
  word-break: break-word; max-height: 60px;
  overflow: hidden; text-overflow: ellipsis;
}

/* ── GENERATE BUTTON ── */
.btn-generate {
  width: 100%; padding: 13px 20px;
  background: linear-gradient(135deg, var(--accent), #b8d400);
  color: #000; border: none; border-radius: var(--radius);
  cursor: pointer; font-family: var(--font);
  font-size: 0.88rem; font-weight: 700;
  transition: all 0.25s; position: relative; overflow: hidden;
}
.btn-generate::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.15));
  opacity: 0; transition: opacity 0.3s;
}
.btn-generate:not(:disabled):hover::before { opacity: 1; }
.btn-generate:not(:disabled):hover {
  box-shadow: 0 0 28px var(--accent-glow), 0 4px 16px rgba(0,0,0,0.4);
  transform: translateY(-1px);
}
.btn-generate:disabled {
  background: rgba(212,240,0,0.15);
  color: rgba(212,240,0,0.35);
  cursor: not-allowed;
}
.btn-gen-inner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* ── PUB DIVIDER ── */
.pub-divider {
  height: 1px; background: var(--border); margin: 4px 0;
}

/* ── CAPTION EDITOR ── */
.caption-section { display: flex; flex-direction: column; gap: 8px; }
.caption-header {
  display: flex; align-items: center; justify-content: space-between;
}
.caption-header-actions { display: flex; gap: 6px; }
.caption-label {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
}
.caption-textarea {
  width: 100%; background: var(--bg-input);
  border: 1px solid var(--border); color: var(--text);
  font-family: var(--font); font-size: 0.82rem;
  padding: 10px 12px; border-radius: var(--radius-sm);
  outline: none; resize: vertical; line-height: 1.6;
  transition: border-color 0.2s;
}
.caption-textarea:focus { border-color: var(--accent); }
.caption-textarea:disabled { opacity: 0.4; cursor: not-allowed; }
.caption-footer {
  display: flex; align-items: center; justify-content: space-between;
}
.caption-char {
  font-size: 0.68rem; font-family: var(--mono);
  color: var(--text-muted);
}
.caption-style-pills { display: flex; gap: 4px; }
.caption-style {
  padding: 3px 10px; border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  font-family: var(--font); font-size: 0.68rem; font-weight: 600;
  cursor: pointer; transition: all 0.18s;
}
.caption-style.active {
  background: var(--accent-dim);
  border-color: var(--border-accent);
  color: var(--accent);
}
.caption-style:hover:not(.active) {
  border-color: rgba(255,255,255,0.15); color: var(--text-dim);
}

/* ── HASHTAGS ── */
.hashtag-section { display: flex; flex-direction: column; gap: 8px; }
.hashtag-container {
  display: flex; flex-wrap: wrap; gap: 5px;
  max-height: 80px; overflow-y: auto;
}
.hashtag-tag {
  font-size: 0.7rem; color: #4ea1ff;
  background: rgba(78,161,255,0.08);
  border: 1px solid rgba(78,161,255,0.2);
  border-radius: 12px; padding: 2px 8px;
  cursor: pointer; transition: all 0.15s;
  font-family: var(--mono);
}
.hashtag-tag:hover { background: rgba(78,161,255,0.18); }

/* ── PUBLISH CONTROLS ── */
.publish-controls {
  display: flex; flex-direction: column; gap: 8px;
}
.btn-connect-ig {
  width: 100%; padding: 11px 16px;
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  color: #fff; border: none; border-radius: var(--radius);
  font-family: var(--font); font-size: 0.82rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 8px;
  transition: all 0.25s;
}
.btn-connect-ig:hover {
  box-shadow: 0 0 20px rgba(253,29,29,0.3); transform: translateY(-1px);
}
.pub-btn-row { display: flex; gap: 8px; }
.btn-publish {
  flex: 2; padding: 11px; border: none;
  background: var(--accent); color: #000;
  font-family: var(--font); font-size: 0.82rem; font-weight: 700;
  border-radius: var(--radius); cursor: pointer; transition: all 0.2s;
}
.btn-publish:not(:disabled):hover { box-shadow: 0 0 18px var(--accent-glow); }
.btn-publish:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-schedule {
  flex: 1; padding: 11px; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-dim);
  font-family: var(--font); font-size: 0.8rem; font-weight: 600;
  border-radius: var(--radius); cursor: pointer; transition: all 0.2s;
}
.btn-schedule:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.btn-schedule:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── SCHEDULE PICKER ── */
.schedule-picker {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
}
.schedule-input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 0.82rem;
  padding: 9px 12px; border-radius: var(--radius-sm);
  outline: none; transition: border-color 0.2s;
}
.schedule-input:focus { border-color: var(--accent); }
.schedule-actions { display: flex; gap: 8px; }

/* ── NB KEY CONFIG ── */
.nb-key-config {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
}
.nb-key-details summary { cursor: pointer; list-style: none; }
.nb-key-summary {
  font-size: 0.72rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
  user-select: none; transition: color 0.2s;
}
.nb-key-summary:hover { color: var(--text-dim); }
.nb-key-inner {
  display: flex; gap: 8px; margin-top: 10px;
}
.nb-key-input {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); font-family: var(--mono); font-size: 0.78rem;
  padding: 8px 10px; border-radius: 8px; outline: none;
  transition: border-color 0.2s;
}
.nb-key-input:focus { border-color: var(--accent); }

/* ── PHONE FRAME ── */
.panel-preview {
  align-self: start;
  position: sticky; top: 80px;
}
.phone-frame {
  width: 230px;
  margin: 0 auto;
  background: #111;
  border-radius: 40px;
  padding: 14px 10px 10px;
  box-shadow:
    0 0 0 2px #222,
    0 0 0 4px #0a0a0a,
    0 24px 60px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255,255,255,0.06);
}
.phone-notch {
  width: 70px; height: 20px;
  background: #000; border-radius: 12px;
  margin: 0 auto 8px;
  box-shadow: 0 0 0 1px #222;
}
.phone-screen {
  background: #000;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid #1a1a1a;
}
.phone-home-bar {
  width: 80px; height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  margin: 10px auto 0;
}

/* ── INSTAGRAM UI ── */
.ig-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 4px;
  color: #fff; font-size: 0.65rem;
}
.ig-topbar-title { font-weight: 700; font-size: 0.8rem; }
.ig-post-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
}
.ig-avatar-ring {
  width: 34px; height: 34px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  flex-shrink: 0;
}
.ig-avatar {
  width: 100%; height: 100%;
  background: #111; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; border: 2px solid #000;
}
.ig-post-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ig-username {
  font-size: 0.72rem; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ig-location { font-size: 0.6rem; color: #888; }
.ig-more { color: #888; margin-left: auto; flex-shrink: 0; }

.ig-post-image {
  width: 100%; aspect-ratio: 9 / 14;
  background: #111;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ig-post-image img { width: 100%; height: 100%; object-fit: cover; }
.ig-placeholder {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; color: #333;
}
.ig-placeholder span { font-size: 1.8rem; }
.ig-placeholder p { font-size: 0.65rem; }

.ig-actions {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 4px;
}
.ig-actions-left { display: flex; gap: 12px; }
.ig-btn {
  background: none; border: none; font-size: 1rem;
  cursor: default; padding: 0; line-height: 1;
}
.ig-likes {
  padding: 0 12px 4px;
  font-size: 0.65rem; font-weight: 700; color: #fff;
}
.ig-caption {
  padding: 0 12px 4px;
  font-size: 0.65rem; color: #fff; line-height: 1.4;
}
.ig-caption strong { color: #fff; }
.ig-hashtags {
  padding: 0 12px 4px;
  font-size: 0.6rem; color: #4ea1ff; line-height: 1.5;
  word-break: break-word;
}
.ig-timestamp {
  padding: 0 12px 10px;
  font-size: 0.58rem; color: #555; text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── PREVIEW ACTIONS ── */
.preview-actions {
  display: flex; gap: 8px; justify-content: center;
  flex-wrap: wrap;
}
.btn-ghost-sm:disabled { opacity: 0.3; cursor: not-allowed; }

/* ══════════════════════════════════════════════════
   TAB SYSTEM — 3 onglets par rôle
   ══════════════════════════════════════════════════ */

/* ── APP ROOT ── */
.app-root {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  min-height: calc(100vh - 60px);
}

/* ── TAB NAVIGATION BAR ── */
.tab-nav {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(10,10,12,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  position: sticky; top: 60px; z-index: 90;
  height: 72px;
  gap: 20px;
}

.tab-nav-inner {
  display: flex; gap: 6px; height: 100%;
  align-items: center;
}

.tab-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 22px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-muted); font-family: var(--font);
  cursor: pointer; border-radius: 10px;
  transition: all 0.22s; position: relative;
  min-width: 150px;
}
.tab-btn::after {
  content: '';
  position: absolute; bottom: -1px; left: 20%; right: 20%;
  height: 2px; background: var(--accent);
  border-radius: 2px 2px 0 0;
  opacity: 0; transition: opacity 0.2s;
}
.tab-btn.active {
  background: var(--accent-dim);
  border-color: var(--border-accent);
  color: var(--accent);
}
.tab-btn.active::after { opacity: 1; }
.tab-btn:hover:not(.active) {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
  color: var(--text-dim);
}
.tab-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px; flex-shrink: 0;
  transition: background 0.2s;
}
.tab-btn.active .tab-icon {
  background: rgba(212,240,0,0.15);
  color: var(--accent);
}
.tab-label {
  font-size: 0.88rem; font-weight: 700;
  display: block; line-height: 1.2;
}
.tab-sub {
  font-size: 0.62rem; color: var(--text-muted);
  font-family: var(--mono); display: block; line-height: 1;
}
.tab-btn.active .tab-sub { color: rgba(212,240,0,0.6); }

/* ── SOUS-ONGLETS (niveau 2) ── */
.subtab-nav {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 28px;
  background: rgba(10,10,12,0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  position: sticky; top: 132px; z-index: 88;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.subtab-nav[hidden] { display: none; }
.subtab-btn {
  display: flex; flex-direction: column; gap: 1px;
  padding: 7px 16px; white-space: nowrap;
  background: transparent; border: 1px solid transparent;
  color: var(--text-muted); font-family: var(--font);
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer; border-radius: 999px;
  transition: all 0.18s;
}
.subtab-btn span {
  font-size: 0.6rem; font-weight: 400; color: var(--text-muted);
  font-family: var(--mono);
}
.subtab-btn:hover:not(.active) {
  background: rgba(255,255,255,0.04); color: var(--text-dim);
}
.subtab-btn.active {
  background: var(--accent); border-color: var(--accent); color: #000;
}
.subtab-btn.active span { color: rgba(0,0,0,0.55); }

/* ── TAB STATUS INDICATORS ── */
.tab-nav-status {
  display: flex; align-items: center; gap: 16px;
  flex-shrink: 0;
}
.tab-status-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; color: var(--text-muted);
  font-family: var(--mono);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
.status-dot.status-off  { background: rgba(255,255,255,0.15); }
.status-dot.status-on   { background: #00c864; box-shadow: 0 0 6px rgba(0,200,100,0.5); }
.status-dot.status-warn { background: #ffb400; box-shadow: 0 0 6px rgba(255,180,0,0.5); }

/* ── TAB PANELS ── */
.tab-panel {
  display: none;
  flex: 1;
  animation: tabFadeIn 0.2s ease-out;
}
.tab-panel.active { display: block; }
@keyframes tabFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── TAB 1: ANALYSE — grid 3 colonnes ── */
.tab-layout-analyse {
  display: grid;
  grid-template-columns: 220px 360px 1fr;
  gap: 20px;
  padding: 28px 24px 40px;
  max-width: 1540px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 1100px) {
  .tab-layout-analyse { grid-template-columns: 1fr; }
  .panel-history { display: none; }
}

/* ── TAB COMPRESSEUR — 2 colonnes ── */
.tab-layout-compress {
  display: flex;
  gap: 20px;
  padding: 28px 24px 40px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: stretch;
}
.tab-layout-compress .panel { display: flex; flex-direction: column; }
@media (max-width: 800px) {
  .tab-layout-compress { flex-direction: column; }
}

/* ── TAB 2: GÉNÉRATION — 3 colonnes ── */
.tab-layout-generation {
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  gap: 20px;
  padding: 28px 24px 40px;
  max-width: 1540px;
  margin: 0 auto;
  align-items: start;
}
.gen-col { display: flex; flex-direction: column; gap: 14px; }
.gen-col-brief { /* sticky sidebar */ }
.gen-col-engine { }
.gen-col-caption {
  position: sticky; top: 148px;
}
@media (max-width: 1300px) {
  .tab-layout-generation { grid-template-columns: 240px 1fr 280px; }
}
@media (max-width: 1100px) {
  .tab-layout-generation { grid-template-columns: 1fr 280px; }
  .gen-col-brief { display: none; }
  .gen-col-caption { position: static; }
}
@media (max-width: 800px) {
  .tab-layout-generation { grid-template-columns: 1fr; }
  .gen-col-caption { display: none; }
}

/* Engine panel */
.gen-engine-panel { gap: 14px !important; }
.gen-params-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 0 2px;
  border-top: 1px solid var(--border);
}
.gen-param-badge {
  font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  background: rgba(212,240,0,0.08);
  border: 1px solid var(--border-accent);
  color: rgba(212,240,0,0.7);
  padding: 3px 8px; border-radius: 6px;
  font-family: var(--mono);
}

/* NB Key panel */
.nb-key-panel { gap: 10px !important; }
.nb-key-hint {
  font-size: 0.68rem; color: var(--text-muted);
  line-height: 1.5; margin: 0;
}

/* Caption panel */
.gen-caption-panel, .gen-preview-panel { gap: 10px !important; }

/* IG publish status bar */
.ig-pub-status {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
  font-size: 0.76rem; color: var(--text-dim);
}
.ig-pub-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.ig-pub-connected {
  border-color: var(--border-accent);
  background: rgba(212,240,0,0.04);
  color: var(--accent);
}

/* ── TAB 3: PUBLICATION — grid 3 colonnes ── */
.tab-layout-publication {
  display: grid;
  grid-template-columns: 300px 1fr 280px;
  gap: 20px;
  padding: 28px 24px 40px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 1200px) {
  .tab-layout-publication { grid-template-columns: 280px 1fr; }
  .pub-stats-panel { display: none; }
}
@media (max-width: 900px) {
  .tab-layout-publication { grid-template-columns: 1fr; }
}

/* ── JSON SUMMARY CARD ── */
.json-summary-card {
  gap: 12px !important;
}
.json-summary-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 24px; text-align: center;
  color: var(--text-muted); font-size: 0.82rem;
}
.json-summary-empty span { font-size: 2rem; opacity: 0.3; }
.json-summary-empty strong { color: var(--accent); }
.json-summary-data { display: flex; flex-direction: column; gap: 8px; }
.summary-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.summary-row:last-child { border: none; }
.summary-key {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); min-width: 80px; flex-shrink: 0;
}
.summary-val {
  font-size: 0.82rem; color: var(--text);
  word-break: break-word; line-height: 1.4;
}
.summary-tags {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 6px 0;
}
.summary-tag {
  font-size: 0.68rem; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 10px;
  padding: 2px 8px; font-family: var(--mono);
}
.prompt-built-row {
  background: rgba(212,240,0,0.04);
  border: 1px solid var(--border-accent);
  border-radius: 8px; padding: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.prompt-built-text {
  font-size: 0.72rem; color: var(--text-dim);
  font-family: var(--mono); line-height: 1.6;
  word-break: break-word;
}

/* ── TAB JUMP BUTTON ── */
.tab-jump-btn {
  display: flex; align-items: center; gap: 4px;
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  color: var(--accent); font-family: var(--font); font-size: 0.68rem;
  font-weight: 600; padding: 3px 8px; border-radius: 6px;
  cursor: pointer; margin-left: auto; transition: all 0.18s;
}
.tab-jump-btn:hover { background: rgba(212,240,0,0.22); }

/* ── PUBLICATION PANELS ── */
.pub-connect-panel, .pub-queue-panel, .pub-stats-panel {
  gap: 16px !important;
}

.ig-account-status { display: flex; flex-direction: column; }
.ig-account-disconnected, .ig-account-connected {
  display: flex; flex-direction: column; gap: 14px;
}
.ig-connect-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, rgba(131,58,180,0.15), rgba(253,29,29,0.15));
  border: 1px solid rgba(253,29,29,0.2);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  color: #fd1d1d;
}
.ig-connect-title {
  font-size: 1rem; font-weight: 700; color: var(--text);
  text-align: center;
}
.ig-connect-sub {
  font-size: 0.78rem; color: var(--text-dim);
  text-align: center; line-height: 1.6;
}
.ig-connect-note {
  display: flex; gap: 8px; align-items: flex-start;
  background: rgba(255,180,0,0.06); border: 1px solid rgba(255,180,0,0.2);
  border-radius: 8px; padding: 10px;
  font-size: 0.72rem; color: var(--text-dim); line-height: 1.5;
}
.ig-connect-note code {
  font-family: var(--mono); color: var(--accent); font-size: 0.68rem;
}
.ig-profile-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border-accent);
  border-radius: 12px; padding: 14px;
}
.ig-profile-name {
  font-size: 0.88rem; font-weight: 700; color: var(--text);
}
.ig-profile-type { font-size: 0.68rem; color: var(--text-muted); }
.ig-connected-badge {
  margin-left: auto; font-size: 0.68rem; font-weight: 700;
  background: rgba(0,200,100,0.12);
  border: 1px solid rgba(0,200,100,0.3);
  color: #00c864; padding: 3px 10px; border-radius: 12px;
}
.pub-config { display: flex; flex-direction: column; gap: 10px; }
.pub-config-row { display: flex; flex-direction: column; gap: 6px; }

/* ── PUBLICATION QUEUE ── */
.pub-queue-list {
  display: flex; flex-direction: column; gap: 10px;
  max-height: calc(100vh - 350px);
  overflow-y: auto;
  min-height: 120px;
}
.pub-queue-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 32px 16px; text-align: center;
  color: var(--text-muted); font-size: 0.82rem;
}
.pub-queue-empty span { font-size: 2rem; opacity: 0.3; }
.pub-queue-item {
  display: flex; gap: 12px; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
  transition: border-color 0.2s;
}
.pub-queue-item:hover { border-color: rgba(255,255,255,0.12); }
.pub-queue-thumb {
  width: 48px; height: 48px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
  background: var(--bg-input); border: 1px solid var(--border);
}
.pub-queue-meta { flex: 1; min-width: 0; }
.pub-queue-caption {
  font-size: 0.78rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 500;
}
.pub-queue-time {
  font-size: 0.68rem; color: var(--text-muted);
  font-family: var(--mono); margin-top: 3px;
}
.pub-queue-status {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  padding: 2px 8px; border-radius: 10px; letter-spacing: 0.06em;
  flex-shrink: 0;
}
.status-scheduled {
  background: rgba(255,180,0,0.12); border: 1px solid rgba(255,180,0,0.3);
  color: #ffb400;
}
.status-published {
  background: rgba(0,200,100,0.12); border: 1px solid rgba(0,200,100,0.3);
  color: #00c864;
}
.status-failed {
  background: rgba(255,80,80,0.12); border: 1px solid rgba(255,80,80,0.3);
  color: #ff6b6b;
}

/* ── STATS ── */
.pub-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pub-stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 12px; text-align: center;
  transition: border-color 0.2s;
}
.pub-stat-card:hover { border-color: var(--border-accent); }
.pub-stat-val {
  font-size: 1.8rem; font-weight: 800;
  color: var(--accent); font-family: var(--mono);
  line-height: 1;
}
.pub-stat-label {
  font-size: 0.68rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-top: 4px;
}
.pub-history-section { display: flex; flex-direction: column; }
.pub-history-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 200px; overflow-y: auto;
}
.next-action-card {
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  border-radius: 10px; padding: 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.next-action-time {
  font-size: 1rem; font-weight: 700; color: var(--accent);
}
.next-action-sub { font-size: 0.72rem; color: var(--text-muted); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .tab-nav { padding: 0 12px; height: 64px; }
  .tab-btn { min-width: auto; padding: 8px 14px; gap: 8px; }
  .tab-nav-status { display: none; }
  .tab-sub { display: none; }
  .tab-layout-analyse, .tab-layout-generation,
  .tab-layout-publication { padding: 16px 12px 32px; }
}

/* ── HOME PAGE LAYOUT ── */
.tab-layout-home {
  padding-top: 0;
}

/* ── NETFLIX STYLE UI ── */
.netflix-home {
  padding: 24px;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.netflix-row-header {
  margin-bottom: 12px;
}
.netflix-row-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #e5e5e5;
  padding-left: 8px;
}

.netflix-row-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 20px;
  scrollbar-width: none; 
}
.netflix-row-scroll::-webkit-scrollbar {
  display: none;
}

.netflix-card {
  flex: 0 0 260px;
  height: 146px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s;
}
.netflix-card:hover {
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 10px 20px rgba(0,0,0,0.8);
}
.netflix-card img, .netflix-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Marquee / Infinite loop */
.netflix-marquee-container {
  overflow: hidden;
  width: 100%;
  position: relative;
}
.netflix-marquee-track {
  display: flex;
  gap: 8px;
  width: max-content;
  animation: marquee 30s linear infinite;
}
.marquee-card {
  flex: 0 0 260px;
  height: 146px;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); } 
}



/* ── PINTEREST MASONRY FEED ── */
.pinterest-feed-container {
  padding-top: 48px;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 16px;
}
.pinterest-feed-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e5e5e5;
  margin-bottom: 24px;
  padding-left: 8px;
}
.pinterest-masonry {
  column-count: 4;
  column-gap: 16px;
  width: 100%;
}
.pinterest-card {
  break-inside: avoid;
  margin-bottom: 16px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}
.pinterest-card img, .pinterest-card video {
  width: 100%;
  display: block;
  border-radius: 8px;
}
.pinterest-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
.pinterest-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 40%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.pinterest-card:hover::after {
  opacity: 1;
}

@media (max-width: 1200px) {
  .pinterest-masonry { column-count: 3; }
}
@media (max-width: 768px) {
  .pinterest-masonry { column-count: 2; }
}
@media (max-width: 480px) {
  .pinterest-masonry { column-count: 1; }
}

/* ── INSTA MODAL ── */
.insta-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
}
.insta-modal.active {
  opacity: 1;
  pointer-events: auto;
}
.insta-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
  z-index: 10000;
  transition: transform 0.2s;
}
.insta-modal-close:hover {
  transform: scale(1.1);
}
.insta-modal-content {
  display: flex;
  width: 90%;
  max-width: 1100px;
  height: 90vh;
  max-height: 800px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.insta-modal.active .insta-modal-content {
  transform: scale(1);
}
.insta-modal-media {
  flex: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.insta-modal-media img, .insta-modal-media video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.insta-modal-info {
  width: 350px;
  background: #121212;
  border-left: 1px solid #262626;
  display: flex;
  flex-direction: column;
}
.insta-modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid #262626;
  display: flex;
  align-items: center;
  gap: 12px;
}
.insta-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #000;
  font-size: 14px;
  flex: 0 0 auto;     /* évite l'écrasement en ovale quand le texte est long */
  overflow: hidden;
}
.insta-avatar img { width: 100%; height: 100%; object-fit: cover; }
.insta-username {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
  flex: 1;
}
.insta-modal-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.insta-comment {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.insta-comment-text {
  font-size: 0.9rem;
  color: #e5e5e5;
  line-height: 1.4;
}
.insta-comment-text span {
  font-weight: 600;
  color: #fff;
  margin-right: 6px;
}
.insta-modal-footer {
  border-top: 1px solid #262626;
  padding: 14px 16px;
}
.insta-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.insta-action-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.2s;
}
.insta-action-btn:hover {
  color: var(--text-muted);
  transform: scale(1.1);
}
.insta-action-btn.right {
  margin-left: auto;
}
.insta-likes {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: #fff;
}
.insta-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.insta-add-comment {
  display: flex;
  border-top: 1px solid #262626;
  padding-top: 14px;
}
.insta-add-comment input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}
.insta-add-comment input::placeholder {
  color: var(--text-muted);
}
.insta-add-comment button {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 0 8px;
}
.insta-add-comment button:hover {
  color: #fff;
}

@media (max-width: 768px) {
  .insta-modal-content {
    flex-direction: column;
    overflow-y: auto;
  }
  .insta-modal-media {
    flex: none;
    height: 400px;
  }
  .insta-modal-info {
    width: 100%;
    border-left: none;
    border-top: 1px solid #262626;
  }
}

/* ── IMMERSIVE ANALYSE LAYOUT (CLONE) ── */
.tab-layout-analyse.immersive {
  flex: 1;
  display: flex;
  align-items: stretch;
  height: auto;
  min-height: 100%;
  padding: 0;
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  background: #111111;
}

.analyse-main-area {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* TOP BAR */
.analyse-top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  z-index: 20;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}
.analyse-tabs {
  display: flex;
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.1);
}
.analyse-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.analyse-tab-btn.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.analyse-scale {
  display: flex;
  align-items: center;
  gap: 12px;
}
.scale-label {
  background: #ff2a5f;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.scale-slider {
  width: 100px;
  accent-color: #fff;
}

/* DROP ZONE / BACKGROUND GRID */
.immersive-drop-zone {
  position: absolute !important;
  inset: 0;
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.immersive-drop-zone.drag-over {
  background: rgba(212,240,0,0.1) !important;
  border: 2px dashed var(--accent) !important;
}

/* Grille d'images décorative retirée : fond uni, look sobre. */
.immersive-bg-grid { display: none !important; }
.immersive-bg-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.immersive-bg-col img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 0;
}

.immersive-overlay-text {
  position: relative;
  z-index: 10;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 56px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: border-color .2s, background .2s;
}
.immersive-drop-zone.drag-over .immersive-overlay-text {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.immersive-overlay-text h2 {
  font-size: 1.5rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.immersive-overlay-text p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0;
}

/* ── Bulles d'idées de génération ───────────────── */
.idea-bubbles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.idea-bubbles-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.idea-bubbles-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 460px;
}
.idea-bubble {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.82rem;
  padding: 7px 13px;
  border-radius: var(--radius-pill, 999px);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.idea-bubble:hover {
  border-color: var(--border-accent);
  color: var(--text);
  background: var(--accent-dim);
}

/* PREVIEW */
.immersive-preview {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 15;
}
.immersive-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.immersive-preview .preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.immersive-preview:hover .preview-overlay {
  opacity: 1;
}

/* FLOATING ACTION BAR */
.floating-action-bar {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 800px;
  background: #1c1c1c;
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 30;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
}

.fab-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}
.fab-icon {
  color: var(--text-muted);
  font-size: 1.2rem;
  font-weight: 300;
}
.fab-icon-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.fab-icon-btn:hover {
  background: var(--accent, #d4f000);
  color: #0a0a0c;
  transform: scale(1.08);
}
.fab-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  font-family: var(--font);
}
.fab-input::placeholder {
  color: #666;
}

.fab-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fab-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fab-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #2a2a2a;
  border: 1px solid transparent;
  color: #d1d1d1;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s;
}
.fab-badge:hover {
  background: #333;
}
.badge-icon {
  font-size: 0.85rem;
}
.fab-stepper {
  gap: 10px;
  padding: 6px 8px;
}
.stepper-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}
.stepper-btn:hover { color: #fff; }

.fab-btn-generate {
  background: #D4F000;
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s, filter 0.2s;
}
.fab-btn-generate:hover:not(:disabled) {
  transform: scale(1.02);
  filter: brightness(1.1);
}
.fab-btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.spinner-dark {
  border-top-color: #000 !important;
  border-right-color: #000 !important;
  border-bottom-color: #000 !important;
  border-left-color: rgba(0,0,0,0.2) !important;
}

/* RIGHT PANEL JSON (Floating) */
.floating-json-panel {
  width: 440px;
  border-left: 1px solid rgba(255,255,255,0.05);
  background: rgba(10,10,12,0.95);
  backdrop-filter: blur(20px);
  z-index: 40;
  border-radius: 0 !important;
  margin: 0 !important;
  align-self: stretch;
  overflow: hidden;
  padding: 0 !important;
  gap: 0 !important;
}
@media (max-width: 1100px) {
  .floating-json-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    transform: translateX(100%);
    transition: transform 0.3s;
  }
  .floating-json-panel.open {
    transform: translateX(0);
  }
}

/* ══ PIPELINE STEPPER (Analyse → Image → Légende → Publier) ══ */
.pipe-nav {
  display: flex;
  gap: 4px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.pipe-step-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.pipe-step-btn:hover { background: rgba(255,255,255,0.04); }
.pipe-num {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 0.78rem; font-weight: 800;
  transition: all 0.2s;
}
.pipe-step-btn.active { color: #fff; }
.pipe-step-btn.active .pipe-num {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.pipe-step-btn.done .pipe-num {
  background: rgba(212,240,0,0.2);
  color: var(--accent);
}
.pipe-step-btn.done .pipe-num::before { content: "✓"; }
.pipe-step-btn.done .pipe-num { font-size: 0; }
.pipe-step-btn.done .pipe-num::before { font-size: 0.8rem; }

.pipe-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}
.pipe-step-panel { display: none; flex-direction: column; gap: 14px; }
.pipe-step-panel.active { display: flex; }

.pipe-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.pipe-prev, .pipe-next {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.18s;
}
.pipe-next {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.pipe-prev:hover:not(:disabled) { background: rgba(255,255,255,0.12); }
.pipe-next:hover:not(:disabled) { filter: brightness(1.1); }
.pipe-prev:disabled, .pipe-next:disabled { opacity: 0.35; cursor: not-allowed; }
.pipe-progress { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }

.pipe-field-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Destinations (IG + Pinterest) */
.pub-dest-row { display: flex; gap: 10px; }
.pub-dest {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
}
.pub-dest input { position: absolute; opacity: 0; }
.pub-dest:has(input:checked) {
  border-color: var(--accent);
  background: rgba(212,240,0,0.06);
}
.pub-dest-icon { font-size: 1.4rem; }
.pub-dest-name { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.pub-dest-state { font-size: 0.62rem; color: var(--text-muted); }
.pub-dest:has(input:checked) .pub-dest-state { color: var(--accent); }

.pipe-connect-link {
  align-self: flex-start;
  font-size: 0.72rem !important;
}

/* Publishing mode cards */
.pub-mode-grid { display: flex; flex-direction: column; gap: 8px; }
.pub-mode {
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  text-align: left;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font);
}
.pub-mode:hover { border-color: rgba(255,255,255,0.2); }
.pub-mode.active {
  border-color: var(--accent);
  background: rgba(212,240,0,0.06);
}
.pub-mode-icon { grid-row: 1 / 3; font-size: 1.3rem; align-self: center; }
.pub-mode-title { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.pub-mode-desc { font-size: 0.68rem; color: var(--text-muted); line-height: 1.35; }
.pub-mode.active .pub-mode-title { color: var(--accent); }

.pipe-mode-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 2px;
}

/* Compact phone preview inside step 3 */
.phone-frame-compact {
  width: 220px;
  align-self: center;
  border-radius: 22px;
  padding: 6px;
}
.phone-frame-compact .phone-screen { border-radius: 16px; }
.phone-frame-compact .ig-post-image { aspect-ratio: 9 / 12; }

/* Editable prompt textarea in step 2 */
textarea.gen-prompt-text {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.4;
}

/* ── FAB : analyse + génération directes ── */
.fab-actions { display: flex; gap: 8px; align-items: center; }
.fab-btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--border);
}
.fab-btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.14);
  transform: scale(1.02);
}
.fab-btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── STEP 4 : lanceur de publication ── */
.pub-launch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 24px 8px;
}
.pub-launch-text { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; max-width: 320px; }
.pub-launch-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 14px;
  padding: 14px 24px;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s, filter 0.18s;
}
.pub-launch-btn:hover { transform: scale(1.03); filter: brightness(1.08); }
.pub-launch-plus {
  font-size: 1.3rem;
  line-height: 1;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.18);
  border-radius: 50%;
}

/* ── PUBLISH MODAL ── */
.modal-publish-box { width: 560px; max-width: 94vw; }
.modal-publish-box .pipe-field-label { display: block; margin: 16px 0 8px; }
.modal-publish-box .pipe-field-label:first-of-type { margin-top: 6px; }
.pub-count {
  background: var(--accent);
  color: #000;
  border-radius: 20px;
  padding: 1px 9px;
  font-size: 0.7rem;
  font-weight: 800;
}
.publish-img-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 64px;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.publish-img-empty {
  font-size: 0.74rem;
  color: var(--text-muted);
  align-self: center;
  text-align: center;
  width: 100%;
}
.publish-thumb {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}
.publish-thumb img { width: 100%; height: 100%; object-fit: cover; }
.publish-thumb-rm {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
}
.pub-daterange { display: flex; gap: 10px; }
.pub-date-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}
.pub-date-field .schedule-input { width: 100%; }
.pub-spread-hint, .pub-date-field span { font-size: 0.7rem; }
.pub-spread-hint { color: var(--text-muted); margin-top: 8px; }
#btn-confirm-publish { margin-top: 18px; }
/* ── CREDIT HISTORY MODAL ── */
.modal-credits-box { width: 520px; }
.credits-summary-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 20px;
}
.credits-stat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 8px; text-align: center;
}
.credits-stat-value { font-size: 1.1rem; font-weight: 800; color: var(--accent); margin-bottom: 2px; }
.credits-stat-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.credits-list {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 12px; height: 300px; overflow-y: auto;
  display: flex; flex-direction: column;
}
.credits-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.8rem;
}
.credit-transaction-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.credit-transaction-item:hover { background: rgba(255,255,255,0.02); }
.ct-meta { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ct-type { font-size: 0.6rem; font-weight: 800; padding: 1px 6px; border-radius: 4px; width: fit-content; }
.ct-type-purchase { background: #00c86422; color: #00c864; }
.ct-type-consumption { background: #55555522; color: #999; }
.ct-type-refund { background: #d4f00022; color: #d4f000; }
.ct-desc { font-size: 0.78rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-date { font-size: 0.65rem; color: var(--text-muted); }
.ct-amount { font-size: 0.9rem; font-weight: 700; font-family: var(--mono); }
.ct-amount.positive { color: #00c864; }
.ct-amount.negative { color: var(--text-dim); }

/* =============================================
   GÉNÉRATEUR D'IDÉES DE PROMPTS — genideas
   ============================================= */
/* ════════════════════════════════════════════════
   REFONTE — Onglet Idées (guidé & simple)
   ════════════════════════════════════════════════ */
#tab-genideas { padding: 28px 24px 80px; overflow-y: auto; height: calc(100vh - 150px); }
.gi-wrap { max-width: 920px; margin: 0 auto; position: relative; }

/* HERO */
.gi-hero {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 28px;
}
.gi-page-title { font-size: 1.7rem; font-weight: 800; margin: 0 0 4px; }
.gi-hero-sub { font-size: .9rem; color: var(--text-muted); margin: 0; }
.gi-quota-bar {
  font-size: .76rem; color: var(--text-dim); background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; white-space: nowrap;
}
.gi-quota-bar strong { color: var(--accent); }

/* STEPS */
.gi-step { margin-bottom: 24px; }
.gi-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.gi-step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #000; font-weight: 800; font-size: .82rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.gi-step-label { font-size: .98rem; font-weight: 700; color: var(--text); }
.gi-step-hint { font-size: .74rem; color: var(--text-muted); margin-left: 4px; }

/* MODE ROW (actor toggle + viral toggle) */
.gi-mode-row { display: flex; flex-wrap: wrap; gap: 8px; }
.gi-mode-btn {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 999px; padding: 9px 18px; font-size: .86rem; cursor: pointer;
  transition: all .15s; font-weight: 500;
}
.gi-mode-btn:hover { color: var(--text); border-color: var(--accent-glow); transform: translateY(-1px); }
.gi-mode-btn.active {
  background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700;
  box-shadow: 0 4px 14px rgba(212,240,0,.25);
}
.gi-mode-btn[data-viral="on"].active { background: #ff6b35; border-color: #ff6b35; color: #fff; box-shadow: 0 4px 14px rgba(255,107,53,.3); }
.gi-mode-btn[data-viral="trend"].active { background: #a855f7; border-color: #a855f7; color: #fff; box-shadow: 0 4px 14px rgba(168,85,247,.3); }

/* VIRAL BADGE on prompt cards */
.gi-viral-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #ff6b35; color: #fff; font-size: .72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; margin-bottom: 6px;
}
.gi-viral-badge--max { background: linear-gradient(135deg, #ff6b35, #ff2d2d); animation: gi-pulse 1.5s infinite; }
@keyframes gi-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,107,53,.4); } 50% { box-shadow: 0 0 0 8px rgba(255,107,53,0); } }

/* HASHTAGS & HOOK */
.gi-prompt-meta { font-size: .78rem; color: var(--text-dim); margin-top: 8px; line-height: 1.6; }
.gi-prompt-meta strong { color: var(--accent); }
.gi-prompt-hook { font-style: italic; color: var(--text); margin-top: 4px; font-size: .82rem; }
.gi-prompt-ratio { display: inline-block; background: var(--bg-input); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; font-size: .72rem; margin-top: 4px; }
.gi-prompt-recipe { font-size: .72rem; color: #a855f7; font-weight: 600; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }

/* TREND LOADING */
.gi-trend-loading { text-align: center; padding: 32px; color: var(--text-dim); }
.gi-trend-loading .gi-spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: #a855f7; border-radius: 50%; animation: gi-spin .6s linear infinite; }
@keyframes gi-spin { to { transform: rotate(360deg); } }

/* THEME CHIPS — gros & tappables */
.gi-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gi-chip {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 999px; padding: 9px 18px; font-size: .86rem; cursor: pointer;
  transition: all .15s; font-weight: 500;
}
.gi-chip:hover { color: var(--text); border-color: var(--accent-glow); transform: translateY(-1px); }
.gi-chip.active {
  background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700;
  box-shadow: 0 4px 14px rgba(212,240,0,.25);
}

/* COUNT + GENERATE */
.gi-step--generate .gi-step-head { margin-bottom: 14px; }
.gi-gen-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px;
}
.gi-count-picker { display: flex; align-items: center; gap: 6px; }
.gi-count-quick {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-dim);
  font-size: .92rem; font-weight: 700; cursor: pointer; transition: all .15s;
}
.gi-count-quick:hover { color: var(--text); border-color: var(--accent-glow); }
.gi-count-quick.active { background: var(--accent); color: #000; border-color: var(--accent); }
.gi-count-input {
  width: 64px; height: 42px; text-align: center; border-radius: 11px;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  font-size: .92rem; font-weight: 700;
}
.gi-generate-btn {
  flex: 1; min-width: 220px; height: 50px;
  background: var(--accent); color: #000; border: none; border-radius: 13px;
  font-size: 1rem; font-weight: 800; cursor: pointer; transition: filter .15s, transform .15s;
}
.gi-generate-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.gi-random-btn {
  width: 50px; height: 50px; flex-shrink: 0;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  border-radius: 13px; font-size: 1.4rem; cursor: pointer; transition: all .15s;
}
.gi-random-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.gi-random-rolling { animation: giDice .5s ease; }
@keyframes giDice {
  0% { transform: rotate(0) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}
.gi-random-hint { font-size: .76rem; color: var(--text-muted); margin: 8px 0 0; }

/* Sélecteur d'acteurs par image (1-5) */
.gi-actors-row { margin-top: 10px; }
.gi-actors-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--text); }
.gi-actors-pick { gap: 8px; }
.gi-actor-btn { flex: 0 0 auto; min-width: 48px; padding: 10px 12px; }
.gi-actor-btn[data-actors="auto"] { min-width: 90px; }
.gi-actor-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* RÉSULTATS — grille de cartes */
.gi-results-wrap { margin-bottom: 24px; }
.gi-results {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; min-height: 200px;
}
.gi-results:has(.gi-empty) { display: block; }
.gi-prompt-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; transition: border-color .15s;
}
.gi-prompt-card:hover { border-color: var(--accent-glow); }
.gi-prompt-text {
  font-family: var(--mono); font-size: .82rem; line-height: 1.6; color: var(--text);
  margin: 0 0 14px; flex: 1;
}
.gi-prompt-actions { display: flex; gap: 8px; }
.gi-mini-btn {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 9px; padding: 7px 12px; font-size: .76rem; cursor: pointer;
  transition: all .15s; font-weight: 600;
}
.gi-mini-btn:hover { color: var(--text); border-color: var(--accent-glow); }
.gi-mini-btn:disabled { opacity: .5; cursor: default; }
.gi-mini-btn-accent { background: var(--accent); color: #000; border-color: var(--accent); }
.gi-mini-btn-accent:hover { filter: brightness(1.08); color: #000; }
.gi-mini-btn-danger:hover { color: #ff5a5a; border-color: rgba(255,90,90,.4); }

.gi-empty {
  color: var(--text-muted); font-size: .88rem; text-align: center;
  padding: 48px 10px; line-height: 1.6;
}
.gi-empty-icon { font-size: 2.8rem; margin-bottom: 10px; }

/* =============================================
   STUDIO — presets vidéo & image
   ============================================= */
.pr-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.pr-card {
  text-align: left; cursor: pointer; font: inherit;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.pr-card:hover { border-color: var(--accent-glow); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.pr-card--active { border-color: var(--accent); box-shadow: 0 4px 16px rgba(212,240,0,.22); }
.pr-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.pr-card-emoji { font-size: 1.9rem; line-height: 1; }
.pr-card-tag {
  font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  padding: 3px 9px; border-radius: 999px;
}
.pr-card-tag--video { background: rgba(168,85,247,.16); color: #c98bff; }
.pr-card-tag--image { background: rgba(212,240,0,.14); color: var(--accent); }
.pr-card-title { font-size: 1rem; font-weight: 800; margin: 0; color: var(--text); }
.pr-card-desc { font-size: .8rem; color: var(--text-muted); margin: 0; line-height: 1.5; flex: 1; }
.pr-card-mode {
  margin-top: 8px; align-self: flex-start; font-size: .68rem; font-weight: 600;
  color: var(--text-dim); background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 7px; padding: 3px 9px;
}

/* SORTIE — prompt généré */
.pr-output {
  margin-top: 22px; background: var(--bg-card); border: 1px solid var(--accent-glow);
  border-radius: 16px; padding: 20px;
}
.pr-output.hidden { display: none; }
.pr-out-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.pr-out-title { font-size: 1.1rem; font-weight: 800; margin: 0; color: var(--text); }
.pr-out-mode {
  font-size: .68rem; font-weight: 600; color: var(--text-dim);
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 7px; padding: 3px 9px;
}
.pr-out-note { font-size: .78rem; color: var(--text-muted); margin: 0 0 14px; line-height: 1.5; }
.pr-out-prompt {
  font-family: var(--mono); font-size: .8rem; line-height: 1.65; color: var(--text);
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; margin: 0 0 14px; white-space: pre-wrap; word-break: break-word;
  max-height: 360px; overflow-y: auto;
}

@media (max-width: 560px) {
  .pr-gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .pr-card { padding: 14px; }
}

/* OPTIONS AVANCÉES / SAUVEGARDÉES (collapsibles) */
.gi-advanced {
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--bg-card); margin-bottom: 14px; overflow: hidden;
}
.gi-advanced-summary {
  list-style: none; cursor: pointer; padding: 14px 18px;
  font-size: .9rem; font-weight: 600; color: var(--text-dim);
  display: flex; align-items: center; gap: 8px;
}
.gi-advanced-summary::-webkit-details-marker { display: none; }
.gi-advanced-summary span { color: var(--text-muted); font-weight: 400; font-size: .8rem; }
.gi-advanced[open] .gi-advanced-summary { border-bottom: 1px solid var(--border); }
.gi-advanced-body { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.gi-clear-btn {
  margin-left: auto; background: none; border: none; color: var(--text-muted);
  font-size: .74rem; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.gi-clear-btn:hover { color: #ff5a5a; }

.gi-field { display: flex; flex-direction: column; }
.gi-field .settings-select { margin-bottom: 6px; }
.gi-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px; }
.gi-check { display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--text-dim); cursor: pointer; }
.gi-check input { accent-color: var(--accent); }

.gi-saved-list { display: flex; flex-direction: column; gap: 8px; }
.gi-saved-item {
  display: flex; align-items: flex-start; gap: 10px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
.gi-saved-text { flex: 1; font-family: var(--mono); font-size: .76rem; line-height: 1.5; margin: 0; color: var(--text-dim); }
.gi-saved-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Paywall overlay */
.gi-paywall { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center;
  justify-content: center; background: rgba(0,0,0,.78); backdrop-filter: blur(6px); }
.gi-paywall.hidden { display: none; }
.gi-paywall-box { position: relative; background: #111113; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 28px; max-width: 400px; text-align: center; }
.gi-paywall-box .modal-close { position: absolute; top: 12px; right: 14px; }
.gi-paywall-icon { font-size: 2.4rem; margin-bottom: 8px; }
.gi-paywall-box h2 { font-size: 1.15rem; margin: 0 0 8px; }
.gi-paywall-box p { font-size: .85rem; color: var(--text-dim); line-height: 1.55; margin: 0 0 18px; }
.gi-paywall-actions { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 720px) {
  .gi-results { grid-template-columns: 1fr; }
  .gi-generate-btn { min-width: 100%; }
}

/* ════════════════════════════════════════════════
   REFONTE — Chat bubbles inline (onglet Créer)
   ════════════════════════════════════════════════ */
.chat-results {
  position: absolute;
  inset: 60px 0 200px 0;   /* top: under top-bar, bottom: above FAB */
  z-index: 10;
  overflow-y: auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.chat-results > .chat-bubble { pointer-events: auto; width: 100%; max-width: 760px; }
.chat-results.hidden { display: none; }
/* Bulles inline retirées — l'image générée arrive directement dans le feed History.
   Le DOM reste présent (refs JS : #gen-image-result, #form-view, etc.). */
#chat-results { display: none !important; }

.chat-bubble {
  background: rgba(20, 22, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: all 0.2s ease;
}
.chat-bubble.hidden { display: none; }
.chat-bubble-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
}
.chat-bubble:not(.collapsed) .chat-bubble-header {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
.chat-bubble-icon { font-size: 1.1rem; }
.chat-bubble-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
}
.chat-bubble-summary {
  flex: 1;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-bubble-chevron {
  transition: transform 0.2s ease;
  color: rgba(255, 255, 255, 0.6);
}
.chat-bubble.collapsed .chat-bubble-chevron { transform: rotate(-90deg); }
.chat-bubble-body {
  padding: 14px;
  max-height: 70vh;
  overflow: auto;
}
.chat-bubble.collapsed .chat-bubble-body { display: none; }

/* Step panels inside chat bubbles : neutralize old wizard styles */
.chat-bubble .pipe-step-panel {
  display: block !important;
  padding: 0;
  border: none;
  background: transparent;
}

/* Hide legacy right panel completely if still present */
#pipeline-panel, .floating-json-panel,
.pipe-nav, .pipe-footer { display: none !important; }

/* Drop the old config sidebar styles (defensive) */
.pub-config { display: none !important; }

/* ════════════════════════════════════════════════
   Onglet Diffuser — refonte complète (Hero + KPI + Grid)
   ════════════════════════════════════════════════ */
#tab-publication { padding: 16px; }
.diffuse-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── HERO STATUS ──────────────────────────────── */
.diffuse-hero {
  background: linear-gradient(135deg, rgba(212,240,0,0.04), rgba(212,240,0,0.01));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 18px 22px;
}
.diffuse-hero-disconnected,
.diffuse-hero-connected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.diffuse-hero-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.diffuse-hero-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.diffuse-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.diffuse-hero-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}
.diffuse-hero-sub {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  margin: 0;
}
.diffuse-hero-sub code {
  background: rgba(255,255,255,0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.74rem;
}
.diffuse-hero-username {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}
.diffuse-hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
}
.diffuse-hero-account-type { color: rgba(255,255,255,0.45); }

/* ── KPI STRIP ────────────────────────────────── */
.diffuse-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.diffuse-kpi {
  background: rgba(20,22,28,0.7);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.diffuse-kpi-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.diffuse-kpi-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.diffuse-kpi-val--time { font-size: 1.05rem; }
.diffuse-kpi-sub {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}
.diffuse-kpi--accent {
  border-color: rgba(212,240,0,0.25);
  background: linear-gradient(135deg, rgba(212,240,0,0.06), rgba(20,22,28,0.7));
}
.diffuse-kpi--accent .diffuse-kpi-val { color: var(--accent, #d4f000); }

/* ── COMPOSER puis QUEUE (empilés) ────────────── */
.diffuse-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.diffuse-card {
  background: rgba(20,22,28,0.7);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.diffuse-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.diffuse-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}
.diffuse-card-sub {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.45);
}

.diffuse-cta-publish {
  background: var(--accent, #d4f000);
  color: #0a0a0c;
  border: none;
  padding: 13px 18px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.diffuse-cta-publish:hover { filter: brightness(1.08); transform: translateY(-1px); }
.diffuse-cta-plus { font-size: 1.2rem; line-height: 1; }

.diffuse-queue-section { display: flex; flex-direction: column; gap: 8px; }
.diffuse-section-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  display: flex;
  align-items: center;
  gap: 8px;
}
.diffuse-section-label .history-count {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
}

/* Composer : style des contenus injectés (#diffuser-content) */
.diffuse-card--composer .pipe-step-panel {
  display: block !important;
  padding: 0;
  position: relative;
}

/* ── ÉPURATION : on retire l'aperçu téléphone redondant (déjà géré dans le modal de publication) ── */
.diffuse-card--composer .phone-frame-compact,
.diffuse-card--composer .preview-actions,
.diffuse-card--composer #btn-refresh-preview { display: none !important; }

/* Composer plus aéré et lisible */
.diffuse-card--composer { gap: 12px; }
.diffuse-card--composer .caption-style-pills { gap: 6px; margin-bottom: 2px; }
.diffuse-card--composer .caption-header-actions { gap: 8px; }
.diffuse-card--composer .caption-textarea {
  min-height: 150px;
  border-radius: 12px;
  background: rgba(0,0,0,0.25);
}
.diffuse-card--composer .hashtag-section { margin-top: 2px; }

/* ── SÉLECTION MULTIPLE DANS LA GALERIE (Créer) ── */
.gallery-grid--selecting .gallery-item { cursor: pointer; position: relative; }
.gallery-grid--selecting .gallery-item::after {
  content: "";
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.35);
  z-index: 3;
}
.gallery-item--selected { outline: 3px solid var(--accent, #d4f000); outline-offset: -3px; }
.gallery-item--selected::after {
  content: "✓";
  border-color: var(--accent, #d4f000);
  background: var(--accent, #d4f000);
  color: #0a0a0c;
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.gallery-selbar {
  position: absolute;
  left: 50%; bottom: 120px;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px;
  background: rgba(20,22,28,0.96);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 10px 16px;
  z-index: 40;
  box-shadow: 0 12px 36px rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
}
.gallery-selbar.hidden { display: none; }
.gallery-selbar-count { font-size: 0.84rem; color: rgba(255,255,255,0.8); }
.gallery-selbar-count strong { color: var(--accent, #d4f000); }
.gallery-selbar-actions { display: flex; gap: 8px; align-items: center; }
#gallery-select-toggle.active {
  background: rgba(212,240,0,0.14);
  color: var(--accent, #d4f000);
}

/* ── LISTE « 1 POST = 1 DATE » (modal publication) ── */
.pub-dates-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.publish-dates-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 240px; overflow-y: auto;
  padding-right: 4px;
}
.pub-date-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 6px 8px;
}
.pub-date-idx {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  font-size: 0.72rem; font-weight: 700;
}
.pub-date-thumb {
  width: 38px; height: 38px;
  object-fit: cover; border-radius: 7px; flex-shrink: 0;
}
.pub-date-input { flex: 1; min-width: 0; }

/* ── SETTINGS DRAWER ──────────────────────────── */
.diffuse-settings-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: flex-end;
}
.diffuse-settings-drawer.hidden { display: none; }
.diffuse-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.diffuse-settings-panel {
  position: relative;
  width: min(420px, 100%);
  height: 100%;
  background: #141416;
  border-left: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: drawerSlideIn 0.25s ease;
}
@keyframes drawerSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.diffuse-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-weight: 700;
  color: #fff;
}
.diffuse-settings-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

@media (max-width: 900px) {
  .diffuse-kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .diffuse-grid { grid-template-columns: 1fr; }
  .diffuse-hero-disconnected, .diffuse-hero-connected { flex-direction: column; align-items: stretch; }
  .diffuse-hero-right { width: 100%; }
  .diffuse-hero-right .btn-connect-ig { flex: 1; }
}

/* Anciennes classes obsolètes — neutralisées */
.tab-layout-publication { display: none; }
.pub-connect-panel, .pub-queue-panel, .pub-stats-panel { display: none; }

/* === legacy block kept inert below === */
.tab-layout-publication-legacy {
  display: grid;
  grid-template-columns: 280px minmax(320px, 1fr) minmax(280px, 1fr);
  gap: 16px;
}

/* ════════════════════════════════════════════════
   GALLERY — History des images générées (style Higgsfield)
   ════════════════════════════════════════════════ */
/* Gallery = feed vertical infini, calqué sur la masonry de l'Accueil.
   #gallery-grid = conteneur de scroll à hauteur fixe.
   .gallery-masonry = multi-colonnes en hauteur AUTO (grandit verticalement). */
.gallery-grid {
  position: absolute;
  inset: 56px 0 0 0;
  z-index: 8;
  padding: 8px 24px 240px;   /* bas large : le contenu scrolle sous la FAB */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.gallery-grid.hidden { display: none; }
.gallery-masonry {
  column-count: 4;
  column-gap: 16px;
  width: 100%;
}
@media (max-width: 1200px) { .gallery-masonry { column-count: 3; } }
@media (max-width: 768px)  { .gallery-masonry { column-count: 2; } }
@media (max-width: 480px)  { .gallery-masonry { column-count: 1; } }

.gallery-item {
  break-inside: avoid;
  margin: 0 0 16px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: rgba(20,22,28,0.6);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}
.gallery-item--pending {
  outline: 2px solid var(--accent, #d4f000);
  outline-offset: -2px;
}
.gallery-pending-badge {
  background: var(--accent, #d4f000) !important;
  color: #0a0a0c !important;
  left: auto !important;
  right: 6px;
  top: 6px !important;
}

/* Hover overlay (Analyser / details) */
.gallery-hover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0.15));
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}
.gallery-item:hover .gallery-hover { opacity: 1; pointer-events: auto; }
.gallery-hover-btn {
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.gallery-hover-btn:hover { background: rgba(0,0,0,0.85); transform: scale(1.04); }
.gallery-hover-analyze {
  background: var(--accent, #d4f000);
  color: #0a0a0c;
  border-color: transparent;
}
.gallery-hover-analyze:hover { filter: brightness(1.1); background: var(--accent, #d4f000); }
.gallery-hover-details {
  padding: 8px 10px;
}
.gallery-mock {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.65);
  color: #d4f000;
  padding: 2px 6px;
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
.gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 60px 20px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  width: 100%;
  column-span: all;
}
.gallery-empty span { font-size: 2.4rem; }
.gallery-bg-dimmed { opacity: 0; pointer-events: none; }

/* ── DETAIL MODAL ─────────────────────────────── */
#modal-gallery-detail .modal-backdrop {
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
}
.gallery-detail-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 0;
  max-width: 1280px;
  width: 95vw;
  height: 88vh;
  padding: 0;
  overflow: hidden;
  background: #0e0e10;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  position: relative;
}
.gallery-detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}
.gallery-detail-img-wrap {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gallery-detail-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.gallery-detail-side {
  border-left: 1px solid rgba(255,255,255,0.06);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  background: #141416;
}
.gallery-detail-author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gallery-detail-name {
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
}
.gallery-detail-role {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
}
.gallery-detail-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 2px;
}
.gallery-detail-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.55);
  padding: 10px 6px;
  font-size: 0.82rem;
  cursor: pointer;
  border-radius: 8px;
  position: relative;
}
.gallery-detail-tab.active { color: #fff; background: rgba(255,255,255,0.04); }
.gallery-detail-tab:disabled { opacity: 0.4; cursor: not-allowed; }
.gallery-detail-block {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gallery-detail-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.06em;
}
.gallery-detail-prompt {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
  white-space: pre-wrap;
}
.gallery-detail-prompt-full {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 280px;
  overflow-y: auto;
}
.gallery-detail-prompt-full.hidden { display: none; }
.gallery-detail-prompt--empty {
  color: rgba(255,255,255,0.4);
  font-style: italic;
}
.gallery-detail-analyze-btn {
  background: var(--accent, #d4f000) !important;
  color: #0a0a0c !important;
  border-color: transparent !important;
  font-weight: 700;
}
.gallery-detail-analyze-btn.hidden { display: none; }
#gallery-detail-copy.hidden, #gallery-detail-seeall.hidden { display: none; }
.gallery-detail-seeall {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.76rem;
  text-align: left;
}
.gallery-detail-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
}
.gallery-detail-info-row > span:first-child { color: rgba(255,255,255,0.5); }
.gallery-detail-info-row > span:last-child { color: #fff; font-weight: 600; }

.gallery-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.gallery-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  font-size: 0.84rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}
.gallery-action:hover { background: rgba(255,255,255,0.08); }
.gallery-action:disabled { opacity: 0.5; cursor: not-allowed; }
.gallery-action--analyze {
  background: var(--accent, #d4f000);
  color: #0a0a0c;
  border-color: transparent;
  font-weight: 700;
}
.gallery-action--analyze:hover { filter: brightness(1.1); background: var(--accent, #d4f000); }
.gallery-hover-hint {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 14px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.gallery-action--primary {
  background: var(--accent, #d4f000);
  color: #0a0a0c;
  border-color: transparent;
}
.gallery-action--primary:hover { filter: brightness(1.08); background: var(--accent, #d4f000); }
.gallery-action--icon { padding: 11px; }
.gallery-action--danger:hover { background: rgba(255,80,80,0.15); color: #ff7777; }

@media (max-width: 900px) {
  .gallery-detail-box {
    grid-template-columns: 1fr;
    grid-template-rows: 50vh 1fr;
    height: 95vh;
  }
  .gallery-detail-side { border-left: none; border-top: 1px solid rgba(255,255,255,0.06); }
}
.pub-caption-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pub-caption-panel .pipe-step-panel {
  display: block !important;
  padding: 0;
}
.pub-caption-panel .phone-frame-compact {
  margin: 8px auto 0;
}
.pub-adv-settings summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Modal publish — pills nav */
.pub-modal-steps {
  display: flex;
  gap: 6px;
  padding: 8px 0 14px;
  flex-wrap: wrap;
}
.pub-modal-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  text-decoration: none;
  transition: all 0.15s ease;
}
.pub-modal-step:hover { background: rgba(212, 240, 0, 0.12); color: #fff; }
.pub-modal-step span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(212, 240, 0, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--accent, #d4f000);
}
.pub-modal-section {
  margin-bottom: 16px;
}
.pub-count-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pub-auto-row {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.pub-auto-row .pub-date-field { flex: 1; }

@media (max-width: 1100px) {
  .tab-layout-publication {
    grid-template-columns: 1fr 1fr;
  }
  .pub-connect-panel { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .tab-layout-publication { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════
   Diffuser — hero compact une fois connecté
   (le gros bandeau "message" disparaît / rétrécit)
   ════════════════════════════════════════════════ */
.diffuse-hero:has(#ig-disconnected.hidden) {
  padding: 8px 16px;
  background: rgba(20,22,28,0.5);
}
.diffuse-hero:has(#ig-disconnected.hidden) .ig-avatar-ring {
  width: 34px; height: 34px;
}
.diffuse-hero:has(#ig-disconnected.hidden) .ig-avatar { font-size: 1rem; }
.diffuse-hero:has(#ig-disconnected.hidden) .diffuse-hero-username { font-size: .92rem; }
.diffuse-hero:has(#ig-disconnected.hidden) .diffuse-hero-meta { font-size: .72rem; margin-top: 1px; }
.diffuse-hero:has(#ig-disconnected.hidden) .diffuse-hero-account-type { display: none; }
.diffuse-hero-connected { transition: all .2s ease; }

/* ════════════════════════════════════════════════
   ONGLET PROFIL
   ════════════════════════════════════════════════ */
#tab-profil { padding: 0 0 80px; overflow-y: auto; height: calc(100vh - 150px); }
.profil-wrap { max-width: 980px; margin: 0 auto; }

.profil-cover {
  height: 200px; border-radius: 0 0 18px 18px;
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  background-size: cover; background-position: center;
  position: relative;
}
.profil-cover-edit, .profil-avatar-edit {
  position: absolute; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.25);
  color: #fff; cursor: pointer; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.profil-cover-edit { top: 14px; right: 18px; }
.profil-cover-edit:hover, .profil-avatar-edit:hover { background: var(--accent); color: #000; }

.profil-head {
  display: flex; gap: 24px; padding: 12px 28px 0;
  align-items: flex-end; flex-wrap: wrap;
}
.profil-avatar-wrap { position: relative; flex-shrink: 0; margin-top: -70px; }
.profil-avatar {
  width: 132px; height: 132px; border-radius: 50%;
  background: var(--bg-card) center/cover no-repeat;
  border: 4px solid var(--bg); display: flex; align-items: center;
  justify-content: center; font-size: 3rem;
}
.profil-avatar.has-img { font-size: 0; }
.profil-avatar-edit { bottom: 8px; right: 6px; }

.profil-id { flex: 1; min-width: 240px; padding-bottom: 6px; }
.profil-name-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.profil-username { font-size: 1.5rem; font-weight: 800; margin: 0; }
.profil-stats { display: flex; gap: 20px; margin: 10px 0; font-size: .86rem; color: var(--text-muted); }
.profil-stats strong { color: var(--text); }
.profil-bio { font-size: .9rem; line-height: 1.55; color: var(--text-dim); margin: 6px 0; white-space: pre-wrap; max-width: 560px; }
.profil-bio--empty { color: var(--text-muted); font-style: italic; }
.profil-link { display: inline-block; font-size: .86rem; color: var(--accent); text-decoration: none; margin: 2px 0 8px; }
.profil-link:hover { text-decoration: underline; }
.profil-socials { display: flex; gap: 10px; margin-top: 6px; }
.profil-social {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; text-decoration: none; transition: all .15s;
}
.profil-social:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--accent-dim); }

.profil-feed-tabs {
  display: flex; gap: 4px; margin: 28px 28px 16px;
  border-bottom: 1px solid var(--border);
}
.profil-feed-tab {
  background: none; border: none; color: var(--text-muted);
  padding: 12px 18px; font-size: .9rem; font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent; transition: all .15s;
}
.profil-feed-tab:hover { color: var(--text); }
.profil-feed-tab.active { color: var(--text); border-bottom-color: var(--accent); }

.profil-feed { padding: 0 28px; }
.profil-masonry { column-count: 4; column-gap: 12px; }
.profil-card {
  break-inside: avoid; margin: 0 0 12px; border-radius: 12px;
  overflow: hidden; cursor: pointer; transition: transform .25s, box-shadow .25s;
}
.profil-card img { width: 100%; display: block; }
.profil-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0,0,0,.5); }
.profil-saved-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.profil-saved-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px;
}
.profil-saved-card p { font-family: var(--mono); font-size: .78rem; line-height: 1.55; margin: 0; color: var(--text-dim); }
.profil-feed-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); line-height: 1.6; }
.profil-feed-empty-icon { font-size: 3rem; margin-bottom: 10px; }

.profil-social-inputs { display: flex; flex-direction: column; gap: 8px; }
.profil-social-row { display: flex; align-items: center; gap: 10px; }
.profil-social-ico { width: 22px; text-align: center; font-size: 1rem; flex-shrink: 0; }

@media (max-width: 1100px) { .profil-masonry { column-count: 3; } }
@media (max-width: 760px) {
  .profil-masonry { column-count: 2; }
  .profil-head { padding: 0 16px; }
  .profil-feed-tabs, .profil-feed { margin-left: 16px; margin-right: 16px; padding-left: 0; padding-right: 0; }
  .profil-saved-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════
   NAV VERTICALE À DROITE (override)
   ════════════════════════════════════════════════ */
.tab-nav {
  position: fixed; top: 60px; right: 0; bottom: 0; left: auto;
  flex-direction: column; justify-content: flex-start; align-items: stretch;
  width: 100px; height: auto; gap: 8px;
  padding: 18px 10px;
  border-bottom: none; border-left: 1px solid var(--border);
}
.tab-nav-inner {
  flex-direction: column; width: 100%; height: auto; gap: 8px;
}
.tab-btn {
  flex-direction: column; gap: 7px; min-width: 0; width: 100%;
  padding: 14px 6px; text-align: center;
}
.tab-btn .tab-label { font-size: 0.72rem; }
.tab-btn::after { display: none; }
.tab-btn.active {
  background: var(--accent-dim);
  border-color: var(--border-accent);
}

/* =============================================
   PWA INSTALL BANNER
   ============================================= */
.pwa-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-top: 1px solid var(--border-accent, rgba(212,240,0,.2));
  padding: 14px 16px; box-shadow: 0 -4px 24px rgba(0,0,0,.5);
  animation: pwa-slide-up .4s ease;
}
@keyframes pwa-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.pwa-banner.hidden { display: none; }
.pwa-banner-content {
  display: flex; align-items: center; gap: 12px; max-width: 600px; margin: 0 auto;
}
.pwa-banner-icon { font-size: 2rem; }
.pwa-banner-text { flex: 1; }
.pwa-banner-text strong { display: block; color: #fff; font-size: .95rem; }
.pwa-banner-text span { color: rgba(255,255,255,.6); font-size: .8rem; }
.pwa-install-btn {
  background: var(--accent, #d4f000); color: #000; border: none; border-radius: 999px;
  padding: 10px 22px; font-weight: 700; font-size: .88rem; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.pwa-install-btn:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(212,240,0,.3); }
.pwa-dismiss-btn {
  background: none; border: none; color: rgba(255,255,255,.4); font-size: 1.4rem;
  cursor: pointer; padding: 4px 8px; line-height: 1;
}
.pwa-dismiss-btn:hover { color: #fff; }
.pwa-ios-hint {
  text-align: center; color: rgba(255,255,255,.7); font-size: .82rem;
  padding: 8px 0 0; margin-top: 8px; border-top: 1px solid rgba(255,255,255,.1);
}
.pwa-ios-hint.hidden { display: none; }

/* When running as installed PWA — hide install banner, adjust safe areas */
@media (display-mode: standalone) {
  .pwa-banner { display: none !important; }
  body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
}

.app-root { padding-right: 100px; }
.subtab-nav { top: 60px; }

#tab-analyse.active { height: calc(100vh - 112px); }
#tab-genideas { height: calc(100vh - 78px); }
#tab-profil { height: calc(100vh - 78px); }

@media (max-width: 760px) {
  .tab-nav { width: 66px; padding: 14px 6px; }
  .app-root { padding-right: 66px; }
  .tab-btn { padding: 12px 4px; }
  .tab-btn .tab-label { font-size: 0.6rem; }
}

/* ════════════════════════════════════════════════
   SETTINGS MODAL
   ════════════════════════════════════════════════ */
#modal-settings .modal-box { max-width: 460px; }
.settings-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px;
}
.settings-cell {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 6px; text-align: center;
  display: flex; flex-direction: column; gap: 4px;
}
.settings-cell-val { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.settings-cell-val.is-on  { color: #00c864; }
.settings-cell-val.is-off { color: var(--text-muted); }
.settings-cell-lbl { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.settings-status-row { display: flex; gap: 16px; margin-top: 8px; }
.settings-status { display: flex; align-items: center; gap: 7px; font-size: 0.82rem; color: var(--text-dim); }
#modal-settings .btn-ghost-sm { width: 100%; margin-top: 8px; }
#settings-lang { margin-top: 6px; }

/* ════════════════════════════════════════════════
   REFONTE — Design unifié de toutes les pop-ups
   (override placé en fin de fichier → gagne sur les
    règles existantes par ordre source)
   ════════════════════════════════════════════════ */
.modal {
  animation: modalFadeIn 0.18s ease-out;
}
.modal.hidden { display: none !important; }
.modal-backdrop {
  background: rgba(6, 8, 14, 0.78) !important;
  backdrop-filter: blur(14px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(140%) !important;
}
.modal-box {
  background: linear-gradient(180deg, #16181d 0%, #0f1115 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 18px !important;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 1px 0 rgba(255, 255, 255, 0.05) inset !important;
  padding: 24px 24px 22px !important;
  max-width: 520px;
  width: min(520px, 92vw);
  max-height: 88vh;            /* évite le débordement viewport */
  overflow-y: auto;            /* scroll interne propre */
  animation: modalSlideUp 0.22s cubic-bezier(.2, .8, .2, 1);
  position: relative;
  z-index: 1;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.modal-close:hover {
  background: rgba(255, 80, 80, 0.15);
  color: #ff7777;
  transform: scale(1.06);
}

/* Inputs / selects à l'intérieur des modales : look unifié */
.modal-box .nb-key-input,
.modal-box .schedule-input,
.modal-box .model-select,
.modal-box .caption-textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  transition: border-color 0.15s ease, background 0.15s ease;
  outline: none;
}
.modal-box .nb-key-input:focus,
.modal-box .schedule-input:focus,
.modal-box .model-select:focus,
.modal-box .caption-textarea:focus {
  border-color: rgba(212, 240, 0, 0.45);
  background: rgba(255, 255, 255, 0.05);
}

/* Boutons primaires dans les modales */
.modal-box .btn-primary,
.modal-box .btn-save-full {
  background: var(--accent, #d4f000);
  color: #0a0a0c;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.modal-box .btn-primary:hover,
.modal-box .btn-save-full:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.modal-box .btn-ghost-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.modal-box .btn-ghost-sm:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

/* Labels et help texts cohérents dans les modales */
.modal-box .caption-label,
.modal-box .pipe-field-label,
.modal-box .setting-label {
  display: block;
  margin: 12px 0 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.modal-box .setting-help {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin: 4px 0 8px;
  line-height: 1.45;
}

/* Modales spécifiques larges (publish) */
#modal-publish .modal-box, .modal-publish-box {
  max-width: 640px;
  width: min(640px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
}

/* Paywall genideas — même langage visuel */
.gi-paywall { backdrop-filter: blur(14px) saturate(140%); background: rgba(6, 8, 14, 0.78); }
.gi-paywall-box {
  background: linear-gradient(180deg, #16181d 0%, #0f1115 100%) !important;
  border: 1px solid rgba(212, 240, 0, 0.22) !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55) !important;
  animation: modalSlideUp 0.22s cubic-bezier(.2, .8, .2, 1);
}

/* Drawer Paramètres avancés (Diffuser) — accord */
.diffuse-settings-panel {
  background: linear-gradient(180deg, #16181d 0%, #0f1115 100%) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.55);
}

/* Modal détail gallery — accord avec le reste */
.gallery-detail-box {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* Animations */
@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Scrollbar fine dans les modales */
.modal-box::-webkit-scrollbar,
#modal-publish .modal-box::-webkit-scrollbar { width: 8px; }
.modal-box::-webkit-scrollbar-thumb,
#modal-publish .modal-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}
.modal-box::-webkit-scrollbar-thumb:hover,
#modal-publish .modal-box::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* =============================================
   RÉCOMPENSES / RENDEMENT — dashboard dopamine
   ============================================= */
.dropdown-item-reward { color: var(--accent); font-weight: 600; }

.modal-rewards-box {
  width: 560px; max-width: 96vw;
  max-height: 90vh; overflow-y: auto;
}

/* — Hero statut — */
.rw-hero {
  display: flex; align-items: center; gap: 16px;
  padding: 18px; border-radius: 16px; margin-bottom: 16px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(212,240,0,0.10), transparent 60%),
              linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
}
.rw-tier-badge {
  flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; font-size: 2rem;
  background: rgba(255,255,255,0.05);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06), 0 8px 24px rgba(0,0,0,0.4);
  animation: rwPulse 2.4s ease-in-out infinite;
}
.rw-tier-badge[data-tier="bronze"]  { box-shadow: 0 0 0 3px rgba(205,127,50,0.35), 0 0 26px rgba(205,127,50,0.35); }
.rw-tier-badge[data-tier="silver"]  { box-shadow: 0 0 0 3px rgba(200,200,210,0.40), 0 0 26px rgba(200,200,210,0.35); }
.rw-tier-badge[data-tier="gold"]    { box-shadow: 0 0 0 3px rgba(255,215,0,0.45), 0 0 30px rgba(255,215,0,0.40); }
.rw-tier-badge[data-tier="diamond"] { box-shadow: 0 0 0 3px rgba(107,214,255,0.50), 0 0 34px rgba(107,214,255,0.45); }
@keyframes rwPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.rw-tier-info { flex: 1; min-width: 0; }
.rw-tier-name { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.rw-tier-perk { font-size: 0.78rem; color: var(--text-dim); margin: 2px 0 10px; }
.rw-progress-track {
  height: 8px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden;
}
.rw-progress-fill {
  height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #ff5fa2);
  transition: width 0.9s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 0 12px var(--accent-glow);
}
.rw-progress-label { font-size: 0.74rem; color: var(--text-dim); margin-top: 6px; }
.rw-progress-label strong { color: var(--text); }

/* — KPIs cagnotte — */
.rw-kpis { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.rw-kpi {
  text-align: center; padding: 14px 8px; border-radius: 12px;
  background: var(--bg-input); border: 1px solid var(--border);
}
.rw-kpi-accent {
  background: linear-gradient(135deg, rgba(212,240,0,0.12), rgba(212,240,0,0.02));
  border-color: var(--border-accent);
}
.rw-kpi-value { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.rw-kpi-accent .rw-kpi-value { color: var(--accent); }
.rw-kpi-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 6px; }
.rw-hint { font-size: 0.78rem; color: var(--text-dim); text-align: center; margin: 10px 2px 4px; }
.rw-hint strong { color: var(--accent); }

/* — Cartes — */
.rw-card {
  margin-top: 14px; padding: 16px; border-radius: 14px;
  background: var(--bg-input); border: 1px solid var(--border);
}
.rw-card-head {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 0.9rem; margin-bottom: 8px;
}
.rw-pot { color: var(--accent); font-size: 1.05rem; font-weight: 800; }
.rw-card-sub { font-size: 0.76rem; color: var(--text-dim); line-height: 1.5; margin-bottom: 12px; }

.rw-ref-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.rw-btn {
  flex: 1; padding: 11px 12px; border-radius: 10px; cursor: pointer;
  font-family: var(--font); font-size: 0.82rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.18s; border: 1px solid var(--border);
}
.rw-btn:disabled { opacity: 0.6; cursor: progress; }
.rw-btn-primary { background: var(--accent); color: #000; border-color: transparent; }
.rw-btn-primary:hover { box-shadow: 0 0 18px var(--accent-glow); transform: translateY(-1px); }
.rw-btn-ghost { background: transparent; color: var(--text-dim); }
.rw-btn-ghost:hover { color: var(--text); border-color: var(--border-accent); }
.rw-bonus-chip {
  background: rgba(0,0,0,0.18); color: #000; font-size: 0.68rem; font-weight: 800;
  padding: 2px 7px; border-radius: 99px;
}
.rw-ref-link { display: flex; gap: 8px; }
.rw-ref-link input { flex: 1; font-size: 0.74rem; }

/* — Prix par modèle — */
.rw-model-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 4px; border-bottom: 1px solid var(--border);
}
.rw-model-row:last-child { border-bottom: none; }
.rw-model-name { font-size: 0.86rem; font-weight: 600; }
.rw-model-price { display: flex; align-items: baseline; gap: 8px; font-size: 0.9rem; }
.rw-model-price strong { color: var(--accent); font-size: 1.05rem; }
.rw-model-eur { font-size: 0.72rem; color: var(--text-muted); }

/* — Historique bonus — */
.rw-hist-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 0.78rem;
}
.rw-hist-row:last-child { border-bottom: none; }
.rw-hist-when { color: var(--text-dim); }
.rw-hist-detail { color: var(--text-muted); font-size: 0.72rem; }
.rw-hist-credits { color: var(--accent); font-weight: 800; }
.rw-empty { font-size: 0.8rem; color: var(--text-muted); text-align: center; padding: 14px 0; }

/* — Confetti — */
.rw-confetti {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  border-radius: 16px; z-index: 5;
}
.rw-confetti i {
  position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px;
  animation: rwFall 1.8s cubic-bezier(.2,.6,.4,1) forwards;
}
@keyframes rwFall {
  0%   { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(115%) rotate(540deg); opacity: 0; }
}

/* — Mobile — */
@media (max-width: 600px) {
  .modal-rewards-box { width: 100%; max-width: 100vw; padding: 18px 14px; border-radius: 16px 16px 0 0; max-height: 94vh; }
  .rw-hero { flex-direction: row; padding: 14px; gap: 12px; }
  .rw-tier-badge { width: 54px; height: 54px; font-size: 1.7rem; }
  .rw-tier-name { font-size: 1.1rem; }
  .rw-kpis { gap: 8px; }
  .rw-kpi-value { font-size: 1.25rem; }
  .rw-kpi-label { font-size: 0.62rem; }
  .rw-ref-actions { flex-direction: column; }
  .rw-btn { width: 100%; }
  .rw-hist-row { grid-template-columns: 1fr auto; }
  .rw-hist-detail { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .rw-tier-badge { animation: none; }
  .rw-confetti { display: none; }
}

/* =============================================
   FEED COMMUNAUTÉ — publier + rangée Accueil
   ============================================= */
/* Bloc "Rendre public" dans le détail galerie */
.gd-feed {
  margin: 12px 0 4px; padding: 12px 14px; border-radius: 12px;
  background: var(--bg-input); border: 1px solid var(--border);
}
.gd-feed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gd-feed-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.gd-feed-toggle input { display: none; }
.gd-feed-switch {
  width: 40px; height: 22px; border-radius: 99px; background: rgba(255,255,255,0.14);
  position: relative; transition: background .2s; flex: 0 0 auto;
}
.gd-feed-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .2s;
}
.gd-feed-toggle input:checked + .gd-feed-switch { background: var(--accent); }
.gd-feed-toggle input:checked + .gd-feed-switch::after { transform: translateX(18px); }
.gd-feed-toggle-label { font-size: .85rem; font-weight: 600; }
.gd-feed-status { font-size: .76rem; color: var(--accent); font-weight: 600; }
.gd-feed-link { margin-top: 10px; width: 100%; font-size: .8rem; }
.gd-feed-btn { margin-top: 10px; width: 100%; }

/* Rangée Communauté (Accueil) */
.netflix-community { margin-bottom: 18px; }
.nfc-feed { position: relative; overflow: hidden; }
.nfc-feed img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nfc-overlay {
  position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 8px;
  padding: 10px; opacity: 0; transition: opacity .2s;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent 55%);
}
.nfc-feed:hover .nfc-overlay { opacity: 1; }
@media (hover: none) { .nfc-overlay { opacity: 1; } }
.nfc-like, .nfc-report, .nfc-link {
  border: none; cursor: pointer; border-radius: 99px; font-family: var(--font);
  font-size: .8rem; font-weight: 700; padding: 6px 10px;
  background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(6px);
  display: inline-flex; align-items: center; gap: 4px; text-decoration: none;
  transition: transform .15s, background .15s;
}
.nfc-like:hover, .nfc-report:hover, .nfc-link:hover { background: rgba(0,0,0,.8); }
.nfc-liked { background: rgba(255,60,120,.85); }
.nfc-like-pop { transform: scale(1.25); }
.nfc-report { margin-left: auto; }

@media (max-width: 600px) {
  .gd-feed { padding: 10px; }
  .gd-feed-toggle-label { font-size: .8rem; }
  .nfc-overlay { opacity: 1; padding: 8px; }
  .nfc-like, .nfc-report, .nfc-link { font-size: .72rem; padding: 5px 8px; }
}

/* =============================================
   DIFFUSER — refonte multi-réseaux
   ============================================= */
.diffuse-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.diffuse-top-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.diffuse-top-sub { font-size: 0.85rem; color: var(--text-dim); margin-top: 2px; }

.diffuse-step { margin-bottom: 22px; }
.diffuse-step-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 1rem; font-weight: 700; margin: 6px 0 12px;
}
.diffuse-step-num {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 0.8rem; font-weight: 800;
  background: var(--accent); color: #000;
}
.diffuse-step-hint { font-size: 0.76rem; color: var(--text-muted); margin-top: 10px; }

/* Grille des réseaux */
.net-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
}
.net-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 12px; text-align: center; transition: transform .15s, border-color .15s;
}
.net-card:hover { transform: translateY(-2px); border-color: var(--border-accent); }
.net-card-inner { display: flex; flex-direction: column; align-items: center; }
.net-ic {
  width: 46px; height: 46px; border-radius: 12px; margin: 0 auto 10px;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.2rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.net-name {
  font-size: 0.9rem; font-weight: 700; margin-bottom: 4px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.net-status { font-size: 0.72rem; margin-bottom: 12px; }
.net-status--on   { color: var(--accent); font-weight: 700; }
.net-status--ready{ color: #5fd0ff; }
.net-status--off  { color: var(--text-muted); }
.net-connect {
  width: 100%; padding: 8px 10px; border-radius: 9px; cursor: pointer;
  font-family: var(--font); font-size: 0.8rem; font-weight: 700;
  background: var(--accent); color: #000; border: 1px solid transparent; transition: all .15s;
}
.net-connect:hover { box-shadow: 0 0 14px var(--accent-glow); }
.net-connect--ghost { background: transparent; color: var(--text-dim); border-color: var(--border); }
.net-connect--ghost:hover { color: var(--text); border-color: var(--border-accent); box-shadow: none; }

@media (max-width: 600px) {
  .diffuse-top-title { font-size: 1.2rem; }
  .net-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .net-ic { width: 40px; height: 40px; }
}

/* — API développeur (modale Récompenses) — */
.rw-api-doc { font-size: .76rem; color: var(--accent); text-decoration: none; }
.rw-api-doc:hover { text-decoration: underline; }
.rw-api-list { margin-bottom: 10px; }
.rw-api-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 4px;
  border-bottom: 1px solid var(--border); font-size: .8rem;
}
.rw-api-row:last-child { border-bottom: none; }
.rw-api-key { font-family: var(--mono); color: var(--text); }
.rw-api-name { color: var(--text-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw-api-revoke { background: none; border: 1px solid var(--border); color: var(--text-dim); border-radius: 7px; padding: 4px 9px; font-size: .72rem; cursor: pointer; }
.rw-api-revoke:hover { color: #ff6b6b; border-color: rgba(255,107,107,.5); }
.rw-api-revoked { opacity: .5; }
.rw-api-off { font-size: .72rem; color: var(--text-muted); }
.rw-api-reveal {
  background: rgba(212,240,0,.08); border: 1px solid var(--border-accent);
  border-radius: 10px; padding: 12px; margin-bottom: 12px;
}
.rw-api-reveal-head { font-size: .76rem; color: var(--accent); margin-bottom: 8px; }
.rw-api-reveal-key {
  font-family: var(--mono); font-size: .82rem; word-break: break-all; color: #fff;
  background: rgba(0,0,0,.35); padding: 8px 10px; border-radius: 8px; margin-bottom: 8px;
}

/* =============================================
   COUCHE SOCIALE — commentaires, profil, amis
   ============================================= */
.nfc-comments {
  background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(6px);
  border-radius: 99px; font-size: .8rem; font-weight: 700; padding: 6px 10px;
  display: inline-flex; align-items: center; gap: 4px;
}

/* Commentaires dans le viewer */
#nb-comments { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.nb-c-row { display: flex; gap: 10px; align-items: flex-start; }
.nb-c-av {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; cursor: pointer;
  display: grid; place-items: center; background: rgba(255,255,255,.08); font-size: 14px;
}
.nb-c-txt { font-size: .9rem; color: #e5e5e5; line-height: 1.4; }
.nb-c-name { font-weight: 700; color: #fff; margin-right: 4px; cursor: pointer; }
.nb-c-name:hover { color: var(--accent); }
.nb-c-empty { font-size: .85rem; color: var(--text-muted); }

/* Modale profil */
.modal-profile-box { width: 560px; max-width: 96vw; max-height: 90vh; overflow-y: auto; }
.pf-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.pf-avatar {
  width: 72px; height: 72px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 2.2rem;
  background: linear-gradient(135deg, rgba(212,240,0,.15), rgba(255,255,255,.03));
  box-shadow: 0 0 0 3px rgba(212,240,0,.25);
}
.pf-id { min-width: 0; }
.pf-name-row { display: flex; align-items: baseline; gap: 8px; }
.pf-name { font-size: 1.3rem; font-weight: 800; }
.pf-tier { font-size: .78rem; color: var(--accent); text-transform: capitalize; }
.pf-handle { font-size: .85rem; color: var(--text-dim); margin: 2px 0 6px; }
.pf-bio { font-size: .86rem; color: #d0d0d0; margin: 0; }
.pf-section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 18px 0 10px; }
.pf-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.pf-posts .nfc-feed { aspect-ratio: 1; height: auto; border-radius: 8px; }
.pf-posts .nfc-feed img { width: 100%; height: 100%; object-fit: cover; }
.pf-requests { margin: 12px 0; }
.pf-req-title { font-size: .8rem; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.pf-req-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: .85rem; border-bottom: 1px solid var(--border); }
.pf-req-row .rw-btn { width: auto; padding: 5px 10px; font-size: .76rem; margin-left: 6px; }
#modal-profile .rw-btn-primary, #modal-profile .rw-btn-ghost { width: 100%; margin-bottom: 8px; }

@media (max-width: 600px) {
  .modal-profile-box { width: 100%; max-width: 100vw; border-radius: 16px 16px 0 0; }
  .pf-posts { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
}
