/* ============================================================================
 * Nexora AI - Native Obsidian Minimalist Theme Integration
 * Strictly aligned with Nexora's dark monochrome design system:
 * - Pure dark matte background (#09090b / #000000)
 * - Crisp 1px borders (#27272a / rgba(255, 255, 255, 0.08))
 * - High-contrast white typography (#ffffff) & muted grays (#a1a1aa / #71717a)
 * - Solid monochrome buttons (white fill / dark outline)
 * - Zero glowing neons, zero saturated blues, zero visual clutter
 * ============================================================================ */

:root {
  --nexora-ai-z: 9500;
  --nexora-bg-base: #09090b;
  --nexora-bg-surface: #121215;
  --nexora-bg-surface-hover: #18181c;
  --nexora-bg-card: #141417;
  --nexora-border-subtle: #1f1f23;
  --nexora-border-default: #27272a;
  --nexora-border-hover: #3f3f46;
  --nexora-text-primary: #ffffff;
  --nexora-text-secondary: #a1a1aa;
  --nexora-text-muted: #71717a;
  --nexora-btn-primary-bg: #ffffff;
  --nexora-btn-primary-text: #000000;
  --nexora-btn-secondary-bg: #18181b;
  --nexora-btn-secondary-border: #27272a;
  --nexora-btn-secondary-text: #ffffff;
  --nexora-accent-dot: #f97316;
  --nexora-radius-sm: 6px;
  --nexora-radius-md: 8px;
  --nexora-radius-lg: 12px;
  --nexora-radius-pill: 9999px;
  --nexora-shadow-elevated: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --nexora-shadow-menu: 0 12px 32px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --nexora-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================================
 * 1. FLOATING ACTION TRIGGER (Matches native Nexora AI pill exactly)
 * ============================================================================ */
#nexora-ai-fab-wrap {
  position: fixed;
  right: 18px;
  bottom: 20px;
  z-index: var(--nexora-ai-z);
  display: flex;
  align-items: center;
  transition: transform 0.24s var(--nexora-ease), opacity 0.2s ease, right 0.24s var(--nexora-ease);
}

#nexora-ai-fab-wrap.hidden {
  display: none !important;
}

#nexora-ai-fab-wrap.drawer-open {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transform: translateY(16px) scale(0.9) !important;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s !important;
}

#nexora-ai-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 10px;
  border-radius: var(--nexora-radius-pill);
  background: #141417;
  color: #ffffff;
  border: 1px solid var(--nexora-border-default);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  font-family: var(--mantine-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  user-select: none;
}

#nexora-ai-fab:hover {
  background: #1c1c20;
  border-color: var(--nexora-border-hover);
  transform: translateY(-1px);
}

#nexora-ai-fab:active {
  transform: scale(0.97);
}

#nexora-ai-fab .nexora-ai-fab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nexora-accent-dot);
  flex-shrink: 0;
}

#nexora-ai-fab .nexora-ai-fab-sparkle {
  display: none;
}

#nexora-ai-fab .nexora-ai-fab-text {
  font-weight: 600;
  color: #ffffff;
}

#nexora-ai-fab .nexora-ai-fab-kbd {
  font-family: var(--mantine-font-family-monospace, monospace);
  font-size: 10px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--nexora-text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#nexora-ai-fab-dock {
  width: 22px;
  height: 22px;
  margin-left: 6px;
  border-radius: 50%;
  border: 1px solid var(--nexora-border-default);
  background: #141417;
  color: var(--nexora-text-muted);
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

#nexora-ai-fab-dock:hover {
  background: #222226;
  color: #ffffff;
  border-color: var(--nexora-border-hover);
}

#nexora-ai-fab-dock svg,
#nexora-ai-fab-tab svg {
  display: block;
  pointer-events: none;
}

#nexora-ai-fab-tab {
  display: none;
}

#nexora-ai-fab-wrap.collapsed {
  right: 0 !important;
}

#nexora-ai-fab-wrap.collapsed #nexora-ai-fab,
#nexora-ai-fab-wrap.collapsed #nexora-ai-fab-dock {
  display: none !important;
}

#nexora-ai-fab-wrap.collapsed #nexora-ai-fab-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 48px;
  background: #18181c;
  border: 1px solid var(--nexora-border-default);
  border-right: none;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  color: var(--nexora-text-muted);
  transition: background 0.15s ease, width 0.15s ease;
}

#nexora-ai-fab-wrap.collapsed #nexora-ai-fab-tab:hover {
  background: #27272a;
  width: 20px;
  color: #ffffff;
}

/* ============================================================================
 * 2. CHAT BUBBLE WINDOW (Minimalist Floating Bubble Style)
 * ============================================================================ */
#nexora-ai-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--nexora-ai-z) + 10);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#nexora-ai-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

