/* ============================================================
   CHATBOT STYLES - FitTrack AI v3.0
   ============================================================ */

/* ===== VARIABLES DE TEMA ===== */
:root {
  /* Tema Oscuro (default) */
  --neural-primary: #00f5a0;
  --neural-secondary: #00d9f5;
  --neural-accent: #8b5cf6;
  --neural-warn: #f59e0b;
  --neural-danger: #ef4444;
  --neural-bg: #0a0a0f;
  --neural-surface: #12121a;
  --neural-surface-2: #1a1a25;
  --neural-border: rgba(255,255,255,0.06);
  --neural-text: #e0e0e0;
  --neural-text-muted: #a0a0b0;
  --neural-glow: 0 0 20px rgba(0,245,160,0.15);
  --neural-modal-bg: rgba(0,0,0,0.85);
  --neural-shadow: 0 25px 80px rgba(0,0,0,0.6);
  --neural-input-bg: #1a1a25;
  --neural-msg-user-bg: rgba(0,245,160,0.15);
  --neural-msg-bot-bg: #1a1a25;
  --neural-card-bg: rgba(0,245,160,0.05);
  --neural-card-border: rgba(0,245,160,0.1);
}

/* Tema Claro */
[data-theme="light"] {
  --neural-primary: #00c985;
  --neural-secondary: #00b8d4;
  --neural-accent: #7c3aed;
  --neural-warn: #d97706;
  --neural-danger: #dc2626;
  --neural-bg: #f0f2f5;
  --neural-surface: #ffffff;
  --neural-surface-2: #f0f2f5;
  --neural-border: rgba(0,0,0,0.08);
  --neural-text: #1a1a2e;
  --neural-text-muted: #6b7280;
  --neural-glow: 0 0 20px rgba(0,201,133,0.2);
  --neural-modal-bg: rgba(255,255,255,0.92);
  --neural-shadow: 0 25px 80px rgba(0,0,0,0.15);
  --neural-input-bg: #ffffff;
  --neural-msg-user-bg: rgba(0,201,133,0.12);
  --neural-msg-bot-bg: #e5e7eb;
  --neural-card-bg: rgba(0,201,133,0.05);
  --neural-card-border: rgba(0,201,133,0.15);
}

/* Tema Automático (sigue al sistema) */
@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --neural-primary: #00c985;
    --neural-secondary: #00b8d4;
    --neural-accent: #7c3aed;
    --neural-warn: #d97706;
    --neural-danger: #dc2626;
    --neural-bg: #f0f2f5;
    --neural-surface: #ffffff;
    --neural-surface-2: #f0f2f5;
    --neural-border: rgba(0,0,0,0.08);
    --neural-text: #1a1a2e;
    --neural-text-muted: #6b7280;
    --neural-glow: 0 0 20px rgba(0,201,133,0.2);
    --neural-modal-bg: rgba(255,255,255,0.92);
    --neural-shadow: 0 25px 80px rgba(0,0,0,0.15);
    --neural-input-bg: #ffffff;
    --neural-msg-user-bg: rgba(0,201,133,0.12);
    --neural-msg-bot-bg: #e5e7eb;
    --neural-card-bg: rgba(0,201,133,0.05);
    --neural-card-border: rgba(0,201,133,0.15);
  }
}

/* ===== ESTILOS BASE DEL WIDGET ===== */
#neuralWidget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

/* ===== TOGGLE BUTTON ===== */
#neuralToggle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--neural-primary), var(--neural-secondary));
  color: #000;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0,245,160,0.3), var(--neural-glow);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 0;
}

#neuralToggle:hover {
  transform: scale(1.08) rotate(5deg);
  box-shadow: 0 12px 40px rgba(0,245,160,0.4), 0 0 30px rgba(0,245,160,0.2);
}

#neuralToggle:active {
  transform: scale(0.95);
}

#neuralToggle.pulse {
  animation: neuralPulse 2s infinite;
}

@keyframes neuralPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(0,245,160,0.3), var(--neural-glow); }
  50% { box-shadow: 0 8px 32px rgba(0,245,160,0.5), 0 0 40px rgba(0,245,160,0.3); }
}

.neural-avatar-img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
  border-radius: 50%;
}

#neuralBadge {
  position: absolute;
  top: 4px;
  right: 9px;
  min-width: 12px;
  height: 12px;
  background: var(--neural-danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  animation: badgePop 0.3s ease;
}

