/* ==========================================================================
   Karaoke Studio — feuille de styles
   Design éditorial sombre + accent lime. Vanilla, zéro dépendance.
   Fonts chargées par index.html (Sora, Montserrat, Anton, Bebas Neue,
   JetBrains Mono). Aucune valeur magique : tout passe par :root.
   ========================================================================== */

:root {
  /* ---- Surfaces ---- */
  --bg:             #0a0a0c;
  --panel:          #131316;
  --card:           #131316;
  --template-card:  #0e0e11;
  --surface:        rgba(255,255,255,.025);
  --surface-faint:  rgba(255,255,255,.015);
  --toast-bg:       #1a1a1f;

  /* ---- Accent (lime) ---- */
  --accent:         #c2f73f;
  --accent-2:       #aee636;
  --accent-ink:     #0b0b0d;
  --accent-contrast:#0b0b0d;
  --accent-soft:    rgba(194,247,63,.10);
  --accent-tint:    rgba(194,247,63,.06);
  --accent-glow:    rgba(194,247,63,.22);
  --accent-glow-2:  rgba(194,247,63,.40);

  /* ---- Texte ---- */
  --text:           #f4f3f0;
  --text-2:         #cdcdd2;
  --text-3:         #9a9aa3;
  --label:          #7a7a82;
  --faint:          #75757d;
  --faint-2:         #75757d;

  /* ---- Bordures ---- */
  --bd-05:  rgba(255,255,255,.05);
  --bd-06:  rgba(255,255,255,.06);
  --bd-07:  rgba(255,255,255,.07);
  --bd-10:  rgba(255,255,255,.10);
  --bd-12:  rgba(255,255,255,.12);
  --bd-13:  rgba(255,255,255,.13);
  --bd-14:  rgba(255,255,255,.14);
  --bd-15:  rgba(255,255,255,.15);
  --bd-22:  rgba(255,255,255,.22);

  /* ---- Remplissages / survols ---- */
  --fill-01: rgba(255,255,255,.01);
  --fill-02: rgba(255,255,255,.02);
  --fill-03: rgba(255,255,255,.03);
  --fill-04: rgba(255,255,255,.04);
  --fill-05: rgba(255,255,255,.05);
  --fill-06: rgba(255,255,255,.06);
  --fill-07: rgba(255,255,255,.07);
  --fill-08: rgba(255,255,255,.08);
  --fill-10: rgba(255,255,255,.10);

  /* ---- Statuts ---- */
  --st-uploaded:    #9a9aa3;
  --st-transcribing:#6fd7e0;
  --st-ready:       var(--accent);
  --st-rendering:   #e6b15a;
  --st-done:        #54e08a;
  --st-error:       #ef6f6f;

  /* ---- Rayons ---- */
  --r-panel:    14px;
  --r-card:     12px;
  --r-template: 11px;
  --r-btn:      10px;
  --r-btn-sm:   9px;
  --r-pill:     7px;
  --r-chip:     6px;
  --r-sm:       5px;
  --r-switch:   13px;

  /* ---- Ombres ---- */
  --shadow-lime:  0 6px 20px var(--accent-glow);
  --shadow-card:  0 14px 50px rgba(0,0,0,.55), inset 0 0 130px rgba(0,0,0,.6);
  --shadow-pop:   0 12px 40px rgba(0,0,0,.5);
  --glow-lime:    0 0 20px var(--accent-glow-2);

  /* ---- Typographie ---- */
  --font-ui:      'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-sample:  'Montserrat', system-ui, sans-serif;
  --font-display: 'Anton', 'Bebas Neue', system-ui, sans-serif;

  /* ---- Mouvement ---- */
  --t-fast: .15s;
  --t-mid:  .25s;
  --ease:   cubic-bezier(.4, 0, .2, 1);

  /* ---- Mesures ---- */
  --topbar-h:  60px;
  --col-queue: 312px;
  --col-style: 360px;
  --gap:       12px;

  /* ---- Scale d'espacement ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }
html { scroll-behavior: smooth; }

body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---- Scrollbars ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--bd-10);
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--bd-22); }
* { scrollbar-width: thin; scrollbar-color: var(--bd-10) transparent; }

/* ---- Utilitaires ---- */
.hidden { display: none !important; }
.mono   { font-family: var(--font-mono); }
.muted  { color: var(--faint-2); }

/* ---- SVG sprite + icônes ---- */
.ks-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico       { width: 18px; height: 18px; display: inline-block; flex-shrink: 0; }
.ico-sm    { width: 15px; height: 15px; }
.ico-lg    { width: 28px; height: 28px; }

.access-gate {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 10, 12, .92);
  backdrop-filter: blur(10px);
}
.access-card {
  width: min(100%, 380px);
  display: grid;
  gap: 14px;
  padding: 30px;
  border: 1px solid var(--bd-14);
  border-radius: var(--r-panel);
  background: var(--panel);
  box-shadow: var(--shadow-card);
}
.access-mark { color: var(--accent); font-size: 24px; line-height: 1; }
.access-card h1 { font-size: 22px; }
.access-card p { color: var(--text-3); font-size: 13px; }
.access-card label { color: var(--label); font-size: 12px; font-weight: 600; }
.access-card input {
  width: 100%; padding: 11px 12px; color: var(--text); background: var(--bg);
  border: 1px solid var(--bd-12); border-radius: var(--r-btn); font: inherit;
}
.access-error { color: var(--st-error) !important; }
.batch-toolbar {
  display: flex; align-items: center; gap: 7px; margin: 0 0 10px;
  padding: 8px; border: 1px solid var(--bd-10); border-radius: var(--r-btn);
  background: var(--accent-tint);
}
.batch-toolbar .mono { flex: 1; font-size: 10px; color: var(--text-2); }
.job-card { position: relative; }
.batch-select { position: absolute; z-index: 3; top: 8px; right: 8px; }
.batch-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.preset-card { min-height: 62px; padding: 9px; text-align: left; border: 1px solid var(--bd-10); border-radius: var(--r-btn); background: var(--surface-faint); color: var(--text); cursor: pointer; font-size: 11px; font-weight: 600; }
.preset-card:hover { border-color: var(--accent); background: var(--accent-tint); }
.preset-card small { display: block; margin-top: 4px; color: var(--text-3); font-size: 9px; font-weight: 400; }
.style-history-actions { display: flex; gap: 5px; }
.style-save-state { margin-right: 3px; color: var(--faint); font-family: var(--font-mono); font-size: 9px; }
.style-save-state.pending, .style-save-state.saving { color: var(--st-rendering); }
.style-save-state.saved { color: var(--st-done); }
.style-save-state.error { color: var(--st-error); }
.tw-nudge { width: 24px; height: 26px; padding: 0; border: 1px solid var(--bd-10); border-radius: var(--r-sm); background: var(--fill-04); color: var(--text-2); cursor: pointer; }
.tw-nudge:hover { color: var(--accent); border-color: var(--accent); }
.tw-nudge.active { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); }
.workflow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 10px 0; }
.workflow-step { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 7px 8px; border: 1px solid var(--bd-06); border-radius: var(--r-sm); color: var(--faint); font-size: 10px; }
.workflow-step b { display: grid; place-items: center; flex: 0 0 16px; width: 16px; height: 16px; border-radius: 999px; background: var(--fill-08); color: var(--text-3); font-size: 9px; }
.workflow-step.active { color: var(--text); border-color: var(--accent); background: var(--accent-tint); }
.workflow-step.active b, .workflow-step.complete b { background: var(--accent); color: var(--accent-ink); }
.workflow-step.complete { color: var(--text-2); }
@media (max-width: 560px) { .workflow-step { padding: 6px; font-size: 9px; } }
.queue-batches { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--bd-06); }
.batches-list { display: grid; gap: 7px; }
.batch-card { padding: 9px; border: 1px solid var(--bd-06); border-radius: var(--r-btn); background: var(--surface-faint); }
.batch-card > div { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.batch-card .mono { color: var(--accent); font-size: 9px; text-transform: uppercase; }
.batch-card small, .batch-empty { display: block; margin-top: 4px; color: var(--text-3); font-size: 10px; }
.music-tools { display: grid; gap: 10px; }
.music-copy { color: var(--text-3); font-size: 12px; }
.music-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.music-strength { display: grid; gap: 5px; padding: 9px 10px; border: 1px solid var(--bd-06); border-radius: var(--r-btn); background: var(--fill-02); }
.music-strength-help { color: var(--faint); font-size: 10px; }
.publish-tools { display: grid; gap: 14px; }
.publish-step { display: grid; gap: 9px; padding: 12px; border: 1px solid var(--bd-06); border-radius: var(--r-btn); background: var(--fill-02); }
.publish-step-head { display: flex; align-items: flex-start; gap: 10px; }
.step-badge { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-contrast, #000); font-size: 10px; font-weight: 800; }
.step-title { font-weight: 700; font-size: 12px; color: var(--text); }
.step-hint { color: var(--text-3); font-size: 10px; line-height: 1.35; margin-top: 2px; }
.publish-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cover-fields { display: flex; gap: 6px; align-items: stretch; }
.cover-title { flex: 1; min-width: 0; padding: 8px 9px; border: 1px solid var(--bd-10); border-radius: var(--r-sm); background: var(--surface-faint); color: var(--text); font: inherit; font-size: 11px; }
.cover-title::placeholder { color: var(--text-3); opacity: 0.7; }
.cover-preview-wrap { position: relative; border: 1px dashed var(--bd-06); border-radius: var(--r-btn); background: var(--fill-01); overflow: hidden; aspect-ratio: 9/16; max-height: 320px; display: flex; align-items: center; justify-content: center; }
.cover-preview { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.cover-placeholder { padding: 18px; color: var(--text-3); font-size: 11px; text-align: center; }
.cover-actions { display: flex; gap: 6px; }
.hook-suggestions { display: grid; gap: 6px; max-height: 220px; overflow-y: auto; padding-right: 3px; }
.hook-card { display: grid; gap: 4px; width: 100%; padding: 9px; border: 1px solid var(--bd-06); border-radius: var(--r-sm); background: var(--surface-faint); color: var(--text); text-align: left; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }
.hook-card:hover { border-color: var(--accent); background: var(--accent-tint); }
.hook-card.active { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.hook-card b { color: var(--accent); font-family: var(--font-mono); font-size: 9px; display: flex; gap: 6px; align-items: center; }
.hook-card .hook-score { font-weight: 700; padding: 1px 5px; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-contrast, #000); }
.hook-card span { overflow: hidden; color: var(--text-2); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.hook-card .hook-meta { display: flex; gap: 8px; color: var(--text-3); font-size: 9px; }
.selected-hook-info { padding: 8px 10px; border-radius: var(--r-sm); background: var(--accent-tint); color: var(--text); font-size: 11px; }
.selected-hook-info .hook-time { font-family: var(--font-mono); color: var(--accent); font-weight: 700; }
.captions-list { display: grid; gap: 8px; }
.caption-empty { color: var(--text-3); font-size: 11px; padding: 8px 0; }
.caption-card { display: grid; gap: 5px; padding: 9px; border: 1px solid var(--bd-06); border-radius: var(--r-sm); background: var(--surface-faint); }
.caption-card .caption-label { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.03em; }
.caption-card p { margin: 0; color: var(--text-2); font-size: 11px; line-height: 1.4; }
.caption-card .caption-actions { display: flex; gap: 5px; }
.caption-card .caption-actions button { padding: 4px 7px; font-size: 10px; }
.pack-status { padding: 8px 10px; border-radius: var(--r-sm); background: var(--fill-01); color: var(--text-3); font-size: 10px; line-height: 1.4; }
.font-picker { width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid var(--bd-10); border-radius: var(--r-sm); background: var(--fill-02); color: var(--text); font: inherit; font-size: 11px; cursor: pointer; }
.font-picker:focus { outline: none; border-color: var(--accent); }
.font-picker option { background: var(--surface); color: var(--text); }
.font-picker optgroup { background: var(--fill-04); color: var(--text-3); font-weight: 700; }
.color-palettes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.palette-card { display: flex; align-items: center; justify-content: center; padding: 8px 4px; border: 1px solid var(--bd-06); border-radius: var(--r-sm); background: var(--fill-02); color: #fff; font-size: 10px; font-weight: 700; cursor: pointer; text-shadow: 0 1px 3px rgba(0,0,0,.8); transition: border-color 120ms ease, transform 120ms ease; }
.palette-card:hover { border-color: var(--accent); transform: translateY(-1px); color: var(--text); }
.palette-card.active { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 1px var(--accent); color: var(--text); font-weight: 800; }
.preview-live-caption { position: absolute; z-index: 5; left: 6%; right: 6%; bottom: 12%; color: #fff; font-weight: 800; font-size: clamp(16px, 4vw, 40px); line-height: 1.05; letter-spacing: .01em; text-align: center; pointer-events: none; text-shadow: 0 2px 0 #000, 0 0 9px #000; }
.preview-live-caption.pos-upper { top: 12%; bottom: auto; }
.preview-live-caption.pos-center { top: 50%; bottom: auto; transform: translateY(-50%); }
.preview-live-caption.pos-custom { top: var(--caption-y, 50%); bottom: auto; transform: translateY(-50%); }
.preview-live-caption .active { color: var(--caption-highlight, #ffe100); }
.safe-area-tools { display: grid; gap: 6px; padding: 9px 10px; border: 1px solid var(--bd-06); border-radius: var(--r-btn); background: var(--fill-02); }
.safe-area-tools p { margin: 0; color: var(--faint); font-size: 10px; line-height: 1.35; }
.safe-area-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.preview-safe-guide {
  position: absolute;
  z-index: 4;
  left: 7%;
  right: 7%;
  height: 1px;
  border-top: 1px dashed rgba(194,247,63,.9);
  pointer-events: none;
  transform: translateY(-50%);
}
.preview-safe-guide span {
  position: absolute;
  right: 0;
  bottom: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(8,10,13,.75);
  color: var(--accent);
  font: 9px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Accessibilité — focus visible
   ========================================================================== */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
.seg-opt:focus-visible,
.seg-tab:focus-visible,
.swatch:focus-visible,
.swatch-custom:focus-visible,
.switch:focus-visible,
.stepper-btn:focus-visible,
.icon-btn:focus-visible,
.template-card:focus-visible,
.job-card:focus-visible,
.tk:focus-visible,
.word-chip:focus-visible,
.dropzone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   Boutons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              filter var(--t-fast) var(--ease),
              opacity var(--t-fast) var(--ease);
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn.sm { font-size: 12px; padding: 7px 13px; border-radius: var(--r-btn-sm); gap: 6px; }
.btn.block { width: 100%; padding: 11px; }

.btn.ghost { border-color: var(--bd-13); color: var(--text); }
.btn.ghost:hover:not(:disabled) { background: var(--fill-06); border-color: var(--bd-22); }

.btn.lime,
.btn.accent {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: var(--shadow-lime);
}
.btn.lime:hover:not(:disabled),
.btn.accent:hover:not(:disabled) { filter: brightness(1.08); }
.btn.lime:active:not(:disabled),
.btn.accent:active:not(:disabled) { filter: brightness(.96); }

.btn.danger {
  background: rgba(239,111,111,.12);
  border-color: rgba(239,111,111,.30);
  color: #f4a0a0;
}
.btn.danger:hover:not(:disabled) { background: rgba(239,111,111,.20); border-color: rgba(239,111,111,.45); }

.btn.icon {
  position: relative;
  width: 32px; height: 32px;
  padding: 0;
  gap: 0;
}
.btn.icon svg { width: 16px; height: 16px; }
/* Élargit la cible tactile à ≥44px sans changer le rendu */
.btn.icon::after { content: ""; position: absolute; inset: -6px; }

.btn-plus  { font-size: 15px; line-height: 1; }
.btn-play  { font-size: 11px; line-height: 1; }
.btn-count { font-family: var(--font-mono); font-size: 12px; opacity: .9; margin-left: 1px; }

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--topbar-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--bd-05);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo {
  width: 27px; height: 27px;
  border-radius: 8px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glow-lime);
  flex: none;
}
.brand-diamond {
  width: 9px; height: 9px;
  background: var(--accent-ink);
  border-radius: 1.5px;
  transform: rotate(45deg);
}
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: -.3px; }
.brand-version {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
  border: 1px solid var(--bd-10);
  padding: 2px 6px;
  border-radius: var(--r-sm);
}
.topbar-spacer { flex: 1; }

/* État de connexion (santé) */
.status-pill, .health-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-3);
  background: var(--fill-04);
  border: 1px solid var(--bd-07);
  padding: 6px 11px;
  border-radius: var(--r-btn-sm);
  white-space: nowrap;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--st-done);
  box-shadow: 0 0 8px var(--st-done);
}
.status-pill.ok  .status-dot, .health-badge.ok  .status-dot { background: var(--st-done); box-shadow: 0 0 8px var(--st-done); }
.status-pill.bad .status-dot, .health-badge.bad .status-dot,
.status-pill.error .status-dot, .health-badge.error .status-dot { background: var(--st-error); box-shadow: 0 0 8px var(--st-error); }
.status-pill.checking .status-dot, .health-badge.checking .status-dot { background: var(--st-rendering); box-shadow: none; }

/* ==========================================================================
   Bannière clé manquante
   ========================================================================== */
.key-banner {
  flex: none;
  margin: 12px 12px 0;
  padding: 11px 14px;
  background: rgba(230,177,90,.10);
  border: 1px solid rgba(230,177,90,.30);
  border-radius: var(--r-btn);
  color: #e6c98a;
  font-size: 13px;
  line-height: 1.5;
}
.key-banner strong { color: #f3dca6; }
.key-banner code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(0,0,0,.35);
  padding: 1px 6px;
  border-radius: var(--r-sm);
  color: #f3dca6;
}

/* ==========================================================================
   Layout — 3 colonnes
   ========================================================================== */
.layout {
  flex: 1;
  display: flex;
  gap: var(--gap);
  padding: var(--gap);
  min-height: 0;
}
.col { min-height: 0; }
.col-queue {
  width: var(--col-queue);
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--bd-06);
  border-radius: var(--r-panel);
  overflow: hidden;
}
.col-editor {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  overflow-y: auto;
  padding-right: 2px;
}
.col-style {
  width: var(--col-style);
  flex: none;
  background: var(--panel);
  border: 1px solid var(--bd-06);
  border-radius: var(--r-panel);
  overflow-y: auto;
  padding: 16px;
}

/* ==========================================================================
   Éléments communs : titres de section, cartes, séparateur, états vides
   ========================================================================== */
.section-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--label);
}
.count-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  background: var(--fill-05);
  padding: 2px 8px;
  border-radius: var(--r-chip);
}
.card {
  background: var(--card);
  border: 1px solid var(--bd-06);
  border-radius: var(--r-panel);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.divider { height: 1px; background: var(--bd-06); }

.empty-state {
  padding: 22px 18px;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}
.empty-state .es-title {
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.empty-state.big {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  padding: 60px 30px;
}
.empty-state.big .es-title { font-size: 17px; }

/* ==========================================================================
   Colonne gauche : file d'attente
   ========================================================================== */
.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px 11px;
  flex: none;
}

.queue-dropzone-wrap { padding: 0 14px 12px; flex: none; }
.dropzone {
  border: 1.5px dashed var(--bd-15);
  border-radius: var(--r-card);
  padding: 17px 14px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-faint);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.dz-icon {
  width: 34px; height: 34px;
  margin: 0 auto;
  border-radius: var(--r-btn-sm);
  background: var(--fill-05);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  color: var(--accent);
}
.dz-title { font-size: 12.5px; color: var(--text-2); margin-top: 9px; font-weight: 500; }
.dz-sub   { font-family: var(--font-mono); font-size: 9.5px; color: var(--faint); margin-top: 4px; }

.jobs-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---- Carte de job ---- */
.job-card {
  --st: var(--text-3);
  position: relative;
  display: flex;
  gap: 10px;
  padding: 10px 11px 10px 13px;
  border-radius: var(--r-template);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.job-card.uploaded     { --st: var(--st-uploaded); }
.job-card.transcribing { --st: var(--st-transcribing); }
.job-card.ready        { --st: var(--st-ready); }
.job-card.rendering    { --st: var(--st-rendering); }
.job-card.done         { --st: var(--st-done); }
.job-card.error        { --st: var(--st-error); }

.job-card:not(.selected):hover {
  background: var(--fill-04);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
.job-card.selected {
  background: var(--accent-tint);
  box-shadow: inset 0 0 0 1px rgba(194,247,63,.30);
}

.job-bar {
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--st);
}
.job-thumb {
  position: relative;
  width: 54px; height: 40px;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a20, #101014);
  display: flex; align-items: center; justify-content: center;
}
.job-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.job-play {
  position: relative;
  width: 0; height: 0;
  border-left: 9px solid rgba(255,255,255,.85);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  margin-left: 2px;
}
.job-body { flex: 1; min-width: 0; }
.job-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-meta { font-family: var(--font-mono); font-size: 10px; color: var(--faint); margin-top: 2px; }
.job-status {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.job-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--st); }
.job-status-label {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--st);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-tpl {
  flex: none;
  font-size: 9.5px;
  color: var(--text-3);
  background: var(--fill-05);
  padding: 2px 7px;
  border-radius: var(--r-chip);
  white-space: nowrap;
}
.job-progress {
  margin-top: 7px;
  height: 3px;
  border-radius: 3px;
  background: var(--fill-06);
  overflow: hidden;
}
.job-progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: var(--st);
  transition: width var(--t-mid) var(--ease);
}
.job-progress.indeterminate > span {
  width: 35% !important;
  animation: ksIndet 1.2s var(--ease) infinite;
}
/* Compat. ancien markup (progress + badge dans la carte) */
.job-card .progress {
  margin-top: 7px; height: 3px; border-radius: 3px;
  background: var(--fill-06); overflow: hidden;
}
.job-card .progress > span {
  display: block; height: 100%; width: 0; border-radius: 3px;
  background: var(--st); transition: width var(--t-mid) var(--ease);
}
.job-card .progress.indeterminate > span { width: 35% !important; animation: ksIndet 1.2s var(--ease) infinite; }
.job-row { margin-top: 7px; display: flex; align-items: center; gap: 7px; }
.job-actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.thumb-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.6);
}