#nexora-ai-drawer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  top: auto;
  width: min(370px, calc(100vw - 32px));
  height: min(490px, calc(100vh - 110px));
  max-height: 520px;
  z-index: calc(var(--nexora-ai-z) + 20);
  display: flex;
  flex-direction: column;
  background: var(--nexora-bg-base);
  color: var(--nexora-text-primary);
  border: 1px solid var(--nexora-border-default);
  border-radius: 18px;
  box-shadow: 0 16px 44px -8px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06);
  font-family: var(--mantine-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  transform: translateY(14px) scale(0.96);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
  overflow: hidden;
}

#nexora-ai-drawer.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* UI Style Adaptation: MINIMAL vs CLASSIC */
#nexora-ai-drawer[data-ui-style="minimal"],
[data-ui-style="minimal"] #nexora-ai-drawer {
  background: rgba(13, 13, 17, 0.82);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

#nexora-ai-drawer[data-ui-style="minimal"] .nexora-ai-header,
[data-ui-style="minimal"] #nexora-ai-drawer .nexora-ai-header {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 14px;
}

#nexora-ai-drawer[data-ui-style="minimal"] .nexora-ai-footer,
[data-ui-style="minimal"] #nexora-ai-drawer .nexora-ai-footer {
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
}

#nexora-ai-drawer[data-ui-style="minimal"] .nexora-ai-input-wrap,
[data-ui-style="minimal"] #nexora-ai-drawer .nexora-ai-input-wrap {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

#nexora-ai-drawer[data-ui-style="minimal"] .nexora-ai-body,
[data-ui-style="minimal"] #nexora-ai-drawer .nexora-ai-body {
  background: transparent;
}

#nexora-ai-drawer[data-ui-style="minimal"] .nexora-ai-msg.assistant .nexora-ai-bubble,
[data-ui-style="minimal"] #nexora-ai-drawer .nexora-ai-msg.assistant .nexora-ai-bubble {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
}

#nexora-ai-drawer[data-ui-style="classic"],
[data-ui-style="classic"] #nexora-ai-drawer {
  background: #111114;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.85);
}

#nexora-ai-drawer[data-ui-style="classic"] .nexora-ai-header,
[data-ui-style="classic"] #nexora-ai-drawer .nexora-ai-header {
  background: #16161a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 14px;
}

#nexora-ai-drawer[data-ui-style="classic"] .nexora-ai-footer,
[data-ui-style="classic"] #nexora-ai-drawer .nexora-ai-footer {
  background: #16161a;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
}

#nexora-ai-drawer[data-ui-style="classic"] .nexora-ai-input-wrap,
[data-ui-style="classic"] #nexora-ai-drawer .nexora-ai-input-wrap {
  background: #0d0d10;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

#nexora-ai-drawer[data-ui-style="classic"] .nexora-ai-body,
[data-ui-style="classic"] #nexora-ai-drawer .nexora-ai-body {
  background: #111114;
}

#nexora-ai-drawer[data-ui-style="classic"] .nexora-ai-msg.assistant .nexora-ai-bubble,
[data-ui-style="classic"] #nexora-ai-drawer .nexora-ai-msg.assistant .nexora-ai-bubble {
  background: #18181c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

@media (max-width: 640px) {
  #nexora-ai-drawer {
    right: 10px;
    left: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: min(470px, calc(78vh - 20px));
    max-height: 480px;
    border-radius: 18px;
    transform-origin: bottom center;
  }
}

/* Header */
.nexora-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--nexora-border-subtle);
  background: #0d0d10;
  flex-shrink: 0;
}

.nexora-ai-aspect-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.nexora-ai-aspect-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--nexora-radius-md);
  background: #18181c;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--nexora-border-default);
  overflow: hidden;
}

.nexora-ai-aspect-info {
  min-width: 0;
}

.nexora-ai-aspect-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--nexora-text-primary);
}

.nexora-ai-aspect-skin-pill {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--nexora-text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nexora-ai-aspect-sub {
  font-size: 11px;
  color: var(--nexora-text-muted);
  margin-top: 2px;
}

.nexora-ai-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.nexora-ai-btn-pill {
  height: 28px;
  padding: 0 9px;
  border-radius: var(--nexora-radius-sm);
  border: 1px solid var(--nexora-border-default);
  background: #18181c;
  color: var(--nexora-text-primary);
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nexora-ai-btn-pill:hover {
  background: #222226;
  border-color: var(--nexora-border-hover);
}

.nexora-ai-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--nexora-radius-sm);
  border: 1px solid var(--nexora-border-subtle);
  background: transparent;
  color: var(--nexora-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
}

.nexora-ai-icon-btn:hover {
  background: #1c1c20;
  color: #ffffff;
  border-color: var(--nexora-border-default);
}

.nexora-ai-close-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--nexora-radius-sm);
  border: none;
  background: transparent;
  color: var(--nexora-text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.nexora-ai-close-btn:hover {
  background: #1c1c20;
  color: #ffffff;
}

/* ============================================================================
 * 3. IN-DRAWER SETTINGS PANEL (Collapsible, Clean Mantine Style)
 * ============================================================================ */
.nexora-ai-settings-panel {
  padding: 14px;
  border-bottom: 1px solid var(--nexora-border-subtle);
  background: #0e0e11;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nexora-ai-settings-panel.hidden {
  display: none !important;
}

.nexora-ai-field {
  display: flex;
  flex-direction: column;
}

.nexora-ai-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--nexora-text-muted);
  margin-bottom: 4px;
}

