:root {
  --bg: #0F0F0F;
  --surface: #1A1A1A;
  --surface2: #222;
  --border: #2E2E2E;
  --text: #F2F2F2;
  --muted: #777;
  --gold: #F4B942;
  --gold-hover: #F7CB6A;
  --radius: 12px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Header ─────────────────────────────────────────── */
header {
  text-align: center;
  margin-bottom: 52px;
  position: relative;
}

.header-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 8px;
}

.api-key-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}

.api-key-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: rotate(-8deg);
}

.logo {
  font-family: 'Poppins', sans-serif;
  font-size: 30px;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: -0.5px;
}

.logo span { color: var(--text); }

.tagline {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ── Mode tabs (Carrousel / Reel Cover) ─────────────── */
.mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 32px;
}

.mode-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 12px;
  transition: all 0.15s;
}

.mode-tab.active {
  background: var(--gold);
  color: #0A0A0A;
}

.mode-tab:not(.active):hover {
  color: var(--text);
}

/* ── Input avec bouton d'action (Pioche) ────────────── */
.input-with-action {
  display: flex;
  gap: 8px;
}

.input-with-action input {
  flex: 1;
}

.pioche-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--gold);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 0 18px;
  transition: all 0.18s;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.pioche-btn:hover {
  border-color: var(--gold);
  background: rgba(244,185,66,0.10);
  transform: translateY(-1px);
}

.pioche-btn:active { transform: translateY(0); }

/* ── Image source tabs (Upload / fal AI) ────────────── */
.img-source-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  padding: 4px;
  border-radius: 8px;
}

.img-src-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 10px;
  transition: all 0.15s;
}

.img-src-tab.active {
  background: var(--gold);
  color: #0A0A0A;
}

.img-src-tab:not(.active):hover { color: var(--text); }

textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
  min-height: 80px;
}

textarea:focus { border-color: var(--gold); }
textarea::placeholder { color: var(--muted); }

/* ── Reel Cover specific ────────────────────────────── */
.checkbox-label {
  color: var(--text);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  letter-spacing: 0.3px;
  line-height: 1.45;
}

.checkbox-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin: 0;
  border: 2px solid var(--border);
  border-radius: 7px;
  background: var(--surface2);
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s;
}

.checkbox-label input[type="checkbox"]:checked {
  background: var(--gold);
  border-color: var(--gold);
}

/* Coche noire dessinée quand la case est active */
.checkbox-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 3px;
  width: 7px;
  height: 13px;
  border: solid #000;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.checkbox-text { flex: 1; }

.fal-cover-hint {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
  letter-spacing: 0.2px;
}

input[type="file"] {
  background: var(--surface2) !important;
  color: var(--muted);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  background: var(--gold);
  border: none;
  border-radius: 6px;
  color: #0A0A0A;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  margin-right: 12px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.15s;
}

input[type="file"]::file-selector-button:hover {
  background: var(--gold-hover);
}

.reel-output-section {
  margin-top: 56px;
}

.reel-preview-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

.reel-preview-wrapper canvas {
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55);
  display: block;
}

/* ── Form ───────────────────────────────────────────── */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 780px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 32px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.form-group input,
.form-group select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--gold);
}

