:root {
        --accent: #7c5cff;
        --accent-2: #9d8bff;
        --accent-soft: rgba(124,92,255,0.14);
        --accent-line: rgba(124,92,255,0.55);
        --ui-bg: rgba(15, 15, 19, 0.62);
        --ui-border: rgba(255, 255, 255, 0.10);
        --surface-1: rgba(255,255,255,0.035);
        --surface-2: rgba(255,255,255,0.065);
        --border-1: rgba(255,255,255,0.08);
        --border-2: rgba(255,255,255,0.15);
        --text: #edecf2;
        --text-dim: #9b9ba8;
        --text-faint: rgba(255,255,255,0.34);
        --radius: 12px;
        --shadow-lg: 0 20px 56px rgba(0,0,0,0.55);
        --font-display: 'Syne', sans-serif;
        --font-mono: 'SF Mono','Fira Code','Cascadia Code',ui-monospace,monospace;
        --ease: cubic-bezier(.22, 1, .36, 1);
      }

      * {
        box-sizing: border-box;
      }

      html,
      body {
        margin: 0;
        height: 100%;
        overflow: hidden;
        font-family: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        color: var(--text);
        -webkit-font-smoothing: antialiased;
        background:
          radial-gradient(72% 60% at 42% 28%, rgba(123,108,255,0.05), transparent 60%),
          #0a0a0e;
      }

      #scene {
        position: fixed;
        inset: 0;
        display: block;
      }

      /* ---- Cadre de capture (limites de l'export) ---- */
      #captureFrame {
        position: fixed;
        z-index: 2;
        pointer-events: none;
        border: 1px solid rgba(255,255,255,0.15);
        border-radius: 5px;
        /* assombrit légèrement tout ce qui est hors du cadre */
        box-shadow: 0 0 0 100vmax rgba(7,7,11,0.40);
      }
      .cf-corner {
        position: absolute; width: 15px; height: 15px;
        border: 2px solid rgba(255,255,255,0.55);
      }
      .cf-corner.tl { top:-1px; left:-1px;  border-right:0; border-bottom:0; border-radius:5px 0 0 0 }
      .cf-corner.tr { top:-1px; right:-1px; border-left:0;  border-bottom:0; border-radius:0 5px 0 0 }
      .cf-corner.bl { bottom:-1px; left:-1px;  border-right:0; border-top:0; border-radius:0 0 0 5px }
      .cf-corner.br { bottom:-1px; right:-1px; border-left:0;  border-top:0; border-radius:0 0 5px 0 }
      .cf-tag {
        position:absolute; top:-30px; left:0;
        display:flex; align-items:center; gap:9px;
        pointer-events:auto; /* le cadre est pointer-events:none, la cartouche reste interactive */
      }
      .cf-trigger {
        display:flex; align-items:center; gap:6px;
        padding:3px 8px 3px 9px; border-radius:7px;
        background:rgba(0,0,0,0.5); border:1px solid rgba(255,255,255,0.1);
        backdrop-filter:blur(8px); color:rgba(255,255,255,0.85);
        cursor:pointer; font-family:inherit;
        transition:background 0.15s, border-color 0.15s;
      }
      .cf-trigger:hover { background:rgba(0,0,0,0.65); border-color:rgba(255,255,255,0.2); }
      .cf-trigger svg { opacity:0.6; }
      .cf-pill { font-size:11px; font-weight:700; letter-spacing:.02em; }
      .cf-label { font-size:11px; font-weight:500; color:rgba(255,255,255,0.5); }
      .cf-formats {
        position:absolute; top:calc(100% + 7px); left:-1px; z-index:13;
        padding:5px; border-radius:5px;
        background:rgba(18,18,24,0.96); backdrop-filter:blur(20px) saturate(1.4);
        border:1px solid var(--border-2, rgba(255,255,255,0.14));
        box-shadow:var(--shadow-lg, 0 18px 44px rgba(0,0,0,0.5));
        display:flex; gap:3px;
        animation:popUp 0.14s ease both;
      }
      .cf-formats.hidden { display:none; }
      .cf-formats .mode-btn { padding:7px 12px; font-size:11px; }
    
      @keyframes dropIn{from{opacity:0; transform:translateY(-12px) translateX(-50%)}to{opacity:1; transform:translateX(-50%) translateY(0);}}

      /* ---- Topbar ---- */
      .topbar {
        position: fixed;
        top: 16px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 6px 6px 14px;
        background: rgba(14, 14, 18, 0.85);
        backdrop-filter: blur(20px) saturate(1.4);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 16px;
        z-index: 10;
        width: min(860px, calc(100% - 32px));
        box-shadow: 0 4px 32px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.06) inset;
            animation: dropIn .7s var(--ease) .15s both;
      }

      .topbar-brand {
        font-family: var(--font-display);
        font-weight: 800;
        font-size: 14px;
        letter-spacing: -0.01em;
        color: rgba(255,255,255,0.92);
        display: flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
        padding-right: 12px;
        border-right: 1px solid var(--border-1);
        margin-right: 4px;
        user-select: none;
      }

      .topbar-url {
        flex: 1;
        min-width: 0;
        position: relative;
        display: flex;
        align-items: center;
      }

      .topbar-url svg {
        position: absolute;
        left: 10px;
        width: 14px;
        height: 14px;
        color: rgba(255,255,255,0.25);
        flex-shrink: 0;
        pointer-events: none;
      }

      .topbar input {
        flex: 1;
        min-width: 0;
        padding: 9px 12px 9px 32px;
        border-radius: 9px;
        border: 1px solid transparent;
        background: rgba(255,255,255,0.04);
        color: var(--text);
        font-size: 13px;
        font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
        letter-spacing: 0.01em;
        outline: none;
        transition: background 0.15s, border-color 0.15s;
        width: 100%;
      }

      .topbar input:focus {
        background: rgba(255,255,255,0.07);
        border-color: rgba(124, 92, 255, 0.5);
      }

      .topbar input::placeholder { color: rgba(255,255,255,0.2); }

      /* Progress bar inside topbar */
      .topbar-progress {
        position: absolute;
        bottom: -1px;
        left: 6px;
        right: 6px;
        height: 2px;
        border-radius: 2px;
        background: linear-gradient(90deg, var(--accent), #a78bff);
        transform-origin: left;
        transform: scaleX(0);
        transition: transform 0.3s ease, opacity 0.3s;
        opacity: 0;
      }
      .topbar-progress.active {
        opacity: 1;
        animation: progress-pulse 1.8s ease-in-out infinite;
      }
      @keyframes progress-pulse {
        0%   { transform: scaleX(0.05); }
        50%  { transform: scaleX(0.75); }
        100% { transform: scaleX(0.95); }
      }

      button {
        cursor: pointer;
        border: none;
        border-radius: 10px;
        padding: 9px 16px;
        font-size: 13px;
        font-weight: 600;
        color: #fff;
        background: var(--accent);
        transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
        white-space: nowrap;
        flex-shrink: 0;
      }

      button:hover { opacity: 0.9; box-shadow: 0 4px 16px rgba(124,92,255,0.35); }
      button:active { transform: translateY(0); }
      button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

      /* Langage boutons (proto) : pas de bordure, seul hover/active révèle l'usage */
      button.ghost {
        background: transparent;
        border: 1px solid transparent;
        box-shadow: none;
      }
      button.ghost:hover { box-shadow: none; background: rgba(255,255,255,0.08); }

      #generate {
        background: linear-gradient(135deg, var(--accent), var(--accent-2));
        box-shadow: 0 4px 18px rgba(124,92,255,0.4), inset 0 1px 0 rgba(255,255,255,0.28);
        display: flex;
        align-items: center;
        gap: 6px;
        letter-spacing: 0.01em;
      }
      #generate:hover {
        opacity: 1;
        box-shadow: 0 8px 26px rgba(124,92,255,0.55), inset 0 1px 0 rgba(255,255,255,0.32);
      }
      #generate svg { width: 13px; height: 13px; transition: transform 0.2s; }
      #generate:hover svg { transform: translateX(2px); }

      button.icon-btn {
        padding: 9px 11px;
        background: transparent;
        border: 1px solid transparent;
        font-size: 14px;
        line-height: 1;
        box-shadow: none;
        display: inline-flex; align-items: center; justify-content: center;
      }
      button.icon-btn:hover { box-shadow: none; background: rgba(255,255,255,0.08); }

      /* ---- Export bar (bas centre, mirroir topbar) ---- */
      .exportbar {
        position: fixed;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        gap: 7px;
        padding: 8px 9px;
        background: rgba(15, 15, 19, 0.7);
        backdrop-filter: blur(20px) saturate(1.4);
        border: 1px solid var(--border-1);
        border-radius: 16px;
        z-index: 10;
        max-width: calc(100% - 280px);
        box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.06);
        animation: barUp 0.5s cubic-bezier(0.22,1,0.36,1) both;
      }
      @keyframes barUp {
        from { opacity: 0; transform: translateX(-50%) translateY(14px); }
        to   { opacity: 1; transform: translateX(-50%) translateY(0); }
      }
      .exportbar select {
        width: auto;
        max-width: 168px;
        padding: 8px 11px;
        font-size: 12px;
        background: var(--surface-1);
        border: 1px solid var(--border-1);
        border-radius: 9px;
        color: var(--text);
        text-overflow: ellipsis;
        transition: background 0.15s, border-color 0.15s;
      }
      .exportbar select:hover { background: var(--surface-2); border-color: var(--border-2); }
      .exportbar select:focus { border-color: var(--accent-line); }
      .exportbar-sep {
        width: 1px; height: 24px;
        background: var(--border-1);
        margin: 0 2px;
        flex-shrink: 0;
      }
      .exportbar .ghost { padding: 9px 14px; font-size: 12px; }
      .exportbar #export {
        display: flex; align-items: center; gap: 6px;
        padding: 9px 18px;
      }
      .exportbar #export svg { width: 12px; height: 12px; transition: transform 0.2s; }
      .exportbar #export:hover svg { transform: translateX(2px); }
      .exportbar #shareBtn { display: inline-flex; align-items: center; gap: 6px; }
      .exportbar #shareBtn svg { flex-shrink: 0; }

      /* PNG sub-menu (discret) */
      .png-menu { position: relative; display: flex; }
      .png-trigger { padding: 9px 10px; display: flex; align-items: center; color: var(--text-dim); }
      .png-trigger:hover { color: var(--text); }
      .png-trigger svg { width: 16px; height: 16px; }
      .png-pop {
        position: absolute;
        bottom: calc(100% + 8px);
        right: 0;
        display: flex; flex-direction: column; gap: 3px;
        padding: 6px;
        background: rgba(20,20,26,0.97);
        backdrop-filter: blur(20px);
        border: 1px solid var(--border-2);
        border-radius: 12px;
        box-shadow: var(--shadow-lg);
        min-width: 168px;
        z-index: 12;
        animation: popUp 0.15s ease both;
      }
      @keyframes popUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
      .png-pop button {
        background: transparent; border: none; color: var(--text);
        text-align: left; padding: 9px 11px; border-radius: 8px;
        font-size: 12px; font-weight: 500; box-shadow: none; width: 100%;
      }
      .png-pop button:hover:not(:disabled) { background: var(--surface-2); box-shadow: none; }
      .png-pop button:disabled { opacity: 0.4; cursor: not-allowed; }
      /* Pro non débloqué : verrou visible, bouton cliquable → modal d'upsell */
      .png-pop button.locked { color: var(--text-dim); }
      .png-pop button.locked::after { content: ' 🔒'; font-size: 10px; opacity: 0.8; }
      .png-pop-label {
        font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
        color: var(--text-faint); padding: 4px 11px 2px;
      }
      .png-sep { height: 1px; background: var(--border-1); margin: 5px 6px; }


      /* Generation modal */
      .gen-modal-overlay {
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.6);
        backdrop-filter: blur(6px);
        z-index: 50;
        display: flex; align-items: center; justify-content: center;
        animation: fadeIn 0.15s forwards;
      }
      .gen-modal {
        background: rgba(16,16,22,0.98);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 18px;
        padding: 24px;
        width: min(960px, calc(100vw - 32px));
        max-height: calc(100vh - 32px);
        overflow-y: auto;
        box-shadow: 0 24px 60px rgba(0,0,0,0.7);
        animation: confirmIn 0.2s cubic-bezier(0.34,1.4,0.64,1) forwards;
      }
      .gen-modal-title {
        font-family: 'Syne', sans-serif;
        font-size: 16px; font-weight: 700;
        color: #fff; margin: 0 0 6px;
      }
      .gen-modal-url {
        font-size: 11px; color: rgba(255,255,255,0.35);
        font-family: ui-monospace, monospace;
        margin: 0 0 18px;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      }
      /* Corps de la modal en 2 colonnes : previews à gauche, réglages à droite.
         Ouvrir « Advanced » remplit la colonne droite au lieu d'allonger la modal. */
      .gen-body {
        display: grid;
        grid-template-columns: 1.4fr 1fr;
        gap: 20px;
        margin-bottom: 18px;
        align-items: start;
      }
      .gen-col { min-width: 0; }
      .gen-col-right { display: flex; flex-direction: column; }
      .gen-body .gen-previews { margin-bottom: 12px; }
      .gen-body .gen-state-row { margin-bottom: 0; }
      .gen-body .gen-fps { margin-bottom: 0; }
      @media (max-width: 720px) {
        .gen-body { grid-template-columns: 1fr; gap: 14px; }
      }
      .gen-state-row {
        display: flex; gap: 8px; margin-bottom: 18px;
      }
      /* Notice « aperçu périmé » : options changées → refaire un preview. */
      .gen-stale {
        display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
        margin-top: 10px; padding: 9px 11px; border-radius: 9px;
        background: rgba(245,176,66,0.1); border: 1px solid rgba(245,176,66,0.28);
        font-size: 11px; color: rgba(245,176,66,0.92);
      }
      .gen-stale span { flex: 1; min-width: 140px; }
      .gen-stale button {
        flex-shrink: 0; padding: 6px 12px; font-size: 11px; font-weight: 600;
        border-radius: 7px; background: rgba(245,176,66,0.18); color: #f5b042;
        border: 1px solid rgba(245,176,66,0.4); box-shadow: none;
      }
      .gen-stale button:hover { background: rgba(245,176,66,0.28); box-shadow: none; }
      .gen-stale.hidden { display: none; }
      .gen-state-chip {
        flex: 1; padding: 8px 10px; border-radius: 9px;
        border: 1px solid rgba(255,255,255,0.08);
        background: rgba(255,255,255,0.03);
        font-size: 11px; font-weight: 600; text-align: center;
        color: rgba(255,255,255,0.3);
      }
      .gen-state-chip.ready {
        border-color: rgba(34,197,94,0.3);
        background: rgba(34,197,94,0.07);
        color: rgba(34,197,94,0.8);
      }
      .gen-state-chip .chip-label { font-size: 10px; opacity: 0.7; display: block; margin-top: 1px; }
      .gen-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
      .gen-option {
        display: flex; align-items: center; gap: 12px;
        padding: 11px 14px; border-radius: 11px;
        border: 1.5px solid rgba(255,255,255,0.08);
        background: rgba(255,255,255,0.03);
        cursor: pointer; transition: all 0.15s;
      }
      .gen-option:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.14); }
      .gen-option.selected {
        border-color: var(--accent);
        background: rgba(124,92,255,0.1);
      }
      .gen-option input[type=radio] { display: none; }
      .gen-radio {
        width: 16px; height: 16px; border-radius: 50%;
        border: 2px solid rgba(255,255,255,0.2);
        flex-shrink: 0; transition: all 0.15s;
        display: flex; align-items: center; justify-content: center;
      }
      .gen-option.selected .gen-radio {
        border-color: var(--accent);
        background: var(--accent);
        box-shadow: 0 0 0 3px rgba(124,92,255,0.2);
      }
      .gen-option.selected .gen-radio::after {
        content: ''; width: 6px; height: 6px;
        border-radius: 50%; background: #fff;
      }
      .gen-option-info { flex: 1; }
      .gen-option-label { font-size: 13px; font-weight: 600; color: #fff; }
      .gen-option-desc  { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 1px; }
      .gen-option-cost  {
        font-size: 12px; font-weight: 700;
        color: rgba(255,255,255,0.5);
        background: rgba(255,255,255,0.07);
        padding: 3px 8px; border-radius: 6px;
      }
      .gen-option.selected .gen-option-cost { color: var(--accent); background: rgba(124,92,255,0.15); }
      .gen-modal-row { display: flex; gap: 8px; justify-content: flex-end; }
      .gen-modal-row button { font-size: 13px; padding: 9px 20px; }

      /* Disclosure « Advanced capture options » dans la modal Generate :
         accueille le panneau d'options reparenté (#optionsPanel.in-modal). */
      .gen-advanced { margin-bottom: 16px; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 12px; }
      .gen-advanced > summary {
        cursor: pointer; user-select: none; list-style: none;
        display: flex; align-items: center; gap: 7px;
        font-size: 12px; font-weight: 600; color: var(--text-dim);
      }
      .gen-advanced > summary::-webkit-details-marker { display: none; }
      .gen-advanced > summary::before {
        content: ''; width: 12px; height: 12px; flex-shrink: 0;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 4l4 4-4 4'/%3E%3C/svg%3E");
        background-size: contain; background-repeat: no-repeat; background-position: center;
        transition: transform 0.18s;
      }
      .gen-advanced[open] > summary::before { transform: rotate(90deg); }
      .gen-advanced > summary:hover { color: var(--text); }
      .gen-advanced-body { padding-top: 12px; }
      /* Le panneau, une fois reparenté, devient un bloc plat dans la modal. */
      .options-panel.in-modal {
        position: static; transform: none; inset: auto;
        width: 100%; padding: 0; gap: 12px;
        background: transparent; backdrop-filter: none;
        border: none; box-shadow: none; z-index: auto; animation: none;
      }
      .options-panel.in-modal .options-panel-title { display: none; }

      /* Screenshot previews in modal */
      .gen-previews {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 10px;
        margin-bottom: 16px;
        align-items: stretch;
      }
      .gen-preview {
        border-radius: 10px;
        overflow: hidden;
        border: 1px solid rgba(255,255,255,0.08);
        background: rgba(255,255,255,0.03);
        display: flex; flex-direction: column;
        position: relative;
      }
      .gen-preview-label {
        font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
        text-transform: uppercase; color: rgba(255,255,255,0.3);
        padding: 7px 10px 0; flex-shrink: 0;
      }
      .gen-preview-img-wrap {
        flex: 1; display: flex; align-items: center; justify-content: center;
        min-height: 80px; padding: 6px;
      }
      .gen-preview img {
        width: 100%; height: 100%; object-fit: cover;
        display: block; border-radius: 6px;
        animation: fadeIn 0.3s ease;
      }
      /* desktop = landscape, phone = portrait */
      .gen-preview.phone   { width: 112px; }
      .gen-preview.phone img { object-fit: cover; border-radius: 8px; }
      .gen-preview-loading {
        font-size: 10px; color: rgba(255,255,255,0.25);
        display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px;
      }
      .gen-preview-loading .mini-spinner {
        width: 16px; height: 16px; border-radius: 50%;
        border: 2px solid rgba(255,255,255,0.1);
        border-top-color: var(--accent);
        animation: spin 0.8s linear infinite;
      }
      .gen-preview-error {
        font-size: 10px; color: rgba(255,100,100,0.6); text-align: center; padding: 8px;
      }
      @keyframes panelIn{from{opacity:0; transform:translateX(14px)}to{opacity:1; transform:none}}

      /* ---- Rail de catégories ---- */
      .cat-rail {
        position: fixed;
        top: 104px;
        right: 17px;
        z-index: 11;
        display: flex;
        flex-direction: column;
        gap: 5px;
        padding: 7px;
        background: var(--ui-bg);
        backdrop-filter: blur(12px);
        border: 1px solid var(--ui-border);
        border-top-right-radius: 14px;
        border-bottom-right-radius: 14px;
        animation: panelIn .7s var(--ease) .22s both;

      }
      .cat-btn {
        width: 40px; height: 40px;
        display: grid; place-items: center;
        border: 0; background: transparent; cursor: pointer;
        color:#FFF;
        opacity: 0.45;
        border-radius: 10px;
        position: relative;
        transition: background 0.15s, opacity 0.15s;
      }
      .cat-btn:hover { opacity: 0.9; background: rgba(255,255,255,0.06); }
      .cat-btn.active { opacity: 1; background: rgba(123,108,255,0.16); }
      .cat-btn.active::before {
        content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
        width: 3px; height: 17px; border-radius: 3px; background: var(--accent);
      }



      /* ---- Panneau de contrôle latéral ---- */
      .panel {
        position: fixed;
        top: 84px;
        bottom: 84px;
        right: 74px;
        width: 270px;
        padding: 22px;
        background: rgba(18,18,24,0.62);
        backdrop-filter: blur(22px) saturate(1.5);
        border: 1px solid var(--ui-border);
        border-radius: 16px;
        box-shadow: var(--shadow-lg, 0 18px 50px rgba(0,0,0,0.45)), inset 0 1px 0 rgba(255,255,255,0.06);
        z-index: 10;
        display: flex;
        flex-direction: column;
        gap: 12px;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,0.15) transparent;
        animation: panelIn .7s var(--ease) .22s both;
      }
      .panel::-webkit-scrollbar { width: 4px; }
      .panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

      /* Panel header row (title + reset icon) */
      .panel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 10px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        margin-bottom: -2px;
      }
      .panel-head-text { display: flex; flex-direction: column; gap: 1px; }
      .panel-eyebrow {
        font-size: 10px; letter-spacing: 0.13em;
        text-transform: uppercase; color: var(--text-faint);
        margin: 0 0 3px;
      }
      .panel-header-title {
        font-family: 'Syne', sans-serif;
        font-size: 18px;
        font-weight: 700;
        letter-spacing: -0.01em;
        color: var(--text);
        user-select: none;
      }
      #resetParams {
        padding: 4px 10px;
        border-radius: 7px;
        background: transparent;
        border: 1px solid rgba(255,255,255,0.09);
        color: rgba(255,255,255,0.28);
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.15s, color 0.15s, border-color 0.15s;
        box-shadow: none;
        flex-shrink: 0;
      }
      #resetParams:disabled {
        opacity: 0.4;
        cursor: not-allowed;
        background: transparent;
        border-color: rgba(255,255,255,0.05);
        color: rgba(255,255,255,0.1);
      }
      #resetParams:hover:not(:disabled) {
        background: rgba(255,255,255,0.07);
        color: rgba(255,255,255,0.7);
        border-color: rgba(255,255,255,0.18);
        transform: none !important;
        box-shadow: none;
      }

      /* Cards accordion */
      .panel-card {
        background: transparent;
        border: none;
        border-radius: 0;
        overflow: visible; /* ne pas clipper le contenu des sections ouvertes */
        animation: cardIn 0.45s cubic-bezier(0.22,1,0.36,1) both;
      }
      @keyframes cardIn {
        from { opacity: 0; transform: translateY(10px); }
        to   { opacity: 1; transform: none; }
      }
      .panel-card:nth-child(2)  { animation-delay: 0.03s; }
      .panel-card:nth-child(3)  { animation-delay: 0.06s; }
      .panel-card:nth-child(4)  { animation-delay: 0.09s; }
      .panel-card:nth-child(5)  { animation-delay: 0.12s; }
      .panel-card:nth-child(6)  { animation-delay: 0.15s; }
      .panel-card:nth-child(7)  { animation-delay: 0.18s; }
      .panel-card:nth-child(8)  { animation-delay: 0.21s; }
      .panel-card:nth-child(9)  { animation-delay: 0.24s; }
      .panel-card:nth-child(10) { animation-delay: 0.27s; }
      @media (prefers-reduced-motion: reduce) {
        .panel-card { animation: none; }
      }
      /* Clip uniquement pour les coins arrondis de l'en-tête */
      .panel-card > h3:first-child { border-radius: 10px 10px 0 0; }
      .panel-card > h3:only-child  { border-radius: 10px; }
      .panel-card:has(h3:not(.collapsed)) {
        border-color: transparent;
        box-shadow: none;
      }

      .panel h3 {
        margin: 0;
        padding: 4px 2px 8px;
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        color: rgba(255,255,255,0.4);
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        user-select: none;
        background: transparent;
        border-bottom: none;
        gap: 6px;
      }
      .panel h3 span { flex: 1; }
      .panel h3:not(.collapsed) { color: rgba(255,255,255,0.5); background: transparent; }
      .panel h3:hover { color: rgba(255,255,255,0.7); }

      .panel h3::after {
        content: '';
        display: block;
        width: 14px; height: 14px; flex-shrink: 0;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
        background-size: contain; background-repeat: no-repeat; background-position: center;
        transition: transform 0.22s cubic-bezier(0.34,1.4,0.64,1), opacity 0.15s;
        opacity: 0.5;
      }
      .panel h3:not(.collapsed)::after { opacity: 1; }
      .panel h3.collapsed::after { transform: rotate(-90deg); }
      .panel h3.no-collapse { cursor: default; }
      .panel h3.no-collapse::after { display: none; }
      .panel h3.no-collapse:hover { background: rgba(255,255,255,0.045); }

      .panel-section {
        display: flex; flex-direction: column; gap: 12px;
        max-height: 3000px;
        overflow: hidden;
        transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1),
                    opacity 0.2s ease,
                    padding 0.28s cubic-bezier(0.4,0,0.2,1);
        opacity: 1;
      }
      .panel-section.collapsed {
        max-height: 0 !important;
        opacity: 0;
        padding-top: 0;
        padding-bottom: 0;
      }
      /* Carte masquée en mode Phone (compose avec le display inline de showCat). */
      .panel-card.phone-hidden { display: none !important; }
      /* Espacement uniforme dans la carte URL bar : mêmes 12px que .panel-section. */
      #urlBarSection, #urlBarOptions { display: flex; flex-direction: column; gap: 12px; }

      .control label {
        display: flex;
        justify-content: space-between;
        font-size: 12px;
        color: var(--text-dim);
        margin-bottom: 6px;
      }

      .control input[type='range'] {
        -webkit-appearance: none; appearance: none;
        width: 100%;
        height: 14px;
        background: transparent;
        cursor: pointer;
        outline: none;
      }
      .control input[type='range']::-webkit-slider-runnable-track {
        height: 4px; border-radius: 4px;
        background: rgba(255,255,255,0.10);
      }
      .control input[type='range']::-webkit-slider-thumb {
        -webkit-appearance: none; appearance: none;
        width: 14px; height: 14px; margin-top: -5px;
        border-radius: 50%;
        background: #fff;
        border: 3px solid var(--accent);
        box-shadow: 0 1px 5px rgba(0,0,0,0.45);
        transition: transform 0.12s, box-shadow 0.12s;
      }
      .control input[type='range']::-webkit-slider-thumb:hover {
        transform: scale(1.18);
        box-shadow: 0 0 0 5px var(--accent-soft);
      }
      .control input[type='range']::-moz-range-track {
        height: 4px; border-radius: 4px;
        background: rgba(255,255,255,0.10);
      }
      .control input[type='range']::-moz-range-thumb {
        width: 14px; height: 14px;
        border-radius: 50%;
        background: #fff;
        border: 3px solid var(--accent);
        box-shadow: 0 1px 5px rgba(0,0,0,0.45);
        cursor: pointer;
      }

      .presets {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 6px;
        padding: 6px;
      }

      .swatch {
        height: 38px;
        width: 38px;
        border-radius: 8px;
        border: 2px solid transparent;
        cursor: pointer;
        padding: 0;
        transition: transform 0.1s ease, box-shadow 0.15s ease;
      }
      .swatch:hover { transform: scale(1.07); border-color: #fff }
      .swatch.active {
        border-color: #fff;
      }

      .panel .row {
        display: flex;
        gap: 8px;
      }

      .panel .row button {
        flex: 1;
        padding: 9px 8px;
        font-size: 12px;
      }

      input[type='color'] {
        width: 38px;
        height: 38px;
        border: 1px solid var(--ui-border);
        border-radius: 7px;
        background: transparent;
        cursor: pointer;
        margin-bottom: 12px;
      }

      select {
        width: 100%;
        padding: 7px 10px;
        border-radius: 7px;
        border: 1px solid var(--ui-border);
        background: rgba(0,0,0,0.35);
        color: var(--text);
        font-size: 12px;
        cursor: pointer;
        outline: none;
      }
      select:focus { border-color: var(--accent); }

      .mode-switch {
        display: flex;
        gap: 4px;
        background: rgba(0,0,0,0.25);
        padding: 4px;
        border-radius: 10px;
      }
      .mode-btn {
        flex: 1;
        padding: 7px 4px;
        font-size: 11px;
        font-weight: 600;
        background: transparent;
        color: var(--text-dim);
        border-radius: 7px;
        border: none;
        cursor: pointer;
        transition: background 0.15s, color 0.15s;
      }
      .mode-btn:hover:not(.active) { color: rgba(255,255,255,0.85); }
      /* Sélection secondaire = neutre (l'accent violet est réservé au primaire :
         Generate, Export, icône active du rail). */
      .mode-btn.active {
        background: rgba(255,255,255,0.13);
        color: #fff;
        box-shadow: none;
      }

      /* ---- Templates 1-clic ---- */
      .tpl-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
      }
      .tpl-btn {
        position: relative;
        padding: 11px 10px 11px 13px;
        font-size: 11.5px;
        font-weight: 600;
        text-align: left;
        background: var(--surface-1);
        color: var(--text-dim);
        border: 1px solid var(--border-1);
        border-radius: 9px;
        cursor: pointer;
        overflow: hidden;
        transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
      }
      .tpl-btn::before {
        content: ''; position: absolute; left: 0; top: 50%;
        transform: translateY(-50%);
        width: 2px; height: 0; border-radius: 2px;
        background: linear-gradient(var(--accent), var(--accent-2));
        transition: height 0.2s ease;
      }
      .tpl-btn:hover {
        background: var(--surface-2);
        border-color: var(--border-2);
        color: #fff;
        transform: translateY(-1px);
      }
      .tpl-btn:hover::before { height: 62%; }
      .tpl-btn:active { transform: translateY(0) scale(0.98); }
      .tpl-btn.full { grid-column: 1 / -1; }

      .hidden {
        display: none !important;
      }

      /* ---- Loader ---- */
      .loader {
        position: fixed;
        inset: 0;
        z-index: 20;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 18px;
        background: rgba(8, 8, 12, 0.78);
        backdrop-filter: blur(4px);
      }

      .spinner {
        width: 46px;
        height: 46px;
        border-radius: 50%;
        border: 4px solid rgba(255, 255, 255, 0.15);
        border-top-color: var(--accent);
        animation: spin 0.9s linear infinite;
      }

      @keyframes spin {
        to {
          transform: rotate(360deg);
        }
      }

      .loader p {
        margin: 0;
        font-size: 14px;
        color: var(--text-dim);
      }

      /* ---- Toast ---- */
      /* Confirmation dialog */
      .confirm-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.55);
        backdrop-filter: blur(4px);
        z-index: 50;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        animation: fadeIn 0.15s forwards;
      }
      @keyframes fadeIn { to { opacity: 1; } }
      .confirm-box {
        background: rgba(18,18,24,0.97);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 16px;
        padding: 24px;
        width: 300px;
        box-shadow: 0 20px 60px rgba(0,0,0,0.6);
        transform: translateY(8px) scale(0.97);
        animation: confirmIn 0.2s cubic-bezier(0.34,1.4,0.64,1) forwards;
      }
      @keyframes confirmIn { to { transform: translateY(0) scale(1); } }
      .confirm-box h4 {
        margin: 0 0 8px;
        font-family: 'Syne', sans-serif;
        font-size: 15px;
        font-weight: 700;
        color: #fff;
      }
      .confirm-box p {
        margin: 0 0 20px;
        font-size: 13px;
        color: rgba(255,255,255,0.5);
        line-height: 1.5;
      }
      .confirm-box .confirm-row {
        display: flex;
        gap: 8px;
        justify-content: flex-end;
      }
      .confirm-box .confirm-row button {
        font-size: 13px;
        padding: 8px 18px;
      }

      .toast {
        position: fixed;
        bottom: 22px;
        left: 50%;
        transform: translateX(-50%);
        padding: 11px 18px;
        background: rgba(22, 22, 30, 0.96);
        border: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 8px 32px rgba(0,0,0,0.45);
        backdrop-filter: blur(16px) saturate(1.4);
        color: rgba(255,255,255,0.88);
        border-radius: 10px;
        font-size: 13px;
        z-index: 30;
        opacity: 0;
        transition: opacity 0.25s ease;
        pointer-events: none;
        white-space: nowrap;
      }
      .toast.error {
        background: rgba(180, 30, 30, 0.95);
        border-color: rgba(255,80,80,0.25);
      }
      .toast.show {
        opacity: 1;
      }

      /* ---- Options panel (topbar) ---- */
      .options-panel {
        position: fixed;
        top: 66px;
        left: 50%;
        transform: translateX(-50%) translateY(0);
        background: rgba(14, 14, 18, 0.92);
        backdrop-filter: blur(20px) saturate(1.4);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 14px;
        padding: 14px 16px;
        z-index: 9;
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: min(480px, calc(100% - 32px));
        box-shadow: 0 8px 40px rgba(0,0,0,0.5);
        animation: slideDown 0.18s cubic-bezier(0.34,1.4,0.64,1) both;
      }
      @keyframes slideDown {
        from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
        to   { opacity: 1; transform: translateX(-50%) translateY(0); }
      }
      .options-panel.hidden { display: none !important; }
      .options-panel-title {
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: rgba(255,255,255,0.25);
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        font-family: 'Syne', sans-serif;
      }
      .opt-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 13px;
        color: rgba(255,255,255,0.7);
        gap: 16px;
        padding: 2px 0;
      }
      .opt-row span { flex: 1; font-weight: 500; color: var(--text); }
      .opt-row small { font-size: 11px; color: rgba(255,255,255,0.35); display: block; margin-top: 1px; }
      .opt-custom-css { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,0.06); }
      .opt-custom-css-header span { font-size: 13px; font-weight: 500; color: var(--text); }
      .opt-custom-css-header small { font-size: 11px; color: rgba(255,255,255,0.35); display: block; margin-top: 2px; }
      #optCustomCss {
        width: 100%; min-height: 80px; max-height: 160px;
        padding: 9px 11px;
        background: rgba(0,0,0,0.35);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 9px;
        color: rgba(255,255,255,0.8);
        font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
        font-size: 11px;
        line-height: 1.6;
        resize: vertical;
        outline: none;
        transition: border-color 0.15s;
      }
      #optCustomCss:focus { border-color: rgba(124,92,255,0.5); }
      #optCustomCss::placeholder { color: rgba(255,255,255,0.18); }
      /* Toggle switch */
      .toggle { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
      .toggle input { opacity: 0; width: 0; height: 0; }
      .toggle-track {
        position: absolute; inset: 0;
        background: rgba(255,255,255,0.15);
        border-radius: 20px;
        cursor: pointer;
        transition: background 0.2s;
      }
      .toggle input:checked + .toggle-track { background: var(--accent); }
      .toggle-track::after {
        content: '';
        position: absolute;
        width: 14px; height: 14px;
        left: 3px; top: 3px;
        background: #fff;
        border-radius: 50%;
        transition: transform 0.2s;
      }
      .toggle input:checked + .toggle-track::after { transform: translateX(16px); }
      button.icon-btn {
        background: rgba(255,255,255,0.08);
        border: 1px solid var(--ui-border);
        font-size: 15px;
        line-height: 1;
      }
/* ======================================================
   EDITO OVERLAY
   ====================================================== */
.edito-overlay {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 38%;
  max-width: 380px;
  padding: 0 0 32px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  pointer-events: none;
  z-index: 8;
  opacity: 0;
}
.edito-overlay.visible { opacity: 1; }

.edito-number {
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  overflow: hidden;
}
.edito-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(32px, 4vw, 58px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 20px;
  overflow: hidden;
}
.edito-title .word,
.edito-title .char { display: inline-block; }

.edito-desc {
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255,255,255,0.5);
  margin: 0 0 24px;
  max-width: 280px;
  overflow: hidden;
}
.edito-tags {
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.28);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  overflow: hidden;
}
.edito-tag { display: inline; }
.edito-tag + .edito-tag::before { content: ' · '; opacity: 0.5; }

