/* ========================================
   VARIABLES DE DISEÑO MOBILE-FIRST
   ======================================== */
:root {
  --bg: #ffffff;
  --fg: #0a1628;
  --muted: #64748b;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --alsea-1: #003D66;
  --alsea-2: #006CA8;
  --alsea-3: #17A1E6;
  --alsea-accent: #0EA5E9;
  --brand: var(--alsea-2);
  --gradient-primary: linear-gradient(135deg, #003D66 0%, #006CA8 50%, #17A1E6 100%);
  --shadow-sm: 0 2px 8px rgba(0,61,102,.08);
  --shadow-md: 0 4px 12px rgba(0,61,102,.1);
  --shadow-lg: 0 8px 24px rgba(0,61,102,.15);
  --shadow-xl: 0 12px 36px rgba(0,61,102,.2);
  --shadow-glow: 0 0 24px rgba(23,161,230,.2);
}

/* ========================================
   RESET Y ESTRUCTURA BASE MOBILE
   ======================================== */
* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(to bottom, #f8fafc 0%, #f1f5f9 100%);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  touch-action: pan-y;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 300px;
  background: radial-gradient(ellipse at top, rgba(23,161,230,0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 15% 85%, rgba(23,161,230,0.05) 0%, transparent 30%),
    radial-gradient(circle at 85% 15%, rgba(0,108,168,0.04) 0%, transparent 30%);
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   HEADER MOBILE OPTIMIZADO
   ======================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  background: 
    linear-gradient(135deg, rgba(0,61,102,0.98) 0%, rgba(0,108,168,0.96) 50%, rgba(23,161,230,0.94) 100%);
  backdrop-filter: blur(20px) saturate(150%);
  color: #fff;
  box-shadow: 
    0 4px 16px rgba(0,61,102,.2),
    inset 0 1px 0 rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-wrap {
  display: grid;
  place-items: center;
  height: 44px;
  width: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  box-shadow: 
    0 4px 12px rgba(0,0,0,.2),
    inset 0 1px 0 rgba(255,255,255,0.9);
  flex-shrink: 0;
}

.logo {
  height: 24px;
  width: auto;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.15));
}

.title {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 8px rgba(0,0,0,.2);
  color: #fff;
}

/* ========================================
   LAYOUT PRINCIPAL MOBILE - SIN SCROLL
   ======================================== */
.container {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  height: calc(100vh - 64px); /* Altura total menos el header */
  overflow: hidden;
}

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  overflow: hidden;
  position: relative;
  height: 100%;
}

.chat-window {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px 16px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  height: 100%;
}
.chat-window::after {
  content: "";
  display: block;
  height: 85px; /* altura del composer + margen */
}

.chat-window::-webkit-scrollbar {
  width: 0;
  display: none;
}

/* ========================================
   BIENVENIDA MOBILE OPTIMIZADA - CENTRADO VERTICAL
   ======================================== */
.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 100px;
  text-align: center;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.welcome-container::-webkit-scrollbar {
  width: 0;
  display: none;
}

.welcome-title {
  font-weight: 900;
  font-size: 1.65rem;
  line-height: 1.2;
  margin: 0 0 32px;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #0a1628 0%, var(--alsea-1) 30%, var(--alsea-2) 70%, var(--alsea-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding: 0 8px;
  flex-shrink: 0;
}

.welcome-title strong {
  font-weight: 900;
  background: linear-gradient(135deg, var(--alsea-1) 0%, var(--alsea-2) 50%, var(--alsea-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
}

.welcome-title strong::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--alsea-3) 30%, var(--alsea-2) 70%, transparent);
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(23,161,230,.3);
}

/* ========================================
   TARJETAS MOBILE FULL WIDTH - COMPACTAS
   ======================================== */
.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  padding: 0 4px;
  margin-top: 0;
  flex-shrink: 0;
}

.action-card {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1.5px solid rgba(226, 232, 240, 0.7);
  background: 
    radial-gradient(circle at 95% 10%, rgba(23,161,230,0.08) 0%, transparent 50%),
    radial-gradient(circle at 5% 90%, rgba(0,108,168,0.05) 0%, transparent 50%),
    linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,252,255,1) 100%);
  box-shadow: 
    0 4px 20px rgba(0,61,102,.1),
    inset 0 1px 0 rgba(255,255,255,0.95);
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: left;
  min-height: 76px;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(23,161,230,0.08), transparent);
  transition: left 0.5s ease;
}