.nexora-ai-input,
.nexora-ai-select {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--nexora-radius-sm);
  background: #141417;
  border: 1px solid var(--nexora-border-default);
  color: #ffffff;
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.nexora-ai-input:focus,
.nexora-ai-select:focus {
  border-color: var(--nexora-border-hover);
}

.nexora-ai-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--nexora-radius-sm);
  border: 1px solid var(--nexora-border-default);
  background: #18181b;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.nexora-ai-btn:hover {
  background: #222226;
  border-color: var(--nexora-border-hover);
}

.nexora-ai-btn.primary {
  background: var(--nexora-btn-primary-bg);
  color: var(--nexora-btn-primary-text);
  border-color: var(--nexora-btn-primary-bg);
  font-weight: 600;
}

.nexora-ai-btn.primary:hover {
  background: #e4e4e7;
  border-color: #e4e4e7;
}

/* ============================================================================
 * 4. CHAT BODY & MESSAGE BUBBLES
 * ============================================================================ */
.nexora-ai-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--nexora-bg-base);
}

/* Minimal Hero Empty State */
.nexora-ai-hero-empty {
  margin: auto 0;
  padding: 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.nexora-ai-hero-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--nexora-radius-lg);
  background: #141417;
  border: 1px solid var(--nexora-border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.nexora-ai-hero-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.nexora-ai-hero-quote {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--nexora-text-secondary);
  font-style: italic;
  max-width: 340px;
}

.nexora-ai-hero-hint {
  font-size: 11px;
  color: var(--nexora-text-muted);
  margin-top: 6px;
}

/* Messages */
.nexora-ai-msg {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  animation: nexoraMsgFade 0.18s var(--nexora-ease);
}

@keyframes nexoraMsgFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.nexora-ai-msg.user {
  align-self: flex-end;
}

.nexora-ai-msg.user .nexora-ai-bubble {
  background: #1f1f23;
  color: #ffffff;
  border: 1px solid var(--nexora-border-default);
  border-radius: var(--nexora-radius-md) var(--nexora-radius-md) 2px var(--nexora-radius-md);
}

.nexora-ai-msg.assistant {
  align-self: flex-start;
}

.nexora-ai-msg.assistant .nexora-ai-bubble {
  background: #121215;
  color: #e4e4e7;
  border: 1px solid var(--nexora-border-subtle);
  border-radius: var(--nexora-radius-md) var(--nexora-radius-md) var(--nexora-radius-md) 2px;
}

.nexora-ai-bubble {
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Tool Execution Pills */
.nexora-ai-tools-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

.nexora-ai-tool-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--nexora-radius-sm);
  background: #141417;
  border: 1px solid var(--nexora-border-subtle);
  font-size: 11px;
  color: var(--nexora-text-secondary);
}

.nexora-ai-tool-pill-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.nexora-ai-tool-badge {
  font-weight: 700;
  color: #22c55e;
  font-size: 11px;
}

.nexora-ai-tool-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nexora-ai-tool-goto {
  padding: 2px 6px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid var(--nexora-border-default);
  color: var(--nexora-text-primary);
  font-size: 10.5px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.nexora-ai-tool-goto:hover {
  background: #222226;
}

/* ============================================================================
 * 5. FOOTER & SINGLE MINIMALIST INPUT WITH ACCIONES DROPDOWN
 * ============================================================================ */
.nexora-ai-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--nexora-border-subtle);
  background: #0d0d10;
  flex-shrink: 0;
  position: relative;
}

.nexora-ai-input-wrap {
  display: flex;
  flex-direction: column;
  border-radius: var(--nexora-radius-md);
  background: #141417;
  border: 1px solid var(--nexora-border-default);
  transition: border-color 0.15s ease;
  overflow: visible;
  position: relative;
  z-index: 10;
}

.nexora-ai-input-wrap:focus-within {
  border-color: var(--nexora-border-hover);
}

.nexora-ai-textarea {
  width: 100%;
  min-height: 36px;
  max-height: 120px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.45;
  padding: 8px 10px 4px 10px;
  resize: none;
  outline: none;
  box-sizing: border-box;
}

.nexora-ai-textarea::placeholder {
  color: var(--nexora-text-muted);
}

.nexora-ai-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 6px 6px;
  position: relative;
}

/* Dropdown Button (Clean Dark Matte) */
.nexora-ai-dropdown-btn {
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid var(--nexora-border-default);
  background: #1a1a1e;
  color: var(--nexora-text-primary);
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nexora-ai-dropdown-btn:hover {
  background: #242429;
  border-color: var(--nexora-border-hover);
}

/* Floating Actions Dropdown Menu (Clean Dark Raycast/Linear Style) */
.nexora-ai-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: min(320px, calc(100vw - 48px));
  background: #111114;
  border: 1px solid var(--nexora-border-default);
  border-radius: var(--nexora-radius-md);
  box-shadow: var(--nexora-shadow-menu);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
  animation: nexoraMenuPop 0.15s var(--nexora-ease);
}

