    /* ========== SESSION MODAL ========== */
    .session-modal {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.7);
      backdrop-filter: blur(8px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 5000;
      padding: 20px;
    }
    .session-modal-content {
      background: white;
      border-radius: 20px;
      max-width: 600px;
      width: 100%;
      max-height: 90vh;
      overflow: hidden;
      box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
      animation: modalSlideIn 0.3s ease;
      display: flex;
      flex-direction: column;
    }
    @keyframes modalSlideIn {
      from { opacity: 0; transform: translateY(-20px) scale(0.95); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }
    .session-modal-header {
      padding: 24px 28px;
      border-bottom: 1px solid var(--edge);
      text-align: center;
      position: relative;
      flex-shrink: 0;
    }
    .session-modal-close {
      position: absolute;
      top: 16px;
      right: 16px;
      width: 32px;
      height: 32px;
      border: none;
      border-radius: 8px;
      background: rgba(100,116,139,0.08);
      color: var(--muted);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      font-family: inherit;
      transition: all 0.15s ease;
    }
    .session-modal-close:hover {
      background: rgba(239,68,68,0.1);
      color: #ef4444;
    }
    .session-modal-header h2 {
      margin: 0 0 8px;
      font-size: 1.5rem;
      color: var(--text);
    }
    .session-modal-header h2 i {
      color: var(--accent);
      margin-right: 10px;
    }
    .session-modal-header p {
      margin: 0;
      color: var(--muted);
      font-size: 0.95rem;
    }
    .session-list {
      padding: 16px;
      flex: 1 1 auto;
      min-height: 0;
      max-height: 400px;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    .session-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px 20px;
      background: var(--bg);
      border-radius: 12px;
      margin-bottom: 12px;
      border: 1px solid var(--edge);
      transition: all 0.2s ease;
    }
    .session-item:hover {
      border-color: var(--accent);
      box-shadow: 0 4px 15px rgba(53, 117, 246, 0.1);
    }
    .session-item:last-child {
      margin-bottom: 0;
    }
    .session-info {
      flex: 1;
    }
    .session-date {
      font-weight: 600;
      color: var(--text);
      margin-bottom: 4px;
    }
    .session-date i {
      color: var(--accent);
      margin-right: 6px;
    }
    .session-progress {
      font-size: 0.85rem;
      color: var(--muted);
      margin-bottom: 4px;
    }
    .session-progress i {
      color: var(--accent-2);
      margin-right: 6px;
    }
    .session-preview {
      font-size: 0.8rem;
      color: var(--muted);
      font-style: italic;
    }
    .session-preview i {
      margin-right: 6px;
    }
    .session-actions {
      display: flex;
      gap: 8px;
      margin-left: 16px;
    }
    .session-modal-footer {
      padding: 20px 28px;
      border-top: 1px solid var(--edge);
      text-align: center;
      flex-shrink: 0;
      background: white;
    }
    .btn-secondary {
      background: linear-gradient(135deg, var(--accent-2), #0ea5a0);
      color: white;
      border: none;
      padding: 12px 24px;
      border-radius: 10px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .btn-secondary:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(18, 194, 163, 0.3);
    }
    .btn-sm {
      padding: 8px 14px;
      font-size: 0.85rem;
    }

    /* Petits Ã©crans : modal de sessions compacte et scrollable */
    @media (max-width: 600px) {
      .session-modal { padding: 12px; }
      .session-modal-header { padding: 16px 18px; }
      .session-modal-header h2 { font-size: 1.2rem; }
      .session-modal-header p { font-size: 0.85rem; }
      .session-list { padding: 12px; }
      .session-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 16px;
      }
      .session-actions {
        margin-left: 0;
        justify-content: flex-end;
      }
      .session-modal-footer { padding: 14px 18px; }
    }
    @media (max-height: 600px) {
      .session-modal { padding: 8px; }
      .session-modal-content { max-height: 96vh; }
      .session-modal-header { padding: 12px 18px; }
      .session-modal-header h2 { font-size: 1.1rem; margin-bottom: 2px; }
      .session-modal-header p { font-size: 0.8rem; }
      .session-modal-footer { padding: 12px 18px; }
    }

    /* ========== CHAT INTERFACE ========== */
    .chat-container {
      max-width: 800px;
      margin: 0 auto;
      padding: 20px 0;
    }
    .chat-header {
      text-align: center;
      margin-bottom: 30px;
    }
    .chat-header h1 {
      margin: 0 0 10px;
      font-size: clamp(24px, 4vw, 32px);
      letter-spacing: -0.5px;
    }
    .chat-header p {
      margin: 0;
      color: var(--muted);
      font-size: 15px;
    }
    .chat-messages {
      display: flex;
      flex-direction: column;
      gap: 16px;
      min-height: 400px;
      max-height: 60vh;
      overflow-y: auto;
      padding: 20px;
      background: var(--panel);
      border: 1px solid var(--edge);
      border-radius: 20px;
      box-shadow: 0 10px 40px rgba(0,0,0,0.06);
      margin-bottom: 20px;
    }
    .chat-message {
      display: flex;
      gap: 12px;
      animation: messageSlide 0.3s ease;
    }
    @keyframes messageSlide {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .chat-message.ai {
      flex-direction: row;
    }
    .chat-message.user {
      flex-direction: row-reverse;
    }
    .chat-avatar {
      width: 42px;
      height: 42px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      flex-shrink: 0;
    }
    .chat-message.ai .chat-avatar {
      width: 63px;
      height: 63px;
      background: white;
      padding: 6px;
      border: 2px solid rgba(53,117,246,0.2);
    }
    .chat-message.ai .chat-avatar img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
    .chat-message.user .chat-avatar {
      background: linear-gradient(135deg, #667eea, #764ba2);
      color: white;
    }
    .chat-bubble {
      max-width: 75%;
      padding: 14px 18px;
      border-radius: 18px;
      line-height: 1.5;
      font-size: 15px;
    }
    .chat-message.ai .chat-bubble {
      background: linear-gradient(135deg, rgba(53,117,246,0.08), rgba(18,194,163,0.08));
      border: 1px solid rgba(53,117,246,0.15);
      border-radius: 18px 18px 18px 4px;
    }
    .chat-message.user .chat-bubble {
      background: linear-gradient(135deg, var(--accent), #2f5fd7);
      color: white;
      border-radius: 18px 18px 4px 18px;
    }
    .chat-bubble strong {
      display: block;
      margin-bottom: 6px;
      font-size: 14px;
      color: var(--accent);
    }
    .chat-message.user .chat-bubble strong {
      color: rgba(255,255,255,0.8);
    }
    .chat-bubble .question-hint {
      display: block;
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid rgba(53,117,246,0.15);
      font-size: 13px;
      color: var(--muted);
      font-style: italic;
    }

    /* Typing indicator */
    .typing-indicator {
      display: flex;
      gap: 4px;
      padding: 8px 0;
    }
    .typing-indicator span {
      width: 8px;
      height: 8px;
      background: var(--accent);
      border-radius: 50%;
      animation: typing 1.4s infinite;
    }
    .typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
    .typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
    @keyframes typing {
      0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
      30% { transform: translateY(-8px); opacity: 1; }
    }

    /* Chat input */
    .chat-input-container {
      display: flex;
      gap: 12px;
      padding: 16px 20px;
      background: var(--panel);
      border: 1px solid var(--edge);
      border-radius: 16px;
      box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    }
    .chat-input {
      flex: 1;
      border: none;
      outline: none;
      font-size: 15px;
      font-family: inherit;
      background: transparent;
      color: var(--text);
      resize: none;
      min-height: 24px;
      max-height: 120px;
    }
    .chat-input::placeholder {
      color: var(--muted);
    }
    .chat-send-btn {
      width: 48px;
      height: 48px;
      border-radius: 12px;
      background: linear-gradient(135deg, var(--accent), #2f5fd7);
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 20px;
      transition: all 0.2s;
      flex-shrink: 0;
    }
    .chat-send-btn:hover:not(:disabled) {
      transform: scale(1.05);
      box-shadow: 0 8px 20px rgba(53,117,246,0.3);
    }
    .chat-send-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    /* Progress indicator */
    .chat-progress {
      display: flex;
      gap: 8px;
      justify-content: center;
      margin-bottom: 20px;
    }
    .progress-dot {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: var(--edge);
      transition: all 0.3s ease;
      cursor: pointer;
      position: relative;
    }
    .progress-dot:hover {
      transform: scale(1.3);
    }
    .progress-dot.active {
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      transform: scale(1.2);
    }
    .progress-dot.done {
      background: var(--accent-2);
      cursor: pointer;
    }
    .progress-dot.done:hover {
      background: var(--accent);
      transform: scale(1.3);
    }
    .progress-dot[data-step="inspiration"].done {
      background: var(--accent-2);
    }
    .progress-dot::after {
      content: attr(data-label);
      position: absolute;
      bottom: -20px;
      left: 50%;
      transform: translateX(-50%);
      font-size: 10px;
      color: var(--muted);
      white-space: nowrap;
      opacity: 0;
      transition: opacity 0.2s;
    }
    .progress-dot:hover::after {
      opacity: 1;
    }
    
    /* Bouton retour dans le chat */
    .chat-back-btn {
      display: none;
      align-items: center;
      gap: 6px;
      padding: 8px 16px;
      background: var(--bg);
      border: 1px solid var(--edge);
      border-radius: 20px;
      color: var(--muted);
      font-size: 0.85rem;
      cursor: pointer;
      transition: all 0.2s ease;
      margin-bottom: 16px;
    }
    .chat-back-btn:hover {
      background: white;
      border-color: var(--accent);
      color: var(--accent);
    }
    .chat-back-btn.visible {
      display: inline-flex;
    }

    /* Variants selection */
    .variants-section {
      display: none;
      padding: 24px;
      background: var(--panel);
      border: 1px solid var(--edge);
      border-radius: 20px;
      box-shadow: 0 10px 40px rgba(0,0,0,0.06);
      margin-top: 20px;
      animation: messageSlide 0.3s ease;
    }
    .variants-section.active {
      display: block;
    }
    .variants-section h3 {
      margin: 0 0 8px;
      font-size: 18px;
    }
    .variants-section p {
      margin: 0 0 16px;
      color: var(--muted);
      font-size: 14px;
    }
    .variant-selector {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 20px;
    }
    .variant-option {
      position: relative;
      cursor: pointer;
      flex: 1;
      min-width: 140px;
    }
    .variant-option input[type="radio"] {
      position: absolute;
      opacity: 0;
      cursor: pointer;
    }
    .variant-content {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 12px 16px;
      background: linear-gradient(135deg, rgba(18,194,163,0.08), rgba(53,117,246,0.08));
      border: 2px solid rgba(18,194,163,0.2);
      border-radius: 999px;
      transition: all 200ms ease;
    }
    .variant-option:hover .variant-content {
      border-color: rgba(53,117,246,0.4);
      transform: translateY(-1px);
    }
    .variant-option input:checked + .variant-content {
      border-color: var(--accent);
      background: linear-gradient(135deg, rgba(18,194,163,0.15), rgba(53,117,246,0.15));
      box-shadow: 0 4px 16px rgba(53,117,246,0.2);
    }
    .token-mini-icon {
      width: 28px;
      height: 28px;
      background: linear-gradient(135deg, var(--accent-2), var(--accent));
      border-radius: 50%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-size: 14px;
      font-weight: 800;
      flex-shrink: 0;
    }
    .variant-text strong {
      font-size: 15px;
      font-weight: 700;
    }
    .variant-text small {
      font-size: 13px;
      color: var(--muted);
    }
    .generate-btn {
      width: 100%;
      padding: 16px;
      font-size: 16px;
    }
    .generate-btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }

    /* Progress bar */
    .progress-container {
      display: none;
      margin-top: 20px;
      padding: 24px;
      background: var(--panel);
      border: 1px solid var(--edge);
      border-radius: 16px;
      box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    }
    .progress-container.active {
      display: block;
      animation: messageSlide 0.3s ease;
    }
    .progress-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
    }
    .progress-title {
      display: flex;
      align-items: center;
      gap: 12px;
      font-weight: 700;
      font-size: 16px;
    }
    .progress-spinner {
      width: 24px;
      height: 24px;
      border: 3px solid rgba(53,117,246,0.2);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }
    @keyframes spin {
      to { transform: rotate(360deg); }
    }
    .progress-percent {
      font-size: 28px;
      font-weight: 800;
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }
    .progress-bar-outer {
      width: 100%;
      height: 12px;
      background: rgba(53,117,246,0.1);
      border-radius: 999px;
      overflow: hidden;
    }
    .progress-bar-inner {
      height: 100%;
      background: linear-gradient(90deg, var(--accent), var(--accent-2));
      border-radius: 999px;
      transition: width 0.5s ease;
      position: relative;
    }
    .progress-bar-inner::after {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
      animation: shimmer 2s infinite;
    }
    @keyframes shimmer {
      0% { transform: translateX(-100%); }
      100% { transform: translateX(100%); }
    }
    .progress-message {
      margin-top: 12px;
      color: var(--muted);
      font-size: 14px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .progress-steps {
      display: flex;
      gap: 8px;
      margin-top: 16px;
      flex-wrap: wrap;
    }
    .progress-step {
      padding: 6px 12px;
      background: rgba(53,117,246,0.08);
      border: 1px solid rgba(53,117,246,0.2);
      border-radius: 999px;
      font-size: 12px;
      color: var(--muted);
      transition: all 0.3s ease;
    }
    .progress-step.active {
      background: linear-gradient(135deg, rgba(53,117,246,0.15), rgba(18,194,163,0.15));
      border-color: var(--accent);
      color: var(--accent);
      font-weight: 600;
    }
    .progress-step.done {
      background: rgba(18,194,163,0.15);
      border-color: var(--accent-2);
      color: var(--accent-2);
    }

    /* ========== TEMPLATE SELECTOR ========== */
    .template-selector {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.72);
      backdrop-filter: blur(10px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 5000;
      padding: 20px;
      animation: fadeIn 0.2s ease;
    }
    .template-selector-inner {
      background: white;
      border-radius: 24px;
      max-width: 820px;
      width: 100%;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 30px 70px rgba(0, 0, 0, 0.3);
      animation: modalSlideIn 0.3s ease;
      display: flex;
      flex-direction: column;
    }
    .template-selector-header {
      padding: 28px 32px 20px;
      border-bottom: 1px solid var(--edge);
      text-align: center;
    }
    .template-selector-header h2 {
      font-size: 1.4rem;
      font-weight: 700;
      color: var(--text);
      margin: 0 0 6px;
    }
    .template-selector-header h2 i {
      color: var(--accent);
      margin-right: 8px;
    }
    .template-selector-header p {
      color: var(--muted);
      margin: 0;
      font-size: 0.95rem;
    }
    .template-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 16px;
      padding: 24px 32px;
    }
    .template-card {
      border: 2px solid var(--edge);
      border-radius: 16px;
      padding: 20px 16px;
      cursor: pointer;
      transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
      background: white;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
    }
    .template-card:hover {
      border-color: var(--accent);
      box-shadow: 0 8px 24px rgba(53, 117, 246, 0.15);
      transform: translateY(-3px);
    }
    .template-card-icon {
      width: 52px;
      height: 52px;
      border-radius: 14px;
      background: linear-gradient(135deg, rgba(53,117,246,0.12), rgba(18,194,163,0.12));
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.4rem;
      color: var(--accent);
    }
    .template-card-name {
      font-weight: 700;
      font-size: 0.95rem;
      color: var(--text);
      line-height: 1.3;
    }
    .template-card-desc {
      font-size: 0.78rem;
      color: var(--muted);
      line-height: 1.4;
    }
    .template-selector-footer {
      padding: 16px 32px 24px;
      text-align: center;
      border-top: 1px solid var(--edge);
    }
    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    @media (max-width: 600px) {
      .template-grid { grid-template-columns: repeat(2, 1fr); padding: 16px; }
      .template-selector-header { padding: 20px 18px 14px; }
      .template-selector-footer { padding: 12px 18px 16px; }
    }

    /* ========== IMAGE SELECTION PANEL (question 11) ========== */
    .image-select-panel {
      margin-top: 14px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .image-source-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }
    .image-source-btn {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      padding: 16px 12px;
      border: 2px dashed var(--edge);
      border-radius: 14px;
      background: var(--panel);
      cursor: pointer;
      transition: all 0.2s ease;
      font-family: inherit;
      color: var(--text);
    }
    .image-source-btn:hover {
      border-color: var(--accent);
      background: rgba(53, 117, 246, 0.04);
    }
    .image-source-btn i {
      font-size: 1.5rem;
      color: var(--accent);
    }
    .image-source-btn span {
      font-weight: 600;
      font-size: 0.9rem;
    }
    .image-source-btn small {
      font-size: 0.75rem;
      color: var(--muted);
    }
    .image-panel-thumbs {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .image-panel-thumb {
      position: relative;
      width: 64px;
      height: 64px;
      border-radius: 10px;
      overflow: visible;
    }
    .image-panel-thumb img {
      width: 64px;
      height: 64px;
      border-radius: 10px;
      object-fit: cover;
    }
    .image-panel-badge {
      position: absolute;
      bottom: -5px;
      left: -5px;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: var(--accent);
      color: white;
      font-size: 9px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 2px solid white;
    }
    .image-panel-badge-custom {
      background: var(--accent-2);
    }
    .image-panel-remove {
      position: absolute;
      top: -7px;
      right: -7px;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: #ef4444;
      border: 2px solid white;
      color: white;
      font-size: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      padding: 0;
      line-height: 1;
    }
    .image-panel-remove:hover {
      background: #dc2626;
    }
    .image-select-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding-top: 4px;
    }
    .image-panel-count {
      font-size: 0.85rem;
      color: var(--muted);
    }
    @media (max-width: 480px) {
      .image-source-actions { grid-template-columns: 1fr; }
    }