/* ==========================================================================
   Colonne centrale : éditeur
   ========================================================================== */
.editor-content { display: flex; flex-direction: column; gap: var(--gap); }

/* ---- En-tête slim ---- */
.editor-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  flex-wrap: wrap;
}
.editor-filename {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40ch;
}
.editor-meta { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.editor-head-spacer { flex: 1; }

.lang-field { display: inline-flex; align-items: center; }
.lang-field select,
select#transcribe-lang {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--fill-04);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239a9aa3' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  border: 1px solid var(--bd-10);
  border-radius: var(--r-btn-sm);
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 26px 6px 10px;
  cursor: pointer;
}
.lang-field select:hover { border-color: var(--bd-13); }

.editor-error {
  background: rgba(239,111,111,.10);
  border: 1px solid rgba(239,111,111,.30);
  color: #f0a3a3;
  border-radius: var(--r-btn);
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.45;
}

/* ---- Badge de statut ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--r-chip);
  white-space: nowrap;
  color: var(--text-3);
  background: var(--fill-05);
}
.badge .bdot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: none;
  background: currentColor;
}
.badge.uploaded     { color: var(--st-uploaded);     background: rgba(154,154,163,.12); }
.badge.transcribing { color: var(--st-transcribing); background: rgba(111,215,224,.12); }
.badge.ready        { color: var(--accent);          background: var(--accent-soft); }
.badge.rendering    { color: var(--st-rendering);    background: rgba(230,177,90,.12); }
.badge.done         { color: var(--st-done);         background: rgba(84,224,138,.12); }
.badge.error        { color: var(--st-error);        background: rgba(239,111,111,.13); }
.badge.ready .bdot,
.badge.done .bdot   { box-shadow: 0 0 6px currentColor; }
.badge.transcribing .bdot,
.badge.rendering .bdot { animation: ksBlink 1s var(--ease) infinite; }

/* ---- Aperçu ---- */
.preview-card {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-frame {
  position: relative;
  width: min(100%, 533px);
  aspect-ratio: 16 / 9;
  max-height: 60vh;
  border-radius: var(--r-card);
  overflow: hidden;
  background: repeating-linear-gradient(135deg, #0c0c10 0 13px, #0a0a0d 13px 26px);
  box-shadow: var(--shadow-card);
}
.preview-frame.ar-source,
.preview-frame.ar-16x9 { aspect-ratio: 16 / 9; width: min(100%, 533px); }
.preview-frame.ar-9x16 { aspect-ratio: 9 / 16; width: auto; height: min(60vh, 460px); }
.preview-frame.ar-1x1  { aspect-ratio: 1 / 1;  width: auto; height: min(55vh, 380px); }
.preview-frame.ar-4x5  { aspect-ratio: 4 / 5;  width: auto; height: min(58vh, 430px); }

.preview-badge {
  position: absolute;
  top: 11px; left: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,.30);
  border: 1px solid var(--bd-12);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  pointer-events: none;
  z-index: 3;
}
.preview-time-badge {
  position: absolute;
  top: 11px; right: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,.45);
  pointer-events: none;
  z-index: 3;
}
#preview-img,
.preview-video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: inherit;
  background: #000;
  z-index: 2;
}
.preview-ph {
  position: absolute;
  left: 0; right: 0; top: 50%;
  transform: translateY(-50%);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: rgba(255,255,255,.10);
  padding: 0 8%;
  pointer-events: none;
  z-index: 1;
}
.spinner {
  position: absolute;
  top: 50%; left: 50%;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--accent);
  animation: ksSpin .8s linear infinite;
  display: none;
  z-index: 4;
}
.preview-frame.loading .spinner { display: block; }