.action-card:active {
  transform: scale(0.98);
  box-shadow: 
    0 2px 12px rgba(0,61,102,.08),
    inset 0 1px 0 rgba(255,255,255,1);
}

.action-card:active::before {
  left: 100%;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  width: 48px;
  flex-shrink: 0;
}

.icon-3d {
  background: transparent;
}

.icon-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0,108,168,.15));
}

.action-card:active .icon-img {
  transform: scale(0.95);
}

.main-text {
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: #0f172a;
  margin-bottom: 3px;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.sub-text {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
}

/* ========================================
   BURBUJAS DE CHAT MOBILE - DISEÑO PRO
   ======================================== */
.bubble-container {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 10px 0;
  width: 100%;
}

.left-container {
  justify-content: flex-start;
  padding-right: 40px;
}

.right-container {
  justify-content: flex-end;
  padding-left: 40px;
}

.bot-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: 
    radial-gradient(circle at 30% 30%, rgba(255,255,255,1) 0%, rgba(240,249,255,1) 100%);
  border: 2px solid rgba(23,161,230,.25);
  display: grid;
  place-items: center;
  box-shadow: 
    0 3px 12px rgba(0,108,168,.15),
    inset 0 1px 0 rgba(255,255,255,1);
  align-self: flex-end;
  position: relative;
}

.bot-avatar::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--alsea-3) 0%, var(--alsea-2) 100%);
  opacity: 0.15;
  z-index: -1;
  filter: blur(6px);
}

.bot-avatar img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,108,168,.2));
}

.bubble {
  position: relative;
  max-width: fit-content;
  padding: 13px 16px;
  line-height: 1.5;
  font-size: 0.94rem;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  letter-spacing: -0.01em;
}

/* Burbuja del BOT (izquierda) - Mejorada */
.left {
  background: linear-gradient(135deg, #0077BE 0%, #17A1E6 100%);
  color: #ffffff;
  border: none;
  border-radius: 20px 20px 20px 6px;
  box-shadow: 
    0 4px 20px rgba(0,119,190,.25),
    0 2px 8px rgba(0,108,168,.15),
    inset 0 1px 0 rgba(255,255,255,.2);
  max-width: 100%;
}

/* Efecto de brillo sutil en la burbuja del bot */
.left::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
  border-radius: 20px 20px 0 0;
  pointer-events: none;
}

/* Burbuja del USUARIO (derecha) - Mejorada */
.right {
  background: 
    radial-gradient(circle at 95% 10%, rgba(148,163,184,0.08) 0%, transparent 60%),
    linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: #0f172a;
  border: 1.5px solid rgba(226,232,240,0.8);
  border-radius: 20px 20px 6px 20px;
  box-shadow: 
    0 3px 12px rgba(15,23,42,.06),
    0 1px 4px rgba(15,23,42,.04),
    inset 0 1px 0 rgba(255,255,255,1);
  align-self: flex-end;
  text-align: left;
  max-width: 100%;
}

/* Contenido de texto en burbujas */
.left strong, .left b {
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.015em;
}

.left em, .left i {
  font-style: italic;
  opacity: 0.95;
}

.right strong, .right b {
  font-weight: 700;
  color: #0a1628;
}

/* Listas en burbujas */
.left ul, .left ol {
  margin: 10px 0 10px 18px;
  padding: 0;
}

.left li {
  margin: 5px 0;
  padding-left: 4px;
  line-height: 1.55;
}

.left ul li::marker {
  color: rgba(255,255,255,0.8);
}

/* Párrafos en burbujas */
.left p {
  margin: 10px 0;
  line-height: 1.55;
}

.left p:first-child {
  margin-top: 0;
}

.left p:last-child {
  margin-bottom: 0;
}

.right p {
  margin: 8px 0;
  line-height: 1.5;
}

.right p:first-child {
  margin-top: 0;
}

.right p:last-child {
  margin-bottom: 0;
}

/* Enlaces en burbujas */
.left a {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.5);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s ease;
}

.left a:hover {
  text-decoration-color: rgba(255,255,255,1);
}