.nexora-ai-dropdown-menu.hidden {
  display: none !important;
}

@keyframes nexoraMenuPop {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.nexora-ai-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: #e4e4e7;
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  width: 100%;
  box-sizing: border-box;
}

.nexora-ai-dropdown-item:hover {
  background: #1c1c21;
  color: #ffffff;
}

.nexora-ai-dropdown-item-icon {
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1;
}

.nexora-ai-dropdown-item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nexora-ai-toolbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nexora-ai-mic-btn {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--nexora-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.15s ease;
}

.nexora-ai-mic-btn:hover {
  background: #222226;
  color: #ffffff;
}

.nexora-ai-mic-btn.recording {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.nexora-ai-send-btn {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: none;
  background: var(--nexora-btn-primary-bg);
  color: var(--nexora-btn-primary-text);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nexora-ai-send-btn:hover:not(:disabled) {
  background: #e4e4e7;
}

.nexora-ai-send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ============================================================================
 * 6. MODAL DE PERSONALIZACIÓN DE ASPECTOS (Native Mantine Modal Style)
 * ============================================================================ */
.nexora-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--nexora-ai-z) + 30);
  background: rgba(0, 0, 0, 0.7);
  transition: opacity 0.2s ease;
}

.nexora-modal-backdrop.hidden {
  display: none !important;
}

.nexora-aspects-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  z-index: calc(var(--nexora-ai-z) + 35);
  background: #0d0d10;
  border: 1px solid var(--nexora-border-default);
  border-radius: var(--nexora-radius-lg);
  box-shadow: var(--nexora-shadow-elevated);
  color: var(--nexora-text-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: nexoraModalEnter 0.2s var(--nexora-ease);
}

.nexora-aspects-modal.hidden {
  display: none !important;
}

@keyframes nexoraModalEnter {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Modal Header */
.nexora-aspects-header,
.nexora-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--nexora-border-subtle);
  background: #0d0d10;
  gap: 12px;
}

.nexora-aspects-title-group {
  flex: 1;
  min-width: 0;
}

.nexora-aspects-title,
.nexora-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nexora-aspects-subtitle {
  font-size: 11.5px;
  color: var(--nexora-text-muted);
  margin-top: 2px;
}

.nexora-aspects-points-badge,
.nexora-modal-points-badge {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  padding: 4px 9px;
  border-radius: var(--nexora-radius-sm);
  background: #18181c;
  border: 1px solid var(--nexora-border-default);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.nexora-aspects-close {
  width: 28px;
  height: 28px;
  border-radius: var(--nexora-radius-sm);
  border: none;
  background: transparent;
  color: var(--nexora-text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.nexora-aspects-close:hover {
  background: #1c1c20;
  color: #ffffff;
}

/* Modal Body */
.nexora-aspects-body,
.nexora-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #0d0d10;
}

/* Aspect Carousel Tabs (Segmented Control Style) */
.nexora-aspects-carousel {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 18px 4px 18px;
  background: #0d0d10;
  border-bottom: 1px solid var(--nexora-border-subtle);
  scrollbar-width: thin;
}

.nexora-aspect-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--nexora-radius-sm);
  border: 1px solid var(--nexora-border-subtle);
  background: #141417;
  color: var(--nexora-text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  font-size: 11.5px;
}

.nexora-aspect-pill:hover {
  background: #1c1c20;
  color: #ffffff;
  border-color: var(--nexora-border-default);
}

.nexora-aspect-pill.selected {
  background: #242429;
  border-color: #ffffff;
  color: #ffffff;
  font-weight: 600;
}

.nexora-aspect-pill-badge {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: #ffffff;
  color: #000000;
  font-weight: 700;
}

/* Active Aspect Showcase */
.nexora-aspect-showcase {
  display: flex;
  gap: 14px;
  padding: 14px;
  border-radius: var(--nexora-radius-md);
  background: #121215;
  border: 1px solid var(--nexora-border-subtle);
  align-items: center;
}

.nexora-aspect-avatar-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 110px;
  padding: 8px;
  border-radius: var(--nexora-radius-md);
  background: #18181c;
  border: 1px solid var(--nexora-border-default);
  flex-shrink: 0;
}