/* ---- Transport ---- */
.transport {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 11px 15px;
}
.play-btn {
  width: 38px; height: 38px;
  flex: none;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(194,247,63,.25);
  transition: filter var(--t-fast) var(--ease);
}
.play-btn:hover { filter: brightness(1.1); }
.transport-time { font-family: var(--font-mono); font-size: 14px; color: var(--text); }
.transport-spacer { flex: 1; }

.seg-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--fill-04);
  padding: 3px;
  border-radius: var(--r-btn);
}
.seg-tab {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.seg-tab:hover:not(:disabled) { color: var(--text-2); }
.seg-tab.active { background: var(--fill-10); color: var(--text); }
.seg-tab:disabled { opacity: .4; cursor: not-allowed; }

/* ---- Progression (transcription / rendu) ---- */
.editor-progress {
  background: var(--card);
  border: 1px solid var(--bd-06);
  border-radius: var(--r-panel);
  padding: 11px 15px;
}
.ep-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}
.ep-track {
  margin-top: 8px;
  height: 6px;
  border-radius: 6px;
  background: var(--fill-06);
  overflow: hidden;
}
.ep-track > span,
#progress-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 6px;
  background: var(--accent);
  transition: width var(--t-mid) var(--ease);
}
#progress-bar.indeterminate {
  width: 35% !important;
  animation: ksIndet 1.2s var(--ease) infinite;
}

/* ---- Montage / waveform ---- */
.montage { padding: 14px 16px 12px; }
.montage .card-head { margin-bottom: 11px; }
.montage-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
}
.mm-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }

.montage-stage {
  position: relative;
  height: 88px;
  border-radius: var(--r-btn);
  background: var(--surface);
  border: 1px solid var(--bd-05);
  overflow: hidden;
}
.wave {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 10px;
}
.wave-bar {
  flex: 1;
  min-width: 2px;
  height: 30%;
  border-radius: 2px;
  background: rgba(255,255,255,.12);
}
.wave-bar.past { background: rgba(194,247,63,.45); }
.beat-marker { position: absolute; top: 6px; bottom: 6px; width: 1px; background: rgba(37,244,238,.72); box-shadow: 0 0 7px rgba(37,244,238,.45); pointer-events: none; }