.right a {
  color: var(--alsea-2);
  text-decoration: underline;
  text-decoration-color: rgba(0,108,168,0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s ease;
}

.right a:hover {
  text-decoration-color: rgba(0,108,168,1);
}

/* ========================================
   MODALES (GUÍA Y EJEMPLOS)
   ======================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,61,102,0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  background: linear-gradient(to bottom, #ffffff 0%, #fafbfc 100%);
  border-radius: 24px 24px 0 0;
  box-shadow: 
    0 -8px 40px rgba(0,61,102,.3),
    inset 0 1px 0 rgba(255,255,255,1);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-backdrop[aria-hidden="false"] .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(226,232,240,0.8);
  background: linear-gradient(135deg, rgba(248,252,255,1) 0%, rgba(241,249,255,1) 100%);
  flex-shrink: 0;
}

.modal-id {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-logo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  box-shadow: 
    0 2px 8px rgba(0,108,168,.15),
    inset 0 1px 0 rgba(255,255,255,1);
  flex-shrink: 0;
}

.modal-logo img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: rgba(148,163,184,0.1);
  color: #475569;
  font-size: 1.3rem;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex-shrink: 0;
}

.modal-close:active {
  background: rgba(148,163,184,0.2);
  transform: scale(0.95);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
}

.modal-body::-webkit-scrollbar {
  width: 4px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--alsea-3) 0%, var(--alsea-2) 100%);
  border-radius: 2px;
}

.guide-section {
  margin-bottom: 24px;
}

.guide-section:last-child {
  margin-bottom: 0;
}

.guide-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 10px 0;
  letter-spacing: -0.01em;
}

.guide-text {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 10px 0;
}

.guide-list {
  margin: 0;
  padding-left: 20px;
  list-style: none;
}

.guide-list li {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 6px;
  padding-left: 8px;
  position: relative;
}

.guide-list li::before {
  content: "•";
  position: absolute;
  left: -10px;
  color: var(--alsea-3);
  font-weight: bold;
}

.guide-list li strong {
  color: #0f172a;
  font-weight: 700;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(226,232,240,0.8);
  background: linear-gradient(to bottom, #fafbfc 0%, #ffffff 100%);
  flex-shrink: 0;
}

.btn-primary {
  width: 100%;
  padding: 13px 24px;
  border: none;
  border-radius: 14px;
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 
    0 4px 16px rgba(23,161,230,.3),
    inset 0 1px 0 rgba(255,255,255,0.2);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 
    0 2px 10px rgba(23,161,230,.25),
    inset 0 1px 0 rgba(255,255,255,0.3);
}

.small-muted {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
  text-align: center;
  display: block;
}

.example-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.example-chip {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(226,232,240,0.8);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(248,252,255,0.98) 100%);
  color: #0f172a;
  font-size: 0.87rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 1px 4px rgba(0,61,102,.04);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  line-height: 1.4;
  letter-spacing: -0.005em;
}

.example-chip:active {
  transform: scale(0.98);
  background: linear-gradient(135deg, rgba(240,249,255,1) 0%, rgba(224,242,254,1) 100%);
  border-color: var(--alsea-3);
  box-shadow: 0 2px 8px rgba(23,161,230,.12);
}

/* ========================================
   COMPOSER MOBILE - FIJO ABAJO
   ======================================== */
.composer-wrap {
  position: relative;
  padding: 12px 16px;
  background: 
    linear-gradient(to bottom, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.95) 100%);
  backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid rgba(226,232,240,0.6);
  z-index: 10;
  flex-shrink: 0;
}

.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

#user-input {
  flex: 1;
  height: 48px;
  padding: 12px 18px;
  border: 1.5px solid rgba(226,232,240,0.8);
  border-radius: 14px;
  font-size: 1rem;
  color: #0f172a;
  background: 
    radial-gradient(circle at 95% 10%, rgba(23,161,230,0.03) 0%, transparent 50%),
    linear-gradient(135deg, #ffffff 0%, #f8fcff 100%);
  outline: none;
  transition: all 0.25s ease;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  box-shadow: 
    0 2px 8px rgba(0,61,102,.04),
    inset 0 1px 0 rgba(255,255,255,1);
  touch-action: manipulation;
}

#user-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

#user-input:focus {
  border-color: var(--alsea-3);
  box-shadow: 
    0 0 0 3px rgba(23,161,230,0.1),
    0 4px 12px rgba(23,161,230,.15),
    inset 0 1px 0 rgba(255,255,255,1);
}

#user-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#send-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 14px;
  background: var(--gradient-primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  box-shadow: 
    0 4px 16px rgba(23,161,230,.3),
    inset 0 1px 0 rgba(255,255,255,0.2);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex-shrink: 0;
}

#send-btn:active {
  transform: scale(0.95);
  box-shadow: 
    0 2px 10px rgba(23,161,230,.25),
    inset 0 1px 0 rgba(255,255,255,0.3);
}

