
/* =========================================
   VARIABLES
   ========================================= */
:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-gradient-blue: linear-gradient(135deg, #4F46E5 0%, #3B82F6 100%);
  --bg-light: #f8fafc;
  --text-black: #0f172a;
  --border-color: #e5e5e5;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
  --sidebar-bg: #171717;
  --sidebar-hover: #2a2a2a;
  --sidebar-text: #ececec;
  --chat-bg: #ffffff;
  --user-bubble-bg: #f4f4f4;
  --input-bg: #ffffff;
  --input-border: #e5e5e5;
  --text-primary: #0d0d0d;
  --text-secondary: #6b6b6b;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
}

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

html, body {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
}

/* =========================================
   CONTENEDOR PRINCIPAL DEL CHAT
   ========================================= */
.ai-text-generator {
  width: 100%;
  height: 700px;
  display: flex;
  overflow: hidden;
  background: #fff;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  margin: 0 0 60px 0;
  border: 1px solid var(--border-color);
  border-top: none;
  position: relative;
}

/* =========================================
   SIDEBAR IZQUIERDO
   ========================================= */
.chat-sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
}

.sidebar-header {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2a2a2a;
}

.new-chat-btn {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid #404040;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all .2s;
  font-family: 'Poppins', sans-serif;
}

.new-chat-btn:hover { background: var(--sidebar-hover); }

.sidebar-toggle {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
}

.sidebar-toggle:hover { background: var(--sidebar-hover); }