.word-chips {
  position: absolute;
  left: 10px; right: 10px; top: 9px;
  height: 24px;
}
.word-chip {
  position: absolute;
  top: 0;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  overflow: hidden;
  border-radius: var(--r-chip);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--bd-10);
  color: var(--text-2);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.word-chip > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.word-chip:hover { background: var(--fill-08); }
.word-chip.active {
  background: rgba(194,247,63,.18);
  border-color: var(--accent);
  color: var(--accent);
}

.playhead {
  position: absolute;
  top: 0; bottom: 0;
  left: 0;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  pointer-events: none;
}
.playhead-knob {
  position: absolute;
  top: -2px; left: -4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.montage-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  padding: 0 2px;
}
.montage-ticks > * {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--faint-2);
}

/* Range / scrubber / sliders */
input[type="range"],
.slider,
.scrubber {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: var(--bd-13);
  outline: none;
  cursor: pointer;
}
.scrubber { margin-top: 8px; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--bd-12);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
}
input[type="range"]:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Transcript ---- */
.transcript { padding: 0; overflow: hidden; }
.transcript-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}
.transcript-summary::-webkit-details-marker { display: none; }
.transcript-summary > span:first-child { display: grid; gap: 4px; }
.transcript-summary small { color: var(--faint); font-size: 11px; }
.transcript-summary-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--bd-12);
  border-radius: 50%;
  color: var(--text-3);
  font-size: 18px;
  line-height: 1;
}
.transcript[open] .transcript-summary { border-bottom: 1px solid var(--bd-06); }
.transcript[open] .transcript-summary-icon { color: var(--accent); border-color: var(--accent); font-size: 0; }
.transcript[open] .transcript-summary-icon::after { content: "−"; font-size: 18px; }
.transcript-body { padding: 14px 16px 16px; }
.transcript .card-head { margin-bottom: 12px; }
.model-label { font-family: var(--font-mono); font-size: 10px; color: var(--faint); }

.icon-btn {
  position: relative;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--bd-12);
  border-radius: var(--r-pill);
  padding: 5px 9px;
  cursor: pointer;
  line-height: 1;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-btn:hover:not(:disabled) { background: var(--fill-06); border-color: var(--bd-13); color: var(--text); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn::after { content: ""; position: absolute; inset: -7px; }

.transcript-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tk {
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: var(--r-chip);
  color: var(--text);
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.tk:hover { background: var(--fill-07); }
.tk.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-bottom-color: var(--accent);
}

.transcript-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint-2);
  margin-top: 13px;
}
.timing-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -2px 0 10px;
  color: var(--text-3);
  font-size: 11px;
}
.timing-toolbar-spacer { flex: 1; }
.timing-toolbar-help { color: var(--faint); }
.ripple-toggle { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font: 10px var(--font-mono); cursor: pointer; white-space: nowrap; }
.ripple-toggle input { accent-color: var(--accent); }
.timing-quality {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--bd-10);
  border-radius: 999px;
  color: var(--text-3);
  background: var(--fill-03);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
}
.timing-quality.good { color: var(--st-ready); border-color: color-mix(in srgb, var(--st-ready) 45%, transparent); }
.timing-quality.watch { color: #f3bd51; border-color: rgba(243,189,81,.5); }
.timing-quality.warn { color: var(--st-error); border-color: color-mix(in srgb, var(--st-error) 45%, transparent); }

/* ---- Transcript : éditeur (lignes / mots) ---- */
.transcript-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.transcript-editor-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
.tx-empty {
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 0;
}
.tx-line {
  background: var(--surface);
  border: 1px solid var(--bd-05);
  border-radius: var(--r-btn);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tx-line-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tx-line-head .ln {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  min-width: 18px;
}
.tx-line-head .spacer { flex: 1; }
.tx-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-3);
}
.tx-time > span { color: var(--faint); }
.tx-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tx-word {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--fill-03);
  border: 1px solid var(--bd-06);
  border-radius: var(--r-btn-sm);
  padding: 3px 5px;
}
.tx-word.timing-warning { border-color: rgba(243,189,81,.7); box-shadow: inset 0 0 0 1px rgba(243,189,81,.08); }
.word-chip.timing-warning { border-color: #f3bd51; color: #ffd485; }
.word-chip.dragging { cursor: grabbing; opacity: .78; box-shadow: 0 0 0 2px var(--accent); }
.tw-seek {
  border: none;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--r-sm);
  white-space: nowrap;
}
.tw-seek:hover { background: var(--accent-soft); }
.del-word {
  border: none;
  background: transparent;
  color: var(--faint);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--r-sm);
}
.del-word:hover { color: var(--st-error); background: rgba(239,111,111,.12); }
.tx-line-foot { display: flex; gap: 6px; }

/* Champs texte de l'éditeur */
.tx-line input[type="text"],
.tx-time input,
.tw-num,
.tx-line-text {
  background: var(--fill-04);
  border: 1px solid var(--bd-10);
  border-radius: var(--r-chip);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 6px;
  outline: none;
  transition: border-color var(--t-fast) var(--ease);
}
.tx-time input { width: 64px; }
.tw-num { width: 56px; }
.tx-line-text { width: 100%; font-family: var(--font-ui); }
.tx-line input:focus,
.tw-num:focus,
.tx-line-text:focus { border-color: var(--accent); }

/* ==========================================================================
   Colonne droite : styles + modèles
   ========================================================================== */
