/* ═══════════════════════════════════════════════════════════════
   AsiaBuzz Studio — Stylesheet v2
   Design éditorial premium · light + dark · K-pop accents
   Lexend partout, contrastes hauts, pas d'italique (dyslexie)
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&family=Instrument+Serif&display=swap');

/* ═════════════════════════════════════════════
   THEMES — Light + Dark
   ═════════════════════════════════════════════ */

/* DARK (par défaut) */
:root, [data-theme="dark"] {
    --bg:              #080B14;
    --bg-elevated:     #0D1117;
    --bg-sunken:       #050810;
    --bg-card:         rgba(255, 255, 255, 0.035);
    --bg-card-hi:      rgba(255, 255, 255, 0.06);
    --bg-input:        rgba(0, 0, 0, 0.32);

    --bd:              rgba(255, 255, 255, 0.08);
    --bd-hi:           rgba(255, 255, 255, 0.16);
    --bd-soft:         rgba(255, 255, 255, 0.04);

    --fg:              #F8FAFC;
    --fg-soft:         #CBD5E1;
    --fg-muted:        #94A3B8;
    --fg-faint:        #64748B;
    --fg-dim:          #475569;

    --shadow-card:     0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 36px rgba(0,0,0,0.36);
    --shadow-hi:       0 1px 0 rgba(255,255,255,0.06) inset, 0 20px 56px rgba(0,0,0,0.55);

    --halo-1:          radial-gradient(ellipse 900px 600px at 8% -8%, rgba(124, 58, 237, 0.18), transparent 55%);
    --halo-2:          radial-gradient(ellipse 700px 500px at 94% 4%, rgba(236, 72, 153, 0.12), transparent 60%);
    --halo-3:          radial-gradient(ellipse 1400px 700px at 50% 110%, rgba(79, 70, 229, 0.10), transparent 65%);
    --grain-opacity:   0.6;

    --topbar-bg:       rgba(8, 11, 20, 0.72);
}

/* LIGHT */
[data-theme="light"] {
    --bg:              #FAF8F4;
    --bg-elevated:     #FFFFFF;
    --bg-sunken:       #F1ECE2;
    --bg-card:         #FFFFFF;
    --bg-card-hi:      #FFFFFF;
    --bg-input:        #FFFFFF;

    --bd:              rgba(26, 18, 38, 0.10);
    --bd-hi:           rgba(124, 58, 237, 0.32);
    --bd-soft:         rgba(26, 18, 38, 0.06);

    --fg:              #1A1226;
    --fg-soft:         #322942;
    --fg-muted:        #6B6478;
    --fg-faint:        #8A8395;
    --fg-dim:          #B5B0BD;

    --shadow-card:     0 1px 0 rgba(255,255,255,0.8) inset, 0 6px 20px rgba(26, 18, 38, 0.06), 0 1px 2px rgba(26, 18, 38, 0.04);
    --shadow-hi:       0 1px 0 rgba(255,255,255,0.9) inset, 0 18px 40px rgba(26, 18, 38, 0.10), 0 2px 6px rgba(26, 18, 38, 0.06);

    --halo-1:          radial-gradient(ellipse 900px 600px at 8% -8%, rgba(124, 58, 237, 0.10), transparent 55%);
    --halo-2:          radial-gradient(ellipse 700px 500px at 94% 4%, rgba(236, 72, 153, 0.08), transparent 60%);
    --halo-3:          radial-gradient(ellipse 1400px 700px at 50% 110%, rgba(245, 158, 11, 0.06), transparent 65%);
    --grain-opacity:   0;

    --topbar-bg:       rgba(250, 248, 244, 0.82);
}

/* ═════════════════════════════════════════════
   CORE TOKENS (couleurs marque + type + anim)
   ═════════════════════════════════════════════ */
:root {
    /* Marque K-pop · stable entre thèmes */
    --violet:          #7C3AED;
    --violet-hi:       #A78BFA;
    --violet-dk:       #5B21B6;
    --indigo:          #4F46E5;
    --rose:            #EC4899;
    --rose-hi:         #F472B6;
    --rose-dk:         #BE185D;
    --gold:            #F59E0B;
    --gold-hi:         #FCD34D;
    --gold-dk:         #B45309;

    --grad-primary:    linear-gradient(135deg, #7C3AED 0%, #4F46E5 100%);
    --grad-kpop:       linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
    --grad-aurora:     linear-gradient(135deg, #7C3AED 0%, #4F46E5 40%, #EC4899 100%);

    --success:         #10B981;
    --danger:          #EF4444;
    --warning:         #F59E0B;

    --glow-v:          rgba(124, 58, 237, 0.45);
    --glow-r:          rgba(236, 72, 153, 0.35);
    --glow-g:          rgba(245, 158, 11, 0.30);

    --font-sans:       'Lexend', system-ui, sans-serif;
    --font-mono:       'JetBrains Mono', monospace;
    --font-serif:      'Instrument Serif', Georgia, serif;

    --r-xs:            6px;
    --r-sm:            10px;
    --r-md:            14px;
    --r-lg:            20px;
    --r-xl:            28px;
    --r-pill:          999px;

    --t-fast:          140ms;
    --t-base:          220ms;
    --t-slow:          380ms;
    --ease:            cubic-bezier(0.22, 1, 0.36, 1);
}

/* ═════════════════════════════════════════════
   RESET + BASE
   ═════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.55;
    color: var(--fg);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    transition: background-color 380ms var(--ease), color 380ms var(--ease);
}

/* Halos lumineux en fond */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: var(--halo-1), var(--halo-2), var(--halo-3);
    z-index: 0;
    transition: opacity 380ms var(--ease);
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: var(--grain-opacity);
    mix-blend-mode: overlay;
}

.app { position: relative; z-index: 1; }

button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124, 58, 237, 0.22); border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: rgba(124, 58, 237, 0.42); }

/* Pas d'italique (dyslexie) */
em, i { font-style: normal; font-weight: 600; }
/* Sauf Instrument Serif accent qui n'a qu'un italique par design */

/* ═════════════════════════════════════════════
   TOPBAR
   ═════════════════════════════════════════════ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 32px;
    background: var(--topbar-bg);
    backdrop-filter: blur(20px) saturate(140%);
    border-bottom: 1px solid var(--bd);
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
}
.brand-mark {
    width: 38px; height: 38px;
    border-radius: 11px;
    background: var(--grad-kpop);
    display: grid;
    place-items: center;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 6px 20px var(--glow-v);
    position: relative;
}
.brand-mark::after {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(255,255,255,0.18), transparent 50%);
    pointer-events: none;
}
.brand-name {
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
    line-height: 1.1;
}
.brand-name b {
    background: var(--grad-aurora);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}
.brand-tag {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    padding: 2px 7px;
    border-radius: var(--r-pill);
    color: var(--gold-dk);
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.28);
    letter-spacing: 0.06em;
    font-weight: 600;
}
[data-theme="dark"] .brand-tag { color: var(--gold); }

.nav {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: center;
}
.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--r-pill);
    background: transparent;
    border: 1px solid transparent;
    color: var(--fg-muted);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-base) var(--ease);
}
.nav-pill svg { width: 17px; height: 17px; stroke-width: 1.8; }
.nav-pill:hover {
    color: var(--fg);
    background: var(--bg-card);
    border-color: var(--bd);
}
.nav-pill.is-active {
    color: white;
    background: var(--grad-primary);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.32), 0 0 0 1px rgba(255,255,255,0.08) inset;
}

.statuses {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: var(--r-pill);
    background: var(--bg-card);
    border: 1px solid var(--bd);
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--fg-soft);
    white-space: nowrap;
}
.status-chip .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
.status-chip.is-warn .dot { background: var(--warning); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }
.status-chip.is-off  .dot { background: var(--fg-dim); box-shadow: none; }
.status-chip .dot.pulse { animation: pulseDot 2s ease-in-out infinite; }
@keyframes pulseDot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.12); }
}

/* ═════════════════════════════════════════════
   LAYOUT
   ═════════════════════════════════════════════ */
.view { display: none; }
.view.is-active {
    display: block;
    animation: fadeUp 380ms var(--ease);
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.page-wrap {
    max-width: 1520px;
    margin: 0 auto;
    padding: 32px 32px 96px;
}

/* ═════════════════════════════════════════════
   BRIEF MATINAL · header éditorial
   ═════════════════════════════════════════════ */
.brief {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 28px;
    margin-bottom: 22px;
}
.brief-meta {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--fg-muted);
    letter-spacing: 0.10em;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.brief-meta::after {
    content: "";
    height: 1px;
    width: 80px;
    background: var(--bd);
    margin-left: 6px;
}
.brief h1 {
    font-size: clamp(2rem, 3.4vw, 2.8rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.025em;
    text-wrap: balance;
    max-width: 900px;
}
.brief h1 .accent {
    font-family: var(--font-serif);
    font-weight: 400;
    background: var(--grad-aurora);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.06em;
    letter-spacing: -0.01em;
}
.brief-count {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-card);
}
.brief-count .num {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    background: var(--grad-kpop);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}
.brief-count .lbl {
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--fg-soft);
}
.brief-count .lbl b { color: var(--fg); font-weight: 600; }

/* ═════════════════════════════════════════════
   VIDSHELF · 3 vidéos du jour
   ═════════════════════════════════════════════ */
.vidshelf {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.vid {
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    padding: 18px 20px;
    cursor: pointer;
    transition: all var(--t-base) var(--ease);
    position: relative;
    overflow: hidden;
    text-align: left;
    box-shadow: var(--shadow-card);
}
.vid::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(236, 72, 153, 0.04) 60%, transparent);
    transition: opacity var(--t-base);
}
.vid:hover { transform: translateY(-2px); border-color: var(--bd-hi); }
.vid:hover::before { opacity: 1; }
.vid.is-active {
    border-color: rgba(236, 72, 153, 0.55);
    box-shadow: var(--shadow-hi), 0 0 0 1px rgba(236, 72, 153, 0.2);
}
.vid.is-active::before {
    opacity: 1;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.10), rgba(236, 72, 153, 0.08) 60%, transparent);
}
.vid-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    position: relative;
}
.vid-num {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--fg-faint);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.vid-tier {
    padding: 3px 9px;
    border-radius: var(--r-pill);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
}
.vid-tier.fort { background: var(--grad-kpop); color: white; box-shadow: 0 4px 12px var(--glow-r); }
.vid-tier.test { background: rgba(245, 158, 11, 0.16); color: var(--gold-dk); border: 1px solid rgba(245, 158, 11, 0.32); }
[data-theme="dark"] .vid-tier.test { color: var(--gold-hi); }
.vid-tier.solo { background: rgba(124, 58, 237, 0.16); color: var(--violet-dk); border: 1px solid rgba(124, 58, 237, 0.32); }
[data-theme="dark"] .vid-tier.solo { color: var(--violet-hi); }

.vid-title {
    font-size: 1.04rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
    text-wrap: balance;
    color: var(--fg);
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
}
.vid-sub {
    font-size: 0.78rem;
    color: var(--fg-muted);
    margin-bottom: 14px;
    position: relative;
}
.vid-score {
    color: var(--fg-soft);
    font-weight: 600;
}