.edito-credit {
  position: fixed;
  left: 48px;
  bottom: 28px;
  font-size: 11px;
  color: rgba(255,255,255,0.22);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 8;
}
.edito-credit svg { width: 12px; height: 12px; opacity: 0.5; }

/* ── Swatch groups ──────────────────────────────────────────── */
.swatch-group-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 8px 0 5px;
}
#presets > .swatch-group-label:first-child { margin-top: 0; }

/* ── Motion picker ──────────────────────────────────────────── */
.motion-menu { position: relative; }
#motionTrigger {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  font-size: 12px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 9px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
#motionTrigger:hover { background: var(--surface-2); border-color: var(--border-2); }
#motionTrigger b { font-weight: 600; }
#motionTrigger svg { opacity: 0.6; }
.motion-trigger-icon {
  width: 14px; height: 10px;
  border-radius: 2.5px;
  border: 1.5px solid currentColor;
  opacity: 0.65;
  transform: perspective(40px) rotateY(-18deg);
}

.motion-pop {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  /* minmax(0,1fr) : sans le 0, min-width:auto des items laisse le texte
     élargir les colonnes au-delà du cadre fixe du popover */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  width: min(430px, calc(100vw - 24px));
  padding: 9px;
  background: rgba(18, 18, 24, 0.92);
  backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border-1);
  border-radius: 14px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.06);
  z-index: 30;
}
.motion-pop.hidden { display: none; }