.form-group input::placeholder { color: var(--muted); }
.form-group select option { background: var(--surface2); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

/* ── Style picker ───────────────────────────────────── */
.style-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.style-btn {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 16px 12px 14px;
  text-align: center;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.style-btn:hover { border-color: var(--gold); color: var(--text); }

.style-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(244,185,66,0.07);
}

.style-preview {
  width: 52px;
  height: 65px;
  border-radius: 5px;
  display: block;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

/* Dark style preview */
.dark-preview {
  background: #0A0A0A;
  border: 1px solid #333;
}
.dark-preview::after {
  content: '⚡';
  position: absolute;
  top: 6px; right: 6px;
  font-size: 12px;
  color: #F4B942;
}

/* Crème style preview */
.creme-preview {
  background: #F5F1EA;
}
.creme-preview::before {
  content: '';
  position: absolute;
  top: 14px; left: 8px; right: 8px;
  height: 5px;
  background: #F4B942;
  border-radius: 2px;
}
.creme-preview::after {
  content: '';
  position: absolute;
  top: 26px; left: 8px; right: 20px;
  height: 4px;
  background: #ccc;
  border-radius: 2px;
}

/* Help text under style picker */
.style-hint {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.3px;
  margin-top: 10px;
  text-align: center;
  line-height: 1.5;
}

/* (slide-count-picker replaced by native select #slideCount) */

/* ── Generate button ────────────────────────────────── */
.generate-btn {
  width: 100%;
  background: var(--gold);
  border: none;
  border-radius: 10px;
  color: #000;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 18px;
  text-transform: uppercase;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.generate-btn:hover { background: var(--gold-hover); transform: translateY(-1px); }
.generate-btn:active { transform: translateY(0); }
.btn-icon { font-size: 18px; }

/* ── Output ─────────────────────────────────────────── */
.output-section { margin-top: 56px; }

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.output-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.download-btn {
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: var(--gold);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  transition: all 0.18s;
}

.download-btn:hover { background: var(--gold); color: #000; }

.output-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.repost-btn {
  border-color: #5B9BD5 !important;
  color: #5B9BD5 !important;
}

.repost-btn:hover {
  background: #5B9BD5 !important;
  color: #fff !important;
}

/* ── Slides horizontal scroll ───────────────────────── */
.slides-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 8px 0 20px;
  scrollbar-color: var(--gold) var(--surface);
  scrollbar-width: thin;
}

.slides-scroll::-webkit-scrollbar { height: 5px; }
.slides-scroll::-webkit-scrollbar-track { background: var(--surface); border-radius: 3px; }
.slides-scroll::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

.slide-wrapper {
  flex-shrink: 0;
  width: 270px;
}

.slide-wrapper canvas {
  border-radius: 8px;
  display: block;
  cursor: text;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.slide-wrapper:not(.editing) canvas:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.slide-wrapper.editing canvas {
  outline: 2px solid #4A90D9;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(74,144,217,0.18);
}

.slide-label {
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 8px;
}

/* ── Per-slide buttons ──────────────────────────────── */
.slide-buttons {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.slide-btn {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  padding: 6px 4px;
  text-align: center;
  transition: all 0.15s;
  white-space: nowrap;
}

.slide-btn:hover {
  border-color: var(--gold);
  color: var(--text);
  background: rgba(212,175,55,0.07);
}

/* ── Inline edit panel ──────────────────────────────── */
.edit-panel {
  display: none;
  background: var(--surface);
  border: 1px solid #4A90D9;
  border-radius: 8px;
  margin-top: 10px;
  padding: 14px;
  width: 270px;
}

.edit-group {
  margin-bottom: 10px;
}

.edit-group label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #4A90D9;
  margin-bottom: 5px;
}

.edit-content {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  min-height: 42px;
  outline: none;
  padding: 8px 10px;
  transition: border-color 0.15s;
  cursor: text;
  white-space: pre-wrap;
  word-break: break-word;
  /* textarea-specific */
  width: 100%;
  resize: none;
  overflow: hidden; /* auto-resize via JS */
  box-sizing: border-box;
}

.edit-content:focus {
  border-color: #4A90D9;
  background: #1e2730;
}

/* Keyboard hint under edit panel */
.edit-kbd-hint {
  color: #555;
  font-size: 10px;
  letter-spacing: 0.3px;
  margin-top: 6px;
  text-align: right;
}

.edit-close-btn {
  width: 100%;
  background: #4A90D9;
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 8px;
  text-transform: uppercase;
  transition: background 0.15s;
  margin-top: 4px;
}

.edit-close-btn:hover { background: #357ABD; }

/* ── Caption & Hashtags ─────────────────────────────── */
.caption-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 28px;
}

.caption-block,
.hashtags-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.caption-block h3,
.hashtags-block h3 {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.caption-text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.hashtags-text {
  color: #5B9BD5;
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Loading overlay ────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(6px);
}

.loading-content { text-align: center; }

.loading-icon {
  display: block;
  font-size: 72px;
  animation: bolt-pulse 0.7s ease-in-out infinite alternate;
}

@keyframes bolt-pulse {
  from { transform: scale(0.9) rotate(-5deg); opacity: 0.7; }
  to   { transform: scale(1.15) rotate(5deg); opacity: 1; }
}

.loading-content p {
  margin-top: 20px;
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* ── API key modal ──────────────────────────────────── */
.api-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  backdrop-filter: blur(6px);
  padding: 20px;
}

.api-modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.api-modal-icon {
  font-size: 36px;
  text-align: center;
  margin-bottom: 14px;
}

.api-modal-title {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  color: var(--text);
}

.api-modal-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 20px;
}

.api-modal-text strong { color: var(--text); }

.api-modal-text code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--gold);
  font-size: 12px;
  padding: 1px 6px;
  font-family: 'IBM Plex Mono', monospace;
}

.api-modal-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s;
  letter-spacing: 0.5px;
}

.api-modal-input:focus { border-color: var(--gold); }

.api-modal-error {
  color: #E85D5D;
  font-size: 12px;
  margin-top: 8px;
  min-height: 16px;
}

.api-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.api-modal-btn-primary {
  flex: 1;
  background: var(--gold);
  border: none;
  border-radius: 8px;
  color: #000;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 12px;
  text-transform: uppercase;
  transition: background 0.18s;
}

.api-modal-btn-primary:hover { background: var(--gold-hover); }

.api-modal-btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 12px 14px;
  transition: all 0.18s;
}