@keyframes badgePop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ===== CHAT WINDOW ===== */
#neuralWindow {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 420px;
  height: 600px;
  max-height: calc(100vh - 120px);
  background: var(--neural-bg);
  border: 1px solid var(--neural-border);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--neural-shadow), 0 0 0 1px rgba(0,245,160,0.05);
}

#neuralWindow.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  #neuralWidget {
    bottom: 16px;
    right: 16px;
  }
  
  #neuralWindow {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    background: var(--neural-bg);
    transform: translateY(20px) scale(0.98);
  }
  
  #neuralWindow.open {
    transform: translateY(0) scale(1);
  }
  
  #neuralToggle {
    width: 56px;
    height: 56px;
  }
  
  .neural-avatar-img {
    width: 40px;
    height: 40px;
  }
  
  .neural-header {
    padding: 12px 16px;
    min-height: 60px;
  }
  
  #neuralMessages {
    padding: 12px;
  }
  
  .neural-msg {
    max-width: 92%;
    font-size: 13px;
    padding: 10px 14px;
  }
  
  .neural-input-area {
    padding: 10px 12px 14px;
    gap: 6px;
  }
  
  #neuralInput {
    font-size: 16px;
    padding: 10px 12px;
    min-height: 44px;
    border-radius: 12px;
  }
  
  .neural-input-btn {
    width: 44px;
    height: 44px;
    font-size: 18px;
    border-radius: 12px;
  }
  
  #neuralFloatSummary {
    right: 16px;
    bottom: 80px;
    max-width: 200px;
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  #neuralWidget {
    bottom: 12px;
    right: 12px;
  }
  
  #neuralToggle {
    width: 52px;
    height: 52px;
  }
  
  .neural-avatar-img {
    width: 56px;
    height: 56px;
  }
  
  .neural-header-title {
    font-size: 14px;
  }
  
  .neural-header-subtitle {
    font-size: 11px;
  }
  
  .neural-header-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  
  .neural-msg {
    font-size: 12.5px;
    padding: 8px 12px;
    border-radius: 14px;
  }
  
  .neural-action-btn {
    font-size: 11px;
    padding: 5px 10px;
  }
  
  .neural-routine-card {
    padding: 10px;
  }
  
  .neural-exercise-row {
    font-size: 11.5px;
    padding: 6px 0;
  }
  
  .neural-progress-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  
  .neural-progress-cell {
    padding: 10px 6px;
  }
  
  .neural-progress-value {
    font-size: 18px;
  }
}

/* ===== HEADER ===== */
.neural-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(0,245,160,0.06), transparent);
  border-bottom: 1px solid var(--neural-border);
  flex-shrink: 0;
  min-height: 64px;
}

.neural-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.neural-header-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  display: block;
}

.neural-avatar-status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: var(--neural-primary);
  border-radius: 50%;
  border: 2px solid var(--neural-bg);
  animation: statusBlink 3s infinite;
}

@keyframes statusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.neural-header-info {
  flex: 1;
  min-width: 0;
}

.neural-header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--neural-text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.neural-version-badge {
  font-size: 10px;
  background: rgba(0,245,160,0.15);
  color: var(--neural-primary);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.neural-header-subtitle {
  font-size: 12px;
  color: var(--neural-text-muted);
}

.neural-header-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.neural-header-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--neural-border);
  background: var(--neural-surface-2);
  color: var(--neural-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
  padding: 0;
}

.neural-header-btn:hover {
  background: rgba(0,245,160,0.1);
  color: var(--neural-primary);
  border-color: rgba(0,245,160,0.2);
}

.neural-header-btn.active {
  background: rgba(0,245,160,0.15);
  color: var(--neural-primary);
  border-color: rgba(0,245,160,0.3);
}

/* ===== MESSAGES AREA ===== */
#neuralMessages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

#neuralMessages::-webkit-scrollbar {
  width: 4px;
}

#neuralMessages::-webkit-scrollbar-track {
  background: transparent;
}

#neuralMessages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

[data-theme="light"] #neuralMessages::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
}

/* ===== MESSAGE BUBBLES ===== */
.neural-msg {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--neural-text);
  opacity: 0;
  transform: translateY(8px);
  animation: msgAppear 0.35s ease forwards;
  position: relative;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@keyframes msgAppear {
  to { opacity: 1; transform: translateY(0); }
}

.neural-msg.user {
  align-self: flex-end;
  background: var(--neural-msg-user-bg);
  border-bottom-right-radius: 4px;
  border: 1px solid rgba(0,245,160,0.1);
}