.motion-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  white-space: normal; /* le button global est en nowrap → texte qui débordait */
  text-align: left;
  padding: 9px 10px 8px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.motion-card:hover { background: var(--surface-2); transform: translateY(-1px); }
.motion-card.active {
  border-color: var(--accent-line, #7c5cff);
  box-shadow: 0 0 0 1px rgba(124,92,255,0.45);
}
.motion-card b { font-size: 12px; font-weight: 600; }
.motion-card small {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.25;
  width: 100%;
  overflow-wrap: break-word;
}

/* Vignette animée : un "device" stylisé qui mime le mouvement du preset */
.motion-thumb {
  position: relative;
  width: 100%;
  height: 38px;
  margin-bottom: 5px;
  border-radius: 7px;
  background: linear-gradient(150deg, rgba(124,92,255,0.16), rgba(20,20,30,0.5));
  overflow: hidden;
  perspective: 110px;
}
.motion-thumb::before,
.motion-thumb::after {
  content: '';
  position: absolute;
  border-radius: 2.5px;
  background: linear-gradient(140deg, #b9a6ff, #6f57d8);
  box-shadow: 0 2px 5px rgba(0,0,0,0.45);
}
.motion-thumb::before {
  width: 30px; height: 19px;
  left: calc(50% - 15px); top: calc(50% - 9.5px);
}
.motion-thumb::after { display: none; }

.motion-card[data-motion="showcase"] .motion-thumb::before {
  animation: mt-showcase 3.4s ease-in-out infinite;
}
@keyframes mt-showcase {
  0%   { transform: translateX(-7px) rotateY(34deg); }
  30%  { transform: translateX(0) rotateY(9deg); }
  55%  { transform: translateX(4px) rotateY(-20deg); }
  80%, 100% { transform: translateX(0) rotateY(6deg); }
}
.motion-card[data-motion="float"] .motion-thumb::before {
  animation: mt-float 4s ease-in-out infinite;
}
@keyframes mt-float {
  0%, 100% { transform: translateY(0) rotateY(5deg); }
  50%      { transform: translateY(-2.5px) rotateY(-4deg); }
}
.motion-card[data-motion="cinematic"] .motion-thumb::before {
  animation: mt-cinematic 3.6s ease-in-out infinite;
}
@keyframes mt-cinematic {
  0%   { transform: translateY(-5px) scale(0.62) rotateY(9deg); }
  70%, 100% { transform: translateY(0) scale(1) rotateY(9deg); }
}
.motion-card[data-motion="orbit"] .motion-thumb::before {
  animation: mt-orbit 3.8s ease-in-out infinite;
}
@keyframes mt-orbit {
  0%   { transform: rotateY(52deg) translateX(-5px); }
  55%  { transform: rotateY(-24deg) translateX(3px); }
  85%, 100% { transform: rotateY(8deg) translateX(0); }
}
.motion-card[data-motion="kinetic"] .motion-thumb::before {
  animation: mt-kinetic 2.6s ease-out infinite;
}
@keyframes mt-kinetic {
  0%   { transform: translateY(7px) scale(1.45); }
  14%  { transform: translateY(0) scale(1); }
  24%  { transform: rotateY(22deg); }
  36%  { transform: rotateY(-15deg); }
  48%, 100% { transform: rotateY(5deg); }
}
.motion-card[data-motion="duo"] .motion-thumb::before {
  width: 24px; height: 16px;
  left: calc(50% - 19px); top: calc(50% - 8px);
  animation: mt-duo-a 3.6s ease-in-out infinite;
}
.motion-card[data-motion="duo"] .motion-thumb::after {
  display: block;
  width: 8px; height: 16px;
  left: calc(50% + 9px); top: calc(50% - 8px);
  animation: mt-duo-b 3.6s ease-in-out infinite;
}
@keyframes mt-duo-a {
  0%   { transform: translateX(-5px) rotateY(38deg); }
  55%, 100% { transform: translateX(0) rotateY(8deg); }
}
@keyframes mt-duo-b {
  0%   { transform: translateX(5px) rotateY(-38deg); }
  55%, 100% { transform: translateX(0) rotateY(-8deg); }
}
/* Reels : momentum continu, whip-pans snappy enchaînés, AUCUN cut. */
.motion-card[data-motion="reels"] .motion-thumb::before {
  animation: mt-reels 2.8s cubic-bezier(0.5, 1.6, 0.4, 1) infinite;
}
@keyframes mt-reels {
  0%   { transform: rotateY(-24deg) scale(1.18); }
  20%  { transform: rotateY(10deg) scale(1.05); }
  40%  { transform: rotateY(-16deg) scale(1.12); }
  60%  { transform: rotateY(12deg) scale(1.04); }
  80%, 100% { transform: rotateY(5deg) scale(1); }
}
/* Spotlight : plan-séquence — gros plan macro qui recule pour révéler, sans cut. */
.motion-card[data-motion="spotlight"] .motion-thumb::before {
  animation: mt-spotlight 4s ease-in-out infinite;
}
@keyframes mt-spotlight {
  0%   { transform: scale(1.9) rotateY(8deg); }
  45%  { transform: scale(1.5) rotateY(2deg); }
  100% { transform: scale(1) rotateY(6deg); }
}

/* ── Progression de capture ─────────────────────────────────── */
.loader-bar {
  width: 230px;
  height: 4px;
  margin-top: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.loader-bar.hidden { display: none; }
.loader-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #a78bff);
  transition: width 0.5s ease;
}
/* % connu → la barre topbar devient déterminée (le scaleX inline pilote) */
.topbar-progress.determinate { animation: none; }

/* ── Modal upsell Pro ───────────────────────────────────────── */
.pro-box { max-width: 360px; }
.pro-perks {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.pro-perks li {
  font-size: 13px;
  color: var(--text);
  padding-left: 22px;
  position: relative;
}
.pro-perks li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #8b6dff;
  font-weight: 700;
}
.pro-note {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 10px 0 4px;
}

/* ── Template actif ─────────────────────────────────────────── */
.tpl-btn.active {
  border-color: rgba(124, 92, 255, 0.55);
  color: #fff;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.35);
}
.tpl-btn.active::before { height: 62%; }

/* ── Extra pages (modal generate) ───────────────────────────── */
.gen-extra-pages {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}
.gen-extra-pages label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}
.gen-extra-pages label span { color: var(--text-dim); font-weight: 400; }
.gen-extra-pages input {
  padding: 8px 10px;
  font-size: 12px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  color: var(--text);
}
.gen-extra-pages input:focus { border-color: var(--accent-line, #7c5cff); outline: none; }
.gen-extra-pages small { font-size: 10px; color: var(--text-dim); line-height: 1.4; }

/* Swatch upload image */
.swatch-image {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: var(--surface-1);
  border: 1px dashed var(--border-2) !important;
}

/* ── Templates : cartes explicites ──────────────────────────── */
.tpl-hint {
  font-size: 10.5px;
  color: var(--text-dim);
  line-height: 1.45;
  margin: 0 0 9px;
}
.tpl-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  white-space: normal;
}
.tpl-btn b { font-size: 11.5px; font-weight: 600; }
.tpl-btn small {
  font-size: 9.5px;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.tpl-btn.active small, .tpl-btn:hover small { color: rgba(255,255,255,0.55); }

/* ── Plans dans la modal Pro ────────────────────────────────── */
.pro-plans {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 12px 0;
}
.pro-plan {
  padding: 10px 12px;
  border: 1px solid var(--border-1);
  border-radius: 10px;
  background: var(--surface-1);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pro-plan:hover { background: var(--surface-2); }
.pro-plan.selected {
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.4);
}
.pro-plan-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
}
.pro-plan-price { font-weight: 700; color: #b9a6ff; }
.pro-plan p { margin: 3px 0 0; font-size: 11px; color: var(--text-dim); line-height: 1.4; }

.pro-restore {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 4px;
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.pro-restore:hover { color: var(--text); box-shadow: none; opacity: 1; }

/* ── Barre de lecture animation ─────────────────────────────── */
.anim-bar {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  width: 340px;
  padding: 7px 10px;
  background: rgba(15, 15, 19, 0.72);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--border-1);
  border-radius: 12px;
  z-index: 9;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.05);
}
.anim-bar.hidden { display: none; }
/* Pendant un export : grisée + non-interactive, mais on garde sa place dans le
   dock (sinon les boutons se décalent). pointer-events:none = pas de scrub/replay
   qui casserait l'enregistrement. */
.anim-bar.is-exporting { opacity: 0.4; pointer-events: none; }
.anim-bar button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  flex-shrink: 0;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 7px;
  color: var(--text-dim);
}
.anim-bar button:hover { color: #fff; background: var(--surface-2); box-shadow: none; }
.anim-bar button.active {
  color: #b9a6ff;
  border-color: rgba(124, 92, 255, 0.55);
  background: rgba(124, 92, 255, 0.12);
}
.anim-track {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}
.anim-track i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #a78bff);
}
#animTime {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  flex-shrink: 0;
  min-width: 58px;
  text-align: right;
}

