:root {
  /* --primary: lab(46.3662% 2.61197 -66.5624); */
  --primary: #004d99;
  --accent: #00c6ff;
  --primary-light: #6b85f9;
  --primary-dark: #3d5bd9;
  /* --accent: #5b7cf9; */
  --background: #f5f7fa;
  --card: #ffffff;
  --foreground: #1a1f36;
  --muted: #e8ecf4;
  --muted-foreground: #6b7280;
  --border: #e2e8f0;
  /* background: linear-gradient(135deg, #004d99 0%, #00c6ff 170%); */
}

/* ============================================
   FLOATING BUTTON
   ============================================ */
.chat-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  /* background: linear-gradient(135deg, var(--primary), var(--accent)); */
  background: linear-gradient(135deg, #004d99 0%, #00c6ff 170%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(79, 110, 247, 0.35);
  transition: all 0.3s ease;
  z-index: 100;
}

.chat-btn:hover { transform: scale(1.05); }
.chat-btn:active { transform: scale(0.95); }
.chat-btn.hidden { transform: scale(0); opacity: 0; }
.chat-btn svg { width: 24px; height: 24px; }

/* ============================================
   CHAT WIDGET
   ============================================ */
.chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 380px;
  height: 520px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 101;
  transition: all 0.3s ease;
  opacity: 0;
  transform: scale(0.95) translateY(16px);
  pointer-events: none;
}

.chat-widget.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

.chat-widget.fullscreen {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  max-width: none;
}

/* ============================================
   HEADER
   ============================================ */
.chat-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.95);
}

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

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.chat-avatar svg { width: 18px; height: 18px; }
.chat-info h3 { font-size: 14px; font-weight: 600; }

.chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted-foreground);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.header-actions { display: flex; gap: 4px; }