.neural-msg.bot {
  align-self: flex-start;
  background: var(--neural-msg-bot-bg);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--neural-border);
}

.neural-msg-time {
  font-size: 10px;
  color: var(--neural-text-muted);
  margin-top: 6px;
  opacity: 0.7;
}

/* ===== TYPING INDICATOR ===== */
.neural-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--neural-surface-2);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  border: 1px solid var(--neural-border);
}

.neural-typing-text {
  font-size: 12px;
  color: var(--neural-text-muted);
}

.neural-typing-dots {
  display: flex;
  gap: 4px;
}

.neural-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--neural-primary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.neural-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.neural-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ===== VOICE LISTENING INDICATOR ===== */
.neural-listening {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(239,68,68,0.1), rgba(245,158,11,0.1));
  border-radius: 18px;
  border: 1px solid rgba(239,68,68,0.2);
  align-self: flex-start;
  animation: listeningPulse 1.5s infinite;
}

@keyframes listeningPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.2); }
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

.neural-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 20px;
}

.neural-wave-bar {
  width: 3px;
  background: linear-gradient(to top, var(--neural-danger), var(--neural-warn));
  border-radius: 2px;
  animation: waveAnim 0.5s infinite ease-in-out alternate;
}

.neural-wave-bar:nth-child(1) { height: 6px; animation-delay: 0s; }
.neural-wave-bar:nth-child(2) { height: 12px; animation-delay: 0.1s; }
.neural-wave-bar:nth-child(3) { height: 18px; animation-delay: 0.2s; }
.neural-wave-bar:nth-child(4) { height: 10px; animation-delay: 0.15s; }
.neural-wave-bar:nth-child(5) { height: 14px; animation-delay: 0.05s; }

@keyframes waveAnim {
  from { transform: scaleY(0.3); }
  to { transform: scaleY(1); }
}

/* ===== INPUT AREA ===== */
.neural-input-area {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--neural-border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: var(--neural-surface);
  flex-shrink: 0;
}

#neuralInput {
  flex: 1;
  background: var(--neural-input-bg);
  border: 1px solid var(--neural-border);
  border-radius: 16px;
  padding: 10px 14px;
  color: var(--neural-text);
  font-size: 14px;
  resize: none;
  outline: none;
  max-height: 100px;
  min-height: 40px;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

#neuralInput:focus {
  border-color: rgba(0,245,160,0.3);
  box-shadow: 0 0 0 3px rgba(0,245,160,0.05);
}

#neuralInput::placeholder {
  color: var(--neural-text-muted);
}

.neural-input-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--neural-border);
  background: var(--neural-surface-2);
  color: var(--neural-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.neural-input-btn:hover {
  background: rgba(0,245,160,0.1);
  color: var(--neural-primary);
}

.neural-input-btn.send {
  background: linear-gradient(135deg, var(--neural-primary), var(--neural-secondary));
  color: #000;
  border: none;
}

.neural-input-btn.send:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}

.neural-input-btn.send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ===== QUICK ACTIONS ===== */
.neural-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.neural-action-btn {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(0,245,160,0.2);
  background: rgba(0,245,160,0.06);
  color: var(--neural-primary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.neural-action-btn:hover {
  background: rgba(0,245,160,0.15);
  transform: translateY(-1px);
}

/* ===== ROUTINE CARD ===== */
.neural-routine-card {
  background: var(--neural-card-bg);
  border: 1px solid var(--neural-card-border);
  border-radius: 14px;
  padding: 14px;
  margin-top: 10px;
}

.neural-routine-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--neural-primary);
  margin-bottom: 10px;
}

.neural-exercise-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 12.5px;
  gap: 8px;
}

.neural-exercise-row:last-child {
  border-bottom: none;
}

.neural-exercise-name {
  color: var(--neural-text);
  font-weight: 500;
}

.neural-exercise-meta {
  color: var(--neural-text-muted);
  font-size: 11px;
  white-space: nowrap;
}

/* ===== PROGRESS GRID ===== */
.neural-progress-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.neural-progress-cell {
  background: var(--neural-surface-2);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  border: 1px solid var(--neural-border);
  transition: transform 0.2s;
}

.neural-progress-cell:hover {
  transform: translateY(-2px);
}

.neural-progress-value {
  font-size: 22px;
  font-weight: 800;
}