.style-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.style-content > .divider { display: none; }
.style-rail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 13px;
  border-bottom: 1px solid var(--bd-10);
}
.style-rail-eyebrow {
  color: var(--label);
  font: 600 9px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.style-rail-head h2 {
  margin-top: 7px;
  font-size: 16px;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.style-rail-status,
.style-group-hint {
  color: var(--faint);
  font: 500 9px/1.2 var(--font-mono);
}
.style-rail-status {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 5px;
  margin-top: 3px;
  padding: 5px 7px;
  border: 1px solid var(--bd-10);
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.style-rail-status span { width: 5px; height: 5px; border-radius: 50%; background: var(--st-done); }
.style-group {
  order: 4;
  border: 1px solid var(--bd-06);
  border-radius: var(--r-card);
  background: var(--fill-01);
  overflow: clip;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.style-group[open] { border-color: var(--bd-12); background: var(--surface-faint); }
.style-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.style-group summary::-webkit-details-marker { display: none; }
.style-group summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 3px;
  border: 1px solid var(--bd-10);
  border-radius: 50%;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  transition: transform var(--t-mid) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.style-group[open] summary { color: var(--text); }
.style-group[open] summary::after { transform: rotate(45deg); color: var(--accent); border-color: rgba(194,247,63,.35); }
.style-group summary:hover { background: var(--fill-04); }
.style-group summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.style-group > .style-section,
.style-group > #style-form {
  padding: 0 12px 14px;
  animation: styleGroupReveal var(--t-fast) var(--ease);
}
.style-group-models { order: 5; }
.style-group-music { order: 6; }
.style-group-templates { order: 2; }
.style-group-presets { order: 3; }
.style-group-publish { order: 7; }
.style-group-appearance { order: 1; }
.style-rail-footer { order: 8; padding-top: 4px; }
.style-group .style-section .card-head { margin-bottom: 12px; }
.style-group-templates .section-label,
.style-group-presets .section-label,
.style-group-music .section-label,
.style-group-publish .section-label { display: none; }
.style-group-templates .card-head { justify-content: flex-end; }
.style-group-models .card-head { display: flex; justify-content: flex-end; }
.style-group-models .card-head .section-label { display: none; }
.style-group-templates .templates-grid {
  max-height: 390px;
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
  scrollbar-gutter: stable;
}
@keyframes styleGroupReveal { from { opacity: .6; transform: translateY(-2px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .style-group > .style-section, .style-group > #style-form { animation: none; } }
.style-section { display: block; }
.style-section .card-head { margin-bottom: 13px; }

/* ---- Grille de modèles ---- */
.templates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.template-card {
  position: relative;
  min-height: 138px;
  border-radius: var(--r-template);
  background: var(--template-card);
  border: 1px solid var(--bd-05);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  font-family: inherit;
  text-align: left;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.template-card:hover { border-color: var(--bd-15); }
.template-card.active {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--accent), 0 8px 24px rgba(194,247,63,.15);
}
.tp-preview,
.template-preview {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.tp-copy { padding: 7px 9px 9px; border-top: 1px solid var(--bd-05); }
.tp-name,
.template-name {
  font-size: 10.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-desc,
.template-desc {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.3;
  text-align: left;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Base de l'échantillon */
.tp-sample {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-sample);
  font-weight: 800;
  font-size: 19px;
  line-height: 1;
  letter-spacing: -.5px;
  color: #fff;
}
.tp-sample .box {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 1px 6px;
  border-radius: var(--r-sm);
  font-weight: 800;
}
.tp-sample .caret {
  color: var(--accent);
  font-weight: 800;
  animation: ksCaret 1s steps(1) infinite;
}
.tp-sample .up {
  color: var(--accent);
  font-size: 11px;
  line-height: 1;
  font-style: normal;
}

/* Variantes par effet (tp-FX) */
.tp-clean .tp-sample,
.tp-default .tp-sample {
  text-shadow: 0 2px 6px rgba(0,0,0,.6);
  -webkit-text-stroke: 1.5px rgba(0,0,0,.7);
}
.tp-default .tp-sample { font-size: 18px; -webkit-text-stroke-width: 1px; }

.tp-karaoke .tp-sample { color: rgba(255,255,255,.4); font-size: 15px; }
.tp-karaoke .tp-sample b { color: var(--accent); font-weight: 800; }

.tp-word_highlight .tp-sample,
.tp-highlight_pop .tp-sample { font-size: 15px; gap: 4px; }
.tp-word_highlight .tp-sample .box,
.tp-highlight_pop .tp-sample .box { padding: 1px 6px; border-radius: var(--r-sm); }
.tp-highlight_pop .tp-sample { animation: ksPop 2.4s var(--ease) infinite; }

.tp-pop .tp-sample,
.tp-word_pop .tp-sample {
  font-weight: 900;
  font-size: 23px;
  -webkit-text-stroke: 1.5px rgba(0,0,0,.7);
  text-shadow: 0 2px 6px rgba(0,0,0,.6);
  animation: ksPop 2.4s var(--ease) infinite;
}

.tp-fade .tp-sample {
  color: rgba(255,255,255,.42);
  animation: ksFade 2.6s var(--ease) infinite alternate;
}

.tp-slide_up .tp-preview { align-items: center; }
.tp-slide_up .tp-sample {
  flex-direction: column;
  gap: 1px;
  font-size: 17px;
  -webkit-text-stroke: 1.2px rgba(0,0,0,.7);
  animation: ksUp 2.4s var(--ease) infinite alternate;
}

.tp-typewriter .tp-sample {
  font-size: 17px;
  -webkit-text-stroke: 1.2px rgba(0,0,0,.7);
}

.tp-bounce .tp-sample {
  font-size: 17px;
  -webkit-text-stroke: 1.2px rgba(0,0,0,.7);
  animation: ksBounce 2.2s var(--ease) infinite;
}
.tp-bounce .tp-sample b { color: var(--accent); font-size: 12px; -webkit-text-stroke: 0; }

.tp-neon .tp-sample {
  font-size: 18px;
  -webkit-text-stroke: 0;
  text-shadow: 0 0 5px var(--accent), 0 0 13px var(--accent), 0 0 24px var(--accent);
}

.tp-tiktok_box .tp-sample { font-size: 16px; }
.tp-tiktok_box .tp-sample .box { padding: 3px 11px; border-radius: var(--r-pill); }

.tp-shadow_pop .tp-sample {
  font-weight: 900;
  font-size: 22px;
  text-shadow: 0 4px 0 rgba(0,0,0,.5), 0 8px 14px rgba(0,0,0,.45);
}

.tp-gradient .tp-sample {
  font-weight: 900;
  font-size: 20px;
  background: linear-gradient(92deg, var(--accent), #7ad0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.tp-capcut_bold .tp-sample {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -.5px;
  -webkit-text-stroke: 1.6px rgba(0,0,0,.8);
  text-shadow: 0 2px 0 rgba(0,0,0,.5);
}

/* ---- Contrôles de style ---- */
#style-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}
#style-form .section-label { margin-bottom: -2px; }
.appearance-subsection { border: 1px solid var(--bd-06); border-radius: var(--r-card); background: var(--fill-02); overflow: hidden; }
.appearance-subsection summary { display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 0 12px; cursor: pointer; color: var(--text); font-size: 12px; font-weight: 650; list-style: none; }
.appearance-subsection summary::-webkit-details-marker { display: none; }
.appearance-subsection summary span:last-child { color: var(--faint); font: 10px var(--font-mono); }
.appearance-subsection summary::after { content: "+"; color: var(--accent); font-size: 18px; }
.appearance-subsection[open] { border-color: var(--bd-13); background: var(--surface-faint); }
.appearance-subsection[open] summary { border-bottom: 1px solid var(--bd-06); }
.appearance-subsection[open] summary::after { content: "−"; }
.appearance-subsection-body { display: grid; gap: 14px; padding: 14px 12px; }
.style-intro {
  padding: 2px 0 14px;
  border: 0;
  border-bottom: 1px solid var(--bd-10);
  border-radius: var(--r-card);
  background: transparent;
}
.style-intro-kicker { color: var(--label); font: 500 9px/1 var(--font-mono); letter-spacing: .12em; }
.style-intro-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 9px; }
.style-intro h3 { font-size: 15px; letter-spacing: -.02em; }
.style-intro p { max-width: 210px; margin-top: 4px; color: var(--text-3); font-size: 10px; line-height: 1.45; }
.style-intro .style-history-actions { flex: none; }
.style-contrast-btn { margin-top: 12px; border-color: var(--bd-10); }
.style-color-card {
  display: grid;
  gap: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.style-color-head { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0 3px; }
.style-color-title { color: var(--text); font-size: 13px; font-weight: 700; }
.style-color-head p { margin-top: 3px; color: var(--text-3); font-size: 10px; }
.style-color-icon { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--bd-10); border-radius: 50%; color: var(--text-3); background: transparent; font-size: 15px; }
.color-control { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--bd-06); border-radius: var(--r-btn); background: var(--fill-02); }
.color-control-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.color-hex { color: var(--text-2); font-size: 10px; }
.color-control .swatches { gap: 7px; }
.color-control .swatch { width: 28px; height: 28px; }
.color-trigger { width: auto; min-width: 112px; height: 32px; padding: 0 10px; border-radius: var(--r-pill); background: var(--fill-06); color: var(--text); font-size: 10px; font-weight: 700; text-shadow: none; }
.color-trigger::after { display: none; }
.color-trigger span { display: inline-flex; align-items: center; gap: 6px; position: relative; z-index: 2; }
.color-trigger span::before { content: ""; width: 12px; height: 12px; border: 1px solid var(--bd-22); border-radius: 50%; background: var(--swatch-color, transparent); }
.color-control-stroke { padding-top: 2px; }
.stroke-row { display: flex; align-items: center; gap: 10px; }
.stroke-row .slider { flex: 1; }
.ctl {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ctl-inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ctl-label { font-size: 11.5px; color: var(--text-3); }
.ctl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ctl-val { font-family: var(--font-mono); font-size: 11px; color: var(--text); }

/* Segmented control (.seg / .seg-opt) */
.seg {
  display: flex;
  gap: 4px;
  background: var(--fill-04);
  padding: 3px;
  border-radius: var(--r-btn);
}
.seg.wrap { flex-wrap: wrap; }
.seg-opt {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  padding: 7px 6px;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.seg.wrap .seg-opt { flex: 1 1 56px; }
.seg-opt:hover:not(.active) { color: var(--text-2); background: var(--fill-04); }
.seg-opt.active {
  background: var(--fill-10);
  color: var(--text);
}

/* Pastilles de couleur (.swatches / .swatch / .swatch-custom) */
.swatches {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
}
.swatch {
  width: 32px; height: 32px;
  padding: 0;
  border-radius: var(--r-btn-sm);
  border: 1px solid var(--bd-14);
  background: transparent;
  cursor: pointer;
  transition: box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.swatch:hover { transform: translateY(-1px); }
.swatch.active {
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent);
}
.swatch-custom {
  position: relative;
  width: 32px; height: 32px;
  padding: 0;
  border-radius: var(--r-btn-sm);
  border: 1px solid var(--bd-14);
  overflow: hidden;
  cursor: pointer;
  display: inline-flex;
  background:
    conic-gradient(from 0deg,
      #ff5d5d, #ffd34d, #54e08a, #6fd7e0, #6c8bff, #c46bff, #ff5d5d);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.swatch-custom:hover { transform: translateY(-1px); }
.swatch-custom::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--swatch-color, transparent);
  pointer-events: none;
}

.swatches.sm { gap: 7px; }
.swatches.sm .swatch,
.swatches.sm .swatch-custom,
.swatch-custom.sm {
  width: 26px; height: 26px;
  border-radius: var(--r-pill);
}

/* Interrupteur (.switch) */
.switch {
  position: relative;
  width: 44px; height: 25px;
  flex: none;
  padding: 0;
  border: 1px solid var(--bd-12);
  border-radius: var(--r-switch);
  background: var(--fill-06);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.switch-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
  transition: left var(--t-fast) var(--ease);
}
.switch[aria-checked="true"],
.switch.on {
  background: var(--accent);
  border-color: transparent;
}
.switch[aria-checked="true"] .switch-knob,
.switch.on .switch-knob { left: 21px; }

/* Compteur (.stepper) */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--bd-10);
  border-radius: var(--r-btn-sm);
  overflow: hidden;
}
.stepper-btn {
  position: relative;
  width: 32px; height: 30px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast) var(--ease);
}
.stepper-btn:hover:not(:disabled) { background: var(--fill-06); }
.stepper-btn:disabled { opacity: .4; cursor: not-allowed; }
.stepper-btn::after { content: ""; position: absolute; inset: -7px; }
.stepper-val {
  width: 36px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}

/* ==========================================================================
   Panel Modèles IA (vocaux + séparation de pistes)
   ========================================================================== */
.models-filters { width: 100%; margin-bottom: 12px; }
.models-filters .seg-tab { flex: 1; justify-content: center; padding: 6px 10px; }

.models-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.models-empty {
  padding: 18px 14px;
  color: var(--faint);
  font-size: 12.5px;
  text-align: center;
  border: 1px dashed var(--bd-08);
  border-radius: var(--r-card);
}
.models-empty .es-title { color: var(--text-3); margin-bottom: 4px; }

.model-card {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--bd-06);
  border-radius: var(--r-card);
  background: var(--card);
  overflow: hidden;
  transition: border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}
.model-card:hover { border-color: var(--bd-13); background: var(--fill-03); }
.model-card.is-active {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--accent), 0 6px 18px rgba(194,247,63,.12);
}

/* favori : liseré vertical lime + fond légèrement teinté */
.model-card.is-fav { background: linear-gradient(90deg, var(--accent-tint) 0%, var(--card) 40%); }

/* ---- étoile favori ---- */
.model-star {
  flex: none;
  width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-right: 1px solid var(--bd-05);
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.model-star svg { width: 15px; height: 15px; display: block; }
.model-star:hover { color: var(--accent); background: var(--accent-tint); }
.model-star.on { color: var(--accent); }
.model-star.on svg { filter: drop-shadow(0 0 5px var(--accent-glow)); }

/* ---- corps cliquable ---- */
.model-main {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  outline: none;
}
.model-main:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.model-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.model-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-active-tag {
  flex: none;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 2px 5px;
  border-radius: var(--r-sm);
  line-height: 1;
}
.model-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-3);
}
.model-type { color: var(--text-2); font-weight: 500; }
.model-card.type-vocal      .model-type { color: #6fd7e0; }
.model-card.type-separation .model-type { color: var(--accent-2); }
.model-sep { color: var(--faint-2); }
.model-provider { opacity: .9; }
.model-desc {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- suppression ---- */
.model-del {
  flex: none;
  width: 36px;
  border: none;
  border-left: 1px solid var(--bd-05);
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.model-del svg { width: 15px; height: 15px; display: block; }
.model-del:hover { color: #ef8a8a; background: rgba(239,111,111,.10); }

/* ---- formulaire d'ajout inline ---- */
.model-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 12px;
  padding: 13px;
  border: 1px solid var(--bd-08);
  border-radius: var(--r-card);
  background: var(--surface);
}
.model-form .ctl { display: block; }
.model-form .ctl-label {
  display: block;
  font-size: 11px;
  color: var(--label);
  margin-bottom: 5px;
}
.mf-input, .mf-select {
  width: 100%;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
 background: var(--bg);
 border: 1px solid var(--bd-10);
  border-radius: var(--r-btn-sm);
  outline: none;
  transition: border-color var(--t-fast) var(--ease);
}
.mf-input:focus, .mf-select:focus { border-color: var(--accent); }
.mf-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a9aa3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.mf-row-2 { display: flex; gap: 9px; }
.mf-row-2 .ctl { flex: 1; min-width: 0; }
.mf-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }

/* ---- responsive : cartes modèles full width déjà géré (colonne unique) ---- */
/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--toast-bg);
  border: 1px solid var(--bd-12);
  color: var(--text);
  padding: 11px 18px;
  border-radius: var(--r-btn);
  font-size: 13px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  max-width: 90vw;
  z-index: 100;
  transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.ok    { border-color: rgba(84,224,138,.45); }
.toast.error { border-color: rgba(239,111,111,.50); }

/* ==========================================================================
   Animations (réutilise les keyframes du design)
   ========================================================================== */
@keyframes ksPop {
  0%   { transform: scale(.55); opacity: 0; }
  65%  { transform: scale(1.09); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes ksFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes ksUp {
  from { transform: translateY(45%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes ksBounce {
  0%   { transform: translateY(35%); opacity: 0; }
  55%  { transform: translateY(-13%); }
  75%  { transform: translateY(5%); }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes ksCaret {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes ksSpin { to { transform: rotate(360deg); } }
@keyframes ksBlink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ksIndet {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  :root { --col-queue: 270px; --col-style: 320px; }
}
@media (max-width: 1000px) {
  :root { --col-queue: 240px; --col-style: 300px; }
  .preview-frame { width: min(100%, 460px); }
}
@media (max-width: 860px) {
  body { overflow: auto; height: auto; min-height: 100vh; }
  .layout {
    flex-direction: column;
    flex: none;
    min-height: 0;
  }
  .col-queue,
  .col-style,
  .col-editor {
    width: 100%;
    max-width: 100%;
    flex: none;
  }
  .col-style { max-height: none; overflow: visible; }
  .col-queue { max-height: 50vh; }
  .col-editor { overflow: visible; padding-right: 0; }
  .empty-state.big { min-height: 30vh; }
}
@media (max-width: 560px) {
  body { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 12px;
    gap: 8px;
  }
  #health-badge { display: none; }
  .brand-name { font-size: 14px; }
  .btn.lime span.btn-count { display: none; }
  .brand-version { display: none; }
  .templates-grid { grid-template-columns: 1fr; }
  .transport { flex-wrap: wrap; }
  .editor-head { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .editor-head-spacer { display: none; }
  .editor-filename { max-width: calc(100% - 74px); }
  .editor-head .btn { min-height: 36px; }
  .workflow-steps { gap: 4px; }
  .workflow-step { min-height: 34px; }
  .timing-toolbar { align-items: stretch; gap: 6px; }
  .timing-toolbar-help { flex-basis: 100%; }
  .timing-toolbar-spacer { display: none; }
  .timing-toolbar .btn { flex: 1 1 auto; min-height: 34px; }
  .tx-word { gap: 3px; padding: 4px; }
  .tw-nudge { width: 28px; height: 30px; }
  .tw-seek, .del-word { min-height: 30px; }
  .tx-word input[type="text"]:first-of-type { min-width: 74px; }
  .tw-num { width: 54px; }
  .safe-area-actions .btn { flex: 1 1 145px; min-height: 36px; }
  .music-actions .btn { min-height: 36px; }
}

@media (max-width: 560px) {
  .topbar .btn { min-height: 44px; }
  .topbar [data-action="import"] { flex: 1; }
  .topbar [data-action="render-all"] { order: 4; flex: 1; }
  .topbar [data-action="export-zip"] { order: 5; flex: 1; }
  .topbar .btn.icon { width: 44px; height: 44px; }
  .brand { flex: 1 1 calc(100% - 56px); }
  .col-queue { max-height: none; }
  .jobs-list { overflow: visible; }
  .job-card { gap: 9px; padding: 12px; }
  .job-thumb { width: 58px; height: 44px; }
  .job-actions { gap: 3px; flex-wrap: wrap; }
  .job-actions .btn { font-size: 10px; padding: 6px 8px; min-height: 32px; }
  .job-actions .btn.icon { width: 32px; height: 32px; padding: 0; }
  .job-actions .btn.icon svg { width: 14px; height: 14px; }
  /* Masque les actions secondaires sur petit écran pour éviter la surcharge */
  .job-actions .btn[data-action="duplicate-job"],
  .job-actions .btn[data-action="transcribe"] { display: none; }
  .empty-state.big { min-height: 24vh; padding: 40px 22px; }
  .transcript-summary { min-height: 72px; padding: 14px; }
  .transcript-summary small { max-width: 28ch; line-height: 1.35; }
  .transcript-body { padding: 14px; }
  .transcript .card-head { align-items: flex-start; flex-direction: column; }
  .transcript .card-head-actions { width: 100%; justify-content: flex-start; }
  .transcript .card-head-actions #toggle-edit { flex: 1 0 100%; min-height: 44px; }
  .style-rail-head { padding: 4px 2px 14px; }
  .style-rail-head h2 { font-size: 18px; }
  .style-group summary { min-height: 52px; padding-inline: 14px; }
  .style-group > .style-section,
  .style-group > #style-form { padding: 0 14px 16px; }
  .style-group-templates .templates-grid { max-height: none; overflow: visible; }
  .template-card { min-height: 126px; flex-direction: row; align-items: stretch; }
  .tp-preview { flex: 0 0 42%; }
  .tp-copy { display: grid; align-content: center; flex: 1; padding: 12px; border-top: 0; border-left: 1px solid var(--bd-05); }
  .tp-name { font-size: 12px; }
  .tp-desc { margin-top: 5px; font-size: 10.5px; -webkit-line-clamp: 3; }
  .color-control { padding: 12px; gap: 10px; }
  .color-control .swatch,
  .swatch-custom { width: 38px; height: 38px; }
  .color-trigger { min-width: 122px; height: 38px; }
  .color-palettes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .palette-card { min-height: 42px; padding: 8px; font-size: 11px; }
  .stroke-row { align-items: stretch; flex-wrap: wrap; }
  .stroke-row .slider { flex-basis: 65%; }
  .cover-fields { flex-direction: column; }
  .cover-fields .btn { min-height: 44px; }
  .safe-area-actions .btn,
  .music-actions .btn,
  .publish-actions .btn { min-height: 44px; }
  .toast { right: 12px; left: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
}

.mobile-render-bar { display: none; }
@media (max-width: 560px) {
  .mobile-render-bar {
    position: fixed;
    z-index: 15;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 76px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--bd-12);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(14px);
  }
  .mobile-render-bar.hidden { display: none; }
  .mobile-render-copy { display: grid; min-width: 0; gap: 2px; }
  .mobile-render-copy strong { color: var(--text); font-size: 12px; }
  .mobile-render-copy span { overflow: hidden; color: var(--text-3); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-render-bar .btn { flex: 0 0 auto; min-height: 48px; padding-inline: 13px; }
}

.studio-modal {
  width: min(440px, calc(100vw - 28px));
  border: 1px solid var(--bd-13);
  border-radius: var(--r-panel);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.studio-modal::backdrop { background: rgba(0, 0, 0, .68); backdrop-filter: blur(4px); }
.render-modal { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 14px; background: rgba(0, 0, 0, .68); backdrop-filter: blur(4px); }
.render-modal.hidden { display: none; }
.render-modal-card { display: grid; justify-items: center; gap: 12px; padding: 30px; text-align: center; }
.modal-kicker { margin: 0; color: var(--accent); font: 600 10px/1 var(--font-mono); letter-spacing: .11em; }
.studio-modal h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; text-wrap: balance; }
.modal-copy { margin: 0; color: var(--text-3); font-size: 13px; line-height: 1.5; text-wrap: pretty; }
.render-orbit { position: relative; width: 68px; height: 68px; border: 1px solid var(--bd-13); border-radius: 50%; }
.render-orbit::before { content: ""; position: absolute; inset: 12px; border: 2px solid var(--accent); border-radius: 50%; border-right-color: transparent; animation: renderOrbit 1.2s linear infinite; }
.render-orbit span { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.render-orbit span:nth-child(1) { top: 8px; left: 31px; }
.render-orbit span:nth-child(2) { right: 10px; bottom: 16px; opacity: .65; }
.render-orbit span:nth-child(3) { bottom: 9px; left: 18px; opacity: .35; }
@keyframes renderOrbit { to { transform: rotate(1turn); } }
.modal-progress { width: 100%; height: 6px; overflow: hidden; border-radius: 99px; background: var(--fill-06); }
.modal-progress span { display: block; width: 6%; height: 100%; border-radius: inherit; background: var(--accent); transition: width .35s var(--ease); }
.modal-value { margin: -4px 0 2px; color: var(--faint); font: 11px var(--font-mono); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.history-modal { max-height: min(680px, calc(100dvh - 28px)); padding: 22px; overflow: auto; }
.history-list { display: grid; gap: 8px; margin-top: 18px; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--bd-06); border-radius: var(--r-btn); background: var(--fill-02); }
.history-item-copy { display: grid; min-width: 0; gap: 3px; }
.history-item-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.history-item-copy span, .history-item-copy small { color: var(--text-3); font-size: 11px; }
.history-item-copy small { color: var(--faint); }
.preset-library-actions { display: flex; align-items: center; gap: 7px; }
.style-presets-list { display: grid; gap: 8px; margin-top: 18px; }
.history-empty { padding: 24px 0; color: var(--text-3); text-align: center; }
.history-page { min-height: 100dvh; padding: clamp(20px, 4vw, 56px); background: var(--bg); }
.history-page-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 28px; max-width: 1120px; margin: 0 auto 34px; }
.history-page-head > .btn { align-self: start; min-height: 42px; }
.history-page-head h1 { margin: 7px 0 8px; font-size: clamp(28px, 5vw, 52px); letter-spacing: -.04em; text-wrap: balance; }
.history-page-head p:not(.modal-kicker) { max-width: 54ch; margin: 0; color: var(--text-3); line-height: 1.5; }
.history-page-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 360px)); gap: 16px; max-width: 1120px; margin: 0 auto; }
.history-project { display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; border: 1px solid var(--bd-06); border-radius: var(--r-panel); background: var(--panel); transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.history-project:hover { border-color: var(--bd-18); transform: translateY(-2px); }
.history-preview { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--fill-06); }
.history-preview-empty { display: grid; place-items: center; min-height: 160px; padding: 20px; color: var(--faint); font-size: 11px; text-align: center; }
.history-project .history-item-copy { padding: 15px 15px 11px; }
.history-project .history-item-copy strong { font-size: 14px; }
.history-project .history-item-copy span { margin-top: 2px; }
.history-project .btn { width: calc(100% - 30px); min-height: 42px; margin: 0 15px 15px; }
body.history-mode > .topbar,
body.history-mode > .layout,
body.history-mode > .mobile-render-bar,
body.history-mode > .key-banner { display: none; }
@media (prefers-reduced-motion: reduce) { .render-orbit::before { animation: none; } }
@media (max-width: 560px) {
  .studio-modal { width: calc(100vw - 20px); }
  .render-modal-card { padding: 26px 20px; }
  .history-modal { padding: 18px; }
  .history-item { align-items: flex-start; flex-direction: column; }
  .history-item .btn { width: 100%; min-height: 44px; }
  .history-page { padding: 16px 14px 30px; }
  .history-page-head { grid-template-columns: 1fr; gap: 18px; margin-bottom: 22px; }
  .history-page-head .btn { justify-self: start; min-height: 44px; }
  .history-page-list { grid-template-columns: 1fr; gap: 12px; }
  .history-project { grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: 1fr auto; }
  .history-preview { grid-row: span 2; height: 100%; min-height: 132px; aspect-ratio: auto; }
  .history-preview-empty { min-height: 132px; }
  .history-project .history-item-copy { padding: 14px 14px 8px; }
  .history-project .btn { width: auto; min-height: 42px; margin: 0 14px 14px; }
}

/* ==========================================================================
   Sélecteur de couleur custom
   ========================================================================== */
.color-picker {
  position: fixed;
  z-index: 100;
  width: 268px;
  padding: 12px;
  border: 1px solid var(--bd-14);
  border-radius: var(--r-card);
  background: var(--panel);
  box-shadow: var(--shadow-pop), 0 0 0 1px rgba(0,0,0,.2);
  display: grid;
  gap: 10px;
}
.cp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cp-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.cp-close {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.cp-close:hover { color: var(--text); background: var(--fill-06); }
.cp-body {
  display: flex;
  gap: 10px;
  align-items: stretch;
  touch-action: none;
}
.cp-sat {
  flex: 1 1 auto;
  width: 200px;
  height: 160px;
  border-radius: var(--r-sm);
  cursor: crosshair;
  background: #ff0000;
}
.cp-hue-wrap {
  flex: 0 0 20px;
  height: 160px;
  border-radius: var(--r-sm);
  overflow: hidden;
}
.cp-hue {
  width: 20px;
  height: 160px;
  cursor: ns-resize;
}
.cp-footer {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cp-hex {
  flex: 1 1 auto;
  padding: 7px 9px;
  border: 1px solid var(--bd-12);
  border-radius: var(--r-btn-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
}
.cp-hex:focus { outline: none; border-color: var(--accent); }

/* ==========================================================================
   Mouvement réduit
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .spinner { animation: none; border-top-color: var(--accent); }
  .tp-sample,
  .tp-sample .caret { animation: none !important; }
}

/* ==========================================================================
   Day theme
   ========================================================================== */
body[data-theme="day"] {
  color-scheme: light;

  --bg: #f5f7f1;
  --panel: #ffffff;
  --card: #ffffff;
  --template-card: #f7f9f4;
  --surface: rgba(27, 38, 24, .045);
  --surface-faint: rgba(27, 38, 24, .025);
  --toast-bg: #ffffff;

  --accent: #86bd12;
  --accent-2: #72a80b;
  --accent-ink: #102000;
  --accent-soft: rgba(134, 189, 18, .15);
  --accent-tint: rgba(134, 189, 18, .08);
  --accent-glow: rgba(134, 189, 18, .22);
  --accent-glow-2: rgba(134, 189, 18, .34);

  --text: #172019;
  --text-2: #344037;
  --text-3: #59645b;
  --label: #586259;
  --faint: #6e776f;
  --faint-2: #818a82;

  --bd-05: rgba(27, 38, 24, .08);
  --bd-06: rgba(27, 38, 24, .10);
  --bd-07: rgba(27, 38, 24, .12);
  --bd-10: rgba(27, 38, 24, .16);
  --bd-12: rgba(27, 38, 24, .20);
  --bd-13: rgba(27, 38, 24, .24);
  --bd-14: rgba(27, 38, 24, .28);
  --bd-15: rgba(27, 38, 24, .32);
  --bd-22: rgba(27, 38, 24, .42);

  --fill-01: rgba(27, 38, 24, .015);
  --fill-02: rgba(27, 38, 24, .025);
  --fill-03: rgba(27, 38, 24, .04);
  --fill-04: rgba(27, 38, 24, .055);
  --fill-05: rgba(27, 38, 24, .07);
  --fill-06: rgba(27, 38, 24, .09);
  --fill-07: rgba(27, 38, 24, .11);
  --fill-08: rgba(27, 38, 24, .13);
  --fill-10: rgba(27, 38, 24, .17);

  --st-uploaded: #65706a;
  --st-transcribing: #087f91;
  --st-ready: var(--accent);
  --st-rendering: #a86400;
  --st-done: #167a45;
  --st-error: #b4232f;

  --shadow-lime: 0 6px 18px rgba(134, 189, 18, .22);
  --shadow-card: 0 10px 28px rgba(35, 47, 30, .09), inset 0 1px 0 rgba(255, 255, 255, .85);
  --shadow-pop: 0 14px 36px rgba(35, 47, 30, .16);
  --glow-lime: 0 0 16px rgba(134, 189, 18, .28);
}

body[data-theme="day"] ::selection { color: var(--accent-ink); }
body[data-theme="day"] ::-webkit-scrollbar-track { background: #edf1e9; }
body[data-theme="day"] ::-webkit-scrollbar-thumb { background: #aab4a9; border-color: #edf1e9; }
body[data-theme="day"] ::-webkit-scrollbar-thumb:hover { background: #7c897c; }
body[data-theme="day"] * { scrollbar-color: #aab4a9 #edf1e9; }

body[data-theme="day"] .access-gate { background: rgba(245, 247, 241, .92); }
body[data-theme="day"] .access-card input,
body[data-theme="day"] .mf-input,
body[data-theme="day"] .mf-select,
body[data-theme="day"] .cp-hex,
body[data-theme="day"] .cover-title {
  background-color: #ffffff;
  color: var(--text);
}
body[data-theme="day"] .font-picker,
body[data-theme="day"] .font-picker option,
body[data-theme="day"] .font-picker optgroup {
  background: #ffffff;
  color: var(--text);
}
body[data-theme="day"] .lang-field select,
body[data-theme="day"] select#transcribe-lang,
body[data-theme="day"] .mf-select {
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2359645b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

body[data-theme="day"] .col-queue,
body[data-theme="day"] .col-style,
body[data-theme="day"] .card,
body[data-theme="day"] .model-card,
body[data-theme="day"] .color-picker,
body[data-theme="day"] .toast {
  box-shadow: var(--shadow-card);
}
body[data-theme="day"] .style-group {
  background: #fbfcf9;
  border-color: rgba(27, 38, 24, .13);
}
body[data-theme="day"] .style-group[open] {
  background: #ffffff;
  border-color: rgba(27, 38, 24, .22);
  box-shadow: 0 5px 16px rgba(35, 47, 30, .06);
}
body[data-theme="day"] .style-group summary:hover { background: rgba(134, 189, 18, .08); }
body[data-theme="day"] .style-group[open] summary::after {
  border-color: rgba(134, 189, 18, .55);
  background: rgba(134, 189, 18, .11);
}
body[data-theme="day"] .style-rail-status { background: #f7faef; color: #4b5a3e; }
body[data-theme="day"] .style-intro,
body[data-theme="day"] .style-rail-head { border-color: rgba(27, 38, 24, .15); }

body[data-theme="day"] .template-card { background: #f6f8f3; border-color: rgba(27, 38, 24, .13); }
body[data-theme="day"] .template-card:hover { border-color: rgba(27, 38, 24, .30); }
body[data-theme="day"] .template-card.active { box-shadow: 0 0 0 2px var(--accent), 0 8px 22px rgba(134, 189, 18, .18); }
body[data-theme="day"] .tp-name,
body[data-theme="day"] .template-name { color: var(--text-2); border-color: rgba(27, 38, 24, .10); }
body[data-theme="day"] .tp-preview { background: linear-gradient(135deg, #e7ece2, #f8faf5); }
body[data-theme="day"] .tp-sample { color: #172019; }
body[data-theme="day"] .tp-clean .tp-sample,
body[data-theme="day"] .tp-default .tp-sample,
body[data-theme="day"] .tp-pop .tp-sample,
body[data-theme="day"] .tp-word_pop .tp-sample,
body[data-theme="day"] .tp-slide_up .tp-sample,
body[data-theme="day"] .tp-typewriter .tp-sample,
body[data-theme="day"] .tp-bounce .tp-sample,
body[data-theme="day"] .tp-capcut_bold .tp-sample {
  text-shadow: none;
  -webkit-text-stroke-color: rgba(23, 32, 25, .22);
}
body[data-theme="day"] .tp-karaoke .tp-sample,
body[data-theme="day"] .tp-fade .tp-sample { color: rgba(23, 32, 25, .55); }

body[data-theme="day"] .color-control,
body[data-theme="day"] .model-form,
body[data-theme="day"] .music-strength,
body[data-theme="day"] .publish-step,
body[data-theme="day"] .safe-area-tools,
body[data-theme="day"] .batch-card,
body[data-theme="day"] .caption-card,
body[data-theme="day"] .hook-card,
body[data-theme="day"] .preset-card { background: #fafcf8; }
body[data-theme="day"] .seg,
body[data-theme="day"] .seg-tabs { background: #edf1e9; }
body[data-theme="day"] .seg-opt.active,
body[data-theme="day"] .seg-tab.active { background: #ffffff; box-shadow: 0 1px 3px rgba(35, 47, 30, .12); }
body[data-theme="day"] .switch-knob { background: #ffffff; box-shadow: 0 1px 3px rgba(35, 47, 30, .24); }
body[data-theme="day"] .swatch.active { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--accent); }

body[data-theme="day"] .model-card.is-fav { background: linear-gradient(90deg, rgba(134, 189, 18, .12), #ffffff 42%); }
body[data-theme="day"] .model-card.is-active { box-shadow: 0 0 0 2px var(--accent), 0 6px 18px rgba(134, 189, 18, .16); }
body[data-theme="day"] .preview-frame { box-shadow: 0 12px 30px rgba(35, 47, 30, .16); }
body[data-theme="day"] .preview-safe-guide span { background: rgba(255, 255, 255, .88); }
body[data-theme="day"] .job-thumb { background: linear-gradient(135deg, #dce4d7, #f4f7f0); }
body[data-theme="day"] .job-play { border-left-color: rgba(23, 32, 25, .82); }
body[data-theme="day"] .wave-bar { background: rgba(27, 38, 24, .20); }
body[data-theme="day"] .word-chip { background: #ffffff; }
body[data-theme="day"] .color-picker { box-shadow: var(--shadow-pop), 0 0 0 1px rgba(27, 38, 24, .10); }

/* ==========================================================================
   Toast stack (queue multi-niveaux)
   ========================================================================== */
.toast-stack {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
  max-width: 90vw;
}
.toast-stack .toast {
  position: relative;
  bottom: auto;
  left: auto;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  animation: toastSlideIn var(--t-mid) var(--ease);
}
.toast-stack .toast.leaving { animation: toastSlideOut var(--t-mid) var(--ease) forwards; }
@keyframes toastSlideIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes toastSlideOut {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(10px); opacity: 0; }
}
@media (max-width: 560px) {
  .toast-stack { right: 12px; left: 12px; bottom: max(12px, env(safe-area-inset-bottom)); transform: none; max-width: none; }
}

/* ==========================================================================
   Modal de confirmation (remplace window.confirm)
   ========================================================================== */
.confirm-modal {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(4px);
  animation: ksFade var(--t-fast) var(--ease);
}
.confirm-modal.hidden { display: none; }
.confirm-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 30px 26px 24px;
  text-align: center;
  animation: ksBounce var(--t-mid) var(--ease);
}
.confirm-icon-wrap {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(239,111,111,.12);
  border: 1px solid rgba(239,111,111,.30);
  color: #f4a0a0;
}
.confirm-icon-wrap.kind-info {
  background: var(--accent-tint);
  border-color: rgba(194,247,63,.30);
  color: var(--accent);
}
.confirm-title { font-size: 19px; letter-spacing: -.025em; }
.confirm-actions { display: flex; gap: 10px; margin-top: 4px; }
.confirm-actions .btn { min-width: 96px; min-height: 40px; justify-content: center; }
@media (max-width: 560px) {
  .confirm-card { padding: 26px 20px 20px; }
  .confirm-actions { width: 100%; flex-direction: column; }
  .confirm-actions .btn { width: 100%; }
}

/* ==========================================================================
   Upload progress bar
   ========================================================================== */
.upload-progress {
  position: relative;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--bd-10);
  border-radius: var(--r-btn);
  background: var(--fill-02);
  display: grid;
  gap: 6px;
  animation: ksFade var(--t-fast) var(--ease);
}
.upload-progress-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--fill-06);
  overflow: hidden;
}
.upload-progress-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width .2s var(--ease);
}
.upload-progress-label {
  font: 11px var(--font-mono);
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
}

/* ==========================================================================
   Skeleton loaders
   ========================================================================== */
.skeleton {
  background: linear-gradient(90deg, var(--fill-03) 25%, var(--fill-06) 50%, var(--fill-03) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-line { height: 12px; margin-bottom: 6px; }
.skeleton-line.short { width: 60%; }
.skeleton-preview { width: 100%; aspect-ratio: 9 / 16; max-height: 200px; border-radius: var(--r-card); }

/* ==========================================================================
   Day theme — nouveaux composants
   ========================================================================== */
body[data-theme="day"] .confirm-icon-wrap { background: rgba(220,80,80,.10); border-color: rgba(220,80,80,.25); color: #c44; }
body[data-theme="day"] .confirm-icon-wrap.kind-info { background: rgba(134,189,18,.10); border-color: rgba(134,189,18,.30); color: #5a8a0c; }
body[data-theme="day"] .upload-progress { background: rgba(0,0,0,.02); border-color: rgba(0,0,0,.08); }
body[data-theme="day"] .skeleton { background: linear-gradient(90deg, rgba(0,0,0,.04) 25%, rgba(0,0,0,.08) 50%, rgba(0,0,0,.04) 75%); background-size: 200% 100%; }
body[data-theme="day"] .toast-stack .toast { background: #ffffff; border-color: rgba(0,0,0,.10); box-shadow: 0 8px 28px rgba(35,47,30,.18); }