.exportbar select:disabled { opacity: 0.45; cursor: not-allowed; }

/* Vignette Launch : 3 plans avec dips */
.motion-card[data-motion="launch"] .motion-thumb::before {
  animation: mt-launch 4.2s ease-in-out infinite;
}
.motion-card[data-motion="launch"] .motion-thumb::after {
  display: block;
  width: 100%; height: 100%;
  left: 0; top: 0;
  border-radius: 0;
  background: #000;
  box-shadow: none;
  opacity: 0;
  animation: mt-launch-dip 4.2s linear infinite;
}
@keyframes mt-launch {
  0%   { transform: rotateY(28deg) scale(1); }
  30%  { transform: rotateY(6deg) scale(1); }
  38%  { transform: rotateY(-18deg) scale(1.35); }
  62%  { transform: rotateY(-5deg) scale(1.35); }
  70%  { transform: rotateY(12deg) scale(0.95); }
  100% { transform: rotateY(5deg) scale(0.95); }
}
@keyframes mt-launch-dip {
  0%, 32%, 40%, 64%, 72%, 100% { opacity: 0; }
  35%, 36% { opacity: 1; }
  67%, 68% { opacity: 1; }
}
@keyframes slideInL{from{opacity:0; transform:translateY(-50%) translateX(-14px)}to{opacity:1; transform:translateY(-50%)}}
/* ── Outils de scène (gauche) : zoom + rotation manuelle ────── */
.scene-tools {
  position: fixed;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 6px;
  background: rgba(15, 15, 19, 0.72);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--border-1);
  border-radius: 13px;
  z-index: 9;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: slideInL .7s var(--ease) .25s both;
}
.scene-tools button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.scene-tools button:hover { color: #fff; background: var(--surface-2); box-shadow: none; }
.scene-tools button:active { background: var(--accent-soft); color: var(--accent-2); border-color: var(--accent-line); }
.scene-tools-row { display: flex; gap: 5px; }
.scene-tools-sep { width: 18px; height: 1px; background: var(--border-1); margin: 2px 0; }

/* Outils scène : masqués sous l'éditeur étroit (la barre gauche gênerait) */
@media (max-width: 760px) {
  .scene-tools { display: none; }
}

/* ── Choix fps (modal Generate) ─────────────────────────────── */
.gen-fps { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.gen-fps > label { font-size: 11px; font-weight: 600; color: var(--text); }
.gen-fps-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-bottom: 12px; }
.gen-fps-switch button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 9px 12px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 9px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.gen-fps-switch button:hover { background: var(--surface-2); }
.gen-fps-switch button.active {
  border-color: var(--accent-line, #7c5cff);
  box-shadow: 0 0 0 1px rgba(124,92,255,0.4);
  background: rgba(124,92,255,0.10);
}
.gen-fps-switch b { font-size: 13px; font-weight: 600; }
.gen-fps-switch span { font-size: 10px; color: var(--text-dim); }

/* Bandeau « serveur occupé » dans la modal Generate */
.gen-busy {
  margin-bottom: 14px;
  padding: 9px 12px;
  font-size: 12px;
  color: #ffcf8a;
  background: rgba(255, 184, 77, 0.10);
  border: 1px solid rgba(255, 184, 77, 0.28);
  border-radius: 9px;
}
.gen-busy.hidden { display: none; }

/* Bouton Annuler dans le loader de capture */
.loader-cancel {
  margin-top: 16px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.loader-cancel:hover { color: #ff6b6b; border-color: rgba(255,107,107,0.4); background: rgba(255,107,107,0.08); }

/* Fallback : site qui bloque la capture → upload manuel */
.fallback-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 60;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s forwards;
}
.fallback-overlay.hidden { display: none; }
.fallback-box {
  position: relative;
  background: rgba(16,16,22,0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 28px 26px 24px;
  width: min(440px, calc(100vw - 32px));
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
  animation: confirmIn 0.2s cubic-bezier(0.34,1.4,0.64,1) forwards;
}
.fallback-icon {
  font-size: 26px; line-height: 1;
  color: #ffb84d;
  margin-bottom: 10px;
}
.fallback-box h3 {
  margin: 0 0 8px;
  font-family: 'Syne', sans-serif;
  font-size: 17px; font-weight: 700;
  color: var(--text);
}
.fallback-box p {
  margin: 0 0 18px;
  font-size: 13px; line-height: 1.5;
  color: var(--text-dim);
}
.fallback-actions { display: flex; flex-direction: column; gap: 8px; }
.fallback-actions button {
  font-size: 13px; font-weight: 600;
  padding: 10px 18px;
  border-radius: 9px;
  cursor: pointer;
}
#fallbackUpload {
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
}
#fallbackUpload:hover { filter: brightness(1.08); }
.fallback-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none;
  color: var(--text-faint);
  font-size: 14px; cursor: pointer;
  line-height: 1;
}
.fallback-close:hover { color: var(--text); }

/* Lien de partage / embed */
.share-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 60;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s forwards;
}
.share-overlay.hidden { display: none; }
.share-box {
  position: relative;
  background: rgba(16,16,22,0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 26px;
  width: min(520px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
  animation: confirmIn 0.2s cubic-bezier(0.34,1.4,0.64,1) forwards;
}
.share-box h3 {
  margin: 0 0 6px;
  font-family: 'Syne', sans-serif;
  font-size: 17px; font-weight: 700;
  color: var(--text);
}
.share-box p { margin: 0 0 16px; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.share-box label {
  display: block;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-dim); opacity: .7;
  margin: 12px 0 4px;
}
.share-row { display: flex; gap: 6px; }
.share-row input {
  flex: 1; min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--ui-border);
  background: rgba(0,0,0,0.4);
  color: var(--text);
  font-size: 12px; font-family: ui-monospace, monospace;
  outline: none;
}
.share-row button {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 12px; font-weight: 600;
  color: #fff; background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px; cursor: pointer;
}
.share-row button:hover { filter: brightness(1.08); }
.share-actions { margin-top: 16px; }
.share-actions a { font-size: 13px; color: var(--accent); text-decoration: none; }
.share-actions a:hover { text-decoration: underline; }

/* Mode viewer (/v/:id) : aucune UI d'édition, juste la scène en boucle */
body.viewer-mode .topbar,
body.viewer-mode .panel,
body.viewer-mode .cat-rail,
body.viewer-mode #captureFrame,
body.viewer-mode .exportbar,
body.viewer-mode .options-panel,
body.viewer-mode #sceneTools,
body.viewer-mode #animBar { display: none !important; }

/* Boutons de partage social dans la modal */
.share-social { display: flex; gap: 8px; margin-top: 16px; align-items: center; }
.share-social-btn {
  font-size: 12px; font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--ui-border);
  text-decoration: none;
}
.share-social-btn:hover { background: rgba(255,255,255,0.12); }
#shareOpen { margin-left: auto; color: var(--accent); background: none; border: none; padding: 8px 4px; }
#shareOpen:hover { text-decoration: underline; background: none; }

/* CTA viral du viewer d'embed (/v/:id) */
.viewer-cta {
  position: fixed; bottom: 18px; right: 18px;
  z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px 9px 12px;
  border-radius: 12px;
  background: rgba(16,16,22,0.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.viewer-cta:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 12px 34px rgba(0,0,0,0.55);
}
.viewer-cta.hidden { display: none; }
/* CTA « Visit site » : bas-gauche, symétrique au badge Made-with (bas-droite). */
.viewer-visit { left: 18px; right: auto; }
.viewer-visit .viewer-cta-spark { font-size: 14px; }
.viewer-cta-spark { font-size: 16px; line-height: 1; }
.viewer-cta-text { display: flex; flex-direction: column; line-height: 1.2; }
.viewer-cta-text b { font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700; }
.viewer-cta-text small { font-size: 10px; color: var(--text-dim); }
.viewer-cta-arrow { font-size: 15px; color: var(--accent); transition: transform 0.15s; }
.viewer-cta:hover .viewer-cta-arrow { transform: translateX(3px); }

/* Historique des rendus (popover topbar, s'ouvre vers le bas) */
.history-menu { position: relative; display: flex; }
.history-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex; flex-direction: column;
  padding: 6px;
  background: rgba(20,20,26,0.97);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 280px;
  max-height: 60vh; overflow-y: auto;
  z-index: 30;
  animation: popUp 0.15s ease both;
}
.history-pop.hidden { display: none; }
.history-pop-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-dim);
  padding: 6px 8px 8px;
}
/* Menu d'upload média (Desktop / Mobile / Both) — même langage que history-pop. */
.upload-menu { position: relative; display: flex; }
.upload-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex; flex-direction: column;
  padding: 6px;
  background: rgba(20,20,26,0.97);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 190px;
  z-index: 30;
  animation: popUp 0.15s ease both;
}
.upload-pop.hidden { display: none; }
.upload-pop-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-dim);
  padding: 6px 8px 8px;
}
.upload-pop button {
  text-align: left; background: transparent; border: none; box-shadow: none;
  color: var(--text); font-size: 13px; padding: 8px 9px; border-radius: 8px;
}
.upload-pop button:hover { background: var(--surface-2); box-shadow: none; }