.api-modal-btn-ghost:hover { border-color: #E85D5D; color: #E85D5D; }

.api-modal-link {
  display: block;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  margin-top: 18px;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: color 0.15s;
}

.api-modal-link:hover { color: var(--gold); }

/* ── Test grille (Instagram grid preview) ───────────── */
.grid-test-section {
  margin-top: 32px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.grid-test-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.grid-test-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.grid-test-sub {
  font-size: 12px;
  color: var(--muted);
  max-width: 380px;
}

.grid-test-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grid-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.grid-mini-btn:hover { border-color: var(--gold); color: var(--gold); }
.grid-mini-btn-danger:hover { border-color: #d9534f; color: #d9534f; }

/* Grille IG : 3 colonnes, tuiles portrait 4:5 (format cover) */
.ig-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  max-width: 420px;
  margin: 0 auto;
  background: #000;
  padding: 4px;
  border-radius: 6px;
}

.ig-cell {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #0A0A0A;
}

.ig-cell canvas,
.ig-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ig-cell-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 22px;
  border: 1px dashed #2A2A2A;
}

.ig-cell-current::after {
  content: 'ACTUELLE';
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--gold);
  color: #000;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 5px;
  border-radius: 3px;
}

.ig-cell-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
}
.ig-cell:hover .ig-cell-remove { opacity: 1; }
.ig-cell-remove:hover { background: #d9534f; }

.grid-test-hint {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 16px;
}

/* ── Plan de reel (voix-off + Higgsfield) ───────────── */
.reelplan-section { margin-top: 56px; }

.reelplan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: baseline;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.reelplan-meta .rp-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.reelplan-meta .rp-music {
  font-size: 13px;
  color: var(--muted);
}
.reelplan-meta .rp-music strong { color: var(--gold); font-weight: 600; }

.reelplan-shots {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rp-shot {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.rp-shot-num {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.rp-shot-num .rp-n {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: #000;
  font-weight: 700; font-size: 15px;
  border-radius: 8px;
}
.rp-shot-num .rp-dur {
  font-size: 11px; color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
}
.rp-shot-body { min-width: 0; }

.rp-vo {
  font-size: 15px; color: var(--text); line-height: 1.5;
  margin-bottom: 8px;
}
.rp-vo::before {
  content: '🎙 VOIX-OFF';
  display: block;
  font-size: 9px; letter-spacing: 2px; font-weight: 700;
  color: var(--muted); margin-bottom: 4px;
}
.rp-overlay {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  color: var(--gold);
  border: 1px solid rgba(244,185,66,0.4);
  border-radius: 6px;
  padding: 3px 9px;
  margin-bottom: 10px;
}
.rp-hf {
  position: relative;
  background: #111;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 40px 10px 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: #bdbdbd;
  line-height: 1.5;
  word-break: break-word;
}
.rp-hf::before {
  content: '🎬 HIGGSFIELD';
  display: block;
  font-size: 9px; letter-spacing: 2px; font-weight: 700;
  color: #5a7fa0; margin-bottom: 5px; font-family: 'Inter', sans-serif;
}
.rp-hf-copy {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.rp-hf-copy:hover { border-color: var(--gold); color: var(--gold); }
.rp-hf-copy.copied { border-color: var(--gold); color: var(--gold); }

/* ── Winners Loop ───────────────────────────────────── */
.winners-section { margin-top: 56px; }
.winners-from {
  font-size: 13px; color: var(--muted); margin-bottom: 20px;
}
.winners-from strong { color: var(--gold); font-weight: 600; }
.winners-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.winner-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.winner-tag {
  align-self: flex-start;
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 10px; border-radius: 6px;
  background: rgba(244,185,66,.14); color: var(--gold);
  border: 1px solid rgba(244,185,66,.4);
  margin-bottom: 12px;
}
.winner-card .wc-serie {
  font-size: 12px; color: var(--gold); font-weight: 600; margin-bottom: 6px;
}
.winner-sujet {
  font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.4;
  margin-bottom: 10px;
}
.winner-why {
  font-size: 13px; color: var(--muted); line-height: 1.5; flex: 1;
  margin-bottom: 14px;
}
.winner-format {
  font-size: 11px; color: var(--muted); font-family: 'IBM Plex Mono', monospace;
  margin-bottom: 14px;
}
.winner-go {
  font-size: 13px; font-weight: 600;
  padding: 9px 14px; border-radius: 8px;
  border: 1px solid var(--gold); background: transparent; color: var(--gold);
  cursor: pointer; transition: background .15s, color .15s;
}
.winner-go:hover { background: var(--gold); color: #000; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 680px) {
  .form-section { padding: 28px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .style-picker { grid-template-columns: repeat(2, 1fr); }
  .caption-section { grid-template-columns: 1fr; }
  .grid-test-header { flex-direction: column; }
  .rp-shot { grid-template-columns: 1fr; }
  .winners-cards { grid-template-columns: 1fr; }
}

/* ── Mobile (téléphone) ─────────────────────────────── */
@media (max-width: 480px) {
  body { padding: 16px 12px; }
  header { margin-bottom: 32px; }
  /* Boutons clé/fal sur leur propre ligne pour ne plus chevaucher le logo */
  .header-actions { position: static; justify-content: flex-end; margin-bottom: 14px; }
  .logo { font-size: 23px; }
  .tagline { font-size: 10px; letter-spacing: 2px; }
  /* Onglets : scroll horizontal propre plutôt que retour à la ligne */
  .mode-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .mode-tabs::-webkit-scrollbar { display: none; }
  .mode-tab { flex: 0 0 auto; white-space: nowrap; }
  /* En-têtes de sortie : titre au-dessus des boutons */
  .output-header { flex-direction: column; align-items: stretch; gap: 12px; }
  .output-actions { flex-wrap: wrap; }
  .output-actions .download-btn { flex: 1 1 auto; }
}