.nexora-angles-toggle-btn {
  background: #242429;
  border: 1px solid var(--nexora-border-default);
  border-radius: 4px;
  color: var(--nexora-text-secondary);
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nexora-angles-toggle-btn:hover {
  background: #32323a;
  color: #ffffff;
}

.nexora-3d-sheet-preview {
  width: 120px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  background: #09090b;
  border: 1px solid var(--nexora-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nexora-3d-sheet-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.nexora-reactions-preview-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.nexora-reaction-preview-lbl {
  font-size: 10.5px;
  color: var(--nexora-text-muted);
}

.nexora-preview-react-btn {
  background: #1c1c21;
  border: 1px solid var(--nexora-border-subtle);
  border-radius: 4px;
  color: var(--nexora-text-secondary);
  font-size: 10.5px;
  padding: 2px 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nexora-preview-react-btn:hover {
  background: #27272f;
  color: #ffffff;
  border-color: #52525b;
}

.nexora-aspect-info {
  flex: 1;
  min-width: 0;
}

.nexora-aspect-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nexora-aspect-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.nexora-aspect-role {
  font-size: 11px;
  color: var(--nexora-text-muted);
}

.nexora-aspect-lore {
  font-size: 11.5px;
  color: var(--nexora-text-secondary);
  margin-top: 3px;
  line-height: 1.4;
}

.nexora-aspect-quote-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: var(--nexora-radius-sm);
  background: #18181c;
  border-left: 2px solid #52525b;
}

.nexora-aspect-quote-text {
  font-size: 11.5px;
  color: #d4d4d8;
  font-style: italic;
  flex: 1;
}

.nexora-aspect-reroll-btn {
  background: transparent;
  border: 1px solid var(--nexora-border-default);
  border-radius: 4px;
  color: var(--nexora-text-muted);
  font-size: 10.5px;
  padding: 3px 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.nexora-aspect-reroll-btn:hover {
  background: #242429;
  color: #ffffff;
}

/* Skins Gallery */
.nexora-skins-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nexora-skins-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
}

.nexora-skins-hint {
  font-size: 11px;
  color: var(--nexora-text-muted);
  font-weight: 400;
}

.nexora-skins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.nexora-skin-card {
  padding: 12px;
  border-radius: var(--nexora-radius-md);
  background: #141417;
  border: 1px solid var(--nexora-border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease;
}

.nexora-skin-card:hover {
  border-color: var(--nexora-border-default);
}

.nexora-skin-card.active-card {
  border-color: #ffffff;
  background: #18181c;
}

.nexora-skin-preview {
  height: 52px;
  border-radius: var(--nexora-radius-sm);
  background: #101013;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--nexora-border-subtle);
}

.nexora-skin-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.nexora-skin-title {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
}

.nexora-skin-badge {
  font-size: 9.5px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 3px;
  background: #222226;
  color: var(--nexora-text-muted);
}

.nexora-skin-badge.legendary {
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.nexora-skin-badge.epic {
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.2);
}

.nexora-skin-badge.rare {
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.nexora-skin-desc {
  font-size: 11px;
  color: var(--nexora-text-muted);
  line-height: 1.35;
}

.nexora-skin-actions {
  margin-top: auto;
}

.nexora-skin-btn {
  width: 100%;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--nexora-radius-sm);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
  border: none;
}

.nexora-skin-btn.equip {
  background: var(--nexora-btn-primary-bg);
  color: var(--nexora-btn-primary-text);
  font-weight: 600;
}

.nexora-skin-btn.equip:hover {
  background: #e4e4e7;
}

.nexora-skin-btn.unlock {
  background: #18181c;
  color: #ffffff;
  border: 1px solid var(--nexora-border-default);
}

.nexora-skin-btn.unlock:hover:not(.disabled) {
  background: #242429;
  border-color: var(--nexora-border-hover);
}

.nexora-skin-btn.unlock.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nexora-skin-btn.equipped {
  background: #222226;
  color: var(--nexora-text-muted);
  cursor: default;
}

/* Token Optimizer Box */
.nexora-token-optimizer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--nexora-radius-md);
  background: #121215;
  border: 1px solid var(--nexora-border-subtle);
  gap: 12px;
}

.nexora-token-optimizer-left {
  flex: 1;
}

.nexora-token-optimizer-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
}

.nexora-token-optimizer-desc {
  font-size: 11px;
  color: var(--nexora-text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

/* Switch */
.nexora-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.nexora-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.nexora-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #27272a;
  border-radius: 999px;
  transition: 0.2s;
}

.nexora-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: 0.2s;
}

.nexora-switch input:checked + .nexora-slider {
  background-color: #ffffff;
}

.nexora-switch input:checked + .nexora-slider:before {
  transform: translateX(16px);
  background-color: #000000;
}

/* ============================================================================
 * 7. NOTIFICATIONS & FLOATING ELEMENTS (Cleaned up, non-intrusive)
 * ============================================================================ */
/* Hide the comic popup bubble so it never intrudes on the user's workspace */
.nexora-reaction-bubble,
#nexora-aspect-reaction-bubble {
  display: none !important;
}

/* Minimal Points Toast (Dark pill, non-distracting) */
.nexora-points-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: calc(var(--nexora-ai-z) + 100);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--nexora-radius-md);
  background: #141417;
  border: 1px solid var(--nexora-border-default);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  animation: nexoraToastIn 0.2s var(--nexora-ease);
}

.nexora-points-toast.out {
  animation: nexoraToastOut 0.2s var(--nexora-ease) forwards;
}

@keyframes nexoraToastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes nexoraToastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

.nexora-points-toast-icon {
  font-size: 13px;
}