.vid-progress {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    position: relative;
}
.vid-progress .pip {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--bd);
}
.vid-progress .pip.done {
    background: var(--grad-kpop);
}
.vid-progress .pip.cur {
    background: var(--grad-kpop);
    opacity: 0.45;
    position: relative;
}
.vid-progress .pip.cur::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 2px;
    background: var(--grad-kpop);
    width: 60%;
}
.vid-foot {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    color: var(--fg-muted);
    font-family: var(--font-mono);
    position: relative;
}
.vid-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.vid-status .ind {
    width: 6px; height: 6px;
    border-radius: 50%;
}
.vid-status .ind.live {
    background: var(--rose);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.18);
    animation: pulseDot 2s ease-in-out infinite;
}
.vid-status .ind.draft { background: var(--fg-faint); }
.vid-status .ind.ready { background: var(--success); }

/* ═════════════════════════════════════════════
   WORKSPACE · 2 cols (workzone + signaux)
   ═════════════════════════════════════════════ */
.studio-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
}

/* ═════════════════════════════════════════════
   WORKZONE · header + phases tabs + content
   ═════════════════════════════════════════════ */
.workzone {
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.wz-head {
    padding: 22px 28px 0;
    border-bottom: 1px solid var(--bd-soft);
}
.wz-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.wz-eyebrow .marker {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--rose);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.18);
    animation: pulseDot 2s ease-in-out infinite;
}
.wz-eyebrow .lbl {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rose-dk);
}
[data-theme="dark"] .wz-eyebrow .lbl { color: var(--rose-hi); }
.wz-title {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    text-wrap: balance;
}
.wz-sub {
    font-size: 0.92rem;
    color: var(--fg-muted);
    margin-bottom: 22px;
}

/* Phases tabs */
.phases {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin: 0 -28px;
    padding: 0 28px;
    border-top: 1px solid var(--bd-soft);
    border-bottom: 1px solid var(--bd-soft);
    background: linear-gradient(180deg, transparent, rgba(124, 58, 237, 0.025));
}
[data-theme="light"] .phases { background: linear-gradient(180deg, transparent, rgba(124, 58, 237, 0.015)); }
.phase {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: transparent;
    border: 0;
    border-top: 2px solid transparent;
    cursor: pointer;
    text-align: left;
    transition: all var(--t-base);
    position: relative;
    min-width: 0;
}
.phase + .phase { border-left: 1px solid var(--bd-soft); }
.phase-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--bd);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: var(--fg-muted);
    transition: all var(--t-base);
}
.phase-icon svg { width: 17px; height: 17px; stroke-width: 1.8; }
.phase-text { min-width: 0; flex: 1; }
.phase-num {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--fg-faint);
    letter-spacing: 0.10em;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 4px;
}
.phase-name {
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--fg-soft);
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.phase-state {
    margin-left: auto;
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--fg-faint);
}
.phase-state.ok {
    color: var(--success);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.phase:hover { background: var(--bg-card-hi); }
.phase:hover .phase-name { color: var(--fg); }
.phase.is-active {
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.05), transparent);
    border-top-color: var(--rose);
}
[data-theme="light"] .phase.is-active { background: linear-gradient(180deg, rgba(124, 58, 237, 0.04), transparent); }
.phase.is-active .phase-icon {
    background: var(--grad-kpop);
    border-color: transparent;
    color: white;
    box-shadow: 0 6px 16px var(--glow-r);
}
.phase.is-active .phase-name { color: var(--fg); }
.phase.is-done .phase-icon {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.30);
    color: var(--success);
}
.phase.is-done .phase-state { color: var(--success); }

.phase-progress {
    height: 2px;
    background: var(--bd-soft);
    margin: 0 -28px;
    position: relative;
}
.phase-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--grad-aurora);
    box-shadow: 0 0 8px var(--glow-v);
    transition: width 480ms var(--ease);
}

/* Phase content */
.wz-body {
    padding: 28px;
    min-height: 420px;
}
.phase-content { display: none; animation: fadeIn 320ms var(--ease); }
.phase-content.is-active { display: block; }
.plan-content { display: none; animation: fadeIn 320ms var(--ease); }
.plan-content.is-active { display: block; }
.plan-phase.is-active {
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.05), transparent);
    border-top-color: var(--violet);
}
.plan-phase.is-active .phase-icon {
    background: var(--grad-kpop);
    border-color: transparent;
    color: white;
    box-shadow: 0 6px 16px var(--glow-r);
}
.plan-phase.is-active .phase-name { color: var(--fg); }
.plan-phase.is-done .phase-icon {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.30);
    color: var(--green);
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-block + .section-block { margin-top: 32px; padding-top: 28px; border-top: 1px dashed var(--bd); }
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 16px;
}
.section-head .label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--fg-muted);
    letter-spacing: 0.10em;
    text-transform: uppercase;
}
.section-head .label::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 2px;
    background: var(--rose);
}
.section-head h3 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ═════════════════════════════════════════════
   BOUTONS
   ═════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--r-sm);
    background: var(--bg-card);
    border: 1px solid var(--bd);
    color: var(--fg);
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-base) var(--ease);
    white-space: nowrap;
    font-family: var(--font-sans);
}
.btn svg { width: 15px; height: 15px; stroke-width: 1.8; }
.btn:hover {
    background: var(--bg-card-hi);
    border-color: var(--bd-hi);
    transform: translateY(-1px);
}
.btn:active { transform: translateY(0) scale(0.98); }
.btn-primary {
    background: var(--grad-primary);
    border-color: transparent;
    color: white;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.36);
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(124, 58, 237, 0.5); }
.btn-kpop {
    background: var(--grad-kpop);
    border-color: transparent;
    color: white;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.36);
}
.btn-kpop:hover { box-shadow: 0 10px 28px rgba(236, 72, 153, 0.5); }
.btn-gold {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.32);
    color: var(--gold-dk);
}
[data-theme="dark"] .btn-gold { color: var(--gold-hi); }
.btn-gold:hover { background: rgba(245, 158, 11, 0.22); }
.btn-ghost {
    background: transparent;
    border-color: var(--bd);
    color: var(--fg-soft);
}
.btn-lg { padding: 13px 22px; font-size: 0.94rem; }
.btn-icon {
    width: 34px; height: 34px; padding: 0;
    border-radius: var(--r-xs);
}

/* ═════════════════════════════════════════════
   INPUTS
   ═════════════════════════════════════════════ */
.input, .textarea, .select {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--bd);
    border-radius: var(--r-sm);
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    line-height: 1.5;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}
.textarea { resize: vertical; min-height: 80px; }
.label-block {
    display: block;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--fg-muted);
    margin-bottom: 6px;
}

/* ═════════════════════════════════════════════
   PHASE 1 — SOURCES
   ═════════════════════════════════════════════ */
.sources-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.s-stat {
    padding: 16px 18px;
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    position: relative;
    overflow: hidden;
}
.s-stat .num {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}
.s-stat .num.v { color: var(--violet); }
.s-stat .num.r { color: var(--rose); }
.s-stat .num.g { color: var(--gold-dk); }
[data-theme="dark"] .s-stat .num.g { color: var(--gold-hi); }
.s-stat .num.gr { color: var(--success); }
.s-stat .lbl { font-size: 0.8rem; color: var(--fg-muted); }
.s-stat .delta {
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--fg-faint);
}

/* Clusters de sujets (vidéo-groupes) */
.clusters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.cluster {
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    padding: 18px 20px;
    cursor: pointer;
    transition: all var(--t-base) var(--ease);
    position: relative;
}
.cluster:hover {
    border-color: var(--bd-hi);
    transform: translateY(-2px);
}
.cluster.is-pick {
    border-color: rgba(236, 72, 153, 0.55);
    background: linear-gradient(180deg, rgba(236, 72, 153, 0.06), rgba(124, 58, 237, 0.02));
}
.cluster-tier {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 3px 8px;
    border-radius: var(--r-pill);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.cluster-tier.fort { background: var(--grad-kpop); color: white; }
.cluster-tier.test { background: rgba(245, 158, 11, 0.16); color: var(--gold-dk); border: 1px solid rgba(245, 158, 11, 0.32); }
[data-theme="dark"] .cluster-tier.test { color: var(--gold-hi); }
.cluster-tier.solo { background: rgba(124, 58, 237, 0.16); color: var(--violet-dk); border: 1px solid rgba(124, 58, 237, 0.32); }
[data-theme="dark"] .cluster-tier.solo { color: var(--violet-hi); }

.cluster-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 2px 56px 10px 0;
    text-wrap: balance;
}
.cluster-topics {
    display: flex; flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}
.cluster-topic {
    font-size: 0.8rem;
    color: var(--fg-soft);
    padding-left: 14px;
    position: relative;
    line-height: 1.4;
}
.cluster-topic::before {
    content: "";
    position: absolute;
    left: 0; top: 9px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--violet);
}
.cluster-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    color: var(--fg-faint);
    padding-top: 12px;
    border-top: 1px solid var(--bd-soft);
}
.cluster-foot b { color: var(--gold-dk); font-weight: 700; font-family: var(--font-mono); }
[data-theme="dark"] .cluster-foot b { color: var(--gold-hi); }

/* Console */
.console {
    background: linear-gradient(180deg, rgba(0,0,0,0.30), rgba(13, 17, 23, 0.55));
    border: 1px solid rgba(124, 58, 237, 0.22);
    border-radius: var(--r-md);
    overflow: hidden;
    font-family: var(--font-mono);
}
[data-theme="light"] .console {
    background: linear-gradient(180deg, #1A1226, #0F0A1A);
    border-color: rgba(124, 58, 237, 0.4);
}
.console-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    background: rgba(124, 58, 237, 0.10);
    border-bottom: 1px solid rgba(124, 58, 237, 0.20);
    font-size: 0.72rem;
    color: rgba(203, 213, 225, 0.86);
}
.console-head .traffic { display: flex; gap: 5px; }
.console-head .traffic span { width: 9px; height: 9px; border-radius: 50%; }
.console-head .traffic span:nth-child(1) { background: var(--rose); }
.console-head .traffic span:nth-child(2) { background: var(--gold); }
.console-head .traffic span:nth-child(3) { background: var(--success); }
.console-body {
    padding: 14px 18px;
    max-height: 220px;
    overflow-y: auto;
    font-size: 0.8rem;
    line-height: 1.7;
    color: #CBD5E1;
}
.console-line { display: flex; gap: 10px; }
.console-line .ts { color: #64748B; flex-shrink: 0; }
.console-line .msg.v { color: var(--violet-hi); }
.console-line .msg.r { color: var(--rose-hi); }
.console-line .msg.g { color: #6EE7B7; }
.console-line .msg.y { color: var(--gold-hi); }
.console-line .msg { color: #CBD5E1; }

/* ═════════════════════════════════════════════
   PHASE 2 — ÉCRITURE
   ═════════════════════════════════════════════ */
.hook-row {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 18px;
    margin-bottom: 28px;
}
.hook-card {
    padding: 22px 26px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.08), rgba(124, 58, 237, 0.04));
    border: 1px solid rgba(236, 72, 153, 0.28);
    border-radius: var(--r-md);
    position: relative;
}
.hook-card .quote-mark {
    position: absolute;
    top: 8px;
    left: 18px;
    font-family: var(--font-serif);
    font-size: 4rem;
    line-height: 1;
    color: rgba(236, 72, 153, 0.32);
    font-weight: 400;
}
.hook-label {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--rose-dk);
    margin-bottom: 10px;
    padding-left: 44px;
}
[data-theme="dark"] .hook-label { color: var(--rose-hi); }
.hook-text {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.015em;
    padding-left: 44px;
    margin-bottom: 14px;
    text-wrap: balance;
    color: var(--fg);
}
.hook-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--fg-muted);
    padding-left: 44px;
}
.hook-meta b { color: var(--fg-soft); font-weight: 600; font-variant-numeric: tabular-nums; }
.hook-meta span + span::before {
    content: "·";
    margin-right: 14px;
    color: var(--fg-dim);
}