#send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.send-icon {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
}

.spinner {
  display: none;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

#send-btn[data-loading="true"] .send-icon {
  display: none;
}

#send-btn[data-loading="true"] .spinner {
  display: inline-block;
}

/* ========================================
   SCROLL TO BOTTOM MOBILE - AJUSTADO
   ======================================== */
#scrollToBottom {
  position: fixed;
  right: 16px;
  bottom: 80px;
  height: 40px;
  width: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  box-shadow: 
    0 4px 16px rgba(23,161,230,.3),
    inset 0 1px 0 rgba(255,255,255,0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  font-size: 1.3rem;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#scrollToBottom[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

#scrollToBottom:active {
  transform: scale(0.95);
}

/* ========================================
   CONVERSACIONES RECIENTES - DISEÑO PRO MEJORADO
   ======================================== */
.recent-conversations {
  width: 100%;
  margin-top: auto;
  padding: 0 4px;
  flex-shrink: 0;
  max-height: 240px;
  display: flex;
  flex-direction: column;
}

.recent-header {
  font-family: "Inter", sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--alsea-2) 0%, var(--alsea-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  margin-top: 24px;
}

.recent-header::before {
  content: "●";
  font-size: 0.5rem;
  color: var(--alsea-3);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.recent-list::-webkit-scrollbar {
  width: 3px;
}

.recent-list::-webkit-scrollbar-track {
  background: rgba(226,232,240,0.3);
  border-radius: 2px;
}

.recent-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--alsea-3) 0%, var(--alsea-2) 100%);
  border-radius: 2px;
}

.recent-list::-webkit-scrollbar-thumb:hover {
  background: var(--alsea-2);
}

/* TARJETAS MEJORADAS - DISEÑO PRO */
.recent-card {
  position: relative;
  background: 
    radial-gradient(circle at 98% 8%, rgba(23,161,230,0.06) 0%, transparent 60%),
    radial-gradient(circle at 2% 92%, rgba(0,108,168,0.04) 0%, transparent 60%),
    linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,252,255,0.98) 100%);
  border: 1.5px solid rgba(226,232,240,0.6);
  border-radius: 16px;
  padding: 14px 16px 14px 18px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  box-shadow: 
    0 2px 8px rgba(0,61,102,.05),
    0 1px 2px rgba(0,61,102,.03),
    inset 0 1px 0 rgba(255,255,255,0.9);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 68px;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
}

/* Borde lateral decorativo */
.recent-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--alsea-3) 0%, var(--alsea-2) 50%, var(--alsea-1) 100%);
  opacity: 0.7;
  transition: all 0.3s ease;
  border-radius: 16px 0 0 16px;
}

/* Icono de flecha mejorado */
.recent-card::after {
  content: '→';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%) translateX(0);
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--alsea-2) 0%, var(--alsea-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estado hover/active mejorado */
.recent-card:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 
    0 4px 16px rgba(23,161,230,.15),
    0 2px 4px rgba(0,61,102,.08),
    inset 0 1px 0 rgba(255,255,255,1);
  background: 
    radial-gradient(circle at 98% 8%, rgba(23,161,230,0.12) 0%, transparent 60%),
    radial-gradient(circle at 2% 92%, rgba(0,108,168,0.08) 0%, transparent 60%),
    linear-gradient(135deg, rgba(240,249,255,1) 0%, rgba(224,242,254,1) 100%);
  border-color: rgba(23,161,230,0.4);
}

.recent-card:active::before {
  opacity: 1;
  width: 4px;
  background: linear-gradient(180deg, var(--alsea-3) 0%, var(--alsea-2) 100%);
}

.recent-card:active::after {
  opacity: 1;
  transform: translateY(-50%) translateX(4px);
}

/* Texto de la pregunta - Mejorado */
.recent-question {
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0a1628;
  margin-bottom: 6px;
  line-height: 1.4;
  padding-right: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.015em;
  position: relative;
}

/* Badge decorativo para preguntas */
.recent-question::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 5px;
  width: 6px;
  height: 6px;
  background: linear-gradient(135deg, var(--alsea-3) 0%, var(--alsea-2) 100%);
  border-radius: 50%;
  opacity: 0.6;
  box-shadow: 0 0 8px rgba(23,161,230,.4);
}