.neural-progress-label {
  font-size: 10px;
  color: var(--neural-text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== PROGRESS BAR ===== */
.neural-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.neural-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--neural-primary), var(--neural-secondary));
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== MODAL ===== */
.neural-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--neural-modal-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.neural-modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.neural-modal {
  background: var(--neural-surface);
  border: 1px solid var(--neural-border);
  border-radius: 20px;
  padding: 32px 28px 28px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  transform: scale(0.92) translateY(10px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.neural-modal-overlay.show .neural-modal {
  transform: scale(1) translateY(0);
}

/* Modal responsive */
@media (max-width: 480px) {
  .neural-modal-overlay {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  
  .neural-modal {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    padding: 40px 24px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--neural-bg);
    border: none;
    transform: scale(1) translateY(0);
  }
  
  .neural-modal-overlay.show .neural-modal {
    transform: scale(1);
  }
  
  .neural-modal-icon {
    font-size: 56px;
    margin-bottom: 16px;
  }
  
  .neural-modal-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
  }
  
  .neural-modal-text {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 28px;
    color: var(--neural-text-muted);
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .neural-modal-actions {
    flex-direction: column;
    gap: 12px;
    max-width: 320px;
    margin: 0 auto;
    width: 100%;
  }
  
  .neural-modal-btn {
    padding: 16px;
    font-size: 17px;
    border-radius: 14px;
  }
}

.neural-modal-icon {
  font-size: 44px;
  margin-bottom: 12px;
  display: block;
}

.neural-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--neural-text);
  margin-bottom: 8px;
}

.neural-modal-text {
  font-size: 14px;
  color: var(--neural-text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.neural-modal-actions {
  display: flex;
  gap: 10px;
}

.neural-modal-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.neural-modal-btn.primary {
  background: linear-gradient(135deg, var(--neural-primary), var(--neural-secondary));
  color: #000;
}

.neural-modal-btn.primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.neural-modal-btn.secondary {
  background: var(--neural-surface-2);
  color: var(--neural-text);
  border: 1px solid var(--neural-border);
}

.neural-modal-btn.secondary:hover {
  background: rgba(255,255,255,0.05);
}

/* ===== FLOATING SUMMARY ===== */
#neuralFloatSummary {
  position: fixed;
  bottom: 100px;
  right: 24px;
  background: var(--neural-surface);
  border: 1px solid var(--neural-border);
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: var(--neural-shadow);
  z-index: 9998;
  display: none;
  max-width: 280px;
  animation: floatIn 0.4s ease;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#neuralFloatSummary.show {
  display: block;
}

@keyframes floatIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.neural-float-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--neural-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.neural-float-item {
  font-size: 12px;
  color: var(--neural-text-muted);
  padding: 3px 0;
}

/* ===== TOAST ===== */
.neural-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--neural-surface);
  border: 1px solid var(--neural-border);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 13px;
  color: var(--neural-text);
  box-shadow: var(--neural-shadow);
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.neural-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
  .neural-toast {
    bottom: 80px;
    font-size: 12px;
    padding: 10px 16px;
    white-space: normal;
    max-width: 85vw;
  }
}

/* ===== SCROLL BUTTON ===== */
#neuralScrollBtn {
  position: absolute;
  bottom: 76px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--neural-surface-2);
  border: 1px solid var(--neural-border);
  color: var(--neural-text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
  z-index: 10;
  padding: 0;
}

#neuralScrollBtn:hover {
  background: rgba(0,245,160,0.1);
  color: var(--neural-primary);
}

#neuralScrollBtn.show {
  display: flex;
}

@media (max-width: 480px) {
  #neuralScrollBtn {
    bottom: 72px;
    right: 14px;
    width: 28px;
    height: 28px;
    font-size: 10px;
  }
}

/* ===== CLEAR CONFIRMATION ===== */
.neural-clear-confirm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: rgba(239,68,68,0.05);
  border-radius: 12px;
  border: 1px solid rgba(239,68,68,0.15);
}

.neural-clear-confirm .neural-clear-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.neural-clear-confirm .neural-clear-btn-danger {
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  background: var(--neural-danger);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.neural-clear-confirm .neural-clear-btn-danger:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

.neural-clear-confirm .neural-clear-btn-cancel {
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid var(--neural-border);
  background: transparent;
  color: var(--neural-text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.neural-clear-confirm .neural-clear-btn-cancel:hover {
  background: rgba(255,255,255,0.05);
}

/* ===== SCROLLBAR GLOBAL ===== */
#neuralWidget *::-webkit-scrollbar {
  width: 4px;
}

#neuralWidget *::-webkit-scrollbar-track {
  background: transparent;
}

#neuralWidget *::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
}

[data-theme="light"] #neuralWidget *::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
}