.hook-aside {
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    padding: 16px 18px;
}
.hook-aside h4 {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.10em;
    margin-bottom: 12px;
}
.hook-sgs { display: flex; flex-direction: column; gap: 8px; }
.hook-sg {
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--bd-soft);
    border-radius: var(--r-xs);
    font-size: 0.84rem;
    color: var(--fg-soft);
    line-height: 1.4;
    cursor: pointer;
    transition: all var(--t-fast);
}
.hook-sg:hover { border-color: rgba(236, 72, 153, 0.32); color: var(--fg); background: var(--bg-card-hi); }

.tt-card {
    padding: 16px 20px;
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    margin-bottom: 18px;
}
.tt-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--fg-muted);
    margin-bottom: 8px;
}
.tt-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 10px;
}
.tags {
    display: flex; flex-wrap: wrap; gap: 5px;
}
.tag {
    padding: 3px 9px;
    border-radius: var(--r-pill);
    background: rgba(124, 58, 237, 0.10);
    border: 1px solid rgba(124, 58, 237, 0.22);
    color: var(--violet-dk);
    font-size: 0.76rem;
    font-weight: 500;
}
[data-theme="dark"] .tag { color: var(--violet-hi); }
.tag.gold {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);
    color: var(--gold-dk);
}
[data-theme="dark"] .tag.gold { color: var(--gold-hi); }

/* Segment badges — structure sandwich */
.seg-badge {
    padding: 2px 8px;
    border-radius: var(--r-pill);
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}
.seg-badge.seg-all {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: var(--success);
}
.seg-badge.seg-a {
    background: rgba(236, 72, 153, 0.12);
    border: 1px solid rgba(236, 72, 153, 0.28);
    color: var(--rose-dk);
}
[data-theme="dark"] .seg-badge.seg-a { color: var(--rose-hi); }
.seg-badge.seg-b {
    background: rgba(79, 70, 229, 0.12);
    border: 1px solid rgba(79, 70, 229, 0.28);
    color: var(--indigo);
}
[data-theme="dark"] .seg-badge.seg-b { color: #a5b4fc; }
.seg-badge.seg-c {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: var(--gold-dk);
}
[data-theme="dark"] .seg-badge.seg-c { color: var(--gold-hi); }
.seg-badge.seg-d {
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(20, 184, 166, 0.28);
    color: #0f766e;
}
[data-theme="dark"] .seg-badge.seg-d { color: #5eead4; }

/* Script meters & sections */
.script-meters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.meter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    border-radius: var(--r-pill);
    font-size: 0.82rem;
}
.meter b {
    font-weight: 700;
    font-size: 0.94rem;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
}
.meter .target { color: var(--fg-faint); font-size: 0.76rem; }
.meter.ok { border-color: rgba(16, 185, 129, 0.34); background: rgba(16, 185, 129, 0.06); }
.meter.ok b { color: var(--success); }
.meter.warn { border-color: rgba(245, 158, 11, 0.34); background: rgba(245, 158, 11, 0.06); }
.meter.warn b { color: var(--gold-dk); }
[data-theme="dark"] .meter.warn b { color: var(--gold-hi); }

.script-sections { display: flex; flex-direction: column; gap: 10px; }
.sc {
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    overflow: hidden;
    transition: border-color var(--t-fast);
}
.sc:hover { border-color: var(--bd-hi); }
.sc.is-focus {
    border-color: rgba(124, 58, 237, 0.40);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.10);
}
.sc-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--bd-soft);
    background: var(--bg-card);
}
.sc-tag {
    padding: 3px 9px;
    border-radius: var(--r-pill);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(124, 58, 237, 0.14);
    color: var(--violet-dk);
    border: 1px solid rgba(124, 58, 237, 0.28);
}
[data-theme="dark"] .sc-tag { color: var(--violet-hi); }
.sc-tag.hook { background: rgba(236, 72, 153, 0.14); color: var(--rose-dk); border-color: rgba(236, 72, 153, 0.28); }
[data-theme="dark"] .sc-tag.hook { color: var(--rose-hi); }
.sc-tag.promesse { background: rgba(245, 158, 11, 0.14); color: var(--gold-dk); border-color: rgba(245, 158, 11, 0.30); }
[data-theme="dark"] .sc-tag.promesse { color: var(--gold-hi); }
.sc-tag.revelation { background: rgba(16, 185, 129, 0.12); color: var(--success); border-color: rgba(16, 185, 129, 0.30); }
.sc-tag.cta { background: rgba(79, 70, 229, 0.16); color: var(--indigo); border-color: rgba(79, 70, 229, 0.30); }
.sc-name { font-size: 0.84rem; font-weight: 600; flex: 1; }
.sc-words { font-size: 0.72rem; color: var(--fg-faint); font-family: var(--font-mono); }
.sc-actions { display: flex; gap: 3px; }
.sc-act {
    width: 26px; height: 26px;
    border-radius: var(--r-xs);
    background: transparent;
    border: 1px solid transparent;
    color: var(--fg-muted);
    display: grid; place-items: center;
    cursor: pointer;
}
.sc-act:hover { background: var(--bg-card-hi); color: var(--fg); }
.sc-act svg { width: 13px; height: 13px; }
.sc-body { padding: 12px 16px 14px; }
.sc-textarea {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: 0.92rem;
    line-height: 1.65;
    resize: none;
    overflow: hidden;
}
.sc-textarea:focus { outline: none; }

/* Phonétique */
.phon-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.phon {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    border-radius: var(--r-sm);
}
.phon .orig { font-weight: 600; }
.phon .arrow { color: var(--fg-faint); }
.phon .input { padding: 7px 10px; font-size: 0.85rem; }

/* ═════════════════════════════════════════════
   PHASE 3 — AUDIO
   ═════════════════════════════════════════════ */
.audio-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.au {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    border-radius: var(--r-sm);
}
.au .au-num {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.14);
    color: var(--violet-dk);
    display: grid; place-items: center;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
}
[data-theme="dark"] .au .au-num { color: var(--violet-hi); }
.au.is-ok .au-num { background: rgba(16, 185, 129, 0.18); color: var(--success); }
.au-label { font-weight: 500; }
.au-dur { font-family: var(--font-mono); font-size: 0.8rem; color: var(--fg-faint); }

.audio-progress {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(236, 72, 153, 0.04));
    border: 1px solid rgba(124, 58, 237, 0.22);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}
.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bd);
    border-radius: var(--r-pill);
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--grad-kpop);
    border-radius: var(--r-pill);
    box-shadow: 0 0 12px var(--glow-r);
    transition: width 600ms var(--ease);
}
.progress-label {
    font-family: var(--font-mono);
    font-size: 0.84rem;
    color: var(--fg);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.final-audio {
    padding: 22px 26px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(236, 72, 153, 0.05));
    border: 1px solid rgba(124, 58, 237, 0.28);
    border-radius: var(--r-md);
}
.fa-row { display: flex; align-items: center; gap: 18px; }
.fa-play {
    width: 54px; height: 54px; border-radius: 50%;
    background: var(--grad-kpop);
    border: 0;
    display: grid; place-items: center;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 8px 24px var(--glow-r);
    transition: transform var(--t-base);
}
.fa-play:hover { transform: scale(1.05); }
.fa-play svg { width: 22px; height: 22px; fill: white; }
.fa-info .title {
    font-size: 0.94rem;
    font-weight: 600;
    margin-bottom: 4px;
    font-family: var(--font-mono);
}
.fa-info .meta {
    font-size: 0.78rem;
    color: var(--fg-muted);
    font-family: var(--font-mono);
}
.fa-wave {
    flex: 1;
    height: 40px;
    border-radius: var(--r-xs);
    overflow: hidden;
}
.fa-wave svg { width: 100%; height: 100%; }
.fa-wave svg rect { fill: rgba(124, 58, 237, 0.55); }
[data-theme="light"] .fa-wave svg rect { fill: rgba(124, 58, 237, 0.65); }

/* ═════════════════════════════════════════════
   PHASE 4 — VISUEL & EXPORT
   ═════════════════════════════════════════════ */