.nexora-points-toast-val {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

.nexora-points-toast-reason {
  font-size: 11px;
  color: var(--nexora-text-secondary);
}

/* ============================================================================
 * 8. AVATAR KEYFRAME ANIMATIONS (Vector SVG)
 * ============================================================================ */
@keyframes nexoraClippyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes nexoraCortanaSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes nexoraVerityFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes nexoraWrenchGlitch {
  0%, 90%, 100% { opacity: 1; transform: translate(0, 0); }
  92% { opacity: 0.8; transform: translate(-1px, 1px); }
  94% { opacity: 1; transform: translate(1px, -1px); }
}

@keyframes nexoraVaultWink {
  0%, 90%, 100% { transform: scale(1); }
  95% { transform: scale(0.96); }
}

@keyframes nexoraManosoEyeMove {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(2px); }
}

@keyframes nexoraJunimoBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px) scaleY(1.05); }
}

@keyframes nexoraCigarSmoke {
  0% { opacity: 0.2; transform: translateY(0); }
  50% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-4px); }
}

@keyframes nexoraR2Eye {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ============================================================================
 * 9. NEXORA 3D AVATAR SYSTEM & REACTIVE ANIMATIONS
 * ============================================================================ */
.nexora-3d-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  perspective: 700px;
  transform-style: preserve-3d;
  flex-shrink: 0;
  user-select: none;
}

.nexora-3d-avatar-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #27272a, #09090b);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
  transform: translateZ(0);
}

.nexora-3d-avatar:hover .nexora-3d-avatar-inner {
  transform: rotateY(-8deg) rotateX(6deg) scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.nexora-3d-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.nexora-3d-avatar-glare {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.03) 45%, transparent 60%);
}

/* 3D Activity Reaction Animations */
@keyframes nexora3dCelebrate {
  0% { transform: scale(1) rotateY(0deg); }
  25% { transform: translateY(-10px) scale(1.15) rotateY(90deg); }
  50% { transform: translateY(-14px) scale(1.2) rotateY(180deg); }
  75% { transform: translateY(-6px) scale(1.12) rotateY(270deg); }
  100% { transform: translateY(0) scale(1) rotateY(360deg); }
}

@keyframes nexora3dIncome {
  0% { transform: scale(1); filter: brightness(1); }
  30% { transform: scale(1.2) rotateY(-10deg); filter: brightness(1.35) drop-shadow(0 0 14px rgba(250, 204, 21, 0.6)); }
  60% { transform: scale(1.15) rotateY(10deg); filter: brightness(1.25) drop-shadow(0 0 10px rgba(250, 204, 21, 0.4)); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes nexora3dExpense {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px) rotateZ(-5deg) scale(0.95); }
  40% { transform: translateX(6px) rotateZ(5deg) scale(0.95); }
  60% { transform: translateX(-4px) rotateZ(-3deg); }
  80% { transform: translateX(4px) rotateZ(3deg); }
  100% { transform: translateX(0) rotateZ(0) scale(1); }
}

@keyframes nexora3dGlitch {
  0% { transform: translate(0); }
  20% { transform: translate(-3px, 2px) skewX(2deg); filter: contrast(1.4) hue-rotate(90deg); }
  40% { transform: translate(3px, -2px) skewY(-2deg); filter: contrast(1.5) hue-rotate(180deg); }
  60% { transform: translate(-2px, -1px); filter: contrast(1.3) hue-rotate(270deg); }
  80% { transform: translate(2px, 1px); filter: contrast(1.2) hue-rotate(360deg); }
  100% { transform: translate(0); filter: none; }
}

.nexora-react-celebrate {
  animation: nexora3dCelebrate 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.nexora-react-income {
  animation: nexora3dIncome 1.1s ease-out !important;
}

.nexora-react-expense {
  animation: nexora3dExpense 0.85s ease-in-out !important;
}

.nexora-react-glitch {
  animation: nexora3dGlitch 0.6s steps(4) infinite !important;
}


/* ============================================================================
 * 3D FLOATING ASSISTANT AVATAR (REPLACES OLD TEXT PILL)
 * ============================================================================ */
#nexora-ai-fab-wrap {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.25), left 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.25), right 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.25), top 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.25);
}

#nexora-ai-fab-wrap.is-dragging {
  transition: none !important;
  cursor: grabbing !important;
  z-index: 10005 !important;
}

#nexora-ai-fab-wrap.is-dragging #nexora-ai-fab {
  cursor: grabbing !important;
  transform: scale(1.12) translateY(-6px) !important;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 16px rgba(99, 102, 241, 0.5)) !important;
}

#nexora-ai-fab-wrap.is-dragging #nexora-ai-fab-dock,
#nexora-ai-fab-wrap.is-dragging .nexora-avatar-speech-bubble {
  opacity: 0.1 !important;
  pointer-events: none !important;
}

#nexora-ai-fab-wrap.drag-arming #nexora-ai-fab {
  transform: scale(1.06);
  filter: drop-shadow(0 0 14px rgba(99, 102, 241, 0.65));
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Left edge styles */
#nexora-ai-fab-wrap.side-left {
  flex-direction: row-reverse;
}