.header-btn {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  border: none;
  background: var(--muted);
  color: var(--muted-foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.header-btn:hover { background: #dde3ed; }
.header-btn.active { background: var(--primary); color: white; }
.header-btn svg { width: 16px; height: 16px; }

/* ============================================
   SCREEN QUERY BANNER
   ============================================ */
.screen-query-banner {
  padding: 8px 16px;
  display: none;
  flex-shrink: 0;
}

.screen-query-banner.active {
  display: flex;
  align-items: center;
  gap: 8px;
}

.screen-query-banner p { font-size: 12px; color: var(--primary); font-weight: 500; }
.screen-query-banner svg { width: 14px; height: 14px; color: var(--primary); }

/* ============================================
   CONTENT AREA
   ============================================ */
.chat-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tab-content {
  height: 100%;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.tab-content.active { display: flex; }

#tabChat { position: relative; }

.chat-widget.fullscreen #tabChat {
  max-width: 100%;
  margin: 0;
  width: 100%;
  padding: 0;
  margin-top: 10px;
}

.chat-widget.fullscreen .chat-content {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* ============================================
   MESSAGES
   ============================================ */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.chat-widget.fullscreen .messages-container {
  padding: 24px 0;
}

.message {
  max-width: 95%;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  animation: messageSlide 0.3s ease-out;
}

.message.bot {
  align-self: flex-start;
  background: var(--muted);
  border-radius: 18px 18px 18px 6px;
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: 18px 18px 6px 18px;
}

.message.bot h2, .message.bot h3, .message.bot h4 {
  margin: 12px 0 6px 0;
  font-weight: 600;
}

.message.bot li { margin: 4px 0; margin-left: 20px; }
.message.bot strong { font-weight: 600; }
.message.bot em { font-style: italic; }

.chat-widget.fullscreen .message {
  padding: 14px 20px;
  font-size: 15px;
}

/* ============================================
   INPUT AREA
   ============================================ */
.input-area {
  padding: 8px 16px 12px; /* reducido: menos espacio arriba/abajo */
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.95);
}

/* En fullscreen el input es más generoso */
.chat-widget.fullscreen .input-area {
  padding: 12px 0 24px;
}

.input-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 20px;
  padding: 4px 4px 4px 14px; /* reducido verticalmente */
  border: 1px solid transparent;
  transition: all 0.2s;
}

.input-wrapper:focus-within {
  background: rgba(255, 255, 255, 1);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.1);
}

.input-wrapper textarea {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  resize: none;
  outline: none;
  padding: 6px 0; /* reducido */
  min-height: 24px;
  max-height: 120px;
  font-family: inherit;
  line-height: 1.5;
  margin-bottom: 5px;
}

.input-wrapper textarea::placeholder { color: rgba(0, 0, 0, 0.4); }

/* En fullscreen el textarea tiene más padding */
.chat-widget.fullscreen .input-wrapper {
  padding: 6px 6px 6px 16px;
}

.chat-widget.fullscreen .input-wrapper textarea {
  padding: 14px 0;
}

.send-btn {
  width: 36px; /* ligeramente más pequeño en modo normal */
  height: 36px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.send-btn:hover { background: var(--primary-dark); transform: scale(1.05); }
.send-btn:active { transform: scale(0.95); }
.send-btn svg { width: 16px; height: 16px; }

/* Send btn más grande en fullscreen */
.chat-widget.fullscreen .send-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
}

.chat-widget.fullscreen .send-btn svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   TABS CONTENT
   ============================================ */
.tab-header {
  font-size: 11px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  padding: 16px 16px 12px;
  flex-shrink: 0;
}

.chat-widget.fullscreen .tab-header {
  text-align: center;
  padding: 24px 16px 16px;
}

.list-container {
  flex: 1;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.chat-widget.fullscreen .list-container {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.list-item {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.03);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s;
  text-align: left;
  margin: 0 !important;
}

.list-item:hover { background: var(--muted); transform: translateX(4px); }

.list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(79, 110, 247, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.list-item-icon svg { width: 18px; height: 18px; }
.list-item-text { font-size: 14px; font-weight: 500; color: var(--foreground); }
.list-item-info { flex: 1; min-width: 0; }
.list-item-subtitle { font-size: 11px; color: var(--muted-foreground); text-transform: capitalize; margin-top: 2px; }

.delete-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #ef4444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.delete-btn:hover { background: #fee2e2; }
.delete-btn svg { width: 16px; height: 16px; }

/* ============================================
   CONSTRUCTOR FORM
   ============================================ */
.constructor-form {
  flex: 1;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.chat-widget.fullscreen .constructor-form {
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
}

.form-input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.1);
}

.form-input::placeholder { color: rgba(0, 0, 0, 0.4); }
textarea.form-input { resize: none; min-height: 80px; }

.type-label { font-size: 11px; color: var(--muted-foreground); margin-bottom: 6px; font-weight: 500; }

.type-suggestions { display: flex; flex-wrap: wrap; gap: 8px; }

.type-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--muted);
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.2s;
}

.type-chip:hover { background: #dde3ed; color: var(--foreground); }
.type-chip.selected { background: var(--primary); color: white; }
.type-chip svg { width: 14px; height: 14px; }

.create-btn {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: auto;
  transition: all 0.2s;
  margin: 0 !important;
  padding: 11px;
}

.create-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(79, 110, 247, 0.3); }
.create-btn:active:not(:disabled) { transform: translateY(0); }
.create-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================
   BOTTOM NAV
   ============================================ */
.bottom-nav {
  padding: 8px 12px 12px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.95);
}