.sb-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0 14px;
    margin: 0 -28px 22px;
    padding-left: 28px;
    padding-right: 28px;
    scroll-snap-type: x mandatory;
}
.sb-scene {
    flex: 0 0 152px;
    aspect-ratio: 9/16;
    border-radius: var(--r-md);
    border: 1.5px solid var(--bd);
    background: linear-gradient(180deg, #1a1330 0%, #0d0a1c 100%);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--t-base);
    scroll-snap-align: start;
    box-shadow: var(--shadow-card);
}
.sb-scene:hover { transform: translateY(-2px); border-color: rgba(236, 72, 153, 0.42); }
.sb-scene.is-ok { border-color: rgba(16, 185, 129, 0.45); }
.sb-num {
    position: absolute;
    top: 8px; left: 8px;
    padding: 2px 7px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    border-radius: var(--r-xs);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    color: white;
}
.sb-badge {
    position: absolute;
    top: 8px; right: 8px;
    padding: 2px 7px;
    border-radius: var(--r-xs);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sb-badge.ok { background: var(--success); color: white; }
.sb-badge.todo { background: var(--gold); color: #0F0A1A; }
.sb-art { width: 100%; height: 62%; opacity: 0.78; }
.sb-art.k1 { background: linear-gradient(135deg, #1e0a3d, #6d28d9, #ec4899); }
.sb-art.k2 { background: linear-gradient(135deg, #0c0a2e, #4f46e5, #ec4899); }
.sb-art.k3 { background: linear-gradient(135deg, #4c1d95, #ec4899, #f59e0b); }
.sb-art.k4 { background: linear-gradient(135deg, #312e81, #7c3aed, #db2777); }
.sb-art.k5 { background: linear-gradient(135deg, #581c87, #c026d3, #fbbf24); }
.sb-art.k6 { background: linear-gradient(180deg, #0c0a2e, #4338ca, #ec4899); }
.sb-art.k7 { background: linear-gradient(135deg, #1e1b4b, #6366f1, #f472b6); }
.sb-cap {
    padding: 10px 11px;
    height: 38%;
    background: linear-gradient(180deg, #14101e, #0d0a1c);
}
.sb-cap .line {
    font-size: 0.76rem;
    font-weight: 600;
    color: #F1ECE2;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sb-cap .mood {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: rgba(241, 236, 226, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Assets visuels */
.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 26px;
}
.asset-cell {
    aspect-ratio: 3/4;
    border-radius: var(--r-md);
    border: 1.5px solid var(--bd);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all var(--t-fast);
    box-shadow: var(--shadow-card);
}
.asset-cell:hover { transform: translateY(-2px); border-color: rgba(236, 72, 153, 0.42); }
.asset-cell.is-ok { border-color: rgba(16, 185, 129, 0.5); }
.asset-cell.gold::after {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(245, 158, 11, 0.28));
    pointer-events: none;
}
.asset-fill { position: absolute; inset: 0; }
.asset-fill.a1 { background: linear-gradient(160deg, #5b21b6, #ec4899); }
.asset-fill.a2 { background: linear-gradient(160deg, #312e81, #db2777); }
.asset-fill.a3 { background: linear-gradient(160deg, #18181b, #7c3aed); }
.asset-fill.a4 { background: linear-gradient(160deg, #4c1d95, #f472b6); }
.asset-fill.a5 { background: linear-gradient(160deg, #0f172a, #6366f1); }
.asset-fill.a6 { background: linear-gradient(160deg, #831843, #f59e0b); }
.asset-fill.a7 { background: linear-gradient(160deg, #1e1b4b, #c026d3); }
.asset-fill.a8 { background: linear-gradient(160deg, #500724, #db2777); }
.asset-meta {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 8px 10px;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.72));
    font-size: 0.74rem;
    font-weight: 500;
    color: white;
    display: flex; justify-content: space-between; align-items: center;
}
.asset-tag {
    font-size: 0.58rem;
    font-family: var(--font-mono);
    color: var(--gold-hi);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Export récap */
.export-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 18px;
}
.recap {
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    padding: 20px;
}
.recap h4 {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}
.recap-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--bd-soft);
    font-size: 0.86rem;
}
.recap-row:last-child { border-bottom: 0; }
.recap-row .k { color: var(--fg-muted); }
.recap-row .v {
    color: var(--fg);
    font-weight: 600;
    display: flex; align-items: center; gap: 6px;
    font-variant-numeric: tabular-nums;
}
.recap-row .v .check { color: var(--success); }

.colab-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.10), rgba(124, 58, 237, 0.04));
    border: 1px solid rgba(245, 158, 11, 0.30);
    border-radius: var(--r-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
}
.colab-card h4 {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gold-dk);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
}
[data-theme="dark"] .colab-card h4 { color: var(--gold-hi); }
.colab-status {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-sm);
    margin-bottom: 14px;
}
.colab-status .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 12px var(--success);
    animation: pulseDot 2s ease-in-out infinite;
}
.colab-status .info { flex: 1; font-family: var(--font-mono); font-size: 0.78rem; }
.colab-status .info .lbl { color: var(--fg-muted); font-size: 0.7rem; }
.colab-status .info .val { color: var(--fg); font-weight: 600; }
.export-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 14px; }

/* Phase footer (actions sticky) */
.phase-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 28px;
    background: var(--bg-card-hi);
    border-top: 1px solid var(--bd-soft);
    margin: 28px -28px -28px;
}
.phase-foot .info {
    display: flex; align-items: center; gap: 12px;
    font-size: 0.84rem;
    color: var(--fg-muted);
}
.phase-foot .info b { color: var(--fg); font-weight: 600; }

/* ═════════════════════════════════════════════
   SIDEBAR · signaux
   ═════════════════════════════════════════════ */
.signals {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 116px);
    overflow-y: auto;
    padding-right: 4px;
}
.signal-card {
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    padding: 16px 18px;
    box-shadow: var(--shadow-card);
}
.signal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.signal-head h4 {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.signal-head h4 svg { width: 14px; height: 14px; color: var(--rose); }
.signal-count {
    padding: 2px 8px;
    background: rgba(124, 58, 237, 0.12);
    border-radius: var(--r-pill);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--violet-dk);
    font-weight: 600;
}
[data-theme="dark"] .signal-count { color: var(--violet-hi); }
.signal-list { display: flex; flex-direction: column; gap: 2px; }
.signal-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 7px 8px;
    border-radius: var(--r-xs);
    font-size: 0.82rem;
    color: var(--fg-soft);
    line-height: 1.35;
    cursor: pointer;
    transition: background var(--t-fast);
}
.signal-item:hover { background: var(--bg-card-hi); }
.signal-item .src {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    padding: 2px 6px;
    border-radius: var(--r-xs);
    background: rgba(124, 58, 237, 0.14);
    color: var(--violet-dk);
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: 0.04em;
}
[data-theme="dark"] .signal-item .src { color: var(--violet-hi); }
.signal-item .src.gold { background: rgba(245, 158, 11, 0.16); color: var(--gold-dk); }
[data-theme="dark"] .signal-item .src.gold { color: var(--gold-hi); }
.signal-item .src.rose { background: rgba(236, 72, 153, 0.14); color: var(--rose-dk); }
[data-theme="dark"] .signal-item .src.rose { color: var(--rose-hi); }
.signal-item .src.gr { background: rgba(16, 185, 129, 0.14); color: var(--success); }
.signal-item .lbl { flex: 1; min-width: 0; }

.signal-trend {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 8px;
    border-radius: var(--r-xs);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background var(--t-fast);
}
.signal-trend:hover { background: var(--bg-card-hi); }
.signal-trend .rank {
    width: 22px; height: 22px;
    border-radius: var(--r-xs);
    background: rgba(124, 58, 237, 0.14);
    color: var(--violet-dk);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.72rem;
    display: grid; place-items: center;
}
[data-theme="dark"] .signal-trend .rank { color: var(--violet-hi); }
.signal-trend .name { flex: 1; color: var(--fg-soft); }
.signal-trend .delta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--success);
}

.birthday-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.10), rgba(236, 72, 153, 0.06));
    border: 1px solid rgba(245, 158, 11, 0.30);
}
.bd-row {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 6px;
    border-bottom: 1px solid var(--bd-soft);
}
.bd-row:last-child { border-bottom: 0; }
.bd-row .avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}
.bd-row .a1 { background: linear-gradient(135deg, #f472b6, #ec4899); }
.bd-row .a2 { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.bd-row .a3 { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.bd-row .info { flex: 1; min-width: 0; }
.bd-row .name { font-size: 0.86rem; font-weight: 600; }
.bd-row .meta { font-size: 0.72rem; color: var(--fg-muted); }
.bd-row .age {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--gold-dk);
    font-weight: 700;
}
[data-theme="dark"] .bd-row .age { color: var(--gold-hi); }

/* ═════════════════════════════════════════════
   BIBLIOTHÈQUE
   ═════════════════════════════════════════════ */
.lib-head {
    display: flex; align-items: end; justify-content: space-between;
    margin-bottom: 22px;
    gap: 20px;
}
.lib-head h1 {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}
.lib-head h1 .accent {
    font-family: var(--font-serif);
    font-weight: 400;
    background: var(--grad-aurora);
    -webkit-background-clip: text;
    color: transparent;
}
.lib-head .sub { color: var(--fg-muted); font-size: 0.92rem; margin-top: 4px; }

.lib-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
.lib-stat {
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-card);
}
.lib-stat .num {
    font-size: 2.2rem; font-weight: 700; line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
}
.lib-stat .lbl { font-size: 0.8rem; color: var(--fg-muted); }
.lib-stat .delta {
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--success);
}
.lib-stat .num.v { color: var(--violet); }
.lib-stat .num.r { color: var(--rose); }
.lib-stat .num.g { color: var(--gold-dk); }
[data-theme="dark"] .lib-stat .num.g { color: var(--gold-hi); }

.lib-filters {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 18px;
}
.chip {
    padding: 7px 14px;
    border-radius: var(--r-pill);
    background: var(--bg-card);
    border: 1px solid var(--bd);
    font-size: 0.82rem;
    color: var(--fg-muted);
    cursor: pointer;
    transition: all var(--t-fast);
}
.chip:hover { color: var(--fg); border-color: var(--bd-hi); }
.chip.is-active {
    background: rgba(124, 58, 237, 0.14);
    color: var(--violet-dk);
    border-color: rgba(124, 58, 237, 0.42);
}
[data-theme="dark"] .chip.is-active { color: var(--violet-hi); }

.lib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.lib-card {
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--t-base) var(--ease);
    box-shadow: var(--shadow-card);
}
.lib-card:hover {
    transform: translateY(-3px);
    border-color: rgba(236, 72, 153, 0.32);
    box-shadow: var(--shadow-hi);
}
.lib-thumb {
    aspect-ratio: 9/16;
    max-height: 220px;
    position: relative;
    overflow: hidden;
}
.lib-thumb .fill { position: absolute; inset: 0; }
.lib-thumb .fill.t1 { background: linear-gradient(180deg, #4c1d95, #db2777 60%, #f59e0b); }
.lib-thumb .fill.t2 { background: linear-gradient(180deg, #0c0a2e, #4f46e5, #ec4899); }
.lib-thumb .fill.t3 { background: linear-gradient(180deg, #1e1b4b, #c026d3 70%, #fbbf24); }
.lib-thumb .fill.t4 { background: linear-gradient(180deg, #18181b, #7c3aed, #f472b6); }
.lib-thumb .fill.t5 { background: linear-gradient(180deg, #500724, #db2777, #f59e0b); }
.lib-thumb .fill.t6 { background: linear-gradient(180deg, #312e81, #6366f1, #ec4899); }
.lib-thumb .play-overlay {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    opacity: 0; transition: opacity var(--t-base);
    background: rgba(0,0,0,0.32);
}
.lib-card:hover .lib-thumb .play-overlay { opacity: 1; }
.play-btn {
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--grad-kpop);
    display: grid; place-items: center;
    box-shadow: 0 8px 24px var(--glow-r);
}
.play-btn svg { width: 22px; height: 22px; fill: white; }
.lib-thumb .duration {
    position: absolute; bottom: 8px; right: 8px;
    padding: 3px 8px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    border-radius: var(--r-xs);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}
.lib-thumb .views {
    position: absolute; top: 8px; left: 8px;
    padding: 3px 8px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    border-radius: var(--r-xs);
    font-size: 0.72rem;
    color: white;
    font-weight: 500;
    display: flex; align-items: center; gap: 5px;
}
.lib-thumb .views svg { width: 12px; height: 12px; }
.lib-body { padding: 14px 16px; }
.lib-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
    color: var(--fg);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lib-meta {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.74rem;
    color: var(--fg-faint);
    font-family: var(--font-mono);
    margin-top: 8px;
}
.lib-platforms { display: flex; gap: 4px; }
.lib-platforms .plat {
    width: 18px; height: 18px;
    border-radius: 4px;
    display: grid; place-items: center;
    font-size: 0.58rem;
    font-weight: 700;
    color: white;
}
.lib-platforms .plat.tt { background: linear-gradient(135deg, #25F4EE, #FE2C55); }
.lib-platforms .plat.yt { background: #FF0000; }
.lib-platforms .plat.ig { background: linear-gradient(135deg, #8b5cf6, #ec4899, #f59e0b); }

/* ═════════════════════════════════════════════
   PAGES PLACEHOLDER
   ═════════════════════════════════════════════ */
.placeholder-page {
    padding: 100px 20px;
    text-align: center;
}
.placeholder-page .ph-icon {
    width: 80px; height: 80px;
    margin: 0 auto 24px;
    border-radius: 22px;
    background: var(--grad-kpop);
    display: grid; place-items: center;
    box-shadow: 0 16px 48px var(--glow-r);
}
.placeholder-page .ph-icon svg { width: 38px; height: 38px; color: white; }
.placeholder-page h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}
.placeholder-page p {
    color: var(--fg-muted);
    font-size: 0.95rem;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ═════════════════════════════════════════════
   UTILITAIRES
   ═════════════════════════════════════════════ */
.spacer { height: 16px; }
.spacer-lg { height: 28px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.muted { color: var(--fg-muted); }
.dim { color: var(--fg-faint); }
.dim-sm { color: var(--fg-faint); font-size: 0.8rem; }

/* ═════════════════════════════════════════════
   ÉDITEUR VIDÉO (Phase 4) · timeline CapCut-style
   ═════════════════════════════════════════════ */
.editor {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.editor-top {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 22px;
    align-items: stretch;
}

.preview-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.preview-frame {
    width: 220px;
    aspect-ratio: 9/16;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    background: #0d0a1c;
    box-shadow: 0 20px 50px rgba(124, 58, 237, 0.32), 0 0 0 1px rgba(255,255,255,0.06);
}
.preview-art {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1e0a3d 0%, #6d28d9 45%, #ec4899 100%);
}
.preview-art::after {
    content: "";
    position: absolute;
    inset: -20% -10% 50% -10%;
    background: radial-gradient(ellipse at 50% 60%, rgba(255, 220, 100, 0.42), transparent 55%);
    pointer-events: none;
    filter: blur(20px);
}
.preview-figure {
    position: absolute;
    bottom: 22%;
    left: 50%;
    transform: translateX(-50%);
    width: 55%;
    aspect-ratio: 3/4;
    border-radius: 50% 50% 35% 35%;
    background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(0,0,0,0.4));
    border: 1.5px solid rgba(245, 158, 11, 0.5);
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.4), inset 0 0 20px rgba(255,200,100,0.18);
}
.preview-cap {
    position: absolute;
    bottom: 8%;
    left: 0; right: 0;
    text-align: center;
    padding: 0 10%;
    z-index: 2;
}
.preview-cap .ctl {
    display: inline-block;
    font-size: 1.12rem;
    font-weight: 800;
    color: white;
    line-height: 1.1;
    text-shadow: 0 3px 14px rgba(0,0,0,0.7);
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, rgba(0,0,0,0.4), transparent);
    padding: 4px 10px;
    border-radius: 6px;
}
.preview-brand {
    position: absolute;
    top: 12px; right: 12px;
    padding: 3px 8px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(6px);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--gold-hi);
    font-weight: 700;
    z-index: 2;
}

.preview-ctrls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ctrl-btn {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    color: var(--fg);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all var(--t-fast);
}
.ctrl-btn:hover { background: var(--bg-card); border-color: var(--bd-hi); }
.ctrl-btn svg { width: 14px; height: 14px; }
.ctrl-btn.play {
    width: 38px; height: 38px;
    background: var(--grad-kpop);
    border-color: transparent;
    color: white;
    box-shadow: 0 6px 16px var(--glow-r);
}
.ctrl-btn.play svg { width: 16px; height: 16px; fill: white; }
.ctrl-time {
    margin-left: 6px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--fg-soft);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.ctrl-time .cur { color: var(--rose); }

.editor-meta {
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.editor-meta .em-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.editor-meta .em-head h4 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.editor-meta .em-head .pill {
    padding: 3px 9px;
    border-radius: var(--r-pill);
    background: rgba(16, 185, 129, 0.14);
    color: var(--success);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid rgba(16, 185, 129, 0.32);
}

.em-check {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 18px;
    font-size: 0.84rem;
}
.em-check li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--fg-soft);
}
.em-check li::before {
    content: "";
    width: 16px; height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}
.em-check li.ok { color: var(--fg); }
.em-check li.ok::before {
    background: rgba(16, 185, 129, 0.18);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310B981' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: 11px 11px;
    background-position: center;
    background-repeat: no-repeat;
}
.em-check li.todo::before {
    background: rgba(245, 158, 11, 0.18);
    border: 1px dashed rgba(245, 158, 11, 0.5);
}

.em-export {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 8px;
}

/* ═══ TIMELINE ═══ */
.tl {
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    padding: 18px 20px;
    overflow-x: auto;
}
[data-theme="dark"] .tl {
    background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.015));
}

.tl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
}
.tl-toolbar .l {
    display: flex; align-items: center; gap: 12px;
    font-size: 0.78rem; color: var(--fg-muted);
}
.tl-toolbar .l b {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--fg);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.tl-zoom {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 10px;
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-pill);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--fg-muted);
}
.tl-zoom button {
    width: 18px; height: 18px;
    border-radius: 4px;
    background: transparent;
    border: 0;
    color: var(--fg-muted);
    cursor: pointer;
    display: grid; place-items: center;
    font-size: 0.9rem;
    font-weight: 700;
}
.tl-zoom button:hover { background: var(--bg-card-hi); color: var(--fg); }

.tl-body {
    display: flex;
    gap: 12px;
    min-width: 760px;
}
.tl-labels {
    width: 90px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tl-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.tl-ruler-spacer { height: 22px; }
.tl-ruler {
    height: 22px;
    position: relative;
    border-bottom: 1px solid var(--bd);
}
.tl-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--bd);
}
.tl-tick.major { background: var(--bd-hi); }
.tl-tick span {
    position: absolute;
    bottom: 5px;
    left: 0;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--fg-faint);
    white-space: nowrap;
    line-height: 1;
}
.tl-tick:first-child span { transform: translateX(0); }
.tl-tick:last-child span { transform: translateX(-100%); }

.tl-lbl {
    height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.tl-lbl svg { width: 13px; height: 13px; stroke-width: 1.8; flex-shrink: 0; }

.tl-track {
    height: 38px;
    position: relative;
    background: rgba(124, 58, 237, 0.04);
    border-radius: 6px;
    overflow: hidden;
}
[data-theme="light"] .tl-track { background: rgba(26, 18, 38, 0.04); }

/* Clips */
.tl-clip {
    position: absolute;
    top: 3px;
    bottom: 3px;
    border-radius: 5px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 2px 6px rgba(0,0,0,0.20);
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.tl-clip:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,0.32); z-index: 4; }

.tl-clip.scene-k1 { background: linear-gradient(135deg, #1e0a3d, #6d28d9, #ec4899); }
.tl-clip.scene-k2 { background: linear-gradient(135deg, #0c0a2e, #4f46e5, #ec4899); }
.tl-clip.scene-k3 { background: linear-gradient(135deg, #4c1d95, #ec4899, #f59e0b); }
.tl-clip.scene-k4 { background: linear-gradient(135deg, #312e81, #7c3aed, #db2777); }
.tl-clip.scene-k5 { background: linear-gradient(135deg, #581c87, #c026d3, #fbbf24); }
.tl-clip.scene-k6 { background: linear-gradient(180deg, #0c0a2e, #4338ca, #ec4899); }
.tl-clip.scene-k7 { background: linear-gradient(135deg, #1e1b4b, #6366f1, #f472b6); }

.tl-clip.img-a1 { background: linear-gradient(160deg, #5b21b6, #ec4899); }
.tl-clip.img-a2 { background: linear-gradient(160deg, #312e81, #db2777); }
.tl-clip.img-a3 { background: linear-gradient(160deg, #18181b, #7c3aed); }
.tl-clip.img-a4 { background: linear-gradient(160deg, #4c1d95, #f472b6); }
.tl-clip.img-a5 { background: linear-gradient(160deg, #831843, #f59e0b); }
.tl-clip.img-a6 { background: linear-gradient(160deg, #1e1b4b, #c026d3); }
.tl-clip.img-a7 { background: linear-gradient(160deg, #500724, #db2777); }
.tl-clip.gold::after {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(circle at center, transparent 40%, rgba(245, 158, 11, 0.42));
    pointer-events: none;
}

.tl-clip.text {
    background: rgba(15, 12, 26, 0.78);
    color: white;
    border-color: rgba(255,255,255,0.22);
    backdrop-filter: blur(8px);
    font-weight: 500;
}
[data-theme="light"] .tl-clip.text {
    background: rgba(26, 18, 38, 0.86);
}

/* Waveform clips */
.tl-wave {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 1.5px;
    padding: 0 4px;
    overflow: hidden;
    cursor: pointer;
    transition: filter var(--t-fast);
}
.tl-wave:hover { filter: brightness(1.15); }
.tl-wave .bar {
    flex: 1;
    min-width: 1.5px;
    background: currentColor;
    border-radius: 1px;
    opacity: 0.85;
}
.tl-wave .label {
    position: absolute;
    top: 4px;
    left: 6px;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    color: rgba(255,255,255,0.92);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    pointer-events: none;
}

.tl-wave.hook       { background: rgba(236, 72, 153, 0.18); border: 1px solid rgba(236, 72, 153, 0.42); color: #F472B6; }
.tl-wave.promesse   { background: rgba(245, 158, 11, 0.18); border: 1px solid rgba(245, 158, 11, 0.42); color: #FCD34D; }
.tl-wave.info       { background: rgba(124, 58, 237, 0.18); border: 1px solid rgba(124, 58, 237, 0.42); color: #A78BFA; }
.tl-wave.revelation { background: rgba(16, 185, 129, 0.16); border: 1px solid rgba(16, 185, 129, 0.42); color: #6EE7B7; }
.tl-wave.cta        { background: rgba(79, 70, 229, 0.20); border: 1px solid rgba(79, 70, 229, 0.45); color: #818CF8; }
.tl-wave.music      { background: rgba(124, 58, 237, 0.06); border: 1px solid rgba(124, 58, 237, 0.18); color: #A78BFA; opacity: 0.65; }
.tl-wave.music .bar { opacity: 0.5; }

/* Playhead */
.tl-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--rose);
    box-shadow: 0 0 10px var(--rose);
    pointer-events: none;
    z-index: 8;
    transition: left 240ms var(--ease);
}
.tl-playhead::before {
    content: "";
    position: absolute;
    top: -3px;
    left: -7px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--rose);
    box-shadow: 0 0 14px var(--rose), 0 0 0 2px rgba(255,255,255,0.06);
}
.tl-playhead::after {
    content: "";
    position: absolute;
    top: 12px;
    left: -5px;
    width: 12px; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid var(--rose);
}

/* ═════════════════════════════════════════════
   FRESHNESS BAR (brief)
   ═════════════════════════════════════════════ */
.freshness {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 14px;
    padding: 5px 4px 5px 11px;
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    border-radius: var(--r-pill);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--fg-soft);
    letter-spacing: 0;
    text-transform: none;
}
.freshness .fr-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
.freshness .fr-news {
    color: var(--rose-dk);
    font-weight: 700;
}
[data-theme="dark"] .freshness .fr-news { color: var(--rose-hi); }
.freshness .fr-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    background: var(--grad-primary);
    color: white;
    border: 0;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.32);
}
.freshness .fr-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(124, 58, 237, 0.5); }
.freshness .fr-btn svg { width: 12px; height: 12px; stroke-width: 2.2; }
.freshness .fr-btn.is-loading svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═════════════════════════════════════════════
   PAGE PARAMÈTRES
   ═════════════════════════════════════════════ */
.set-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 20px;
}
.set-head h1 {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.05;
}
.set-head h1 .accent {
    font-family: var(--font-serif);
    font-weight: 400;
    background: var(--grad-aurora);
    -webkit-background-clip: text;
    color: transparent;
}
.set-head .sub { color: var(--fg-muted); font-size: 0.92rem; margin-top: 4px; }

.set-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    align-items: start;
}
.set-nav {
    position: sticky;
    top: 92px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.set-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: transparent;
    border: 0;
    border-radius: var(--r-sm);
    color: var(--fg-muted);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
    text-align: left;
}
.set-nav-item svg { width: 15px; height: 15px; stroke-width: 1.8; }
.set-nav-item:hover { background: var(--bg-card); color: var(--fg); }
.set-nav-item.is-active {
    background: var(--bg-card);
    color: var(--violet);
    box-shadow: 0 0 0 1px var(--bd);
}
[data-theme="dark"] .set-nav-item.is-active { color: var(--violet-hi); }

.set-content { display: flex; flex-direction: column; gap: 22px; }
.set-card {
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    padding: 24px 26px;
    box-shadow: var(--shadow-card);
    scroll-margin-top: 92px;
}
.set-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.set-card h3 .ic {
    width: 24px; height: 24px;
    border-radius: 6px;
    background: var(--bg-card-hi);
    display: grid; place-items: center;
    color: var(--fg-muted);
}
.set-card h3 .ic svg { width: 13px; height: 13px; }
.set-card p.sub {
    font-size: 0.86rem;
    color: var(--fg-muted);
    margin-bottom: 18px;
}
.set-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--bd-soft);
}
.set-row:first-of-type { padding-top: 6px; }
.set-row:last-of-type { padding-bottom: 6px; border-bottom: 0; }
.set-row .key {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--fg);
}
.set-row .desc {
    font-size: 0.78rem;
    color: var(--fg-muted);
    margin-top: 2px;
}
.set-row .ctrl { display: flex; align-items: center; gap: 10px; }

.api-input {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--bd);
    border-radius: var(--r-sm);
    font-family: var(--font-mono);
    font-size: 0.84rem;
}
.api-input input {
    flex: 1;
    background: transparent;
    border: 0;
    color: var(--fg);
    font: inherit;
    outline: none;
    letter-spacing: 0.02em;
}
.api-input .status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
    font-family: var(--font-sans);
    letter-spacing: 0;
    text-transform: none;
}
.api-input .status.ok { background: rgba(16, 185, 129, 0.14); color: var(--success); }
.api-input .status.warn { background: rgba(245, 158, 11, 0.14); color: var(--gold-dk); }
[data-theme="dark"] .api-input .status.warn { color: var(--gold-hi); }
.api-input .status.err { background: rgba(239, 68, 68, 0.14); color: var(--danger); }
.api-input .status .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.set-row-stack { grid-template-columns: 1fr; align-items: start; gap: 8px; }

/* Mémoire Gemini · liste */
.mem-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}
.mem-item {
    padding: 12px 14px;
    background: var(--bg-card-hi);
    border: 1px solid var(--bd-soft);
    border-radius: var(--r-sm);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
}
.mem-item .mem-type {
    padding: 3px 8px;
    border-radius: var(--r-pill);
    background: rgba(124, 58, 237, 0.14);
    color: var(--violet-dk);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
[data-theme="dark"] .mem-item .mem-type { color: var(--violet-hi); }
.mem-item .mem-type.hook { background: rgba(236, 72, 153, 0.14); color: var(--rose-dk); }
[data-theme="dark"] .mem-item .mem-type.hook { color: var(--rose-hi); }
.mem-item .mem-type.phon { background: rgba(245, 158, 11, 0.14); color: var(--gold-dk); }
[data-theme="dark"] .mem-item .mem-type.phon { color: var(--gold-hi); }
.mem-item .mem-type.script { background: rgba(16, 185, 129, 0.14); color: var(--success); }
.mem-item .mem-body {
    display: flex; flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.mem-item .key { font-size: 0.84rem; font-weight: 600; color: var(--fg); }
.mem-item .val {
    font-size: 0.78rem;
    color: var(--fg-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mem-item .mem-del {
    width: 26px; height: 26px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--fg-faint);
    display: grid; place-items: center;
    cursor: pointer;
}
.mem-item .mem-del:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}
.mem-item .mem-del svg { width: 13px; height: 13px; }

/* Drop zone CSV */
.drop {
    padding: 28px 20px;
    border: 1.5px dashed var(--bd-hi);
    border-radius: var(--r-md);
    background: var(--bg-card-hi);
    text-align: center;
    cursor: pointer;
    transition: all var(--t-fast);
}
.drop:hover {
    border-color: var(--violet);
    background: rgba(124, 58, 237, 0.04);
}
.drop .ic-big {
    width: 44px; height: 44px;
    margin: 0 auto 12px;
    border-radius: 12px;
    background: var(--grad-primary);
    display: grid; place-items: center;
    color: white;
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.32);
}
.drop .ic-big svg { width: 20px; height: 20px; }
.drop .title { font-size: 0.94rem; font-weight: 600; margin-bottom: 4px; }
.drop .hint { font-size: 0.78rem; color: var(--fg-muted); }

/* ═════════════════════════════════════════════
   PAGE VOCABULAIRE
   ═════════════════════════════════════════════ */
.voc-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 20px;
}
.voc-head h1 {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.05;
}
.voc-head h1 .accent {
    font-family: var(--font-serif);
    font-weight: 400;
    background: var(--grad-aurora);
    -webkit-background-clip: text;
    color: transparent;
}
.voc-head .sub { color: var(--fg-muted); font-size: 0.92rem; margin-top: 4px; }

.voc-add {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}
.voc-add .input { flex: 1; }

.voc-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.voc-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
}
.voc-tab {
    padding: 7px 14px;
    border-radius: var(--r-pill);
    background: var(--bg-card);
    border: 1px solid var(--bd);
    font-size: 0.82rem;
    color: var(--fg-muted);
    cursor: pointer;
    transition: all var(--t-fast);
}
.voc-tab:hover { color: var(--fg); }
.voc-tab.is-active {
    background: rgba(124, 58, 237, 0.16);
    color: var(--violet-dk);
    border-color: rgba(124, 58, 237, 0.42);
}
[data-theme="dark"] .voc-tab.is-active { color: var(--violet-hi); }

.voc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.voc-card {
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    padding: 16px 18px;
    transition: all var(--t-fast);
    box-shadow: var(--shadow-card);
}
.voc-card:hover { border-color: var(--bd-hi); transform: translateY(-2px); }
.voc-card.lang-ko { border-left: 3px solid var(--rose); }
.voc-card.lang-en { border-left: 3px solid var(--indigo); }
.voc-card.lang-jp { border-left: 3px solid var(--gold); }

.voc-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.voc-word {
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--fg);
}
.voc-lang {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    border-radius: var(--r-pill);
}
.voc-lang.ko { background: rgba(236, 72, 153, 0.14); color: var(--rose-dk); }
[data-theme="dark"] .voc-lang.ko { color: var(--rose-hi); }
.voc-lang.en { background: rgba(79, 70, 229, 0.16); color: var(--indigo); }
.voc-lang.jp { background: rgba(245, 158, 11, 0.16); color: var(--gold-dk); }
[data-theme="dark"] .voc-lang.jp { color: var(--gold-hi); }

.voc-phon-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--bg-card-hi);
    border-radius: var(--r-sm);
}
.voc-phon-row .arrow { color: var(--fg-faint); }
.voc-phon {
    flex: 1;
    background: transparent;
    border: 0;
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
}
.voc-card .voc-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 0.72rem;
    color: var(--fg-faint);
    font-family: var(--font-mono);
}
.voc-card .voc-actions {
    display: flex; gap: 4px;
}
.voc-act {
    width: 28px; height: 28px;
    border-radius: 7px;
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    color: var(--fg-soft);
    display: grid; place-items: center;
    cursor: pointer;
    transition: all var(--t-fast);
}
.voc-act:hover { color: var(--fg); background: var(--bg-card); }
.voc-act svg { width: 12px; height: 12px; }
.voc-act.play { background: var(--grad-primary); color: white; border-color: transparent; }
.voc-act.play:hover { box-shadow: 0 4px 12px rgba(124, 58, 237, 0.32); }
.voc-act.play svg { fill: white; }
.an-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 20px;
}
.an-head h1 {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.05;
}
.an-head h1 .accent {
    font-family: var(--font-serif);
    font-weight: 400;
    background: var(--grad-aurora);
    -webkit-background-clip: text;
    color: transparent;
}
.an-head .sub { color: var(--fg-muted); font-size: 0.92rem; margin-top: 4px; }

.range-tabs {
    display: inline-flex;
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-pill);
    padding: 4px;
    gap: 2px;
}
.range-tab {
    padding: 7px 16px;
    border-radius: var(--r-pill);
    border: 0;
    background: transparent;
    color: var(--fg-muted);
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
}
.range-tab:hover { color: var(--fg); }
.range-tab.is-active {
    background: var(--grad-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.32);
}

/* KPI tiles */
.an-kpis {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 32px;
}
.kpi {
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}
.kpi .ic {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: var(--bg-card-hi);
    display: grid; place-items: center;
    color: var(--fg-muted);
    margin-bottom: 10px;
}
.kpi .ic svg { width: 14px; height: 14px; stroke-width: 1.8; }
.kpi.v .ic { background: rgba(124, 58, 237, 0.16); color: var(--violet); }
.kpi.r .ic { background: rgba(236, 72, 153, 0.16); color: var(--rose); }
.kpi.g .ic { background: rgba(245, 158, 11, 0.16); color: var(--gold-dk); }
[data-theme="dark"] .kpi.g .ic { color: var(--gold-hi); }
.kpi.gr .ic { background: rgba(16, 185, 129, 0.16); color: var(--success); }
.kpi.i .ic { background: rgba(79, 70, 229, 0.16); color: var(--indigo); }

.kpi .lbl {
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.kpi .num {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    margin-bottom: 8px;
    color: var(--fg);
}
.kpi .delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
}
.kpi .delta.up { color: var(--success); }
.kpi .delta.down { color: var(--danger); }
.kpi .spark {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 60px;
    height: 28px;
    opacity: 0.85;
}
.kpi .spark svg { width: 100%; height: 100%; overflow: visible; }
.kpi .spark path { fill: none; stroke-width: 2; stroke-linecap: round; }
.kpi.v .spark path { stroke: var(--violet-hi); }
.kpi.r .spark path { stroke: var(--rose-hi); }
.kpi.g .spark path { stroke: var(--gold); }
.kpi.gr .spark path { stroke: var(--success); }
.kpi.i .spark path { stroke: #818CF8; }

/* Analytics sections common */
.an-section {
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    padding: 22px 24px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-card);
}
.an-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 14px;
}
.an-section-head h3 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.an-section-head h3 .marker {
    width: 8px; height: 8px;
    border-radius: 2px;
    background: var(--rose);
}
.an-section-head h3 .marker.v { background: var(--violet); }
.an-section-head h3 .marker.g { background: var(--gold); }
.an-section-head h3 .marker.gr { background: var(--success); }
.an-section-head h3 .marker.i { background: var(--indigo); }
.an-section-head .meta { color: var(--fg-muted); font-size: 0.82rem; }

.an-tabs {
    display: inline-flex;
    background: var(--bg-card-hi);
    border-radius: var(--r-pill);
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--bd);
}
.an-tab {
    padding: 6px 14px;
    border-radius: var(--r-pill);
    border: 0;
    background: transparent;
    color: var(--fg-muted);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
}
.an-tab.is-active {
    background: var(--bg-card);
    color: var(--fg);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Vidéos table */
.an-vids {
    display: flex; flex-direction: column;
    gap: 8px;
}
.an-vid {
    display: grid;
    grid-template-columns: 50px 1fr auto auto auto auto;
    gap: 14px;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-card-hi);
    border: 1px solid var(--bd-soft);
    border-radius: var(--r-sm);
    transition: all var(--t-fast);
    cursor: pointer;
}
.an-vid:hover { border-color: var(--bd-hi); transform: translateX(2px); }
.an-vid .thumb {
    width: 50px; height: 64px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}
.an-vid .thumb.t1 { background: linear-gradient(180deg, #4c1d95, #db2777 60%, #f59e0b); }
.an-vid .thumb.t2 { background: linear-gradient(180deg, #0c0a2e, #4f46e5, #ec4899); }
.an-vid .thumb.t3 { background: linear-gradient(180deg, #1e1b4b, #c026d3 70%, #fbbf24); }
.an-vid .thumb.t4 { background: linear-gradient(180deg, #18181b, #7c3aed, #f472b6); }
.an-vid .thumb.t5 { background: linear-gradient(180deg, #500724, #db2777, #f59e0b); }
.an-vid .thumb.t6 { background: linear-gradient(180deg, #312e81, #6366f1, #ec4899); }
.an-vid .thumb.t7 { background: linear-gradient(180deg, #4c1d95, #db2777 60%, #f59e0b); }
.an-vid .info {
    min-width: 0;
}
.an-vid .ttl {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.an-vid .meta {
    font-size: 0.74rem;
    color: var(--fg-muted);
    font-family: var(--font-mono);
}
.an-vid .stat {
    text-align: right;
    min-width: 70px;
}
.an-vid .stat .v {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.an-vid .stat .k {
    font-size: 0.7rem;
    color: var(--fg-faint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.an-vid .complete {
    display: flex; align-items: center; gap: 8px;
    min-width: 110px;
}
.an-vid .complete .bar {
    flex: 1;
    height: 5px;
    background: var(--bd);
    border-radius: var(--r-pill);
    overflow: hidden;
}
.an-vid .complete .bar .fill {
    height: 100%;
    background: var(--grad-kpop);
    border-radius: var(--r-pill);
}
.an-vid .complete .val {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--fg);
    min-width: 36px;
    text-align: right;
}

/* Top 10 list */
.top-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 18px;
}
.top-row {
    display: grid;
    grid-template-columns: 26px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: var(--r-xs);
    transition: background var(--t-fast);
    cursor: pointer;
}
.top-row:hover { background: var(--bg-card-hi); }
.top-row .rank {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--fg-faint);
}
.top-row.gold .rank { color: var(--gold-dk); }
[data-theme="dark"] .top-row.gold .rank { color: var(--gold-hi); }
.top-row.gold .rank::before { content: "🏆 "; }
.top-row .ttl {
    font-size: 0.88rem;
    color: var(--fg);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.top-row .views {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--violet-dk);
}
[data-theme="dark"] .top-row .views { color: var(--violet-hi); }

/* Keywords + Audience grid */
.an-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 22px;
    margin-bottom: 22px;
}
.kw-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.kw {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 9px 14px;
    background: var(--bg-card-hi);
    border: 1px solid var(--bd-soft);
    border-radius: var(--r-sm);
}
.kw .q {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kw .q::before {
    content: "🔍 ";
    margin-right: 4px;
    opacity: 0.6;
}
.kw .impressions {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--fg-soft);
    font-weight: 600;
}
.kw .ctr {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--success);
    font-weight: 700;
    min-width: 56px;
    text-align: right;
}
.kw .ctr.down { color: var(--fg-faint); }

/* Audience */
.audience {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.audience-block h5 {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}
.bar-row {
    display: grid;
    grid-template-columns: 80px 1fr 44px;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 0.82rem;
}
.bar-row .name { color: var(--fg-soft); }
.bar-row .b {
    height: 6px;
    background: var(--bd);
    border-radius: var(--r-pill);
    overflow: hidden;
}
.bar-row .b .fill {
    height: 100%;
    background: var(--grad-primary);
    border-radius: var(--r-pill);
}
.bar-row .b.r .fill { background: var(--grad-kpop); }
.bar-row .b.g .fill { background: var(--grad-gold, var(--gold)); }
.bar-row .pct {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--fg);
    font-weight: 600;
    text-align: right;
}

.device-row {
    display: flex;
    gap: 10px;
}
.device {
    flex: 1;
    padding: 12px 14px;
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    border-radius: var(--r-sm);
    text-align: center;
}
.device .num {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--fg);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    margin-bottom: 4px;
}
.device .lbl {
    font-size: 0.72rem;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Retention curve */
.retention {
    background: var(--bg-card-hi);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    padding: 18px 22px;
    margin-bottom: 22px;
}
.retention-svg {
    width: 100%;
    height: 220px;
    display: block;
}
.retention-svg .grid line { stroke: var(--bd); stroke-width: 1; stroke-dasharray: 2 4; }
.retention-svg .axis text { fill: var(--fg-faint); font-family: var(--font-mono); font-size: 11px; }
.retention-svg .curve {
    fill: none;
    stroke: url(#kpop-grad);
    stroke-width: 2.4;
    stroke-linecap: round;
}
.retention-svg .curve-fill { fill: url(#kpop-grad-fade); opacity: 0.6; }
.retention-svg .ann line { stroke: var(--rose); stroke-width: 1; stroke-dasharray: 3 3; }
.retention-svg .ann circle { fill: var(--rose); }
.retention-svg .ann text { fill: var(--fg); font-family: var(--font-mono); font-size: 11px; font-weight: 600; }

.retention-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--bd-soft);
}
.retention-summary .s {
    text-align: center;
}
.retention-summary .s .v {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.retention-summary .s .l {
    font-size: 0.72rem;
    color: var(--fg-muted);
    margin-top: 4px;
}

/* AI rules cards */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.rule {
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(236, 72, 153, 0.04));
    border: 1px solid rgba(124, 58, 237, 0.22);
    border-radius: var(--r-md);
}
[data-theme="light"] .rule { background: linear-gradient(135deg, rgba(124, 58, 237, 0.04), rgba(236, 72, 153, 0.02)); }
.rule .type {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--r-pill);
    background: rgba(124, 58, 237, 0.18);
    color: var(--violet-dk);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}
[data-theme="dark"] .rule .type { color: var(--violet-hi); }
.rule .type.hook { background: rgba(236, 72, 153, 0.18); color: var(--rose-dk); }
[data-theme="dark"] .rule .type.hook { color: var(--rose-hi); }
.rule .type.struct { background: rgba(245, 158, 11, 0.18); color: var(--gold-dk); }
[data-theme="dark"] .rule .type.struct { color: var(--gold-hi); }
.rule .desc {
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--fg);
    margin-bottom: 12px;
    text-wrap: balance;
}
.rule .conf {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.72rem;
    color: var(--fg-muted);
    font-family: var(--font-mono);
}
.rule .conf .bar {
    flex: 1;
    height: 4px;
    background: var(--bd);
    border-radius: var(--r-pill);
    overflow: hidden;
}
.rule .conf .bar .fill {
    height: 100%;
    background: var(--grad-kpop);
    border-radius: var(--r-pill);
}

/* ═════════════════════════════════════════════
   PAGE VOCABULAIRE TTS
   ═════════════════════════════════════════════ */
.vc-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 22px;
    gap: 20px;
}
.vc-head h1 {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.05;
}
.vc-head h1 .accent {
    font-family: var(--font-serif);
    font-weight: 400;
    background: var(--grad-aurora);
    -webkit-background-clip: text;
    color: transparent;
}
.vc-head .sub { color: var(--fg-muted); font-size: 0.92rem; margin-top: 4px; }

.vc-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
.vc-stat {
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-card);
}
.vc-stat .num {
    font-size: 1.9rem; font-weight: 700; line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    margin-bottom: 5px;
}
.vc-stat .num.v { color: var(--violet); }
.vc-stat .num.r { color: var(--rose); }
.vc-stat .num.g { color: var(--gold-dk); }
[data-theme="dark"] .vc-stat .num.g { color: var(--gold-hi); }
.vc-stat .num.gr { color: var(--success); }
.vc-stat .lbl { font-size: 0.78rem; color: var(--fg-muted); }

.vc-add {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(236, 72, 153, 0.03));
    border: 1px solid rgba(124, 58, 237, 0.22);
    border-radius: var(--r-md);
    padding: 20px 22px;
    margin-bottom: 22px;
}
.vc-add h3 {
    font-size: 0.94rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 10px;
}
.vc-add h3 .marker {
    width: 8px; height: 8px; border-radius: 2px;
    background: var(--rose);
}
.vc-add-row {
    display: grid;
    grid-template-columns: 1.2fr auto 1.2fr auto auto;
    gap: 10px;
    align-items: center;
}
.vc-add-row .arrow { color: var(--fg-faint); font-weight: 600; }

.vc-filters {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 18px;
    align-items: center;
}
.vc-filters .search {
    margin-left: auto;
    width: 260px;
}

.vc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.vc-card {
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-card);
    transition: all var(--t-fast);
}
.vc-card:hover { border-color: var(--bd-hi); transform: translateY(-1px); }
.vc-card .flag {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--bg-card-hi);
    display: grid; place-items: center;
    font-size: 0.94rem;
    flex-shrink: 0;
}
.vc-card.kr .flag { background: rgba(236, 72, 153, 0.14); }
.vc-card.en .flag { background: rgba(79, 70, 229, 0.14); }
.vc-card.jp .flag { background: rgba(245, 158, 11, 0.14); }
.vc-info { flex: 1; min-width: 0; }
.vc-orig {
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--fg);
    line-height: 1.2;
    margin-bottom: 2px;
}
.vc-phon {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--violet);
    line-height: 1.2;
}
[data-theme="dark"] .vc-phon { color: var(--violet-hi); }
.vc-actions {
    display: flex; gap: 3px;
    flex-shrink: 0;
}
.vc-act {
    width: 30px; height: 30px;
    border-radius: var(--r-xs);
    background: transparent;
    border: 1px solid transparent;
    color: var(--fg-muted);
    display: grid; place-items: center;
    cursor: pointer;
    transition: all var(--t-fast);
}
.vc-act svg { width: 14px; height: 14px; }
.vc-act:hover { background: var(--bg-card-hi); color: var(--fg); border-color: var(--bd); }
.vc-act.play:hover { color: var(--rose); }
.vc-act.del:hover { color: var(--danger); }

.vc-recent {
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    padding: 18px 22px;
    margin-top: 22px;
    box-shadow: var(--shadow-card);
}
.vc-recent h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex; align-items: center; gap: 10px;
}
.vc-recent h3 .marker {
    width: 8px; height: 8px; border-radius: 2px;
    background: var(--gold);
}
.vc-recent-list {
    display: flex; flex-direction: column; gap: 4px;
}
.vc-recent-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 7px 10px;
    border-radius: var(--r-xs);
    font-size: 0.86rem;
}
.vc-recent-row:hover { background: var(--bg-card-hi); }
.vc-recent-row .o { font-weight: 600; }
.vc-recent-row .p { font-family: var(--font-mono); color: var(--violet); }
[data-theme="dark"] .vc-recent-row .p { color: var(--violet-hi); }
.vc-recent-row .ts {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--fg-faint);
}

/* ═════════════════════════════════════════════
   PAGE PARAMÈTRES
   ═════════════════════════════════════════════ */
.set-head { margin-bottom: 24px; }
.set-head h1 {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.05;
}
.set-head h1 .accent {
    font-family: var(--font-serif);
    font-weight: 400;
    background: var(--grad-aurora);
    -webkit-background-clip: text;
    color: transparent;
}
.set-head .sub { color: var(--fg-muted); font-size: 0.92rem; margin-top: 4px; }

.set-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.set-grid .span-2 { grid-column: span 2; }

.set-card {
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    padding: 22px 24px;
    box-shadow: var(--shadow-card);
}
.set-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bd-soft);
}
.set-card-head .ic {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--grad-primary);
    display: grid; place-items: center;
    color: white;
    box-shadow: 0 6px 16px var(--glow-v);
    flex-shrink: 0;
}
.set-card-head .ic.gold {
    background: var(--grad-gold, linear-gradient(135deg, #F59E0B, #FCD34D));
    color: #1A1226;
    box-shadow: 0 6px 16px var(--glow-g);
}
.set-card-head .ic.rose {
    background: var(--grad-kpop);
    box-shadow: 0 6px 16px var(--glow-r);
}
.set-card-head .ic svg { width: 17px; height: 17px; stroke-width: 2; }
.set-card-head h3 {
    font-size: 1.04rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.set-card-head .sub {
    font-size: 0.78rem;
    color: var(--fg-muted);
    margin-top: 2px;
}

.set-row {
    margin-bottom: 14px;
}
.set-row:last-child { margin-bottom: 0; }
.set-row label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--fg-soft);
    margin-bottom: 6px;
}
.set-row label .badge {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    background: rgba(16, 185, 129, 0.14);
    color: var(--success);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.set-row label .badge.err {
    background: rgba(239, 68, 68, 0.14);
    color: var(--danger);
}
.set-row .input-mask {
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
}

.set-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--bd-soft);
}

.set-mem-row {
    display: grid;
    grid-template-columns: auto 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 9px 12px;
    background: var(--bg-card-hi);
    border: 1px solid var(--bd-soft);
    border-radius: var(--r-sm);
    margin-bottom: 6px;
}
.set-mem-row .type {
    padding: 2px 8px;
    border-radius: var(--r-pill);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(124, 58, 237, 0.16);
    color: var(--violet-dk);
}
[data-theme="dark"] .set-mem-row .type { color: var(--violet-hi); }
.set-mem-row .type.hook { background: rgba(236, 72, 153, 0.16); color: var(--rose-dk); }
[data-theme="dark"] .set-mem-row .type.hook { color: var(--rose-hi); }
.set-mem-row .type.script { background: rgba(245, 158, 11, 0.16); color: var(--gold-dk); }
[data-theme="dark"] .set-mem-row .type.script { color: var(--gold-hi); }
.set-mem-row .from {
    font-size: 0.84rem;
    color: var(--fg-faint);
    text-decoration: line-through;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.set-mem-row .to {
    font-size: 0.86rem;
    color: var(--fg);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.set-mem-row .ts {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--fg-muted);
}

.set-import {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    background: var(--bg-card-hi);
    border: 1px dashed var(--bd-hi);
    border-radius: var(--r-md);
}
.set-import .info { font-size: 0.86rem; color: var(--fg-soft); }
.set-import .info b { color: var(--fg); font-weight: 600; }
.set-import .info .meta {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--fg-muted);
    margin-top: 2px;
}

.set-source-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-card-hi);
    border: 1px solid var(--bd-soft);
    border-radius: var(--r-sm);
    margin-bottom: 6px;
}
.set-source-row .name { font-weight: 500; font-size: 0.88rem; }
.set-source-row .url {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--fg-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.set-source-row .status {
    padding: 3px 9px;
    border-radius: var(--r-pill);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(16, 185, 129, 0.14);
    color: var(--success);
}
.set-source-row .status.off {
    background: var(--bg-card);
    color: var(--fg-faint);
    border: 1px solid var(--bd);
}

/* Toggle switch */
.toggle {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--bd);
    border-radius: var(--r-pill);
    cursor: pointer;
    transition: background var(--t-base);
    flex-shrink: 0;
    border: 0;
    padding: 0;
}
.toggle::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: white;
    transition: left var(--t-base);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on {
    background: var(--grad-primary);
}
.toggle.on::after {
    left: 18px;
}

/* ═══════════════════════════════════════════════════════════════
   MONTAGE IA (Claude) — timeline conversationnelle
   ═══════════════════════════════════════════════════════════════ */
.mt-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.mt-flex { flex:1; }
.mt-select { background:var(--bg-input); color:var(--fg); border:1px solid var(--bd); border-radius:10px; padding:8px 12px; font:inherit; }
.mt-status { min-height:22px; font-size:13px; color:var(--fg-muted); margin-bottom:12px; }
.mt-status.is-ok   { color:#34D399; }
.mt-status.is-warn { color:#FBBF24; }
.mt-status.is-err  { color:#F87171; }
.mt-video-link { color:var(--violet-hi); font-weight:600; margin-left:8px; }

.mt-layout { display:grid; grid-template-columns: 220px 1fr 340px; gap:16px; align-items:start; }
@media (max-width: 1100px) { .mt-layout { grid-template-columns: 1fr; } }

/* Aperçu */
.mt-preview-frame { position:relative; aspect-ratio:9/16; background:var(--bg-sunken); border:1px solid var(--bd); border-radius:14px; overflow:hidden; box-shadow:var(--shadow-card); }
.mt-preview-frame img { width:100%; height:100%; object-fit:cover; display:none; }
.mt-preview-empty { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; text-align:center; color:var(--fg-faint); font-size:13px; }
.mt-preview-caption { margin-top:8px; font-size:12px; color:var(--fg-muted); text-align:center; }

/* Timeline */
.mt-timeline-col { background:var(--bg-card); border:1px solid var(--bd); border-radius:14px; padding:14px; box-shadow:var(--shadow-card); }
.mt-ruler { position:relative; height:28px; margin-left:120px; border-bottom:1px solid var(--bd); cursor:crosshair; }
.mt-tick { position:absolute; top:4px; font-size:10px; color:var(--fg-faint); transform:translateX(-50%); pointer-events:none; }
.mt-tick::after { content:""; position:absolute; left:50%; top:16px; width:1px; height:8px; background:var(--bd-hi); }
.mt-playhead { position:absolute; top:0; bottom:-500px; width:2px; background:var(--rose); z-index:5; pointer-events:none; box-shadow:0 0 8px var(--rose); }
.mt-tracks { position:relative; }
.mt-track { display:flex; align-items:stretch; min-height:40px; border-bottom:1px solid var(--bd-soft); }
.mt-track-label { width:120px; flex:0 0 120px; font-size:12px; color:var(--fg-soft); display:flex; align-items:center; }
.mt-lane { position:relative; flex:1; min-height:40px; }
.mt-lane-empty { position:absolute; inset:6px; display:flex; align-items:center; font-size:11px; color:var(--fg-dim); font-style:italic; }
.mt-clip { position:absolute; top:6px; bottom:6px; border-radius:8px; font-size:11px; padding:4px 8px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; cursor:pointer; border:1px solid transparent; color:#fff; display:flex; align-items:center; transition:transform .08s, box-shadow .08s; }
.mt-clip:hover { transform:translateY(-1px); box-shadow:0 4px 14px rgba(0,0,0,.4); z-index:3; }
.mt-clip.is-selected { border-color:#FFD700; box-shadow:0 0 0 2px rgba(255,215,0,.45); z-index:4; }
.mt-clip.is-fond       { background:linear-gradient(120deg, #1E3A8A, #4F46E5); }
.mt-clip.is-personnage { background:linear-gradient(120deg, #7C3AED, #A78BFA); }
.mt-clip.is-texte      { background:linear-gradient(120deg, #9D174D, #EC4899); }
.mt-clip.is-sub        { background:linear-gradient(120deg, #92400E, #F59E0B); font-size:10px; }
.mt-clip.is-audio      { background:linear-gradient(120deg, #065F46, #10B981); }
.mt-clip.is-music      { background:linear-gradient(120deg, #155E75, #06B6D4); }
.mt-playhead-hint { margin-top:10px; font-size:11px; color:var(--fg-faint); }

/* Chat */
.mt-chat-col { background:var(--bg-card); border:1px solid var(--bd); border-radius:14px; box-shadow:var(--shadow-card); display:flex; flex-direction:column; max-height:640px; }
.mt-chat-head { padding:12px 14px; border-bottom:1px solid var(--bd); }
.mt-chat-title { font-weight:600; }
.mt-chat-target { font-size:11px; color:var(--violet-hi); margin-top:2px; }
.mt-chat-thread { flex:1; overflow-y:auto; padding:12px; display:flex; flex-direction:column; gap:8px; min-height:220px; }
.mt-bubble { max-width:88%; padding:8px 12px; border-radius:12px; font-size:13px; line-height:1.45; white-space:pre-wrap; }
.mt-bubble.is-user   { align-self:flex-end; background:var(--violet-dk); color:#fff; border-bottom-right-radius:4px; }
.mt-bubble.is-claude { align-self:flex-start; background:var(--bg-card-hi); border:1px solid var(--bd); border-bottom-left-radius:4px; }
.mt-bubble.is-err { color:#F87171; }
.mt-quick { display:flex; gap:6px; flex-wrap:wrap; padding:0 12px 8px; }
.mt-quick-btn { background:var(--bg-input); border:1px solid var(--bd); color:var(--fg-soft); border-radius:999px; font-size:11px; padding:5px 10px; cursor:pointer; }
.mt-quick-btn:hover { border-color:var(--violet-hi); color:var(--fg); }
.mt-chat-inputrow { display:flex; gap:8px; padding:10px 12px 12px; border-top:1px solid var(--bd); }
.mt-chat-inputrow input { flex:1; background:var(--bg-input); border:1px solid var(--bd); border-radius:10px; color:var(--fg); padding:9px 12px; font:inherit; }

/* Pré-tri */
.mt-pretri { margin-top:18px; }
.mt-pretri-loading { color:var(--fg-muted); font-size:13px; padding:14px; }
.mt-video-card { background:var(--bg-card); border:1px solid var(--bd); border-radius:14px; padding:14px 16px; margin-top:12px; box-shadow:var(--shadow-card); }
.mt-video-head { display:flex; align-items:center; gap:10px; margin-bottom:6px; }
.mt-score { background:linear-gradient(120deg, var(--violet), var(--rose)); color:#fff; font-weight:700; border-radius:8px; padding:2px 8px; font-size:13px; }
.mt-meta { color:var(--fg-muted); font-size:12px; margin-left:auto; }
.mt-hook { color:#FBBF24; font-size:13px; margin-bottom:8px; }
.mt-video-card ul { margin:0; padding-left:18px; display:flex; flex-direction:column; gap:8px; font-size:13px; }
.mt-angle { color:var(--rose-hi); font-size:12px; }
.mt-ecartes { margin-top:12px; color:var(--fg-muted); font-size:12px; }

/* Production du jour */
.mt-prod { background:var(--bg-card); border:1px solid var(--bd); border-radius:14px; padding:16px 18px; margin-bottom:14px; box-shadow:var(--shadow-card); }
.mt-prod-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.mt-prod-head h3 { margin:0; }
.mt-prod-head .sub { margin:2px 0 0; color:var(--fg-muted); font-size:13px; }
.mt-prod-list { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:12px; margin-top:12px; }
.mt-prod-card { background:var(--bg-card-hi); border:1px solid var(--bd); border-radius:12px; padding:12px; display:flex; flex-direction:column; gap:8px; }
.mt-prod-card.is-validee  { border-color:rgba(52,211,153,.5); }
.mt-prod-card.is-refusee  { border-color:rgba(248,113,113,.5); opacity:.75; }
.mt-prod-card.is-echec    { border-color:rgba(251,191,36,.5); }
.mt-prod-card-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:13px; }
.mt-prod-video { width:100%; max-height:340px; border-radius:10px; background:#000; }
.mt-prod-manquant { font-size:12px; color:#FBBF24; }
.mt-prod-actions { display:flex; gap:8px; flex-wrap:wrap; }