#nexora-ai-fab-wrap.side-left #nexora-ai-fab-dock {
  margin-left: 0;
  margin-right: 2px;
}

#nexora-ai-fab-wrap.side-left #nexora-ai-fab-dock svg {
  transform: rotate(180deg);
}

#nexora-ai-fab-wrap.side-left.collapsed {
  transform: translateX(calc(-100% + 24px));
}

#nexora-ai-fab-wrap.side-left #nexora-ai-fab-tab {
  border-radius: 0 12px 12px 0;
  border-left: none;
  border-right: 1px solid var(--app-border-color, #27272a);
  box-shadow: 4px 4px 16px rgba(0, 0, 0, 0.6);
}

#nexora-ai-fab-wrap.side-left #nexora-ai-fab-tab:hover {
  transform: translateX(4px);
}

#nexora-ai-fab-wrap.side-left #nexora-ai-fab-tab svg {
  transform: rotate(180deg);
}

#nexora-ai-fab-wrap.side-left .nexora-avatar-speech-bubble {
  right: auto;
  left: 0;
}

#nexora-ai-fab-wrap.side-left .nexora-avatar-speech-bubble::after {
  right: auto;
  left: 32px;
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

/* Mobile positioning: fallback when no dynamic inline style is set */
@media (max-width: 768px) {
  #nexora-ai-fab-wrap:not([style*="top"]) {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 104px);
    right: 14px;
  }

  #nexora-ai-fab-wrap.collapsed:not([style*="top"]) {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 104px);
    transform: translateX(calc(100% - 24px));
  }

  .nexora-3d-floating-trigger {
    width: 64px !important;
    height: 76px !important;
  }

  .nexora-avatar-3d-body {
    width: 60px !important;
    height: 64px !important;
  }

  .nexora-avatar-floor-shadow {
    width: 44px !important;
    height: 8px !important;
  }
}

#nexora-ai-fab-wrap.collapsed {
  transform: translateX(calc(100% - 24px));
}

#nexora-ai-fab-wrap.collapsed #nexora-ai-fab,
#nexora-ai-fab-wrap.collapsed #nexora-ai-fab-dock,
#nexora-ai-fab-wrap.collapsed #nexora-avatar-speech-bubble {
  display: none !important;
}

#nexora-ai-fab-wrap.collapsed #nexora-ai-fab-tab {
  display: flex !important;
}

#nexora-ai-fab-tab {
  display: none;
  width: 44px;
  height: 48px;
  background: #141417;
  border: 1px solid var(--app-border-color, #27272a);
  border-right: none;
  border-radius: 12px 0 0 12px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: -4px 4px 16px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease, background 0.15s ease;
}

#nexora-ai-fab-tab:hover {
  background: #1c1c20;
  transform: translateX(-4px);
}

.nexora-3d-floating-trigger {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 76px;
  height: 90px;
  user-select: none;
}

.nexora-avatar-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  perspective: 700px;
}

.nexora-avatar-3d-body {
  position: relative;
  width: 72px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  animation: nexoraIdleFloat 3.8s ease-in-out infinite;
  transition: filter 0.25s ease;
  will-change: transform;
}

.nexora-3d-floating-char {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.7));
  pointer-events: none;
  user-select: none;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.nexora-3d-floating-trigger:hover .nexora-3d-floating-char {
  transform: scale(1.08) translateY(-4px);
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.85));
}

.nexora-3d-floating-trigger:active .nexora-3d-floating-char {
  transform: scale(0.94) translateY(2px);
}

.nexora-avatar-floor-shadow {
  width: 52px;
  height: 10px;
  margin-top: -6px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(3px);
  animation: nexoraShadowPulse 3.8s ease-in-out infinite;
  pointer-events: none;
}

#nexora-ai-fab-dock {
  background: #141417;
  border: 1px solid var(--app-border-color, #27272a);
  color: #71717a;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  margin-left: 2px;
  margin-bottom: 8px;
  transition: all 0.15s ease;
}

#nexora-ai-fab-dock:hover {
  color: #ffffff;
  background: #27272a;
}