/* Texto de la respuesta - Mejorado */
.recent-answer {
  font-family: "Inter", sans-serif;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.45;
  font-weight: 500;
  padding-right: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

/* Animación de entrada mejorada */
@keyframes slideInUpFade {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.recent-card {
  animation: slideInUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.recent-card:nth-child(1) {
  animation-delay: 0.05s;
}

.recent-card:nth-child(2) {
  animation-delay: 0.1s;
}

.recent-card:nth-child(3) {
  animation-delay: 0.15s;
}

.recent-card:nth-child(4) {
  animation-delay: 0.2s;
}

.recent-card:nth-child(5) {
  animation-delay: 0.25s;
}

/* ========================================
   OPTIMIZACIONES ESPECÍFICAS MOBILE
   ======================================== */

/* Prevenir zoom en input en iOS */
@supports (-webkit-touch-callout: none) {
  input[type="text"] {
    font-size: 16px !important;
  }
}

/* Mejorar rendimiento de animaciones en móvil */
.action-card,
.bubble-container,
.modal-card,
.recent-card {
  will-change: transform;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* Safe area para dispositivos con notch */
@supports (padding: max(0px)) {
  body {
    padding-top: env(safe-area-inset-top);
  }
}

/* Prevenir selección de texto en elementos táctiles */
.action-card,
.example-chip,
.btn-primary,
#send-btn,
.modal-close,
.recent-card {
  -webkit-user-select: none;
  user-select: none;
}

/* ========================================
   MEDIA QUERIES PARA DISPOSITIVOS PEQUEÑOS
   ======================================== */
@media (max-height: 667px) {
  .welcome-container {
    padding: 16px 20px 90px;
  }
  
  .welcome-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
  }
  
  .action-card {
    min-height: 68px;
    padding: 14px;
  }
  
  .icon {
    height: 44px;
    width: 44px;
  }
  
  .icon-img {
    width: 42px;
    height: 42px;
  }
  
  .main-text {
    font-size: 1rem;
  }
  
  .sub-text {
    font-size: 0.8rem;
  }
  
  .recent-conversations {
    max-height: 180px;
  }
  
  .recent-header {
    margin-top: 16px;
  }
  
  .recent-card {
    padding: 12px 14px 12px 16px;
    min-height: 62px;
  }
  
  .recent-question {
    font-size: 0.82rem;
    margin-bottom: 5px;
  }
  
  .recent-answer {
    font-size: 0.72rem;
  }
  
  .bubble {
    font-size: 0.9rem;
    padding: 11px 14px;
  }
  
  .bot-avatar {
    width: 34px;
    height: 34px;
  }
  
  .bot-avatar img {
    width: 19px;
    height: 19px;
  }
}

@media (max-width: 360px) {
  .welcome-title {
    font-size: 1.45rem;
    margin-bottom: 24px;
  }
  
  .action-card {
    padding: 14px;
    min-height: 68px;
  }
  
  .icon {
    height: 44px;
    width: 44px;
  }
  
  .icon-img {
    width: 40px;
    height: 40px;
  }
  
  .main-text {
    font-size: 0.98rem;
  }
  
  .sub-text {
    font-size: 0.8rem;
  }
  
  .recent-card {
    padding: 11px 13px 11px 15px;
    min-height: 58px;
  }
  
  .recent-question {
    font-size: 0.8rem;
    margin-bottom: 5px;
  }
  
  .recent-answer {
    font-size: 0.7rem;
  }
  
  #user-input {
    height: 44px;
    padding: 10px 16px;
    font-size: 0.95rem;
  }
  
  #send-btn {
    height: 44px;
    width: 44px;
  }
  
  .bubble {
    font-size: 0.88rem;
    padding: 11px 14px;
  }
  
  .left-container {
    padding-right: 30px;
  }
  
  .right-container {
    padding-left: 30px;
  }
  
  .bot-avatar {
    width: 32px;
    height: 32px;
  }
  
  .bot-avatar img {
    width: 18px;
    height: 18px;
  }
}

@media (min-height: 800px) {
  .recent-conversations {
    max-height: 320px;
  }
  
  .welcome-title {
    font-size: 1.75rem;
    margin-bottom: 36px;
  }
  
  .recent-card {
    min-height: 72px;
    padding: 15px 17px 15px 19px;
  }
  
  .recent-question {
    font-size: 0.9rem;
    margin-bottom: 7px;
  }
  
  .recent-answer {
    font-size: 0.78rem;
  }
  
  .bubble {
    font-size: 0.96rem;
    padding: 14px 17px;
  }
}