.sidebar-search { padding: 12px; border-bottom: 1px solid #2a2a2a; }

.search-input {
  width: 100%;
  padding: 10px 14px;
  background: #2a2a2a;
  border: 1px solid #404040;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.search-input:focus { border-color: var(--primary-color); background: #333; }
.search-input::placeholder { color: #8e8e8e; }

.sidebar-conversations {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.sidebar-conversations::-webkit-scrollbar { width: 6px; }
.sidebar-conversations::-webkit-scrollbar-track { background: transparent; }
.sidebar-conversations::-webkit-scrollbar-thumb { background: #404040; border-radius: 4px; }

.conv-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #8e8e8e;
  padding: 12px 8px 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.conv-section-count {
  background: #2a2a2a;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
}

.conv-item {
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--sidebar-text);
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.conv-item:hover { background: var(--sidebar-hover); }
.conv-item.active { background: #2a2a2a; border-left: 3px solid var(--primary-color); }

.conv-item-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
}

.conv-item-meta { display: flex; align-items: center; gap: 6px; }
.conv-item-date { font-size: 11px; color: #8e8e8e; }

.conv-item-delete {
  opacity: 0;
  background: transparent;
  border: none;
  color: #8e8e8e;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
}

.conv-item:hover .conv-item-delete { opacity: 1; }
.conv-item-delete:hover { color: var(--error); background: rgba(239,68,68,0.1); }

.sidebar-footer { padding: 12px; border-top: 1px solid #2a2a2a; }

.sidebar-footer-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all .2s;
  font-family: 'Poppins', sans-serif;
  text-align: left;
  margin-bottom: 4px;
}

.sidebar-footer-btn:hover { background: var(--sidebar-hover); }

/* =========================================
   ÁREA PRINCIPAL DE CHAT
   ========================================= */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--chat-bg);
  min-width: 0;
  height: 100%;
}

.chat-header {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  flex-shrink: 0;
  height: 60px;
}

.chat-header-left { display: flex; align-items: center; gap: 12px; flex: 1; }

.chat-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================================
   MENSAJES
   ========================================= */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
}

.chat-messages::-webkit-scrollbar { width: 8px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: #e5e5e5; border-radius: 4px; }

.message {
  padding: 20px 0;
  display: flex;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  padding-left: 24px;
  padding-right: 24px;
}

.message.user { justify-content: flex-end; }

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.message.ai .message-avatar { background: var(--primary-gradient-blue); color: #fff; }
.message.user .message-avatar { background: #10a37f; color: #fff; }

.message-content {
  flex: 1;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  font-family: 'Open Sans', sans-serif;
}

.message.user .message-content {
  background: var(--user-bubble-bg);
  padding: 14px 18px;
  border-radius: 20px;
  max-width: 80%;
  margin-left: auto;
}

.message.ai .message-content { padding: 4px 0; }

.message-content .text-output { line-height: 1.8; color: var(--text-primary); font-size: 15px; }
.message-content .text-output h1 { font-size: 26px; font-weight: 800; margin: 24px 0 14px; }
.message-content .text-output h2 { font-size: 22px; font-weight: 700; margin: 20px 0 12px; }
.message-content .text-output h3 { font-size: 18px; font-weight: 600; margin: 16px 0 10px; }
.message-content .text-output p { margin-bottom: 16px; line-height: 1.8; }
.message-content .text-output p:last-child { margin-bottom: 0; }
.message-content .text-output ul, .message-content .text-output ol { margin: 14px 0; padding-left: 28px; }
.message-content .text-output li { margin-bottom: 8px; }
.message-content .text-output strong { font-weight: 700; }
.message-content .text-output em { font-style: italic; color: var(--text-secondary); }
.message-content .text-output a { color: var(--primary-color); text-decoration: underline; }

.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.message-action-btn {
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.message-action-btn:hover {
  background: var(--bg-light);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

/* =========================================
   ESTADO VACÍO - PROMPTS EN 3 LÍNEAS
   ========================================= */
.empty-chat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 30px 20px;
  text-align: center;
}

.empty-chat-icon {
  width: 72px;
  height: 72px;
  background: var(--primary-gradient-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  margin-bottom: 24px;
}

.empty-chat h2 { font-size: 24px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; }
.empty-chat p { color: var(--text-secondary); font-size: 15px; max-width: 450px; line-height: 1.6; margin-bottom: 24px; }

/* PROMPTS EN 3 LÍNEAS - MÁS PEQUEÑOS */
.empty-chat-examples {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 700px;
  margin: 0 auto;
  padding: 0;
}

.example-chip {
  padding: 8px 14px;
  background: #fff;
  border: 2px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  transition: all .25s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  flex-shrink: 0;
}

.example-chip:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(99,102,241,0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}

.example-chip:active {
  transform: translateY(0);
}

/* CHIP DE BÚSQUEDA */
.search-chip {
  background: var(--primary-gradient-blue);
  color: #fff;
  border: 2px solid var(--primary-color);
}

.search-chip:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

/* =========================================
   INDICADOR DE ESCRITURA
   ========================================= */
.typing-indicator { display: flex; gap: 4px; padding: 8px 0; }

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(.6); opacity: .4; }
  40% { transform: scale(1); opacity: 1; }
}

/* =========================================
   ÁREA DE INPUT
   ========================================= */
.chat-input-area {
  padding: 20px 24px 24px;
  background: #fff;
  flex-shrink: 0;
}

.chat-input-container { max-width: 800px; margin: 0 auto; position: relative; }

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 26px;
  padding: 10px 10px 10px 20px;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.chat-input-wrapper:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 2px 16px rgba(99,102,241,0.15);
}

.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  font-family: 'Open Sans', sans-serif;
  color: var(--text-primary);
  padding: 8px 0;
  resize: none;
  max-height: 200px;
  line-height: 1.5;
  min-height: 24px;
}

.chat-input::placeholder { color: #9ca3af; }

.chat-input-actions { display: flex; gap: 6px; align-items: center; padding-bottom: 4px; }

.chat-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  color: var(--text-secondary);
}

.chat-action-btn:hover { background: var(--bg-light); color: var(--primary-color); }

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--text-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s ease;
  flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) { transform: scale(1.05); }
.chat-send-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.chat-send-btn.is-generating {
  background: var(--error) !important;
  opacity: 1 !important;
  cursor: pointer !important;
  animation: pulseStop 1.5s infinite;
}

@keyframes pulseStop {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

.chat-input-hint { text-align: center; font-size: 11px; color: var(--text-secondary); margin-top: 10px; }

/* =========================================
   SUGERENCIAS RÁPIDAS
   ========================================= */
.quick-suggestions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 800px;
  margin: 0 auto 16px;
  padding: 0 24px;
}

.quick-suggestion-btn {
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
}

.quick-suggestion-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(99,102,241,0.05);
  transform: translateY(-2px);
}

/* =========================================
   MODAL DE CONFIGURACIÓN
   ========================================= */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal-overlay.show { display: flex; }

.settings-modal {
  background: #fff;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 { font-size: 20px; font-weight: 700; color: var(--text-primary); }

.close-modal {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal:hover { background: var(--bg-light); color: var(--text-primary); }

.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 24px; }

.setting-section { border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; }

.setting-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-item { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.setting-item:last-child { margin-bottom: 0; }
.setting-item label { font-weight: 600; color: var(--text-primary); font-size: 14px; }
.setting-item small { color: var(--text-secondary); font-size: 12px; }

.setting-item input[type="text"], .setting-item select {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  outline: none;
}

.setting-item input[type="text"]:focus, .setting-item select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.setting-item input[type="range"] { width: 100%; margin: 8px 0; }
.range-value { text-align: center; font-weight: 600; color: var(--primary-color); font-size: 14px; }

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-save {
  padding: 12px 24px;
  background: var(--primary-gradient-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
}

.btn-save:hover { opacity: 0.9; }

.btn-cancel {
  padding: 12px 24px;
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
}

.btn-cancel:hover { background: var(--bg-light); }

.tone-selector-modal { position: relative; display: inline-block; width: 100%; }

.tone-dropdown-list {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 100%;
  max-height: 350px;
  overflow-y: auto;
  z-index: 99999;
  box-shadow: var(--shadow-xl);
}

.tone-dropdown-list.open { display: block !important; }

.tone-dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tone-dropdown-item:hover { background: var(--bg-light); }
.tone-dropdown-item.active { background: rgba(99,102,241,0.1); color: var(--primary-color); font-weight: 600; }
.tone-dropdown-item i { width: 20px; text-align: center; font-size: 14px; }

/* =========================================
   MODAL BUSCADOR DE PROMPTS
   ========================================= */
.prompt-search-modal {
  background: #fff;
  width: 95%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
}

.prompt-search-box {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.prompt-search-box input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: all .2s;
}

.prompt-search-box input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

.prompt-search-results {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.prompt-search-results::-webkit-scrollbar { width: 6px; }
.prompt-search-results::-webkit-scrollbar-track { background: transparent; }
.prompt-search-results::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.search-placeholder {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 15px;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 15px;
}

.prompt-category {
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.category-title {
  padding: 14px 18px;
  background: var(--bg-light);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.category-prompts {
  padding: 0;
}

.prompt-item {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all .2s;
}

.prompt-item:hover {
  background: rgba(99,102,241,0.03);
}

.prompt-item:last-child {
  border-bottom: none;
}

.prompt-item p {
  flex: 1;
  margin: 0;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
}

.use-prompt-btn {
  padding: 8px 16px;
  background: var(--primary-gradient-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
  flex-shrink: 0;
}

.use-prompt-btn:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 99999;
  animation: slideIn .3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--error); }
.toast.warning { border-left: 4px solid var(--warning); }

.toast-icon { font-size: 20px; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--error); }
.toast.warning .toast-icon { color: var(--warning); }

.toast-message { font-size: 14px; color: var(--text-primary); font-weight: 500; }

/* =========================================
   RESPONSIVE (TABLET)
   ========================================= */
@media (max-width: 1024px) {
  .chat-sidebar { width: 260px; }
  .message { max-width: 100%; padding-left: 16px; padding-right: 16px; }
}

/* =========================================
   RESPONSIVE (MÓVIL)
   ========================================= */
@media (max-width: 768px) {
  .ai-text-generator {
    height: 600px !important;
    margin: 0 0 40px 0 !important;
    position: relative !important;
  }

  .chat-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
  }

  .chat-sidebar.mobile-open { transform: translateX(0); }

  .chat-header { padding: 10px 12px; height: 50px; }
  .chat-header-title { font-size: 14px; }

  .chat-input-area {
    padding: 16px 12px 12px 12px;
  }

  .message {
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .message-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .message-content { font-size: 14px; }

  /* ✅ BOTONES DE ACCIÓN EN UNA SOLA LÍNEA CON SCROLL */
  .message-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .message-actions::-webkit-scrollbar {
    display: none;
  }

  .message-action-btn {
    padding: 6px 10px;
    font-size: 10px;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 6px;
  }

  /* SUGERENCIAS RÁPIDAS - OCULTAS (ya no se usan) */
  .quick-suggestions {
    display: none !important;
  }

  /* PROMPTS EN MÓVIL - MÁS PEQUEÑOS */
  .empty-chat-examples {
    gap: 6px;
    max-width: 100%;
    padding: 0 8px;
  }

  .example-chip {
    padding: 6px 10px;
    font-size: 10px;
    border-radius: 16px;
  }

  .empty-chat { padding: 20px 15px; }
  .empty-chat h1 { font-size: 22px; }
  .empty-chat h2 { font-size: 18px; }
  .empty-chat p { font-size: 12px; }

  .chat-input-wrapper {
    padding: 8px 8px 8px 14px;
    border-radius: 20px;
  }

  .chat-input { font-size: 14px; }

  .chat-input-hint { font-size: 10px; }
  
  /* MODAL PROMPTS EN MÓVIL */
  .prompt-search-modal {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  
  .prompt-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .use-prompt-btn {
    width: 100%;
    justify-content: center;
  }
}


/* Ajustes exclusivos de la versión estática para preservar el aspecto original */
html,body {font-family:Arial,'Open Sans',system-ui,sans-serif;background:#fff;color:#111;}
button,input,textarea,select {font:inherit;}
button {touch-action:manipulation;}
.ai-text-generator {height:calc(100dvh - 2px); min-height:540px; max-height:1000px; margin:0; border-radius:0 0 16px 16px; border-top:0;}
.quick-suggestions {display:flex !important;}
.quick-suggestions[hidden] {display:none !important;}
.chat-sidebar {width:310px;}
.sidebar-toggle:focus-visible,.chat-action-btn:focus-visible,.chat-send-btn:focus-visible,.new-chat-btn:focus-visible,.close-modal:focus-visible {outline:2px solid #6366f1;outline-offset:2px;}
.chat-input {min-width:0;}
.message.user .message-content {flex:0 1 auto;overflow-wrap:anywhere;white-space:pre-wrap;}
.message.ai .message-content {min-width:0;}
.message-content .text-output {overflow-wrap:anywhere;}
.message-content .text-output pre {overflow:auto;max-width:100%;background:#f5f5f5;padding:12px;border-radius:8px;}
.message-actions {gap:6px;}
.conv-item-delete {opacity:.7;}
.setting-item input[type=url], .setting-item input[type=password] {padding:12px 16px;border:1px solid var(--border-color);border-radius:8px;font-size:14px;width:100%;outline:none;}
.setting-item input:focus {border-color:var(--primary-color);}
.connection-note {padding:12px 14px;background:#f6f7fb;border:1px solid #e5e7ee;border-radius:10px;color:#475569;font-size:12px;line-height:1.5;}
.visually-hidden {position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
.secondary-section{padding:72px 22px;max-width:980px;margin:auto;color:#172033;line-height:1.75;font:16px/1.75 system-ui,sans-serif;}
.secondary-section h2{font-size:28px;margin:0 0 14px;line-height:1.2;}
.secondary-section h3{font-size:20px;margin:28px 0 8px;line-height:1.35;}
.secondary-section p{margin:0 0 18px;}
.secondary-section ul{padding-left:24px;margin-bottom:22px;}
.secondary-section a{color:#4f46e5;text-decoration:underline;}
.copyson-footer{text-align:center;padding:24px 16px;background:#fafafa;font:13px system-ui,sans-serif;color:#667085;}
.copyson-footer a{color:#475569;}
.settings-modal{overscroll-behavior:contain;}
.prompt-item{cursor:pointer;}
.prompt-item:focus-visible{outline:3px solid #6366f1;}
.sidebar-mobile-toggle{display:none;}
@media (max-width:767px){.ai-text-generator{height:100dvh; min-height:420px;margin:0!important;}
 .chat-sidebar{width:min(310px,85vw)!important;}
 .sidebar-mobile-toggle{display:inline-flex;align-items:center;justify-content:center;border:0;background:transparent;font-size:19px;color:#111;margin-right:10px;cursor:pointer;}
 .chat-header{padding-left:14px;}
 .chat-header-left{gap:4px;}
 .chat-input-area{padding:12px 12px 18px;}
 .quick-suggestions{padding:0 12px;margin-bottom:10px;}
 .secondary-section{padding:45px 20px;}
 .secondary-section h2{font-size:24px;}}
@media (min-width:768px){
body.sidebar-collapsed .chat-sidebar{width:66px;}
body.sidebar-collapsed .sidebar-search,body.sidebar-collapsed .sidebar-conversations,body.sidebar-collapsed .sidebar-footer{display:none;}
body.sidebar-collapsed .new-chat-btn{font-size:0;max-width:0;overflow:hidden;padding:0;border:0;}
body.sidebar-collapsed .sidebar-header{justify-content:center;}
body.sidebar-collapsed .sidebar-toggle{margin:0;}
}

/* Prioridad móvil frente a declaraciones !important de la plantilla heredada. */
@media (max-width:767px) {
 .ai-text-generator {height:100dvh !important;min-height:420px !important;margin:0 !important;}
 .sidebar-mobile-toggle {display:inline-flex !important;}
 .chat-sidebar {height:100dvh !important;}
}

@media (max-width:767px){
 .sidebar-mobile-toggle {display:inline-flex !important;flex:0 0 34px;width:34px;min-width:34px;height:34px;font-size:22px;line-height:1;align-items:center;justify-content:center;}
}


/* Copyson Chat · retoques visuales conservadores: mantiene la interfaz y sus eventos */
:root{--primary-color:#5d55e6;--primary-dark:#4d43d0;--sidebar-bg:#151821;--sidebar-hover:#292b39;--border-color:#e5e7f0;--user-bubble-bg:#f3f4fa}
.ai-text-generator{box-shadow:0 16px 44px rgba(22,24,48,.08);border-color:#e8e9f1}
.chat-sidebar{background:#151821}
.new-chat-btn{border:1px solid #484959;border-radius:13px;font-weight:720}
.new-chat-btn:hover{background:#272939;border-color:#7169a2}
.search-input{border-radius:11px;border-color:#3b3d4f;background:#242633}
.search-input:focus{border-color:#8278ff;box-shadow:0 0 0 3px rgba(131,120,246,.11)}
.conv-item{border-radius:10px}
.conv-item.active{background:#2c2d40;border-left-color:#8278ff}
.sidebar-footer-btn{border-radius:10px}
.chat-header{border-bottom:1px solid #eaebf2;background:#fff}
.chat-input-wrapper{border-radius:22px;box-shadow:0 8px 30px rgba(70,68,130,.075);transition:border-color .18s,box-shadow .18s}
.chat-input-wrapper:focus-within{box-shadow:0 9px 32px rgba(75,70,190,.13)}
.chat-send-btn{background:linear-gradient(145deg,#1e2438,#141829);box-shadow:0 5px 12px rgba(26,28,65,.12)}
.empty-chat-icon{background:linear-gradient(135deg,#615af3,#4d3ad0)!important;box-shadow:0 12px 34px rgba(89,77,208,.19)}
.example-chip{border-radius:999px;transition:transform .16s,box-shadow .16s,background .16s}
.example-chip:hover{transform:translateY(-2px);box-shadow:0 6px 14px rgba(53,46,133,.08)}
.quick-suggestion-btn{border-radius:999px}
@media(max-width:650px){.ai-text-generator{border-radius:0 0 12px 12px;box-shadow:none}.chat-input-wrapper{border-radius:19px}.new-chat-btn{border-radius:11px}}