/* Floating speech bubble */
.nexora-avatar-speech-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  max-width: 280px;
  min-width: 140px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(18, 18, 22, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-family: var(--mantine-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 500;
  pointer-events: none;
  animation: nexoraBubbleIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

.nexora-avatar-speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 32px;
  width: 10px;
  height: 10px;
  background: rgba(18, 18, 22, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transform: rotate(45deg);
}

@keyframes nexoraBubbleIn {
  from { opacity: 0; transform: translateY(8px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes nexoraIdleFloat {
  0%, 100% { transform: translateY(0px) rotateX(0deg); }
  50% { transform: translateY(-7px) rotateX(2deg); }
}

@keyframes nexoraShadowPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(0.82); opacity: 0.45; }
}

/* Personality Animations on Actions */
.nexora-avatar-3d-body.nexora-anim-celebrate {
  animation: nexoraAnimCelebrate 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

.nexora-avatar-3d-body.nexora-anim-income {
  animation: nexoraAnimIncome 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

.nexora-avatar-3d-body.nexora-anim-expense {
  animation: nexoraAnimExpense 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

.nexora-avatar-3d-body.nexora-anim-glitch {
  animation: nexoraAnimGlitch 0.5s ease !important;
}

@keyframes nexoraAnimCelebrate {
  0% { transform: scale(1) rotateY(0deg); }
  30% { transform: scale(1.22) translateY(-16px) rotateY(180deg); }
  60% { transform: scale(1.15) translateY(-8px) rotateY(360deg); }
  100% { transform: scale(1) translateY(0) rotateY(360deg); }
}

@keyframes nexoraAnimIncome {
  0% { transform: scale(1); }
  35% { transform: scale(1.2) translateY(-10px); filter: drop-shadow(0 0 16px rgba(250, 204, 21, 0.8)); }
  70% { transform: scale(1.1) translateY(-4px); filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.5)); }
  100% { transform: scale(1) translateY(0); }
}

@keyframes nexoraAnimExpense {
  0%, 100% { transform: translateX(0) rotateZ(0deg); }
  20% { transform: translateX(-6px) rotateZ(-6deg); }
  40% { transform: translateX(6px) rotateZ(6deg); }
  60% { transform: translateX(-4px) rotateZ(-4deg); }
  80% { transform: translateX(4px) rotateZ(4deg); }
}

@keyframes nexoraAnimGlitch {
  0%, 100% { transform: translate(0); filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.7)); }
  20% { transform: translate(-3px, 2px); filter: hue-rotate(90deg) drop-shadow(-3px 0 #ef4444); }
  40% { transform: translate(3px, -2px); filter: hue-rotate(270deg) drop-shadow(3px 0 #06b6d4); }
  60% { transform: translate(-2px, -1px); }
  80% { transform: translate(2px, 1px); }
}

.nexora-showcase-avatar-float {
  animation: nexoraIdleFloat 4.2s ease-in-out infinite;
}

@keyframes nexoraPushUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Guarantee removal of white square in top navigation rail */

.nexora-rail-icon-slot > div[style*="maskImage: url(/nexora-logo"],
.nexora-rail-icon-slot > div[style*="mask-image: url(/nexora-logo"],
.nexora-rail-icon-slot > div[style*="nexora-logo"],
.nexora-rail-icon-slot > div[style*="maskImage: url(/nexora-logo"],
.nexora-rail-icon-slot > div[style*="mask-image: url(/nexora-logo"],
.nexora-rail-icon-slot > div[style*="nexora-logo"],
div[style*="nexora-logo-192.png"]:not(.nexora-splash-logo):not(.nexora-brand-logo) {
  display: none !important;
}

/* Smooth transition for SVG wave path and numbers in Finanzas */
svg path {
  transition: d 0.65s cubic-bezier(0.2, 0.8, 0.2, 1), fill 0.65s ease, stroke 0.65s ease;
}

svg line {
  transition: y1 0.65s cubic-bezier(0.2, 0.8, 0.2, 1), y2 0.65s cubic-bezier(0.2, 0.8, 0.2, 1), stroke-opacity 0.65s ease;
}

svg stop {
  transition: offset 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Nexora Minimalist Currency Switcher Button */
.nexora-currency-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--app-border-color, rgba(255, 255, 255, 0.12));
  color: var(--mantine-color-text, #ffffff);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
  user-select: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  line-height: 1.35;
  outline: none;
}

.nexora-currency-switch-btn:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.nexora-currency-switch-btn:active {
  transform: scale(0.96) translateY(0);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.nexora-currency-switch-btn .nexora-curr-icon {
  opacity: 0.7;
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
  flex-shrink: 0;
}

.nexora-currency-switch-btn:hover .nexora-curr-icon {
  opacity: 1;
  transform: rotate(180deg);
}

[data-mantine-color-scheme="light"] .nexora-currency-switch-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1a1a1a;
}

[data-mantine-color-scheme="light"] .nexora-currency-switch-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.22);
  color: #000000;
}

/* Rolling Number Odometer Animation (Clock/Pomodoro Style) */
.nexora-rolling-num {
  display: inline-block;
  animation: nexoraRollingNum 0.52s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, opacity, filter;
}

@keyframes nexoraRollingNum {
  0% {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(2.5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* ============================================================================
 * MOBILE QUICK HOME BUTTON (Boton de la Casita para Inicio en Celular)
 * ============================================================================ */
.nexora-mobile-home-btn {
  display: none;
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 84px);
  left: 14px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 18, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
  cursor: pointer;
  z-index: calc(var(--nexora-ai-z) - 5);
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, background 0.15s ease;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
}

.nexora-mobile-home-btn.visible {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.nexora-mobile-home-btn:hover {
  background: rgba(28, 28, 34, 0.95);
  border-color: rgba(255, 255, 255, 0.22);
}

.nexora-mobile-home-btn:active {
  transform: scale(0.92);
}

@media (min-width: 769px) {
  .nexora-mobile-home-btn {
    display: none !important;
  }
}