.history-list { display: flex; flex-direction: column; gap: 2px; }
.history-empty { font-size: 12px; color: var(--text-dim); padding: 10px 8px; }
.history-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  width: 100%; text-align: left; box-shadow: none;
}
.history-item:hover { background: var(--surface-2); box-shadow: none; }
.history-thumb {
  width: 64px; height: 36px; flex-shrink: 0;
  object-fit: cover; border-radius: 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--ui-border);
}
.history-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.history-meta b { font-size: 12px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-meta small { font-size: 10px; color: var(--text-dim); }
.history-item.expired { opacity: 0.45; }
.history-item.expired:hover { background: transparent; cursor: default; }

/* Animation : grilles poses 3D + transitions in/out */
.pose-grid, .anim-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.anim-grid .mode-btn { font-size: 10px; padding: 6px 2px; }
.pose-btn {
  font-size: 10px; font-weight: 600;
  padding: 7px 2px;
  border-radius: 7px;
  color: var(--text-dim);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.pose-btn:hover { color: var(--text); background: rgba(255,255,255,0.07); }
.pose-btn.active { color: #fff; background: rgba(255,255,255,0.13); }

/* Background : groupes de swatches commutés par le switch */
.bg-group[hidden] { display: none; }

/* Popover réglages d'export (dans le dock, s'ouvre vers le haut) */
.export-menu { position: relative; display: flex; }
.export-pop {
  position: absolute; bottom: calc(100% + 12px); right: 0;
  display: flex; flex-direction: column; gap: 9px;
  padding: 13px; width: 240px;
  background: rgba(16,16,22,0.97); backdrop-filter: blur(20px);
  border: 1px solid var(--border-2, rgba(255,255,255,0.1)); border-radius: 13px;
  box-shadow: var(--shadow-lg, 0 18px 50px rgba(0,0,0,0.5)); z-index: 12;
}
.export-pop.hidden { display: none; }
.export-pop-label {
  font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 1px;
}
.export-pop select { width: 100%; box-sizing: border-box; }
.export-pop #unlockPro { width: 100%; justify-content: center; }

/* ===================================================================
   Alignement sur le prototype — langage de boutons unifié
   =================================================================== */
/* Segmented (mode-switch) façon .seg du proto : conteneur sombre, pas de bordure
   sur les boutons, actif = blanc translucide (neutre) */
.mode-switch {
  display: flex; gap: 2px; padding: 3px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
}
.mode-switch .mode-btn {
  flex: 1; height: 20px; padding: 0 10px;
  border: 0; background: transparent; color: var(--text-dim);
  font-size: 12px; font-weight: 600; border-radius: 7px; cursor: pointer;
  transition: background 0.16s var(--ease, cubic-bezier(.22,1,.36,1)), color 0.16s;
}
.mode-switch .mode-btn:hover:not(.active) { color: var(--text); background: transparent; }
.mode-switch .mode-btn.active { background: rgba(255,255,255,0.1); color: #fff; box-shadow: none; }

/* Rail de catégories façon .rail-btn — icônes parfaitement centrées */
.cat-btn { width: 42px; height: 42px; padding: 0; border-radius: 11px; display: grid; place-items: center; }
.cat-btn svg { display: block; }
.cat-btn.active::before { left: -9px; height: 18px; }

/* Swatches façon .sw : bordure transparente, hover scale, actif = liseré + halo accent */
.swatch { border: 1.5px solid transparent; transition: transform 0.16s var(--ease, cubic-bezier(.22,1,.36,1)), border-color 0.16s, box-shadow 0.16s; }
.swatch:hover { transform: scale(1.08); }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 3px rgba(123,108,255,0.4); }

/* Poses façon .chip */
.pose-btn { border: 1px solid rgba(255,255,255,0.05); background: rgba(255,255,255,0.03); }
.pose-btn:hover { background: rgba(255,255,255,0.07); }
.pose-btn.active { background: rgba(123,108,255,0.18); color: #fff; border-color: rgba(123,108,255,0.5); }

/* Transitions des options à l'ouverture d'un panneau (stagger, façon .pane.on) */
@keyframes optRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.panel-section.stagger > * { animation: optRise 0.42s cubic-bezier(.22,1,.36,1) both; }
.panel-section.stagger > *:nth-child(2)  { animation-delay: 0.04s; }
.panel-section.stagger > *:nth-child(3)  { animation-delay: 0.08s; }
.panel-section.stagger > *:nth-child(4)  { animation-delay: 0.12s; }
.panel-section.stagger > *:nth-child(5)  { animation-delay: 0.16s; }
.panel-section.stagger > *:nth-child(6)  { animation-delay: 0.20s; }
.panel-section.stagger > *:nth-child(7)  { animation-delay: 0.24s; }
.panel-section.stagger > *:nth-child(8)  { animation-delay: 0.28s; }
.panel-section.stagger > *:nth-child(n+9){ animation-delay: 0.30s; }

/* Zone Transport : lecture (anim-bar) + unlock — prend la largeur dispo. */
.dock-transport { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 100%; border-bottom: 1px solid var(--border-1); padding-bottom: 4px; }
/* anim-bar (lecture) intégrée dans le dock d'export — toujours visible, inline */
.exportbar .anim-bar {
  position: static; transform: none;
  flex: 1; width: auto;
  padding: 0; gap: 8px;
  background: transparent; backdrop-filter: none; border: none; box-shadow: none; z-index: auto;
}
.exportbar .anim-bar .anim-track { flex: 1 1 auto; width: auto; min-width: 80px; }
.exportbar .anim-bar button {
  width: 28px; height: 28px;
  background: transparent; border: 1px solid transparent; box-shadow: none;
}
.exportbar .anim-bar button:hover { background: rgba(255,255,255,0.08); color: #fff; }
.exportbar .anim-bar button.active { color: #b9a6ff; background: rgba(124,92,255,0.12); border-color: transparent; }
.exportbar .anim-bar #animTime { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; min-width: 58px; }
/* Bouton play/pause : bascule d'icône selon l'état de lecture */
.anim-play .ic-pause { display: none; }
.anim-play.playing .ic-play { display: none; }
.anim-play.playing .ic-pause { display: block; }
.dock-sep { width: 1px; height: 22px; background: rgba(255,255,255,0.1); flex-shrink: 0; margin: 0 3px; }
/* le dock peut être plus large maintenant qu'il porte la lecture + les réglages inline */
.exportbar { max-width: calc(100% - 120px); flex-wrap: wrap; justify-content: center; row-gap: 8px; }

/* Dock zoné : Transport · Output · Actions, séparés par des hairlines,
   chaque réglage Output devient un micro-champ labellisé. */
.dock-output { display: flex; align-items: flex-end; gap: 9px; flex-wrap: wrap; }
.dock-actions { display: flex; align-items: center; gap: 6px; flex: 1; }
.dock-actions > button { flex: 1; border: 1px solid var(--border-1); align-items: center; justify-content: center; }
.dock-field { display: inline-flex; flex-direction: column; gap: 3px; }
.dock-field > span {
  font-size: 8px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-faint); padding-left: 3px; line-height: 1;
}

/* Selects du dock uniformisés sur #motionTrigger : même hauteur, graisse et
   chevron custom (la flèche native du <select> est masquée). */
.exportbar select,
.dock-field .motion-menu #motionTrigger {
  box-sizing: border-box;
  height: 32px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 9px;
}
.exportbar select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 0 28px 0 11px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8' fill='none'%3E%3Cpath d='M1 2.5L4 5.5L7 2.5' stroke='%23ffffff' stroke-opacity='0.55' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 11px center !important;
}
.dock-field .motion-menu #motionTrigger { padding: 0 11px; gap: 7px; }
.dock-field .motion-menu #motionTrigger b { font-weight: 600; }