.chat-widget.fullscreen .bottom-nav {
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 18px;
  padding: 6px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  border-radius: 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-item.active { background: white; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.nav-item svg { width: 20px; height: 20px; color: var(--muted-foreground); }
.nav-item.active svg { color: var(--primary); }
.nav-item span { font-size: 10px; font-weight: 500; color: var(--muted-foreground); }
.nav-item.active span { color: var(--primary); }

.nav-item.special {
  width: 48px;
  height: 48px;
  margin: -14px 0;
  padding: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 4px 16px rgba(79, 110, 247, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item.special:hover { transform: scale(1.05); }
.nav-item.special svg { color: white; width: 22px; height: 22px; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  font-size: 14px;
  padding: 32px;
  text-align: center;
}

.empty-icon { opacity: 0.4; margin-bottom: 12px; }
.empty-title { margin: 0 0 4px; font-size: 14px; font-weight: 500; color: #c9d1d9; }
.empty-subtitle { margin: 0; font-size: 12px; color: #8b949e; }

/* ============================================
   APP ITEM
   ============================================ */
.list-item.app-item { position: relative; padding-right: 100px; }

.app-actions {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4px;
}

.app-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #8b949e;
  cursor: pointer;
  transition: all 0.15s ease;
}

.app-action-btn:hover { background: rgba(255, 255, 255, 0.1); }
.app-action-btn.run { color: #3fb950; }
.app-action-btn.run:hover { background: rgba(63, 185, 80, 0.15); }
.app-action-btn.edit:hover { background: rgba(88, 166, 255, 0.15); color: #58a6ff; }
.app-action-btn.delete:hover { background: rgba(248, 81, 73, 0.15); color: #f85149; }

/* ============================================
   TYPING INDICATOR
   ============================================ */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--muted);
  border-radius: 18px 18px 18px 6px;
  align-self: flex-start;
  max-width: fit-content;
}

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

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* ============================================
   CODE BLOCKS — estilo unificado tipo runner
   ============================================ */

/* Inline code */
.ariah-inline-code {
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.875em;
  color: #991b1b;
  border: 1px solid rgba(110, 118, 129, 0.3);
}

/* Code block container */
.ariah-code-block {
  background: #0d1117;
  border-radius: 12px;
  margin: 12px 0;
  overflow: hidden;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  border: 1px solid rgba(48, 54, 61, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Header — mismo estilo que ariah-runner-header */
.ariah-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, rgba(56, 139, 253, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0;
    padding: 10px;
}

/* Language label */
.ariah-code-lang {
  font-size: 11px;
  font-weight: 600;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(110, 118, 129, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dot animado como en runner-title */
.ariah-code-lang::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #3fb950;
  border-radius: 50%;
  animation: pulse-dot 1.5s ease infinite;
  display: inline-block;
}

/* Typing state: sin dot, solo shimmer */
.ariah-code-typing .ariah-code-lang::before { display: none; }
.ariah-code-typing .ariah-code-header {
  background: linear-gradient(90deg, rgba(56,139,253,0.1) 0%, rgba(139,92,246,0.2) 50%, rgba(56,139,253,0.1) 100%);
  background-size: 200% 100%;
  animation: typing-shimmer 1.5s ease infinite;
}

.ariah-typing-indicator { font-size: 10px; color: #58a6ff; font-style: italic; }

/* Botones */
.ariah-code-actions { display: flex; gap: 6px; flex-shrink: 0; }

.ariah-code-copy,
.ariah-code-run {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(48, 54, 61, 0.6);
  border: 1px solid rgba(110, 118, 129, 0.3);
  color: #8b949e;
  padding: 3px 6px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ariah-code-copy:hover {
  background: rgba(56, 139, 253, 0.2);
  border-color: rgba(56, 139, 253, 0.5);
  color: #58a6ff;
}

.ariah-code-run {
  background: rgba(46, 160, 67, 0.15);
  border-color: rgba(46, 160, 67, 0.4);
  color: #3fb950;
}

.ariah-code-run:hover {
  background: rgba(46, 160, 67, 0.3);
  border-color: rgba(46, 160, 67, 0.6);
  color: #56d364;
}

.ariah-code-copy svg, .ariah-code-run svg { flex-shrink: 0; }

/* Scrollable body */
.ariah-code-body { max-height: 400px; overflow: auto; }

/* Code content */
.ariah-code-content {
  margin: 0;
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.6;
  color: #c9d1d9;
  background: transparent;
  overflow-x: auto;
}

.ariah-code-content code { font-family: inherit; background: none; padding: 0; color: inherit; }

/* Syntax highlighting */
.ariah-code-keyword { color: #ff7b72; font-weight: 500; }
.ariah-code-string { color: #a5d6ff; }
.ariah-code-number { color: #79c0ff; }
.ariah-code-comment { color: #8b949e; font-style: italic; }
.ariah-code-function { color: #d2a8ff; }
.ariah-code-property { color: #79c0ff; }
.ariah-code-tag { color: #7ee787; }
/* Syntax Highlighting */
.hl-keyword { color: #ff7b72; }
.hl-string { color: #a5d6ff; }
.hl-number { color: #79c0ff; }
.hl-comment { color: #8b949e; font-style: italic; }
.hl-tag { color: #7ee787; }

/* Parrafos en mensajes */
.message.bot p {
    margin: 0 0 8px 0;
}
.message.bot p:last-child {
    margin-bottom: 0;
}

/* ============================================
   MARKDOWN ELEMENTS
   ============================================ */
.ariah-heading { margin: 16px 0 8px; font-weight: 600; color: inherit; }
h2.ariah-heading { font-size: 1.3em; }
h3.ariah-heading { font-size: 1.15em; }
h4.ariah-heading { font-size: 1em; }

.ariah-paragraph { margin: 8px 0; line-height: 1.6; }

.ariah-list, .ariah-list-ordered { margin: 8px 0; padding-left: 24px; }
.ariah-list-item, .ariah-list-item-ordered { margin: 4px 0; line-height: 1.5; }

.ariah-link { color: #58a6ff; text-decoration: none; border-bottom: 1px solid rgba(88, 166, 255, 0.3); transition: all 0.2s ease; }
.ariah-link:hover { color: #79c0ff; border-bottom-color: #79c0ff; }

.ariah-hr { border: none; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); margin: 20px 0; }

/* ============================================
   RUNNER MODAL
   ============================================ */
.ariah-runner-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.ariah-runner-modal.active { opacity: 1; visibility: visible; }

.ariah-runner-container {
  /* width: 90%;
  max-width: 900px;
  height: 80vh; */
  width: 100%;
  height: 100dvh;
  background: #0d1117;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s ease;
}

.ariah-runner-modal.active .ariah-runner-container { transform: scale(1) translateY(0); }

.ariah-runner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(56, 139, 253, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ariah-runner-title {
  font-size: 13px;
  font-weight: 500;
  color: #c9d1d9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ariah-runner-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #3fb950;
  border-radius: 50%;
  animation: pulse-dot 1.5s ease infinite;
}

.ariah-runner-actions { display: flex; align-items: center; gap: 8px; }

.ariah-runner-close {
  background: transparent;
  border: 1px solid rgba(248, 81, 73, 0.4);
  color: #f85149;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.ariah-runner-close:hover { background: rgba(248, 81, 73, 0.2); border-color: #f85149; }

.ariah-runner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #8b949e;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ariah-runner-btn:hover { background: rgba(255, 255, 255, 0.05); color: #c9d1d9; }

.ariah-runner-btn.edit { border-color: rgba(88, 166, 255, 0.4); color: #58a6ff; }
.ariah-runner-btn.edit:hover { background: rgba(88, 166, 255, 0.15); border-color: #58a6ff; }

.ariah-runner-btn.save { border-color: rgba(63, 185, 80, 0.4); color: #3fb950; }
.ariah-runner-btn.save:hover { background: rgba(63, 185, 80, 0.15); border-color: #3fb950; }

.ariah-runner-btn svg, .ariah-runner-close svg { flex-shrink: 0; }

.ariah-runner-iframe {
  width: 100%;
  height: calc(100% - 52px);
  border: none;
  background: #fff;
}

/* ============================================
   MOBILE STYLES
   ============================================ */
@media (max-width: 768px) {
  .ariah-code-body{max-height: 250px;}
  .chat-btn { right: 16px; bottom: 16px; width: 52px; height: 52px; }

  .chat-widget {
    right: 0; bottom: 0; left: 0;
    width: 100%; height: 85vh;
    border-radius: 24px 24px 0 0;
    max-height: 85vh;
  }

  .chat-widget.open { transform: translateY(0); }

  .chat-widget.fullscreen {
    height: 100%; max-height: 100%;
    border-radius: 0; flex-direction: column;
  }

  .chat-widget.fullscreen .bottom-nav {
    position: relative; left: auto; top: auto; bottom: auto;
    width: 100%; height: auto; max-width: none;
    padding: 8px 12px calc(env(safe-area-inset-bottom, 12px) + 12px);
    background: rgba(255, 255, 255, 0.95);
    border-right: none;
  }

  .chat-widget.fullscreen .nav-container {
    flex-direction: row; align-items: center;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 18px; padding: 6px;
    height: auto;
  }

  .chat-widget.fullscreen .nav-item {
    flex-direction: column; justify-content: center;
    gap: 3px; padding: 8px 12px; width: auto;
  }

  .chat-widget.fullscreen .nav-item svg { width: 20px; height: 20px; }
  .chat-widget.fullscreen .nav-item span { font-size: 10px; }

  .chat-widget.fullscreen .nav-item.special {
    width: 44px; height: 44px;
    margin: -12px 0; padding: 0; order: 0;
  }

  .chat-widget.fullscreen .nav-item.special::after { display: none; }

  .chat-widget.fullscreen .chat-header {
    position: relative; top: auto; left: auto; right: auto; width: 100%;
    backdrop-filter: none;
  }

  .chat-widget.fullscreen .screen-query-banner {
    position: relative; top: auto; left: auto; right: auto;
  }

  .chat-widget.fullscreen .chat-content {
    margin-left: 0; margin-top: 0;
    max-width: none; padding: 0;
    height: auto; flex: 1;
  }

  .chat-widget.fullscreen .messages-container { padding: 16px; }
  .chat-widget.fullscreen .input-area { padding: 8px 16px 24px; }

  .chat-widget.fullscreen .message {
    max-width: 85%; font-size: 14px; padding: 12px 16px;
  }

  .chat-widget.fullscreen .list-container,
  .chat-widget.fullscreen .constructor-form {
    max-width: none; padding: 0 16px 16px;
  }

  .chat-widget.fullscreen .tab-header { text-align: left; padding: 16px; }

  .messages-container { padding: 12px; }
  .message { font-size: 14px; padding: 10px 14px; }

  .input-area {
    padding: 8px 12px!important;
    padding-bottom: calc(env(safe-area-inset-bottom, 12px) + 8px);
  }

  .input-wrapper { padding: 3px 3px 3px 12px!important;}
  /* .input-wrapper textarea { font-size: 16px; } Prevents zoom on iOS */
  .send-btn { width: 36px; height: 36px; }

  .bottom-nav { padding-bottom: calc(env(safe-area-inset-bottom, 12px) + 12px); }
  .nav-item { padding: 6px 10px; }
  .nav-item span { font-size: 9px; }
  .nav-item.special { width: 44px; height: 44px; margin: -12px 0; }
  .chat-widget.fullscreen .input-wrapper textarea {
    padding: 8px 0;
}
}

/* ============================================
   DESKTOP FULLSCREEN — LEFT SIDEBAR
   ============================================ */
@media (min-width: 769px) {
  .chat-widget.fullscreen { flex-direction: row; }

  .chat-widget.fullscreen .bottom-nav {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 240px; height: 100%;
    padding: 20px 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-right: 1px solid var(--border);
    border-radius: 0; z-index: 10; order: -1;
  }

  .chat-widget.fullscreen .nav-container {
    flex-direction: column; align-items: stretch;
    justify-content: flex-start; gap: 6px;
    padding: 8px; background: transparent;
    border-radius: 0; height: 100%;
  }

  .chat-widget.fullscreen .nav-item {
    flex-direction: row; justify-content: flex-start;
    gap: 12px; padding: 14px 16px;
    border-radius: 12px; width: 100%;
  }

  .chat-widget.fullscreen .nav-item:hover { background: #1476E1; color: white!important; }
  .chat-widget.fullscreen .nav-item.active { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); }
  .chat-widget.fullscreen .nav-item svg { width: 22px; height: 22px; }
  .chat-widget.fullscreen .nav-item span { font-size: 14px; font-weight: 500; }

  .chat-widget.fullscreen .nav-item.special {
    width: 100%; height: auto;
    margin: 0 0 12px 0; padding: 14px 16px;
    border-radius: 12px; order: -1;
    justify-content: center;
  }

  .chat-widget.fullscreen .nav-item.special svg { width: 20px; height: 20px; }

  .chat-widget.fullscreen .nav-item.special::after {
    content: "Constructor";
    font-size: 14px; font-weight: 600;
    margin-left: 10px; color: white;
  }

  /* Header fijo — debajo del cual fluyen los mensajes */
  .chat-widget.fullscreen .chat-header {
    position: fixed; top: 0;
    left: 240px; right: 0; width: auto;
    z-index: 5;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }

  /* Banner debajo del header */
  .chat-widget.fullscreen .screen-query-banner {
    position: fixed;
    top: 61px; /* altura del header */
    left: 240px; right: 0; z-index: 4;
    background: rgba(255, 255, 255, 0.95);
  }

  /* El banner solo aparece cuando está activo — el content-area
     se ajusta automáticamente con margin-top dinámico */
  .chat-widget.fullscreen .chat-content {
    margin-left: 240px;
    margin-top: 61px; /* solo el header; si el banner está activo JS debe sumar su altura */
    max-width: calc(100% - 240px);
    padding: 0 24px;
    height: calc(100% - 61px);
  }

  /* Cuando el banner está activo, añade esta clase al chat-content desde JS:
     .chat-content.banner-active { margin-top: 100px; height: calc(100% - 100px); } */
  .chat-widget.fullscreen .chat-content.banner-active {
    margin-top: 100px;
    height: calc(100% - 100px);
  }

  .chat-widget.fullscreen .messages-container { max-width: 800px; margin: 0 auto; width: 100%; }
  .chat-widget.fullscreen .input-area { max-width: 800px; margin: 0 auto; width: 100%; }
  .chat-widget.fullscreen .list-container { max-width: 600px; margin: 0 auto; }
  .chat-widget.fullscreen .constructor-form { max-width: 500px; margin: 0 auto; }
  .chat-widget.fullscreen .tab-header { max-width: 800px; margin: 0 auto; width: 100%; }
}

@media (min-width: 1200px) {
  .chat-widget.fullscreen .bottom-nav { width: 260px; }
  .chat-widget.fullscreen .chat-header { left: 260px; }
  .chat-widget.fullscreen .screen-query-banner { left: 260px; }
  .chat-widget.fullscreen .chat-content {
    margin-left: 260px; max-width: calc(100% - 260px); padding: 0 40px;
  }
  .chat-widget.fullscreen .messages-container,
  .chat-widget.fullscreen .input-area,
  .chat-widget.fullscreen .tab-header { max-width: 900px; }
  .chat-widget.fullscreen .message { font-size: 15px; }
  .chat-widget.fullscreen .list-container { max-width: 700px; }
  .chat-widget.fullscreen .constructor-form { max-width: 550px; }
}

@media (min-width: 1600px) {
  .chat-widget.fullscreen .bottom-nav { width: 280px; }
  .chat-widget.fullscreen .chat-header { left: 280px; }
  .chat-widget.fullscreen .screen-query-banner { left: 280px; }
  .chat-widget.fullscreen .chat-content {
    margin-left: 280px; max-width: calc(100% - 280px);
  }
  .chat-widget.fullscreen .messages-container,
  .chat-widget.fullscreen .input-area,
  .chat-widget.fullscreen .tab-header { max-width: 1000px; }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes messageSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

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

@keyframes typing-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   SCROLLBAR
   ============================================ */
.messages-container::-webkit-scrollbar,
.list-container::-webkit-scrollbar,
.constructor-form::-webkit-scrollbar { width: 6px; }

.messages-container::-webkit-scrollbar-track,
.list-container::-webkit-scrollbar-track,
.constructor-form::-webkit-scrollbar-track { background: transparent; }

.messages-container::-webkit-scrollbar-thumb,
.list-container::-webkit-scrollbar-thumb,
.constructor-form::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1); border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover,
.list-container::-webkit-scrollbar-thumb:hover,
.constructor-form::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.2); }
.ariah-code-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

.ariah-code-body::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.4);
  border-radius: 999px;
}

.ariah-code-body::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 139, 253, 0.7);
}

.ariah-code-body::-webkit-scrollbar-corner {
  background: transparent;
}
/* css solo aplica cuando esta tamaño completo */

   @media (min-width: 769px) {
    .chat-widget.fullscreen {
      background: radial-gradient(1200px 600px at 20% 0%, rgba(0,198,255,0.10), transparent 55%),
                  radial-gradient(900px 500px at 80% 10%, rgba(0,77,153,0.14), transparent 50%),
                  linear-gradient(180deg, rgba(245,247,250,1) 0%, rgba(241,245,249,1) 100%);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(226,232,240,0.9);
    }
    .chat-widget.fullscreen .bottom-nav {
      background: linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(248,250,252,0.75) 100%);
      border-right: 1px solid rgba(226,232,240,0.9);
      box-shadow: 10px 0 30px rgba(2, 6, 23, 0.06);
      padding: 18px 14px;
    }

    .chat-widget.fullscreen .chat-header {
      background: rgba(255, 255, 255, 0.72);
      backdrop-filter: blur(14px);
      border-bottom: 1px solid rgba(226,232,240,0.9);
      box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
    }
  
    .chat-widget.fullscreen .screen-query-banner {
      background: transparent;
      border-radius: 0 0 18px 18px;
    }
    .chat-widget.fullscreen .chat-content {
      background: transparent;
    }
    .chat-widget.fullscreen .chat-content {
      padding: 0 28px;
      padding-top: 25px;
    }
  
    .chat-widget.fullscreen .chat-content.banner-active {
      margin-top: 100px; 
      height: calc(100% - 100px);
    }
  
    .chat-widget.fullscreen .message {
      border-radius: 18px;
      border: 1px solid rgba(226,232,240,0.9);
      box-shadow: 0 10px 25px rgba(2, 6, 23, 0.04);
      padding: 14px 18px;
      max-width: 88%;
    }
  
    .chat-widget.fullscreen .message.bot {
      background: rgba(255,255,255,0.78);
      backdrop-filter: blur(10px);
      color: #0f172a;
    }
    .chat-widget.fullscreen .input-area {
      background: transparent;
      backdrop-filter: blur(14px);
    }
  
    .chat-widget.fullscreen .input-wrapper {
      background: white;
      border: 1px solid rgba(226,232,240,0.9);
      border-radius: 22px;
      padding: 6px 8px 6px 14px;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
    }
  
    .chat-widget.fullscreen .input-wrapper:focus-within {
      border-color: rgba(0,77,153,0.35);
      box-shadow: 0 0 0 4px rgba(0,77,153,0.10);
      background: rgba(255,255,255,0.92);
    }
  
    .chat-widget.fullscreen .input-wrapper textarea {
      font-size: 14.5px;
    }

    .chat-widget.fullscreen .send-btn {
      background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 170%);
      box-shadow: 0 12px 25px rgba(0,77,153,0.25);
      border: 1px solid rgba(255,255,255,0.25);
    }
  
    .chat-widget.fullscreen .send-btn:hover {
      transform: translateY(-1px) scale(1.02);
      filter: saturate(1.05);
    }
    .chat-widget.fullscreen .tab-header {
      color: rgba(15, 23, 42, 0.75);
      font-size: 12px;
      padding: 18px 0 10px;
      letter-spacing: 0.6px;
    }

    /* .chat-widget.fullscreen .list-container {
      padding: 10px 0 24px;
      max-width: 760px;
    } */
  
    .chat-widget.fullscreen .list-item {
      background: rgba(255,255,255,0.72);
      border: 1px solid rgba(226,232,240,0.9);
      border-radius: 16px;
      box-shadow: 0 10px 25px rgba(2, 6, 23, 0.04);
      transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
      padding: 14px 16px;
    }
  
    .chat-widget.fullscreen .list-item:hover {
      transform: translateY(-2px);
      background: rgba(255,255,255,0.88);
      box-shadow: 0 18px 40px rgba(2, 6, 23, 0.07);
    }
  
    /* .chat-widget.fullscreen .constructor-form {
      padding: 10px 0 24px;
      max-width: 640px !important;
    } */
  
    .chat-widget.fullscreen .form-input {
      border-radius: 16px;
      background: rgba(255,255,255,0.72);
      border: 1px solid rgba(226,232,240,0.95);
      box-shadow: 0 10px 25px rgba(2, 6, 23, 0.03);
    }
  
    .chat-widget.fullscreen .form-input:focus {
      box-shadow: 0 0 0 4px rgba(0,198,255,0.12), 0 10px 25px rgba(2, 6, 23, 0.04);
    }
  
    .chat-widget.fullscreen .nav-container {
      padding: 14px 10px;
    }
  
    .chat-widget.fullscreen .nav-item {
      border-radius: 16px;
      padding: 14px 14px;
      border: 1px solid transparent;
      background: rgba(255,255,255,0.55);
      backdrop-filter: blur(10px);
    }
  
    .chat-widget.fullscreen .nav-item:hover {
      background: rgba(20,118,225,0.10);
      border-color: rgba(20,118,225,0.25);
      transform: translateY(-1px);
    }
    .chat-widget.fullscreen .nav-item.special {
      border-radius: 18px;
      background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 170%);
      box-shadow: none;
    }
    .chat-widget.fullscreen .messages-container::-webkit-scrollbar,
    .chat-widget.fullscreen .list-container::-webkit-scrollbar,
    .chat-widget.fullscreen .constructor-form::-webkit-scrollbar {
      width: 8px;
    }
  
    .chat-widget.fullscreen .messages-container::-webkit-scrollbar-thumb {
      background: rgba(0,77,153,0.25);
      border-radius: 999px;
      border: 2px solid rgba(255,255,255,0.6);
    }
  }
  /* =========================================================
   GLASS FULLSCREEN CENTERED (SOLO PC)
   ========================================================= */
@media (min-width: 769px) {
  /* Contenedor fullscreen: ya no ocupa todo el viewport */
  .chat-widget.open.fullscreen {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;

    width: min(1400px, 96vw) !important;
    height: min(820px, 92vh) !important;

    margin: auto !important;          /* centrado */
    max-width: 1400px !important;
    max-height: 92vh !important;

    border-radius: 26px !important;
    overflow: hidden !important;

    /* Glass */
    /* background: rgba(255, 255, 255, 0.18) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important; */

    border: 1px solid rgba(226, 232, 240, 0.55) !important;
    box-shadow: 0 40px 120px rgb(2 6 23 / 79%) !important;
  }

  /* Si tu CSS anterior fuerza flex-direction/row, no lo rompemos,
     pero aseguramos que el layout interno siga funcionando */
  .chat-widget.open.fullscreen {
    display: flex !important;
    flex-direction: row !important;
  }

  /* Sidebar y header dentro del contenedor glass */
  /* .chat-widget.open.fullscreen .bottom-nav,
  .chat-widget.open.fullscreen .chat-header,
  .chat-widget.open.fullscreen .screen-query-banner {
    background: rgba(255, 255, 255, 0.14) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-color: rgba(226, 232, 240, 0.45) !important;
  } */

  /* Opcional: que el contenido no se vea “plano” */
  .chat-widget.open.fullscreen .chat-content,
  .chat-widget.open.fullscreen .messages-container,
  .chat-widget.open.fullscreen .list-container,
  .chat-widget.open.fullscreen .constructor-form,
  .chat-widget.open.fullscreen .input-area {
    background: transparent !important;
  }
}
/* .chat-widget.fullscreen .mensajePrimer{
  margin-top: 35px;
} */
.chat-widget.fullscreen .mensajeSegundo{
  display: revert!important;}
/* .chat-widget.open.fullscreen ~ main {
  display: none !important;
} */
.chat-widget.open.fullscreen ~ main {
  overflow: hidden;
  max-height: 80vh;
}