@charset "UTF-8";
:root {
  --zr-font-primary: 'source-sans-pro', sans-serif;
  --zr-font-mono: 'source-code-pro', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  --zr-font-display: 'proxima-nova', 'source-sans-pro', sans-serif;
  --zr-font-extralight: 200;
  --zr-font-light: 300;
  --zr-font-normal: 400;
  --zr-font-medium: 500;
  --zr-font-semibold: 600;
  --zr-font-bold: 700;
  --zr-font-black: 900;
  --zr-code-regular: 400;
  --zr-code-medium: 500;
  --zr-code-semibold: 600;
  --zr-code-bold: 700;
  --zr-text-xs: 0.75rem;
  --zr-text-sm: 0.875rem;
  --zr-text-base: 1rem;
  --zr-text-lg: 1.125rem;
  --zr-text-xl: 1.25rem;
  --zr-text-2xl: 1.5rem;
  --zr-text-3xl: 1.875rem;
  --zr-text-4xl: 2.25rem;
  --zr-leading-none: 1;
  --zr-leading-tight: 1.25;
  --zr-leading-snug: 1.375;
  --zr-leading-normal: 1.5;
  --zr-leading-relaxed: 1.625;
  --zr-leading-loose: 2;
  --zr-tracking-tighter: -0.05em;
  --zr-tracking-tight: -0.025em;
  --zr-tracking-normal: 0em;
  --zr-tracking-wide: 0.025em;
  --zr-tracking-wider: 0.05em;
  --zr-space-1: 0.25rem;
  --zr-space-2: 0.5rem;
  --zr-space-3: 0.75rem;
  --zr-space-4: 1rem;
  --zr-space-5: 1.25rem;
  --zr-space-6: 1.5rem;
  --zr-space-8: 2rem;
  --zr-space-10: 2.5rem;
  --zr-space-12: 3rem;
}

:root {
  --zr-primary: #0D9488;
  --zr-primary-50: #F0FDFA;
  --zr-primary-100: #CCFBF1;
  --zr-primary-200: #99F6E4;
  --zr-primary-300: #5EEAD4;
  --zr-primary-400: #2DD4BF;
  --zr-primary-500: #14B8A6;
  --zr-primary-600: #0D9488;
  --zr-primary-700: #0F766E;
  --zr-primary-800: #115E59;
  --zr-primary-900: #134E4A;
  --zr-primary-hover: #0F766E;
  --zr-primary-light: #CCFBF1;
  --zr-primary-dark: #115E59;
  --zr-primary-rgb: 13, 148, 136;
  --zr-accent: #F59E0B;
  --zr-accent-50: #FFFBEB;
  --zr-accent-100: #FEF3C7;
  --zr-accent-200: #FDE68A;
  --zr-accent-300: #FCD34D;
  --zr-accent-400: #FBBF24;
  --zr-accent-500: #F59E0B;
  --zr-accent-600: #D97706;
  --zr-accent-700: #B45309;
  --zr-accent-800: #92400E;
  --zr-accent-900: #78350F;
  --zr-accent-hover: #D97706;
  --zr-accent-light: #FEF3C7;
  --zr-accent-rgb: 245, 158, 11;
  --zr-success: #10B981;
  --zr-success-bg: #064E3B;
  --zr-success-light: #D1FAE5;
  --zr-success-rgb: 16, 185, 129;
  --zr-warning: #F59E0B;
  --zr-warning-bg: #78350F;
  --zr-warning-light: #FEF3C7;
  --zr-warning-rgb: 245, 158, 11;
  --zr-error: #EF4444;
  --zr-error-bg: #7F1D1D;
  --zr-error-light: #FEE2E2;
  --zr-error-rgb: 239, 68, 68;
  --zr-info: #06B6D4;
  --zr-info-bg: #164E63;
  --zr-info-light: #CFFAFE;
  --zr-info-rgb: 6, 182, 212;
  --zr-think: #8B5CF6;
  --zr-think-light: #EDE9FE;
  --zr-think-rgb: 139, 92, 246;
}

:root,
[data-theme=dark] {
  --zr-bg-primary: #0F172A;
  --zr-bg-secondary: #1E293B;
  --zr-bg-tertiary: #334155;
  --zr-bg-quaternary: #475569;
  --zr-bg-hover: #1E3A5F;
  --zr-bg-active: #0F4C4C;
  --zr-bg-overlay: rgba(15, 23, 42, 0.9);
  --zr-text-primary: #F1F5F9;
  --zr-text-secondary: #CBD5E1;
  --zr-text-tertiary: #94A3B8;
  --zr-text-muted: #64748B;
  --zr-text-inverse: #0F172A;
  --zr-text-disabled: #475569;
  --zr-border: #334155;
  --zr-border-hover: #475569;
  --zr-border-focus: var(--zr-primary);
  --zr-border-light: #1E293B;
  --zr-border-strong: #64748B;
  --zr-user-message-bg: #134E4A;
  --zr-user-message-border: #0F766E;
  --zr-assistant-message-bg: transparent;
  --zr-assistant-message-border: var(--zr-border);
  --zr-message-border-left: var(--zr-primary);
  --zr-message-hover-bg: rgba(13, 148, 136, 0.08);
  --zr-code-bg: #1E293B;
  --zr-code-bg-alt: #0F172A;
  --zr-code-border: #334155;
  --zr-code-header-bg: linear-gradient(135deg, #0D9488 0%, #0F766E 100%);
  --zr-code-keyword: #2DD4BF;
  --zr-code-string: #FCD34D;
  --zr-code-comment: #64748B;
  --zr-code-function: #38BDF8;
  --zr-code-variable: #F472B6;
  --zr-code-number: #FB923C;
  --zr-inline-code-bg: #1E293B;
  --zr-inline-code-text: #2DD4BF;
  --zr-inline-code-border: #334155;
  --zr-button-bg: var(--zr-primary);
  --zr-google-button-bg: var(--zr-bg-primary);
  --zr-button-bg-hover: var(--zr-primary-hover);
  --zr-button-text: #ffffff;
  --zr-button-secondary-bg: transparent;
  --zr-button-secondary-border: var(--zr-border);
  --zr-button-secondary-text: var(--zr-text-primary);
  --zr-input-bg: var(--zr-bg-secondary);
  --zr-input-border: var(--zr-border);
  --zr-input-border-focus: var(--zr-primary);
  --zr-input-text: var(--zr-text-primary);
  --zr-input-placeholder: var(--zr-text-muted);
  --zr-gradient-primary: linear-gradient(135deg, #0D9488 0%, #14B8A6 50%, #2DD4BF 100%);
  --zr-gradient-accent: linear-gradient(135deg, #F59E0B 0%, #FBBF24 50%, #FCD34D 100%);
  --zr-gradient-hero: linear-gradient(135deg, #0D9488 0%, #0F766E 40%, #115E59 100%);
  --zr-gradient-think: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 50%, #A78BFA 100%);
  --zr-gradient-text: linear-gradient(135deg, #2DD4BF 0%, #14B8A6 100%);
  --zr-glow-primary: 0 0 20px rgba(13, 148, 136, 0.4);
  --zr-glow-accent: 0 0 20px rgba(245, 158, 11, 0.4);
  --zr-glow-success: 0 0 20px rgba(16, 185, 129, 0.4);
  --zr-glow-error: 0 0 20px rgba(239, 68, 68, 0.4);
}

[data-theme=light] {
  --zr-bg-primary: #FAFAF9;
  --zr-bg-secondary: #F5F5F4;
  --zr-bg-tertiary: #FFFFFF;
  --zr-bg-quaternary: #E7E5E4;
  --zr-bg-hover: #CCFBF1;
  --zr-bg-active: #99F6E4;
  --zr-bg-overlay: rgba(250, 250, 249, 0.95);
  --zr-text-primary: #0F172A;
  --zr-text-secondary: #334155;
  --zr-text-tertiary: #64748B;
  --zr-text-muted: #94A3B8;
  --zr-text-inverse: #F1F5F9;
  --zr-text-disabled: #CBD5E1;
  --zr-border: #E7E5E4;
  --zr-border-hover: #D6D3D1;
  --zr-border-focus: var(--zr-primary);
  --zr-border-light: #F5F5F4;
  --zr-border-strong: #A8A29E;
  --zr-primary: #0F766E;
  --zr-primary-hover: #115E59;
  --zr-accent: #D97706;
  --zr-accent-hover: #B45309;
  --zr-success: #059669;
  --zr-success-bg: #D1FAE5;
  --zr-success-light: #ECFDF5;
  --zr-warning: #D97706;
  --zr-warning-bg: #FEF3C7;
  --zr-warning-light: #FFFBEB;
  --zr-error: #DC2626;
  --zr-error-bg: #FEE2E2;
  --zr-error-light: #FEF2F2;
  --zr-info: #0891B2;
  --zr-info-bg: #CFFAFE;
  --zr-info-light: #ECFEFF;
  --zr-user-message-bg: #CCFBF1;
  --zr-user-message-border: #99F6E4;
  --zr-assistant-message-bg: transparent;
  --zr-message-hover-bg: rgba(13, 148, 136, 0.06);
  --zr-code-bg: #F8FAFC;
  --zr-code-bg-alt: #F1F5F9;
  --zr-code-border: #E2E8F0;
  --zr-code-header-bg: linear-gradient(135deg, #0F766E 0%, #115E59 100%);
  --zr-code-keyword: #0F766E;
  --zr-code-string: #B45309;
  --zr-code-comment: #64748B;
  --zr-code-function: #0369A1;
  --zr-code-variable: #BE185D;
  --zr-code-number: #C2410C;
  --zr-inline-code-bg: #F1F5F9;
  --zr-inline-code-text: #0F766E;
  --zr-inline-code-border: #E2E8F0;
  --zr-input-bg: #FFFFFF;
  --zr-input-border: var(--zr-border);
  --zr-input-text: var(--zr-text-primary);
  --zr-input-placeholder: var(--zr-text-muted);
  --zr-gradient-primary: linear-gradient(135deg, #0F766E 0%, #0D9488 50%, #14B8A6 100%);
  --zr-gradient-accent: linear-gradient(135deg, #D97706 0%, #F59E0B 50%, #FBBF24 100%);
  --zr-gradient-hero: linear-gradient(135deg, #0F766E 0%, #115E59 100%);
  --zr-gradient-think: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
  --zr-gradient-text: linear-gradient(135deg, #0F766E 0%, #0D9488 100%);
  --zr-glow-primary: 0 0 15px rgba(13, 148, 136, 0.2);
  --zr-glow-accent: 0 0 15px rgba(245, 158, 11, 0.2);
  --zr-glow-success: 0 0 15px rgba(16, 185, 129, 0.2);
  --zr-glow-error: 0 0 15px rgba(239, 68, 68, 0.2);
}

:root {
  --zr-sidebar-width: 260px;
  --zr-sidebar-width-collapsed: 60px;
  --zr-sidebar-width-mobile: 280px;
  --zr-content-max-width: 1200px;
  --zr-chat-max-width: min(90vw, 800px);
  --zr-chat-max-width-xl: min(90vw, 1000px);
  --zr-prose-max-width: 65ch;
  --zr-header-height: 60px;
  --zr-footer-height: 40px;
  --zr-input-area-height: 120px;
  --zr-sidebar-current-width: var(--zr-sidebar-width);
  --zr-content-left-offset: var(--zr-sidebar-width);
  --zr-input-min-height: 44px;
  --zr-button-height: 44px;
  --zr-button-height-sm: 36px;
  --zr-button-height-lg: 52px;
  --zr-code-block-padding: var(--zr-space-4);
  --zr-code-line-height: 1.5;
  --zr-code-font-size: 0.875rem;
}

:root {
  --zr-radius-none: 0;
  --zr-radius-sm: 4px;
  --zr-radius-md: 6px;
  --zr-radius-lg: 8px;
  --zr-radius-xl: 12px;
  --zr-radius-2xl: 16px;
  --zr-radius-3xl: 24px;
  --zr-radius-full: 9999px;
  --zr-button-radius: var(--zr-radius-lg);
  --zr-input-radius: var(--zr-radius-lg);
  --zr-card-radius: var(--zr-radius-xl);
  --zr-modal-radius: var(--zr-radius-2xl);
  --zr-code-radius: var(--zr-radius-md);
}

:root {
  --zr-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --zr-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --zr-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --zr-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --zr-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --zr-shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --zr-shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  --zr-shadow-primary: 0 4px 14px 0 rgba(13, 148, 136, 0.25);
  --zr-shadow-accent: 0 4px 14px 0 rgba(245, 158, 11, 0.25);
}

:root {
  --zr-duration-75: 75ms;
  --zr-duration-100: 100ms;
  --zr-duration-150: 150ms;
  --zr-duration-200: 200ms;
  --zr-duration-300: 300ms;
  --zr-duration-500: 500ms;
  --zr-duration-700: 700ms;
  --zr-duration-1000: 1000ms;
  --zr-ease-linear: linear;
  --zr-ease-in: cubic-bezier(0.4, 0, 1, 1);
  --zr-ease-out: cubic-bezier(0, 0, 0.2, 1);
  --zr-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --zr-ease-back: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --zr-ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --zr-transition-fast: var(--zr-duration-150) var(--zr-ease-out);
  --zr-transition-normal: var(--zr-duration-300) var(--zr-ease-in-out);
  --zr-transition-slow: var(--zr-duration-500) var(--zr-ease-in-out);
  --zr-transition-colors: color var(--zr-transition-fast), background-color var(--zr-transition-fast), border-color var(--zr-transition-fast);
  --zr-transition-opacity: opacity var(--zr-transition-fast);
  --zr-transition-transform: transform var(--zr-transition-fast);
  --zr-transition-all: all var(--zr-transition-fast);
}

:root {
  --zr-z-auto: auto;
  --zr-z-0: 0;
  --zr-z-10: 10;
  --zr-z-20: 20;
  --zr-z-30: 30;
  --zr-z-40: 40;
  --zr-z-50: 50;
  --zr-z-9999: 9999;
  --zr-z-sidebar: var(--zr-z-10);
  --zr-z-header: var(--zr-z-20);
  --zr-z-dropdown: var(--zr-z-30);
  --zr-z-overlay: var(--zr-z-40);
  --zr-z-modal: var(--zr-z-50);
  --zr-z-toast: var(--zr-z-9999);
  --zr-z-tooltip: var(--zr-z-50);
}

body {
  font-size: 16px;
}

:root {
  --zr-sidebar-width: 260px;
  --zr-sidebar-width-collapsed: 60px;
  --zr-sidebar-header-height: 60px;
  --zr-mobile-header-height: 60px;
  --zr-sidebar-bg: var(--zr-bg-secondary);
  --zr-sidebar-border: var(--zr-border);
  --zr-sidebar-hover: var(--zr-bg-hover);
  --zr-conversation-active-bg: var(--zr-bg-tertiary);
  --zr-conversation-active-border: var(--zr-primary);
  --zr-conversation-hover-bg: var(--zr-bg-hover);
  --zr-profile-avatar-bg: var(--zr-primary);
  --zr-profile-dropdown-bg: var(--zr-bg-tertiary);
  --zr-sidebar-z: 100;
  --zr-mobile-header-z: 200;
  --zr-sidebar-mobile-z: 1000;
  --zr-overlay-z: 999;
  --zr-dropdown-z: 1100;
}

.zr-sidebar {
  width: var(--zr-sidebar-width);
  height: 100vh;
  background: var(--zr-sidebar-bg);
  border-right: 1px solid var(--zr-sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: var(--zr-sidebar-z);
  transition: all var(--zr-transition-normal);
}
.zr-sidebar.collapsed {
  width: var(--zr-sidebar-width-collapsed);
}
.zr-sidebar.collapsed .zr-action-label,
.zr-sidebar.collapsed .zr-profile-info,
.zr-sidebar.collapsed .zr-profile-chevron,
.zr-sidebar.collapsed .zr-conversations,
.zr-sidebar.collapsed .zr-sidebar-brand {
  opacity: 0;
  visibility: hidden;
  width: 0;
  overflow: hidden;
}
.zr-sidebar.collapsed .zr-sidebar-header {
  justify-content: center;
}
.zr-sidebar.collapsed .zr-sidebar-actions {
  flex-direction: column;
  align-items: center;
}
.zr-sidebar .zr-action-label,
.zr-sidebar .zr-profile-info,
.zr-sidebar .zr-profile-chevron,
.zr-sidebar .zr-conversations,
.zr-sidebar .zr-sidebar-brand {
  transition: opacity 0.15s ease, visibility 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
}
@media (max-width: 767px) {
  .zr-sidebar {
    transform: translateX(-100%);
    z-index: var(--zr-sidebar-mobile-z);
    width: var(--zr-sidebar-width);
  }
  .zr-sidebar.mobile-open {
    transform: translateX(0);
  }
}

.zr-sidebar-header {
  padding: var(--zr-space-3);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--zr-space-3);
  border-bottom: 1px solid var(--zr-sidebar-border);
  min-height: var(--zr-sidebar-header-height);
  flex-shrink: 0;
}

.zr-sidebar-toggle-internal {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--zr-radius-lg);
  background: transparent;
  color: var(--zr-text-primary);
  transition: var(--zr-transition-colors);
  flex-shrink: 0;
}
.zr-sidebar-toggle-internal:hover {
  background: var(--zr-sidebar-hover);
}
.zr-sidebar-toggle-internal:active {
  transform: scale(0.95);
}
.zr-sidebar-toggle-internal .zr-hamburger {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.zr-sidebar-toggle-internal .zr-hamburger span {
  width: 16px;
  height: 2px;
  background: var(--zr-text-primary);
  border-radius: var(--zr-radius-full);
  transition: var(--zr-transition-transform);
}

.zr-sidebar-brand {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.zr-sidebar-brand .zr-brand-icon {
  display: flex;
  width: 30px;
  height: 30px;
}
.zr-sidebar-brand .zr-brand-icon img {
  object-fit: contain;
  width: 100%;
  height: auto;
}
.zr-sidebar-brand .zr-brand-name {
  font-family: var(--zr-font-display);
  font-weight: var(--zr-font-bold);
  font-size: var(--zr-text-lg);
  letter-spacing: var(--zr-tracking-tight);
  color: var(--zr-text-primary);
}

.zr-new-chat-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--zr-radius-lg);
  background: transparent;
  color: var(--zr-text-primary);
  transition: var(--zr-transition-colors);
}
.zr-new-chat-btn:hover {
  background: var(--zr-sidebar-hover);
}
.zr-new-chat-btn:active {
  transform: scale(0.95);
}
.zr-new-chat-btn svg {
  display: block;
  margin: 0 auto;
}

.zr-conversations {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 var(--zr-space-3);
}
.zr-conversations::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.zr-conversations::-webkit-scrollbar-track {
  background: var(--zr-bg-secondary);
}
.zr-conversations::-webkit-scrollbar-thumb {
  background: var(--zr-border);
  border-radius: var(--zr-radius-full);
}
.zr-conversations::-webkit-scrollbar-thumb:hover {
  background: var(--zr-border-hover);
}

.zr-conversations-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--zr-text-muted);
}
.zr-conversations-loading .zr-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--zr-border);
  border-top: 2px solid var(--zr-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: var(--zr-space-3);
}
.zr-conversations-loading span {
  font-size: var(--zr-text-sm);
}

.zr-conversations-empty {
  text-align: center;
  padding: var(--zr-space-6) var(--zr-space-4);
  color: var(--zr-text-muted);
}
.zr-conversations-empty p {
  margin: 0;
  font-size: var(--zr-text-sm);
}
.zr-conversations-empty p:first-child {
  font-weight: var(--zr-font-medium);
  margin-bottom: var(--zr-space-1);
  color: var(--zr-text-primary);
}

.zr-conversations-container {
  padding: var(--zr-space-2) 0;
}

.zr-conversation-item {
  display: flex;
  flex-direction: column;
  padding: var(--zr-space-3);
  margin-bottom: var(--zr-space-1);
  border-radius: var(--zr-radius-lg);
  cursor: pointer;
  transition: background-color var(--zr-transition-fast);
  position: relative;
  border: 2px solid transparent;
}
.zr-conversation-item:hover {
  background: var(--zr-conversation-hover-bg);
}
.zr-conversation-item:hover .zr-conversation-delete {
  opacity: 1;
}
.zr-conversation-item.active {
  background: var(--zr-conversation-active-bg);
  border-left-color: var(--zr-conversation-active-border);
  border-left-width: 3px;
}
.zr-conversation-item.active .zr-conversation-title {
  color: var(--zr-text-primary);
  font-weight: var(--zr-font-semibold);
}

.zr-conversation-main {
  margin-bottom: var(--zr-space-2);
}

.zr-conversation-title {
  font-weight: var(--zr-font-medium);
  font-size: var(--zr-text-sm);
  color: var(--zr-text-primary);
  margin-bottom: var(--zr-space-1);
  line-height: var(--zr-leading-tight);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zr-conversation-preview {
  font-size: var(--zr-text-xs);
  color: var(--zr-text-muted);
  line-height: var(--zr-leading-tight);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zr-conversation-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--zr-text-xs);
  color: var(--zr-text-muted);
}

.zr-conversation-time {
  flex: 1;
}

.zr-conversation-count {
  background: var(--zr-bg-tertiary);
  padding: 2px var(--zr-space-2);
  border-radius: var(--zr-radius-full);
  min-width: 20px;
  text-align: center;
  font-weight: var(--zr-font-medium);
  font-size: 10px;
}

.zr-conversation-delete {
  position: absolute;
  top: var(--zr-space-2);
  right: var(--zr-space-2);
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--zr-radius-full);
  background: var(--zr-bg-secondary);
  color: var(--zr-text-muted);
  opacity: 0;
  transition: all var(--zr-transition-fast);
  font-size: var(--zr-text-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.zr-conversation-delete:hover {
  background: var(--zr-error);
  color: white;
  transform: scale(1.1);
}

.zr-sidebar-footer {
  margin-top: auto;
  padding: var(--zr-space-3);
  display: flex;
  flex-direction: column;
  gap: var(--zr-space-4);
  border-top: 1px solid var(--zr-sidebar-border);
  flex-shrink: 0;
}

.zr-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: var(--zr-space-1);
  margin-top: auto;
}

.zr-sidebar-action {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  border-radius: var(--zr-radius-lg);
  background: transparent;
  color: var(--zr-text-primary);
  transition: background-color var(--zr-transition-fast);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 var(--zr-space-3);
  font-size: var(--zr-text-sm);
  gap: var(--zr-space-3);
}
.zr-sidebar-action:hover {
  background: var(--zr-sidebar-hover);
}
.zr-sidebar-action:active {
  transform: scale(0.98);
}
.zr-sidebar-action svg {
  flex-shrink: 0;
}
.zr-sidebar-action .zr-action-label {
  font-weight: var(--zr-font-medium);
}

.zr-profile-menu {
  position: relative;
}

.zr-profile-trigger {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: var(--zr-radius-lg);
  background: transparent;
  display: flex;
  align-items: center;
  gap: var(--zr-space-3);
  transition: background-color var(--zr-transition-fast);
}
.zr-profile-trigger:hover {
  background: var(--zr-sidebar-hover);
}

.zr-profile-avatar {
  width: 32px;
  height: 32px;
  background: var(--zr-profile-avatar-bg);
  border-radius: var(--zr-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: var(--zr-font-bold);
  font-size: var(--zr-text-sm);
  flex-shrink: 0;
}

.zr-profile-info {
  flex: 1;
  text-align: left;
  min-width: 0;
}

.zr-profile-name {
  display: block;
  font-weight: var(--zr-font-medium);
  font-size: var(--zr-text-sm);
  color: var(--zr-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zr-profile-plan {
  display: block;
  font-size: var(--zr-text-xs);
  color: var(--zr-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zr-profile-chevron {
  flex-shrink: 0;
  transition: transform var(--zr-transition-fast);
}

.zr-profile-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--zr-profile-dropdown-bg);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-xl);
  margin-bottom: var(--zr-space-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--zr-transition-normal);
  z-index: var(--zr-dropdown-z);
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  min-width: 240px;
  white-space: nowrap;
}
.zr-sidebar.collapsed .zr-profile-dropdown {
  right: auto;
  width: 240px;
}
.zr-profile-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.zr-profile-dropdown.show ~ .zr-profile-trigger .zr-profile-chevron {
  transform: rotate(180deg);
}
.zr-profile-dropdown::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.zr-profile-dropdown::-webkit-scrollbar-track {
  background: var(--zr-bg-secondary);
}
.zr-profile-dropdown::-webkit-scrollbar-thumb {
  background: var(--zr-border);
  border-radius: var(--zr-radius-full);
}
.zr-profile-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--zr-border-hover);
}

.zr-profile-options {
  padding: var(--zr-space-2);
}

.zr-profile-option {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--zr-space-3);
  padding: var(--zr-space-3);
  border-radius: var(--zr-radius-md);
  font-size: var(--zr-text-sm);
  color: var(--zr-text-primary);
  transition: background-color var(--zr-transition-fast);
  text-decoration: none;
  white-space: nowrap;
}
.zr-profile-option:hover {
  background: var(--zr-bg-hover);
}
.zr-profile-option svg {
  flex-shrink: 0;
}
.zr-profile-option span:first-of-type {
  flex: 1;
  text-align: left;
}
.zr-profile-option .zr-option-value {
  margin-left: auto;
  color: var(--zr-text-muted);
  font-size: var(--zr-text-xs);
}
.zr-profile-option.zr-profile-logout {
  color: var(--zr-error);
}
.zr-profile-option.zr-profile-logout:hover {
  background: var(--zr-error);
  color: white;
}

.zr-profile-divider {
  height: 1px;
  background: var(--zr-border);
  margin: var(--zr-space-2) 0;
}

.zr-mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--zr-mobile-header-height);
  background: var(--zr-sidebar-bg);
  border-bottom: 1px solid var(--zr-sidebar-border);
  z-index: var(--zr-mobile-header-z);
}
@media (min-width: 1024px) {
  .zr-mobile-header {
    display: none;
  }
}

.zr-mobile-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--zr-space-4);
}

.zr-mobile-menu-toggle {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.zr-mobile-menu-toggle .zr-burger-line {
  width: 20px;
  height: 2px;
  background: var(--zr-text-primary);
  border-radius: var(--zr-radius-full);
  transition: var(--zr-transition-transform);
}
.zr-mobile-menu-toggle:hover .zr-burger-line {
  background: var(--zr-primary);
}

.zr-mobile-brand {
  display: flex;
  align-items: center;
  gap: var(--zr-space-2);
}
.zr-mobile-brand .zr-brand-icon {
  width: 30px;
  height: 30px;
}
.zr-mobile-brand .zr-brand-icon img {
  object-fit: contain;
  width: 100%;
  height: auto;
}
.zr-mobile-brand .zr-brand-name {
  font-family: var(--zr-font-display);
  font-weight: var(--zr-font-bold);
  font-size: var(--zr-text-lg);
  letter-spacing: var(--zr-tracking-tight);
}

.zr-mobile-theme-toggle {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--zr-radius-lg);
  background: var(--zr-bg-tertiary);
  border: 1px solid var(--zr-border);
  transition: background-color var(--zr-transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.zr-mobile-theme-toggle:hover {
  background: var(--zr-bg-hover);
}

.zr-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--zr-bg-overlay);
  z-index: var(--zr-overlay-z);
  opacity: 0;
  visibility: hidden;
  transition: all var(--zr-transition-fast);
}
@media (min-width: 1024px) {
  .zr-sidebar-overlay {
    display: none;
  }
}
.zr-sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 767px) {
  .zr-app-container {
    padding-top: var(--zr-mobile-header-height);
  }
  .zr-main-content {
    height: calc(100vh - var(--zr-mobile-header-height));
  }
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
[data-theme=light] .zr-sidebar {
  --zr-sidebar-bg: #ffffff;
  --zr-sidebar-border: #e5e7eb;
  --zr-sidebar-hover: #f9fafb;
  --zr-conversation-active-bg: #f3f4f6;
  --zr-conversation-hover-bg: #f9fafb;
  --zr-profile-dropdown-bg: #ffffff;
}

.zr-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.zr-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.zr-modal {
  background: var(--zr-bg-primary);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--zr-border);
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.zr-modal-overlay.active .zr-modal {
  transform: scale(1) translateY(0);
}

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

.zr-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--zr-text-primary);
  margin: 0;
}

.zr-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--zr-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

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

.zr-modal-body {
  padding: 1.5rem;
}

.zr-modal-text {
  color: var(--zr-text-secondary);
  line-height: 1.6;
  margin: 0 0 1.5rem 0;
}

.zr-modal-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--zr-border);
  border-radius: 6px;
  background: var(--zr-bg-secondary);
  color: var(--zr-text-primary);
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s ease;
}

.zr-modal-input:focus {
  outline: none;
  border-color: var(--zr-accent);
  box-shadow: 0 0 0 3px rgba(var(--zr-accent-rgb), 0.1);
}

.zr-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 0 1.5rem 1.5rem;
}

.zr-modal-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  min-width: 80px;
}

.zr-modal-btn-primary {
  background: var(--zr-accent);
  color: white;
}

.zr-modal-btn-primary:hover {
  background: var(--zr-accent-hover);
  transform: translateY(-1px);
}

.zr-modal-btn-secondary {
  background: transparent;
  color: var(--zr-text-secondary);
  border: 1px solid var(--zr-border);
}

.zr-modal-btn-secondary:hover {
  background: var(--zr-bg-secondary);
  color: var(--zr-text-primary);
}

.zr-modal-confirm .zr-modal-title {
  color: var(--zr-warning);
}

.zr-modal-alert .zr-modal-title {
  color: var(--zr-error);
}

.zr-modal-success .zr-modal-title {
  color: var(--zr-success);
}

@media (max-width: 480px) {
  .zr-modal {
    width: 95%;
    margin: 1rem;
  }
  .zr-modal-actions {
    flex-direction: column-reverse;
  }
  .zr-modal-btn {
    width: 100%;
  }
}
.zr-message-text {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--zr-text-primary);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.zr-message-text > *:first-child {
  margin-top: 0 !important;
}
.zr-message-text > *:last-child {
  margin-bottom: 0 !important;
}

.zr-message-text h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem 0;
  line-height: 1.25;
  position: relative;
  padding-bottom: 0.6rem;
  background: var(--zr-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.zr-message-text h1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--zr-gradient-primary);
  border-radius: var(--zr-radius-full);
}
@media (max-width: 767px) {
  .zr-message-text h1 {
    font-size: 1.4rem;
    margin: 1.25rem 0 0.6rem 0;
  }
}
.zr-message-text h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--zr-text-primary);
  margin: 1.25rem 0 0.6rem 0;
  line-height: 1.3;
  padding-left: 0.85rem;
  position: relative;
}
.zr-message-text h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 4px;
  background: var(--zr-gradient-accent);
  border-radius: var(--zr-radius-full);
}
@media (max-width: 767px) {
  .zr-message-text h2 {
    font-size: 1.2rem;
    margin: 1rem 0 0.5rem 0;
  }
}
.zr-message-text h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--zr-text-primary);
  margin: 1rem 0 0.5rem 0;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.zr-message-text h3::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--zr-primary);
  border-radius: 50%;
  flex-shrink: 0;
}
@media (max-width: 767px) {
  .zr-message-text h3 {
    font-size: 1.05rem;
    margin: 0.9rem 0 0.4rem 0;
  }
}
.zr-message-text h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--zr-primary);
  margin: 0.9rem 0 0.4rem 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.zr-message-text h5 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--zr-text-primary);
  margin: 0.75rem 0 0.4rem 0;
}
.zr-message-text h6 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--zr-text-secondary);
  margin: 0.75rem 0 0.4rem 0;
}

.zr-message-text p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--zr-text-primary);
  margin-bottom: 0.9rem;
}
.zr-message-text p:empty {
  display: none;
}
@media (max-width: 767px) {
  .zr-message-text p {
    line-height: 1.6;
    margin-bottom: 0.75rem;
  }
}

.zr-message-text strong, .zr-message-text b {
  font-weight: 700;
  color: var(--zr-text-primary);
}
.zr-message-text em, .zr-message-text i {
  color: var(--zr-accent);
  font-style: italic;
  font-weight: 500;
}
.zr-message-text code:not(pre code) {
  font-family: var(--zr-font-mono);
  font-size: 0.875em;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: var(--zr-radius-sm);
  background: var(--zr-inline-code-bg);
  color: var(--zr-inline-code-text);
  border: 1px solid var(--zr-inline-code-border);
  transition: all var(--zr-transition-fast);
}
.zr-message-text code:not(pre code):hover {
  background: var(--zr-bg-tertiary);
  border-color: var(--zr-primary);
}
.zr-message-text a {
  color: var(--zr-primary);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color var(--zr-transition-fast);
}
.zr-message-text a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--zr-gradient-primary);
  transition: width var(--zr-transition-normal);
}
.zr-message-text a:hover {
  color: var(--zr-primary-hover);
}
.zr-message-text a:hover::after {
  width: 100%;
}
.zr-message-text mark {
  background: linear-gradient(135deg, rgba(var(--zr-accent-rgb), 0.2) 0%, rgba(var(--zr-accent-rgb), 0.1) 100%);
  color: var(--zr-text-primary);
  padding: 0.1em 0.4em;
  border-radius: var(--zr-radius-sm);
  border-left: 2px solid var(--zr-accent);
}

.zr-message-text ul:not(.zr-task-list) {
  margin: 0.9rem 0;
  padding-left: 0;
  list-style: none;
}
.zr-message-text ul:not(.zr-task-list) > li {
  position: relative;
  margin-bottom: 0.5rem;
  padding-left: 1.6rem;
  line-height: 1.6;
}
.zr-message-text ul:not(.zr-task-list) > li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--zr-gradient-primary);
  border-radius: 50%;
}
.zr-message-text ul:not(.zr-task-list) > li:last-child {
  margin-bottom: 0;
}
.zr-message-text ol:not(.zr-ordered-list) {
  margin: 0.9rem 0;
  padding-left: 0;
  list-style: none;
  counter-reset: ol-counter;
}
.zr-message-text ol:not(.zr-ordered-list) > li {
  position: relative;
  margin-bottom: 0.6rem;
  padding-left: 2.25rem;
  line-height: 1.6;
  counter-increment: ol-counter;
}
.zr-message-text ol:not(.zr-ordered-list) > li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--zr-gradient-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--zr-shadow-primary);
}
.zr-message-text ol:not(.zr-ordered-list) > li:last-child {
  margin-bottom: 0;
}
.zr-message-text ol.zr-ordered-list,
.zr-message-text .zr-ordered-list {
  margin: 0.9rem 0;
  padding-left: 0;
  list-style: none;
}
.zr-message-text ol.zr-ordered-list > li,
.zr-message-text ol.zr-ordered-list > .zr-ordered-item,
.zr-message-text .zr-ordered-list > li,
.zr-message-text .zr-ordered-list > .zr-ordered-item {
  position: relative;
  margin-bottom: 0.6rem;
  padding-left: 2.25rem;
  line-height: 1.6;
  display: block;
}
.zr-message-text ol.zr-ordered-list > li::before,
.zr-message-text ol.zr-ordered-list > .zr-ordered-item::before,
.zr-message-text .zr-ordered-list > li::before,
.zr-message-text .zr-ordered-list > .zr-ordered-item::before {
  content: var(--item-number);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--zr-gradient-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--zr-shadow-primary);
}
.zr-message-text ol.zr-ordered-list > li:last-child,
.zr-message-text ol.zr-ordered-list > .zr-ordered-item:last-child,
.zr-message-text .zr-ordered-list > li:last-child,
.zr-message-text .zr-ordered-list > .zr-ordered-item:last-child {
  margin-bottom: 0;
}
.zr-message-text ul.zr-task-list {
  margin: 0.9rem 0;
  padding-left: 0;
  list-style: none;
}
.zr-message-text ul.zr-task-list .zr-task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
  padding: 0.4rem 0.6rem;
  border-radius: var(--zr-radius-md);
  transition: background var(--zr-transition-fast);
}
.zr-message-text ul.zr-task-list .zr-task-item:hover {
  background: var(--zr-message-hover-bg);
}
.zr-message-text ul.zr-task-list .zr-task-item .zr-task-checkbox {
  color: var(--zr-text-muted);
  font-size: 1.1em;
  flex-shrink: 0;
}
.zr-message-text ul.zr-task-list .zr-task-item.checked .zr-task-checkbox {
  color: var(--zr-success);
}
.zr-message-text ul.zr-task-list .zr-task-item.checked .zr-task-text {
  text-decoration: line-through;
  opacity: 0.7;
}
.zr-message-text ul.zr-task-list .zr-task-item:last-child {
  margin-bottom: 0;
}
.zr-message-text ul ul, .zr-message-text ol ol, .zr-message-text ul ol, .zr-message-text ol ul {
  margin: 0.4rem 0 0.4rem 0.5rem;
}
.zr-message-text ul ul > li, .zr-message-text ol ol > li, .zr-message-text ul ol > li, .zr-message-text ol ul > li {
  margin-bottom: 0.35rem;
}
.zr-message-text ul ul > li::before, .zr-message-text ol ol > li::before, .zr-message-text ul ol > li::before, .zr-message-text ol ul > li::before {
  opacity: 0.7;
  transform: scale(0.85);
}

.zr-message-text blockquote {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--zr-bg-secondary) 0%, rgba(var(--zr-primary-rgb), 0.05) 100%);
  border-left: 4px solid transparent;
  border-image: var(--zr-gradient-primary) 1;
  border-radius: 0 var(--zr-radius-lg) var(--zr-radius-lg) 0;
  position: relative;
  font-style: italic;
}
.zr-message-text blockquote::before {
  content: '"';
  position: absolute;
  top: -0.3rem;
  left: 0.75rem;
  font-size: 3rem;
  font-family: Georgia, serif;
  color: var(--zr-primary);
  opacity: 0.3;
  line-height: 1;
}
.zr-message-text blockquote p {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
}
.zr-message-text blockquote p:last-child {
  margin-bottom: 0;
}

.zr-message-text hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--zr-primary) 20%, var(--zr-accent) 50%, var(--zr-primary) 80%, transparent 100%);
  margin: 1.5rem 0;
  border-radius: var(--zr-radius-full);
  opacity: 0.6;
}

.zr-message-text .zr-code-block-wrapper {
  margin: 1.25rem 0;
  border-radius: var(--zr-radius-lg);
  overflow: hidden;
  background: var(--zr-code-bg);
  border: 1px solid var(--zr-code-border);
  box-shadow: var(--zr-shadow-md);
  transition: all var(--zr-transition-normal);
}
.zr-message-text .zr-code-block-wrapper:hover {
  border-color: var(--zr-primary);
  box-shadow: var(--zr-shadow-lg), var(--zr-glow-primary);
  transform: translateY(-2px);
}
@media (max-width: 767px) {
  .zr-message-text .zr-code-block-wrapper {
    margin: 1rem 0;
    border-radius: var(--zr-radius-md);
  }
  .zr-message-text .zr-code-block-wrapper:hover {
    transform: none;
  }
}
.zr-message-text .zr-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--zr-code-header-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.zr-message-text .zr-code-header .zr-code-language {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.zr-message-text .zr-code-header .zr-code-language::before {
  content: "⟨⟩";
  opacity: 0.7;
}
.zr-message-text .zr-code-header .zr-code-copy-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--zr-radius-md);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--zr-transition-fast);
}
.zr-message-text .zr-code-header .zr-code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.02);
}
.zr-message-text .zr-code-header .zr-code-copy-btn.copied {
  background: var(--zr-success);
  border-color: var(--zr-success);
}
.zr-message-text .zr-code-body {
  overflow-x: auto;
}
.zr-message-text .zr-code-body pre {
  margin: 0;
  padding: 1rem;
  background: transparent;
  font-family: var(--zr-font-mono);
  font-size: var(--zr-code-font-size);
  line-height: var(--zr-code-line-height);
  tab-size: 2;
}
.zr-message-text .zr-code-body pre code {
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  padding: 0;
  border: none;
  color: var(--zr-text-primary);
}
.zr-message-text .zr-code-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.zr-message-text .zr-code-body::-webkit-scrollbar-track {
  background: var(--zr-bg-secondary);
}
.zr-message-text .zr-code-body::-webkit-scrollbar-thumb {
  background: var(--zr-border);
  border-radius: var(--zr-radius-full);
}
.zr-message-text .zr-code-body::-webkit-scrollbar-thumb:hover {
  background: var(--zr-border-hover);
}

.zr-message-text .zr-table-wrapper {
  margin: 1.25rem 0;
  overflow-x: auto;
  border-radius: var(--zr-radius-lg);
  border: 1px solid var(--zr-border);
  box-shadow: var(--zr-shadow-sm);
}
.zr-message-text .zr-table-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.zr-message-text .zr-table-wrapper::-webkit-scrollbar-track {
  background: var(--zr-bg-secondary);
}
.zr-message-text .zr-table-wrapper::-webkit-scrollbar-thumb {
  background: var(--zr-border);
  border-radius: var(--zr-radius-full);
}
.zr-message-text .zr-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--zr-border-hover);
}
@media (max-width: 767px) {
  .zr-message-text .zr-table-wrapper {
    margin: 1rem 0;
  }
}
.zr-message-text table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.zr-message-text table th, .zr-message-text table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--zr-border);
}
@media (max-width: 767px) {
  .zr-message-text table th, .zr-message-text table td {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
}
.zr-message-text table thead th {
  background: linear-gradient(135deg, var(--zr-bg-secondary) 0%, rgba(var(--zr-primary-rgb), 0.1) 100%);
  font-weight: 700;
  color: var(--zr-primary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--zr-primary);
}
.zr-message-text table tbody tr {
  transition: background var(--zr-transition-fast);
}
.zr-message-text table tbody tr:nth-child(even) {
  background: var(--zr-bg-secondary);
}
.zr-message-text table tbody tr:hover {
  background: var(--zr-message-hover-bg);
}
.zr-message-text table tbody tr:last-child td {
  border-bottom: none;
}

.zr-message-text .zr-generated-image-container {
  margin: 1.25rem 0;
  border-radius: var(--zr-radius-xl);
  overflow: hidden;
  background: var(--zr-bg-secondary);
  border: 1px solid var(--zr-border);
  box-shadow: var(--zr-shadow-md);
  transition: all var(--zr-transition-normal);
}
.zr-message-text .zr-generated-image-container:hover {
  box-shadow: var(--zr-shadow-xl), var(--zr-glow-accent);
  transform: translateY(-2px);
}
.zr-message-text .zr-image-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--zr-gradient-accent);
}
.zr-message-text .zr-image-header .zr-image-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: white;
}
.zr-message-text .zr-image-header .zr-image-actions {
  display: flex;
  gap: 0.5rem;
}
.zr-message-text .zr-image-header .zr-image-actions .zr-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
}
.zr-message-text .zr-image-header .zr-image-actions .zr-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}
.zr-message-text .zr-image-wrapper {
  position: relative;
}
.zr-message-text .zr-image-wrapper .zr-generated-image {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transition: opacity var(--zr-transition-slow);
}
.zr-message-text .zr-image-wrapper .zr-generated-image.loaded {
  opacity: 1;
}

.zr-think-accordion {
  margin: 1rem 0;
  background: linear-gradient(135deg, var(--zr-bg-secondary) 0%, rgba(var(--zr-think-rgb), 0.05) 100%);
  border: 1px solid rgba(var(--zr-think-rgb), 0.2);
  border-radius: var(--zr-radius-lg);
  overflow: hidden;
  transition: all var(--zr-transition-normal);
}
.zr-think-accordion:hover {
  border-color: rgba(var(--zr-think-rgb), 0.4);
}
.zr-think-accordion.open .zr-think-chevron {
  transform: rotate(180deg);
}
.zr-think-accordion.open .zr-think-content {
  max-height: 500px;
  overflow-y: auto;
}

.zr-think-toggle {
  display: flex;
  align-items: center;
  gap: var(--zr-space-2);
  width: 100%;
  padding: var(--zr-space-3) var(--zr-space-4);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--zr-text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
}
.zr-think-toggle:hover {
  background: rgba(var(--zr-think-rgb), 0.08);
}

.zr-think-icon {
  font-size: 1.1rem;
}

.zr-think-label {
  flex: 1;
  color: var(--zr-text-primary);
}

.zr-think-chevron {
  transition: transform var(--zr-transition-normal);
  color: var(--zr-text-secondary);
}

.zr-think-badge {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--zr-think);
  background: rgba(var(--zr-think-rgb), 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: var(--zr-radius-full);
}

.zr-think-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.zr-think-inner {
  padding: var(--zr-space-3);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--zr-text-secondary);
  font-family: var(--zr-font-mono);
  white-space: pre-wrap;
  word-break: break-word;
  border-top: 1px solid rgba(var(--zr-think-rgb), 0.1);
}
.zr-think-inner p {
  margin-bottom: 0.5rem;
}
.zr-think-inner p:last-child {
  margin-bottom: 0;
}

.zr-think-streaming .zr-think-toggle {
  cursor: default;
}
.zr-think-streaming .zr-think-chevron {
  opacity: 0.4;
}

.zr-think-badge .zr-thinking-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.zr-think-badge .zr-thinking-dots .zr-dot {
  width: 4px;
  height: 4px;
  background: var(--zr-think);
  border-radius: 50%;
  animation: zr-dot-pulse 1.4s ease-in-out infinite;
}
.zr-think-badge .zr-thinking-dots .zr-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.zr-think-badge .zr-thinking-dots .zr-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes zr-dot-pulse {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}
.zr-message-user .zr-message-body {
  position: relative;
}
.zr-message-user .zr-message-body.zr-collapsible .zr-message-meta {
  padding-right: 40px;
}
.zr-message-user .zr-message-body.zr-collapsed .zr-message-text {
  max-height: 4.5em;
  overflow: hidden;
  position: relative;
}
.zr-message-user .zr-message-body.zr-collapsed .zr-message-text::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.5em;
  background: linear-gradient(to bottom, transparent, var(--zr-user-message-bg, var(--zr-bg-secondary)) 90%);
  pointer-events: none;
}
.zr-message-user .zr-message-body.zr-collapsed .zr-collapse-toggle i {
  transform: rotate(0deg);
}
.zr-message-user .zr-message-body.zr-expanded .zr-message-text, .zr-message-user .zr-message-body.zr-collapsible:not(.zr-collapsed) .zr-message-text {
  max-height: none;
}
.zr-message-user .zr-message-body.zr-expanded .zr-message-text::after, .zr-message-user .zr-message-body.zr-collapsible:not(.zr-collapsed) .zr-message-text::after {
  display: none;
}
.zr-message-user .zr-message-body.zr-expanded .zr-collapse-toggle i, .zr-message-user .zr-message-body.zr-collapsible:not(.zr-collapsed) .zr-collapse-toggle i {
  transform: rotate(180deg);
}
.zr-message-user .zr-collapse-toggle {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--zr-primary-rgb), 0.2);
  border: none;
  border-radius: var(--zr-radius-full);
  color: var(--zr-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 2;
}
.zr-message-user .zr-collapse-toggle:hover {
  background: rgba(var(--zr-primary-rgb), 0.4);
  color: var(--zr-text-primary);
}
.zr-message-user .zr-collapse-toggle i {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.zr-messages-list > .zr-message:last-child {
  margin-bottom: 1.5rem;
}

.zr-logo-thinking {
  mix-blend-mode: multiply;
}

.zr-thinking-animation {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zr-thinking-text {
  font-size: 1rem;
  font-weight: 500;
  background: linear-gradient(90deg, var(--color-1), var(--color-2), var(--color-1));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 2s ease-in-out infinite;
}

@media (prefers-color-scheme: light) {
  .zr-thinking-text {
    --color-1: #4b5563; /* gris oscuro base */
    --color-2: #1f2937; /* gris más oscuro (brillo) */
  }
}
@media (prefers-color-scheme: dark) {
  .zr-thinking-text {
    --color-1: #d1d5db; /* gris claro base */
    --color-2: #f9fafb; /* gris muy claro (brillo) */
  }
}
@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}
.zr-thinking-spacer {
  height: calc(100vh - 250px);
  min-height: 200px;
  max-height: 500px;
  pointer-events: none;
}

code[class*=language-],
pre[class*=language-] {
  text-shadow: none !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[data-theme=dark] .zr-message-text .zr-code-block-wrapper {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
[data-theme=dark] .zr-message-text .zr-code-block-wrapper:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), var(--zr-glow-primary);
}
[data-theme=dark] .zr-message-text blockquote::before {
  opacity: 0.2;
}

[data-theme=light] .zr-message-text .zr-code-block-wrapper {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
[data-theme=light] .zr-message-text .zr-code-block-wrapper:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), var(--zr-glow-primary);
}
[data-theme=light] .zr-message-text h1 {
  background: linear-gradient(135deg, #0F766E 0%, #0D9488 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.zr-gallery-header {
  max-width: var(--zr-content-max-width);
  margin: 0 auto var(--zr-space-8);
  padding: var(--zr-space-6) var(--zr-space-4) 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--zr-space-6);
}
@media (max-width: 767px) {
  .zr-gallery-header {
    flex-direction: column;
    gap: var(--zr-space-4);
    padding-top: var(--zr-space-4);
  }
}

.zr-gallery-title-section {
  flex: 1;
}
.zr-gallery-title-section h1 {
  font-family: var(--zr-font-display);
  font-size: var(--zr-text-3xl);
  font-weight: var(--zr-font-bold);
  color: var(--zr-text-primary);
  margin-bottom: var(--zr-space-2);
  line-height: var(--zr-leading-tight);
}
@media (max-width: 767px) {
  .zr-gallery-title-section h1 {
    font-size: var(--zr-text-2xl);
  }
}

.zr-gallery-subtitle {
  font-size: var(--zr-text-lg);
  color: var(--zr-text-secondary);
  margin: 0;
}

.zr-gallery-stats {
  display: flex;
  gap: var(--zr-space-4);
}
@media (max-width: 767px) {
  .zr-gallery-stats {
    width: 100%;
    justify-content: space-around;
  }
}

.zr-stat-item {
  text-align: center;
  padding: var(--zr-space-3) var(--zr-space-4);
  background: var(--zr-bg-secondary);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-xl);
  min-width: 80px;
}
.zr-stat-item .zr-stat-value {
  display: block;
  font-size: var(--zr-text-2xl);
  font-weight: var(--zr-font-bold);
  color: var(--zr-primary);
  line-height: 1;
  margin-bottom: var(--zr-space-1);
}
.zr-stat-item .zr-stat-label {
  display: block;
  font-size: var(--zr-text-xs);
  color: var(--zr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.zr-gallery-container {
  max-width: var(--zr-content-max-width);
  margin: 0 auto;
  padding: 0 var(--zr-space-4) var(--zr-space-8);
}

.zr-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--zr-space-4);
}
@media (max-width: 767px) {
  .zr-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--zr-space-3);
  }
}

.zr-gallery-item {
  background: var(--zr-bg-secondary);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-xl);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--zr-transition-normal);
}
.zr-gallery-item:hover {
  border-color: var(--zr-primary);
  transform: translateY(-4px);
  box-shadow: var(--zr-shadow-lg);
}
.zr-gallery-item:hover .zr-gallery-image-overlay {
  opacity: 1;
}

.zr-gallery-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: var(--zr-bg-tertiary);
}

.zr-gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--zr-transition-normal);
}
.zr-gallery-item:hover .zr-gallery-image {
  transform: scale(1.05);
}

.zr-gallery-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
  opacity: 0;
  transition: opacity var(--zr-transition-normal);
  display: flex;
  align-items: flex-end;
  padding: var(--zr-space-3);
}

.zr-gallery-quick-actions {
  display: flex;
  gap: var(--zr-space-2);
  width: 100%;
}
.zr-gallery-quick-actions button {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: var(--zr-space-2);
  background: rgba(255, 255, 255, 0.9);
  color: var(--zr-text-primary);
  border-radius: var(--zr-radius-md);
  font-size: var(--zr-text-xs);
  font-weight: var(--zr-font-medium);
  transition: all var(--zr-transition-fast);
}
.zr-gallery-quick-actions button:hover {
  background: white;
  transform: translateY(-2px);
}

.zr-gallery-item-info {
  padding: var(--zr-space-3);
}

.zr-gallery-prompt {
  font-size: var(--zr-text-sm);
  color: var(--zr-text-primary);
  line-height: var(--zr-leading-tight);
  margin-bottom: var(--zr-space-2);
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.zr-gallery-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--zr-text-xs);
  color: var(--zr-text-muted);
}

.zr-gallery-model {
  display: flex;
  align-items: center;
  gap: var(--zr-space-1);
}
.zr-gallery-model svg {
  width: 12px;
  height: 12px;
}

.zr-gallery-date {
  display: flex;
  align-items: center;
  gap: var(--zr-space-1);
}

.zr-gallery-loading,
.zr-gallery-empty {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--zr-space-16) var(--zr-space-4);
  text-align: center;
}

.zr-gallery-loading .zr-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--zr-border);
  border-top: 3px solid var(--zr-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: var(--zr-space-4);
}
.zr-gallery-loading p {
  color: var(--zr-text-muted);
}

.zr-gallery-empty .zr-empty-icon {
  font-size: 4rem;
  margin-bottom: var(--zr-space-4);
  opacity: 0.5;
}
.zr-gallery-empty h3 {
  font-size: var(--zr-text-xl);
  font-weight: var(--zr-font-semibold);
  color: var(--zr-text-primary);
  margin-bottom: var(--zr-space-2);
}
.zr-gallery-empty p {
  color: var(--zr-text-muted);
  margin-bottom: var(--zr-space-6);
}

.zr-gallery-load-more {
  margin-top: var(--zr-space-6);
  text-align: center;
}

.zr-image-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--zr-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--zr-space-4);
}
.zr-image-detail-modal .zr-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}
.zr-image-detail-modal .zr-modal-content {
  position: relative;
  background: var(--zr-bg-primary);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-2xl);
  max-width: 800px;
  max-height: 90vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--zr-shadow-2xl);
}
@media (max-width: 767px) {
  .zr-image-detail-modal .zr-modal-content {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}
.zr-image-detail-modal .zr-modal-header {
  padding: var(--zr-space-4);
  border-bottom: 1px solid var(--zr-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.zr-image-detail-modal .zr-modal-header h3 {
  font-size: var(--zr-text-lg);
  font-weight: var(--zr-font-semibold);
  color: var(--zr-text-primary);
  margin: 0;
}
.zr-image-detail-modal .zr-modal-close {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--zr-radius-full);
  background: transparent;
  color: var(--zr-text-muted);
  font-size: var(--zr-text-xl);
  transition: var(--zr-transition-colors);
}
.zr-image-detail-modal .zr-modal-close:hover {
  background: var(--zr-bg-hover);
  color: var(--zr-text-primary);
}
.zr-image-detail-modal .zr-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--zr-space-4);
}
.zr-image-detail-modal .zr-modal-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.zr-image-detail-modal .zr-modal-body::-webkit-scrollbar-track {
  background: var(--zr-bg-secondary);
}
.zr-image-detail-modal .zr-modal-body::-webkit-scrollbar-thumb {
  background: var(--zr-border);
  border-radius: var(--zr-radius-full);
}
.zr-image-detail-modal .zr-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--zr-border-hover);
}
.zr-image-detail-modal .zr-modal-body #detail-image {
  width: 100%;
  height: auto;
  border-radius: var(--zr-radius-lg);
  margin-bottom: var(--zr-space-4);
}
.zr-image-detail-modal .zr-image-info {
  display: flex;
  flex-direction: column;
  gap: var(--zr-space-4);
}
.zr-image-detail-modal .zr-info-item label {
  display: block;
  font-size: var(--zr-text-xs);
  font-weight: var(--zr-font-semibold);
  color: var(--zr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--zr-space-2);
}
.zr-image-detail-modal .zr-info-item p {
  font-size: var(--zr-text-sm);
  color: var(--zr-text-primary);
  line-height: var(--zr-leading-relaxed);
  margin: 0;
}
.zr-image-detail-modal .zr-modal-actions {
  padding: var(--zr-space-4);
  border-top: 1px solid var(--zr-border);
  display: flex;
  gap: var(--zr-space-3);
}
@media (max-width: 767px) {
  .zr-image-detail-modal .zr-modal-actions {
    flex-direction: column;
  }
  .zr-image-detail-modal .zr-modal-actions .zr-btn {
    width: 100%;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.zr-gallery-quick-actions {
  display: flex;
  gap: 8px;
}

.zr-gallery-action-btn {
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

.zr-gallery-action-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.libraries-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}
.libraries-modal[style*="display: flex"] {
  display: flex !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.libraries-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.libraries-modal-content {
  position: relative;
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
  color: var(--text-primary);
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.libraries-modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.libraries-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.libraries-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary, #666);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s;
}
.libraries-modal-close:hover {
  background: var(--bg-secondary, #f5f5f5);
}

.libraries-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.libraries-loading,
.libraries-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary, #666);
}
.libraries-loading p,
.libraries-empty p {
  margin: 0;
  font-size: 14px;
}

.libraries-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.libraries-document-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  transition: background 0.2s, border-color 0.2s;
  cursor: pointer;
}
.libraries-document-item:hover {
  background: var(--bg-secondary, #f5f5f5);
  border-color: var(--accent-color, #007acc);
}

.libraries-document-check {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.libraries-document-check input[type=checkbox] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--accent-color, #007acc);
}

.libraries-document-info {
  flex: 1;
  min-width: 0;
}

.libraries-document-title {
  display: block;
  font-weight: 500;
  margin: 0 0 4px 0;
  cursor: pointer;
  color: var(--text-primary, #000);
  font-size: 14px;
}

.libraries-document-meta {
  font-size: 12px;
  color: var(--text-secondary, #666);
  margin: 0 0 6px 0;
}

.libraries-document-desc {
  font-size: 12px;
  color: var(--text-secondary, #666);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

@media (max-width: 768px) {
  .libraries-modal-content {
    width: 95%;
    max-height: 90vh;
  }
  .libraries-modal-header,
  .libraries-modal-body,
  .libraries-modal-footer {
    padding: 16px;
  }
}
.zr-bulk-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--zr-space-4) var(--zr-space-6);
  background: var(--zr-primary);
  border-radius: var(--zr-radius-lg);
  margin-bottom: var(--zr-space-4);
  animation: slideDown 0.3s ease-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.zr-bulk-info {
  color: white;
  font-weight: var(--zr-font-semibold);
  font-size: var(--zr-text-sm);
}
.zr-bulk-info #bulk-count {
  font-size: var(--zr-text-lg);
  font-weight: var(--zr-font-bold);
}

.zr-bulk-buttons {
  display: flex;
  gap: var(--zr-space-3);
}

.zr-btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: var(--zr-space-2) var(--zr-space-4);
  font-size: var(--zr-text-xs);
}
.zr-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

.zr-btn-danger {
  background: #dc3545;
  color: white;
  border: 1px solid #dc3545;
  padding: var(--zr-space-2) var(--zr-space-4);
  font-size: var(--zr-text-xs);
  display: flex;
  align-items: center;
  gap: var(--zr-space-2);
}
.zr-btn-danger:hover {
  background: #c82333;
  border-color: #c82333;
}

.zr-input-footer {
  display: flex;
  flex-direction: row;
  padding: 0;
  border-top: none;
  background: transparent;
}

.zr-footer-buttons-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  padding: 0;
  justify-content: flex-start;
}

.zr-footer-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  height: 36px;
  border: 1px solid var(--border-color, #d0d0d0);
  border-radius: 8px;
  background: var(--bg-secondary, #ffffff);
  color: var(--text-primary, #333);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
  position: relative;
}
.zr-footer-button i {
  font-size: 16px;
  flex: 0 0 auto;
  opacity: 0.8;
}
.zr-footer-button span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.zr-footer-button:hover {
  border-color: var(--accent-color, #007acc);
  background: var(--bg-primary, #fafafa);
}
.zr-footer-button:hover i {
  opacity: 1;
  color: var(--accent-color, #007acc);
}
.zr-footer-button:active {
  transform: scale(0.98);
}
.zr-footer-button:focus {
  outline: none;
  border-color: var(--accent-color, #007acc);
  box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.1);
}

#documents-button-count {
  flex: 0.25;
}

.zr-footer-button-task:hover i {
  color: #ff9800;
}

.zr-footer-button-project:hover i {
  color: #4caf50;
}

.zr-footer-button-documents:hover i {
  color: #2196f3;
}

.zr-footer-button-model:hover i {
  color: #9c27b0;
}

.zr-hidden-select {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 13px;
  z-index: 10;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
}

.zr-input-stats {
  font-size: 11px;
  color: var(--text-secondary, #999);
  margin-left: auto;
  white-space: nowrap;
  padding: 0 4px;
}

@media (max-width: 1024px) {
  .zr-footer-button {
    padding: 6px 10px;
    font-size: 12px;
    height: 32px;
  }
  .zr-footer-button i {
    font-size: 14px;
  }
}
@media (max-width: 768px) {
  .zr-footer-buttons-row {
    gap: 6px;
  }
  .zr-footer-button {
    padding: 6px 8px;
    font-size: 11px;
    height: 30px;
  }
  .zr-footer-button i {
    font-size: 12px;
  }
  .zr-footer-button span {
    display: none;
  }
  .zr-input-stats {
    font-size: 10px;
  }
}
.zr-model-button-logo {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  flex: 0 0 auto;
  overflow: hidden;
  font-size: 12px;
}
.zr-model-button-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1px;
}
.zr-model-button-logo i {
  font-size: 12px;
  opacity: 0.7;
}

/* ============================================
   ZENREFLEX - Credits Banner System
   Archivo: credits_banner.scss
   ============================================ */
/* ============================================
   1. VARIABLES Y CONFIGURACIÓN
   ============================================ */
/* ============================================
   2. CONTENEDOR PRINCIPAL DEL BANNER
   ============================================ */
.zr-credits-banner {
  background: transparent;
  border-top: none;
  border-radius: 12px 12px 0 0;
  padding: 5px 20px;
  color: #343638;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: var(--zr-chat-max-width);
  margin-inline: auto;
}
.zr-credits-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(239, 68, 68, 0.5) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.zr-credits-banner.zr-credits-ok {
  background: transparent;
  border-top: none;
}
.zr-credits-banner.zr-credits-ok .zr-credits-icon {
  color: #64748b;
  opacity: 0.6;
  animation: none;
}
.zr-credits-banner.zr-credits-ok .zr-credits-text {
  color: #64748b;
}
.zr-credits-banner.zr-credits-ok .zr-credits-text strong {
  color: #94a3b8;
  font-weight: 500;
}
.zr-credits-banner.zr-credits-ok .zr-credits-bar-mini {
  background: rgba(255, 255, 255, 0.05);
  max-width: 80px;
}
.zr-credits-banner.zr-credits-ok .zr-credits-fill-mini,
.zr-credits-banner.zr-credits-ok .zr-credits-progress-fill {
  background: #64748b;
  opacity: 0.4;
}
.zr-credits-banner.zr-credits-ok:hover {
  background: rgba(16, 185, 129, 0.05);
}
.zr-credits-banner.zr-credits-ok:hover .zr-credits-icon {
  opacity: 0.9;
  color: #10b981;
}
.zr-credits-banner.zr-credits-ok:hover .zr-credits-text {
  color: #94a3b8;
}
.zr-credits-banner.zr-credits-ok:hover .zr-credits-text strong {
  color: #343638;
}
.zr-credits-banner.zr-credits-ok:hover .zr-credits-fill-mini,
.zr-credits-banner.zr-credits-ok:hover .zr-credits-progress-fill {
  opacity: 0.8;
  background: #10b981;
}
.zr-credits-banner.zr-credits-normal {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.12) 100%);
  border-top-color: rgba(59, 130, 246, 0.2);
}
.zr-credits-banner.zr-credits-normal .zr-credits-icon {
  color: #3b82f6;
}
.zr-credits-banner.zr-credits-normal .zr-credits-fill-mini,
.zr-credits-banner.zr-credits-normal .zr-credits-progress-fill {
  background: linear-gradient(90deg, #3b82f6 0%, rgb(107.7609756098, 161.0975609756, 248.2390243902) 100%);
}
.zr-credits-banner.zr-credits-low {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.12) 100%);
  border-top-color: rgba(245, 158, 11, 0.2);
}
.zr-credits-banner.zr-credits-low .zr-credits-icon {
  color: #f59e0b;
}
.zr-credits-banner.zr-credits-low .zr-credits-fill-mini,
.zr-credits-banner.zr-credits-low .zr-credits-progress-fill {
  background: linear-gradient(90deg, #f59e0b 0%, rgb(247.0078740157, 177.4763779528, 59.9921259843) 100%);
}
.zr-credits-banner.zr-credits-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.12) 100%);
  border-top-color: rgba(239, 68, 68, 0.2);
}
.zr-credits-banner.zr-credits-danger .zr-credits-icon {
  color: #ef4444;
}
.zr-credits-banner.zr-credits-danger .zr-credits-fill-mini,
.zr-credits-banner.zr-credits-danger .zr-credits-progress-fill {
  background: linear-gradient(90deg, #ef4444 0%, rgb(243.0197044335, 114.9802955665, 114.9802955665) 100%);
}
.zr-credits-banner.zr-credits-danger::before {
  opacity: 1;
  animation: pulse-danger 2s ease-in-out infinite;
}

/* ============================================
   3. VERSIÓN COMPACTA (>50% créditos)
   ============================================ */
.zr-credits-depleted {
  display: flex;
  justify-content: space-between;
}

.zr-credits-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.zr-credits-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.zr-credits-mini .zr-credits-icon {
  color: #ef4444;
  opacity: 0.9;
  font-size: 18px;
  flex-shrink: 0;
  animation: float 3s ease-in-out infinite;
}
.zr-credits-mini .zr-credits-text {
  color: #94a3b8;
  font-size: 14px;
}
.zr-credits-mini .zr-credits-text strong {
  color: var(--zr-primary);
  font-weight: 600;
}

.zr-credits-bar-mini {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  flex: 1;
  max-width: 120px;
  position: relative;
}
.zr-credits-bar-mini::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

.zr-credits-fill-mini {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ef4444 0%, rgb(243.0197044335, 114.9802955665, 114.9802955665) 100%);
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

/* ============================================
   4. VERSIÓN NORMAL (20%-50% créditos)
   ============================================ */
.zr-credits-normal {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zr-credits-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.zr-credits-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.zr-credits-left .zr-credits-icon {
  color: #ef4444;
  opacity: 0.9;
  font-size: 20px;
  flex-shrink: 0;
  animation: float 3s ease-in-out infinite;
}
.zr-credits-left .zr-credits-text {
  color: #94a3b8;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.zr-credits-left .zr-credits-text strong {
  color: #343638;
  font-weight: 600;
}
.zr-credits-left .zr-credits-text .zr-purchased-badge {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.3));
  color: #10b981;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.zr-credits-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zr-conversation-cost {
  font-size: 13px;
  color: #64748b;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}
.zr-conversation-cost strong {
  color: #343638;
  font-weight: 600;
}
.zr-conversation-cost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.zr-credits-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.zr-credits-progress::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

.zr-credits-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444 0%, rgb(243.0197044335, 114.9802955665, 114.9802955665) 100%);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* ============================================
   5. VERSIÓN CRÍTICA (<20% créditos)
   ============================================ */
.zr-credits-critical {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  animation: pulse-container 2s ease-in-out infinite;
}

.zr-critical-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.zr-critical-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.zr-critical-main .zr-critical-icon {
  color: #ef4444;
  font-size: 24px;
  flex-shrink: 0;
  animation: shake 0.5s ease-in-out infinite;
}
.zr-critical-main .zr-critical-text .zr-critical-title {
  color: #343638;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.zr-critical-main .zr-critical-text .zr-critical-subtitle {
  color: #94a3b8;
  font-size: 13px;
}
.zr-critical-main .zr-critical-text .zr-critical-subtitle strong {
  color: #ef4444;
  font-weight: 600;
}

.zr-critical-action .zr-recharge-button {
  padding: 8px 20px;
  background: linear-gradient(135deg, #ef4444 0%, rgb(234.9802955665, 21.0197044335, 21.0197044335) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  white-space: nowrap;
}
.zr-critical-action .zr-recharge-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}
.zr-critical-action .zr-recharge-button:active {
  transform: translateY(0);
}

.zr-critical-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zr-critical-progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.zr-critical-progress::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  animation: shimmer-fast 1.5s infinite;
}

.zr-critical-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444 0%, rgb(245.0295566502, 138.4704433498, 138.4704433498) 100%);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.7);
  animation: glow-pulse 1.5s ease-in-out infinite;
}

.zr-critical-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.zr-stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.zr-stat-item .zr-stat-label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.zr-stat-item .zr-stat-value {
  font-size: 16px;
  font-weight: 600;
  color: #343638;
}
.zr-stat-item .zr-stat-value.danger {
  color: #ef4444;
}
.zr-stat-item .zr-stat-value.warning {
  color: #f59e0b;
}

.zr-credits-warning {
  display: flex;
  justify-content: space-between;
}

/* ============================================
   6. ANIMACIONES
   ============================================ */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}
@keyframes shimmer-fast {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}
@keyframes pulse-danger {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}
@keyframes pulse-container {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.005);
  }
}
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  75% {
    transform: translateX(2px);
  }
}
@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.7);
  }
  50% {
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.9);
  }
}
/* ============================================
   7. RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  .zr-credits-banner {
    padding: 10px 16px;
    border-radius: 8px 8px 0 0;
  }
  .zr-credits-compact,
  .zr-credits-normal .zr-credits-info,
  .zr-critical-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .zr-credits-mini {
    width: 100%;
  }
  .zr-credits-bar-mini {
    max-width: none;
  }
  .zr-conversation-mini,
  .zr-conversation-cost {
    align-self: flex-start;
  }
  .zr-critical-stats {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .zr-credits-banner {
    padding: 8px 12px;
  }
  .zr-credits-mini {
    flex-wrap: wrap;
  }
  .zr-credits-bar-mini {
    width: 100%;
    order: 3;
  }
  .zr-critical-main .zr-critical-icon {
    font-size: 20px;
  }
  .zr-critical-text .zr-critical-title {
    font-size: 14px;
  }
  .zr-critical-text .zr-critical-subtitle {
    font-size: 12px;
  }
  .zr-recharge-button {
    width: 100%;
    padding: 10px;
  }
}
/* ============================================
   8. MODO CLARO (opcional)
   ============================================ */
@media (prefers-color-scheme: light) {
  .zr-credits-banner {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.08) 100%);
    border-top-color: rgba(239, 68, 68, 0.15);
    color: #1e293b;
  }
  .zr-credits-text,
  .zr-critical-subtitle {
    color: #64748b;
  }
  .zr-credits-text strong,
  .zr-critical-title,
  .zr-stat-value {
    color: #0f172a;
  }
  .zr-credits-bar-mini,
  .zr-credits-progress,
  .zr-critical-progress {
    background: rgba(0, 0, 0, 0.1);
  }
  .zr-conversation-mini,
  .zr-conversation-cost,
  .zr-stat-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
  }
}
/* ============================================
   9. UTILIDADES Y HELPERS
   ============================================ */
.zr-credits-hidden {
  display: none !important;
}

.zr-credits-loading {
  opacity: 0.6;
  pointer-events: none;
}

.zr-credits-updating .zr-credits-fill-mini,
.zr-credits-updating .zr-credits-progress-fill,
.zr-credits-updating .zr-critical-fill {
  animation: pulse-width 0.6s ease-in-out;
}

@keyframes pulse-width {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}
/* ============================================
   10. ACCESIBILIDAD
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .zr-credits-banner,
  .zr-credits-icon,
  .zr-critical-icon,
  .zr-credits-fill-mini,
  .zr-credits-progress-fill,
  .zr-critical-fill {
    animation: none !important;
    transition: none !important;
  }
}
.zr-recharge-button:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

/* ============================================
   FIN DEL ARCHIVO
   ============================================ */
.zr-footer-button-task {
  anchor-name: --task-button;
}

[popover] {
  position: fixed;
  inset: auto;
  margin: 0;
}

.zr-task-type-popover {
  position-anchor: --task-button;
  bottom: anchor(top);
  left: anchor(left);
  margin-bottom: 4px;
}

.zr-popover {
  background: var(--bg-primary, #ffffff);
  border-radius: 8px;
  border: 1px solid var(--border-color, #d0d0d0);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  animation: slideUp 0.2s ease;
  max-height: 400px;
  overflow-y: auto;
  padding: 0;
  width: auto;
  max-width: 300px;
}

.zr-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}
.zr-popover-header h3 {
  font-size: 12px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary, #333);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.zr-popover-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary, #999);
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.zr-popover-close:hover {
  color: var(--text-primary, #333);
}

.zr-popover-content {
  padding: 4px;
}

.zr-task-type-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.zr-task-type-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary, #333);
  text-align: left;
  width: 100%;
}
.zr-task-type-option i {
  font-size: 16px;
  flex: 0 0 auto;
  opacity: 0.7;
}
.zr-task-type-option:first-child {
  border-radius: 8px 8px 0 0;
}
.zr-task-type-option:last-child {
  border-radius: 0 0 8px 8px;
}
.zr-task-type-option:hover {
  background: var(--bg-secondary, #f5f5f5);
}
.zr-task-type-option:hover i {
  opacity: 1;
}
.zr-task-type-option.active {
  background: rgba(0, 122, 204, 0.1);
  color: var(--accent-color, #007acc);
  font-weight: 600;
}
.zr-task-type-option.active i {
  color: var(--accent-color, #007acc);
}

.zr-task-type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.zr-task-type-name {
  flex: 1;
  font-size: 13px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.zr-footer-button-model {
  anchor-name: --model-button;
}

.zr-model-popover {
  position-anchor: --model-button;
  bottom: anchor(top);
  left: anchor(left);
  margin-bottom: 4px;
}

.zr-model-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.zr-model-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary, #333);
  text-align: left;
  width: 100%;
  position: relative;
}
.zr-model-option i {
  font-size: 16px;
  flex: 0 0 auto;
  opacity: 0.7;
}
.zr-model-option:hover {
  background: var(--bg-secondary, #f5f5f5);
}
.zr-model-option:hover i {
  opacity: 1;
}
.zr-model-option.active {
  background: rgba(0, 122, 204, 0.1);
  color: var(--accent-color, #007acc);
  font-weight: 600;
}
.zr-model-option.active i {
  color: var(--accent-color, #007acc);
}

.zr-model-name {
  flex: 1;
  font-size: 13px;
}

.zr-model-logo {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 14px;
  flex: 0 0 auto;
  overflow: hidden;
}
.zr-model-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
}

.zr-model-provider {
  font-size: 10px;
}

.zr-model-favorite {
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s;
  flex: 0 0 auto;
  cursor: pointer;
}
.zr-model-option:hover .zr-model-favorite {
  opacity: 0.5;
}
.zr-model-favorite.active {
  opacity: 1;
  color: #ffc107;
}

.zr-popover {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color, #d0d0d0) transparent;
}

.zr-popover::-webkit-scrollbar {
  width: 6px;
}

.zr-popover::-webkit-scrollbar-track {
  background: transparent;
}

.zr-popover::-webkit-scrollbar-thumb {
  background: var(--border-color, #d0d0d0);
  border-radius: 3px;
}
.zr-popover::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary, #999);
}

.zr-model-favorite {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  opacity: 0.4;
  transition: opacity 0.2s, color 0.2s;
}
.zr-model-favorite i {
  color: var(--text-secondary, #999);
  transition: color 0.2s;
}
.zr-model-favorite.active {
  opacity: 1;
}
.zr-model-favorite.active i {
  color: #e74c3c;
}
.zr-model-option:hover .zr-model-favorite {
  opacity: 0.8;
}

.zr-footer-button-documents {
  anchor-name: --documents-button;
}

.zr-documents-popover {
  position-anchor: --documents-button;
  bottom: anchor(top);
  left: anchor(left);
  margin-bottom: 8px;
  max-width: 750px;
  max-height: 680px;
  width: auto;
  padding: 0 !important;
  display: none !important;
}
.zr-documents-popover:popover-open {
  display: flex !important;
  flex-direction: column;
}

.zr-popover-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--accent-color, #007acc) 0%, rgba(0, 122, 204, 0.85) 100%);
  border-bottom: none;
  color: white;
}
.zr-popover-header h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: white;
}

.zr-popover-close {
  color: white;
  opacity: 0.8;
}
.zr-popover-close:hover {
  opacity: 1;
  color: white;
}

.zr-documents-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  background: var(--border-color, #e0e0e0);
  min-height: 400px;
  max-height: 400px;
}

.zr-documents-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary, #f9f9f9);
  border-right: 1px solid var(--border-color, #e0e0e0);
}

.zr-documents-search {
  display: flex;
  align-items: center;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  gap: 8px;
  background: var(--bg-primary, #ffffff);
}
.zr-documents-search i {
  color: var(--text-secondary, #999);
  font-size: 14px;
  flex: 0 0 auto;
}

.zr-documents-search .zr-search-input {
  flex: 1;
  border: 1px solid var(--border-color, #e0e0e0);
  background: var(--bg-secondary, #f9f9f9);
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--text-primary, #333);
}
.zr-documents-search .zr-search-input::placeholder {
  color: var(--text-secondary, #999);
}
.zr-documents-search .zr-search-input:focus {
  outline: none;
  border-color: var(--accent-color, #007acc);
  background: var(--bg-primary, #ffffff);
}

.zr-documents-libraries {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.zr-library-wrapper {
  margin-bottom: 8px;
  border: none;
  background: var(--bg-primary, #ffffff);
  border-radius: 6px;
  overflow: hidden;
}
.zr-library-wrapper:last-child {
  margin-bottom: 0;
}

.zr-library-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-primary, #ffffff);
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary, #333);
  transition: all 0.2s ease;
}
.zr-library-header:hover {
  background: rgba(0, 122, 204, 0.08);
}

.zr-library-icon {
  font-size: 14px;
  flex: 0 0 auto;
  opacity: 0.7;
}

.zr-library-name {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zr-library-toggle {
  font-size: 11px;
  flex: 0 0 auto;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.zr-library-content {
  padding: 0;
}

.zr-category-wrapper {
  margin-bottom: 0;
}

.zr-category-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary, #333);
  transition: all 0.2s ease;
}
.zr-category-header:hover {
  background: rgba(0, 122, 204, 0.05);
}
.zr-category-header.active {
  background: rgba(0, 122, 204, 0.12);
  font-weight: 700;
  border-left: 3px solid var(--accent-color, #007acc);
  padding-left: 7px;
}

.zr-category-icon {
  font-size: 12px;
  flex: 0 0 auto;
  opacity: 0.6;
}

.zr-category-name {
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zr-category-toggle {
  font-size: 10px;
  flex: 0 0 auto;
  opacity: 0.5;
}

.zr-category-content {
  padding: 0;
}

.zr-documents-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary, #ffffff);
}

.zr-documents-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  background: var(--bg-primary, #ffffff);
  flex: 0 0 auto;
}

.zr-btn-small {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border-color, #d0d0d0);
  border-radius: 5px;
  background: var(--bg-secondary, #f9f9f9);
  color: var(--text-primary, #333);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.zr-btn-small i {
  font-size: 13px;
}
.zr-btn-small:hover {
  border-color: var(--accent-color, #007acc);
  background: rgba(0, 122, 204, 0.05);
  color: var(--accent-color, #007acc);
}

.zr-selected-documents {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

.zr-document-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  margin-bottom: 6px;
  border-radius: 5px;
  background: var(--bg-secondary, #f9f9f9);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.zr-document-item:last-child {
  margin-bottom: 0;
}
.zr-document-item:hover {
  background: rgba(0, 122, 204, 0.05);
  border-color: var(--border-color, #e0e0e0);
}

.zr-document-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex: 0 0 auto;
  accent-color: var(--accent-color, #007acc);
}

.zr-document-icon {
  font-size: 13px;
  flex: 0 0 auto;
  opacity: 0.7;
}

.zr-document-info {
  flex: 1;
  min-width: 0;
}

.zr-document-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary, #333);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zr-document-type {
  font-size: 10px;
  color: var(--text-secondary, #999);
  margin-top: 2px;
}

.zr-document-delete {
  opacity: 0;
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  font-size: 13px;
  flex: 0 0 auto;
  transition: opacity 0.2s;
}
.zr-document-item:hover .zr-document-delete {
  opacity: 0.8;
}
.zr-document-delete:hover {
  opacity: 1;
}

.zr-documents-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-color, #e0e0e0);
  background: var(--bg-secondary, #f9f9f9);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #333);
  text-align: center;
  flex: 0 0 auto;
}

.zr-footer-button-project {
  anchor-name: --project-button;
}

.zr-projects-popover {
  position-anchor: --project-button;
  bottom: anchor(top);
  left: anchor(left);
  margin-bottom: 4px;
  max-width: 280px;
  max-height: 400px;
}

.zr-projects-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.zr-project-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary, #333);
  text-align: left;
  width: 100%;
}
.zr-project-option i {
  font-size: 14px;
  flex: 0 0 auto;
  opacity: 0.6;
}
.zr-project-option:first-child {
  border-radius: 6px 6px 0 0;
}
.zr-project-option:last-child {
  border-radius: 0 0 6px 6px;
}
.zr-project-option:hover {
  background: var(--bg-secondary, #f5f5f5);
}
.zr-project-option:hover i {
  opacity: 1;
}
.zr-project-option.active {
  background: rgba(0, 122, 204, 0.1);
  color: var(--accent-color, #007acc);
  font-weight: 600;
}
.zr-project-option.active i {
  color: var(--accent-color, #007acc);
}

.zr-project-name {
  flex: 1;
  font-size: 13px;
}

.zr-documents-popover .zr-document-item.zr-doc-truncated {
  border-left: 3px solid #ffc107;
  background-color: #fffbf0;
}
.zr-documents-popover .zr-document-item.zr-doc-truncated:hover {
  background-color: #fff8e1;
}
.zr-documents-popover .zr-doc-badge-small {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.4rem;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  vertical-align: middle;
  background-color: #fff3cd !important;
  color: #856404 !important;
  border: 1px solid #ffc107;
  font-weight: 500;
}
.zr-documents-popover .zr-doc-badge-small .bi-exclamation-triangle {
  font-size: 0.65rem;
  color: #ff9800;
}
.zr-documents-popover .zr-doc-meta-info {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 0.25rem;
  font-style: italic;
}

.zr-toasts {
  position: fixed;
  top: var(--zr-space-4);
  right: var(--zr-space-4);
  z-index: var(--zr-z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--zr-space-2);
}

@media (max-width: 767px) {
  .zr-toasts {
    top: calc(var(--zr-mobile-header-height) + var(--zr-space-4));
    left: var(--zr-space-4);
    right: var(--zr-space-4);
  }
}
.zr-toast {
  background: var(--zr-bg-tertiary);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-lg);
  padding: var(--zr-space-3) var(--zr-space-4);
  display: flex;
  align-items: center;
  gap: var(--zr-space-3);
  min-width: 300px;
  opacity: 0;
  transform: translateX(100%);
  transition: all var(--zr-transition-normal);
}

@media (max-width: 767px) {
  .zr-toast {
    min-width: auto;
  }
}
.zr-toast.zr-toast-success {
  border-color: var(--zr-success);
}

.zr-toast.zr-toast-error {
  border-color: var(--zr-error);
}

.zr-toast.zr-toast-warning {
  border-color: var(--zr-warning);
}

.zr-toast .zr-toast-content {
  display: flex;
  align-items: center;
  gap: var(--zr-space-2);
  flex: 1;
}

.zr-toast .zr-toast-content .zr-toast-icon {
  font-size: var(--zr-text-lg);
}

.zr-toast .zr-toast-content .zr-toast-message {
  font-size: var(--zr-text-sm);
  color: var(--zr-text-primary);
}

.zr-toast .zr-toast-close {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--zr-radius-full);
  background: transparent;
  color: var(--zr-text-muted);
}

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

.zr-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--zr-z-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--zr-transition-fast), pointer-events var(--zr-transition-fast);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.zr-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 5000;
}

.zr-modal-content {
  position: relative;
  background: var(--zr-bg-primary);
  border-radius: var(--zr-radius-2xl);
  border: 1px solid var(--zr-border);
  box-shadow: var(--zr-shadow-2xl);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 0.3s var(--zr-ease-out);
}

@keyframes modalSlideUp {
  from {
    transform: translateY(30px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
.zr-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--zr-space-6);
  border-bottom: 1px solid var(--zr-border);
  background: var(--zr-bg-secondary);
  flex-shrink: 0;
}
.zr-modal-header h3 {
  margin: 0;
  font-size: var(--zr-text-lg);
  font-weight: var(--zr-font-semibold);
  color: var(--zr-text-primary);
}

.zr-modal-close {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--zr-radius-lg);
  color: var(--zr-text-muted);
  font-size: var(--zr-text-lg);
  transition: var(--zr-transition-colors);
  flex-shrink: 0;
}
.zr-modal-close:hover {
  background: var(--zr-bg-tertiary);
  color: var(--zr-text-primary);
}
.zr-modal-close:focus-visible {
  outline: 2px solid var(--zr-primary);
  outline-offset: 2px;
}

.zr-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--zr-space-6);
  color: var(--zr-text-primary);
}
.zr-modal-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.zr-modal-body::-webkit-scrollbar-track {
  background: var(--zr-bg-secondary);
}
.zr-modal-body::-webkit-scrollbar-thumb {
  background: var(--zr-border);
  border-radius: var(--zr-radius-full);
}
.zr-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--zr-border-hover);
}

.zr-form-group {
  margin-bottom: var(--zr-space-6);
  display: flex;
  flex-direction: column;
}
.zr-form-group:last-child {
  margin-bottom: 0;
}

.zr-form-group label {
  display: block;
  font-size: var(--zr-text-sm);
  font-weight: var(--zr-font-semibold);
  color: var(--zr-text-primary);
  margin-bottom: var(--zr-space-2);
  text-transform: uppercase;
  letter-spacing: var(--zr-tracking-wide);
}

.zr-form-input {
  padding: var(--zr-space-3) var(--zr-space-4);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-lg);
  background: var(--zr-input-bg);
  color: var(--zr-input-text);
  font-size: var(--zr-text-base);
  font-family: var(--zr-font-primary);
  transition: var(--zr-transition-colors);
}
.zr-form-input::placeholder {
  color: var(--zr-input-placeholder);
}
.zr-form-input:hover {
  border-color: var(--zr-border-hover);
}
.zr-form-input:focus {
  outline: none;
  border-color: var(--zr-border-focus);
  box-shadow: 0 0 0 3px rgba(193, 206, 254, 0.1);
}
.zr-form-input:disabled {
  background: var(--zr-bg-secondary);
  color: var(--zr-text-disabled);
  cursor: not-allowed;
}

select.zr-form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23C1CEFE' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--zr-space-3) center;
  padding-right: var(--zr-space-10);
}
[data-theme=light] select.zr-form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235A6B7C' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

.zr-form-help {
  font-size: var(--zr-text-xs);
  color: var(--zr-text-muted);
  margin-top: var(--zr-space-1);
}

.zr-file-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.zr-file-input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.zr-file-input-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--zr-space-3);
  width: 100%;
  padding: var(--zr-space-8) var(--zr-space-4);
  border: 2px dashed var(--zr-border);
  border-radius: var(--zr-radius-lg);
  background: var(--zr-bg-secondary);
  color: var(--zr-text-secondary);
  font-size: var(--zr-text-sm);
  text-align: center;
  cursor: pointer;
  transition: var(--zr-transition-colors);
}
.zr-file-input-label i {
  font-size: var(--zr-text-2xl);
  opacity: 0.7;
}
.zr-file-input-wrapper:hover .zr-file-input-label {
  border-color: var(--zr-border-focus);
  background: var(--zr-bg-tertiary);
  color: var(--zr-text-primary);
}
.zr-file-input-wrapper:hover .zr-file-input-label i {
  opacity: 1;
}

.zr-modal-footer {
  display: flex;
  gap: var(--zr-space-4);
  justify-content: flex-end;
  padding: var(--zr-space-6);
  border-top: 1px solid var(--zr-border);
  background: var(--zr-bg-secondary);
  flex-shrink: 0;
}

.zr-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--zr-space-3) var(--zr-space-6);
  height: auto;
  border-radius: var(--zr-radius-lg);
  font-size: var(--zr-text-sm);
  font-weight: var(--zr-font-semibold);
  transition: var(--zr-transition-colors);
  text-transform: uppercase;
  letter-spacing: var(--zr-tracking-wide);
  white-space: nowrap;
}
.zr-btn i {
  margin-right: var(--zr-space-2);
}
.zr-btn:focus-visible {
  outline: 2px solid var(--zr-primary);
  outline-offset: 2px;
}
.zr-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.zr-btn-primary {
  background: var(--zr-primary);
  color: #ffffff;
  border: 1px solid var(--zr-primary);
}
.zr-btn-primary:hover:not(:disabled) {
  background: var(--zr-primary-hover);
  border-color: var(--zr-primary-hover);
}
.zr-btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.zr-btn-secondary {
  background: transparent;
  color: var(--zr-text-primary);
  border: 1px solid var(--zr-border);
}
.zr-btn-secondary:hover:not(:disabled) {
  background: var(--zr-bg-tertiary);
  border-color: var(--zr-border-hover);
  color: var(--zr-accent);
}
.zr-btn-secondary:active:not(:disabled) {
  transform: scale(0.98);
}

.zr-loading {
  text-align: center;
  padding: var(--zr-space-8) var(--zr-space-4);
  color: var(--zr-text-secondary);
  font-size: var(--zr-text-sm);
}
.zr-loading::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--zr-text-secondary);
  border-radius: 50%;
  margin-left: var(--zr-space-2);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}
.zr-empty-state {
  text-align: center;
  padding: var(--zr-space-8) var(--zr-space-4);
  color: var(--zr-text-muted);
  font-size: var(--zr-text-sm);
}

.zr-error {
  text-align: center;
  padding: var(--zr-space-6);
  background: var(--zr-error-bg);
  color: var(--zr-error);
  border-radius: var(--zr-radius-lg);
  font-size: var(--zr-text-sm);
}

@media (max-width: 768px) {
  .zr-modal-content {
    width: 95%;
    max-width: none;
  }
  .zr-modal-header,
  .zr-modal-body,
  .zr-modal-footer {
    padding: var(--zr-space-4);
  }
  .zr-modal-footer {
    flex-direction: column-reverse;
  }
  .zr-modal-footer .zr-btn {
    width: 100%;
  }
}
.zr-modal-image-studio {
  max-width: 95vw;
  width: 95%;
  height: 90vh;
  max-height: 900px;
}
@media (max-width: 768px) {
  .zr-modal-image-studio {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }
}

.zr-image-studio-body {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0;
  padding: 0 !important;
  height: calc(90vh - 70px);
  max-height: 830px;
  overflow: hidden;
}
@media (max-width: 900px) {
  .zr-image-studio-body {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow-y: auto;
  }
}

.zr-studio-config {
  display: flex;
  flex-direction: column;
  padding: var(--zr-space-4);
  border-right: 1px solid var(--zr-border);
  overflow-y: auto;
  background: var(--zr-bg-secondary);
}
.zr-studio-config::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.zr-studio-config::-webkit-scrollbar-track {
  background: var(--zr-bg-secondary);
}
.zr-studio-config::-webkit-scrollbar-thumb {
  background: var(--zr-border);
  border-radius: var(--zr-radius-full);
}
.zr-studio-config::-webkit-scrollbar-thumb:hover {
  background: var(--zr-border-hover);
}
@media (max-width: 900px) {
  .zr-studio-config {
    border-right: none;
    border-bottom: 1px solid var(--zr-border);
    max-height: 60vh;
  }
}
.zr-studio-config .zr-form-group {
  margin-bottom: var(--zr-space-4);
  flex-shrink: 0;
}
.zr-studio-config .zr-form-group > label {
  display: flex;
  align-items: center;
  gap: var(--zr-space-2);
  font-size: var(--zr-text-xs);
  font-weight: var(--zr-font-semibold);
  color: var(--zr-text-secondary);
  margin-bottom: var(--zr-space-2);
  text-transform: uppercase;
  letter-spacing: var(--zr-tracking-wide);
}
.zr-studio-config .zr-form-group > textarea {
  width: 100%;
}

.zr-accordion-item {
  margin-bottom: var(--zr-space-3);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-md);
  overflow: hidden;
  flex-shrink: 0;
}
.zr-accordion-item.active {
  border-color: var(--zr-primary);
}
.zr-accordion-item.active .zr-accordion-header {
  background: var(--zr-bg-primary);
  border-bottom: 1px solid var(--zr-border);
}
.zr-accordion-item.active .zr-accordion-icon {
  transform: rotate(180deg);
}

.zr-accordion-header {
  display: flex;
  align-items: center;
  padding: var(--zr-space-2) var(--zr-space-3);
  cursor: pointer;
  font-weight: var(--zr-font-semibold);
  font-size: var(--zr-text-sm);
  color: var(--zr-text-primary);
  background: var(--zr-bg-secondary);
  transition: var(--zr-transition-colors);
}
.zr-accordion-header:hover {
  background: var(--zr-bg-tertiary);
}
.zr-accordion-header i:first-child {
  margin-right: var(--zr-space-2);
  color: var(--zr-primary);
}
.zr-accordion-header span {
  flex-grow: 1;
}
.zr-accordion-header .zr-accordion-icon {
  margin-left: var(--zr-space-2);
  font-size: var(--zr-text-xs);
  color: var(--zr-text-muted);
  transition: transform var(--zr-transition-fast);
}

.zr-accordion-content {
  padding: var(--zr-space-3);
  background: var(--zr-bg-primary);
  overflow-y: hidden;
}
.zr-accordion-content #negative-prompt-group {
  margin-bottom: 0;
}
.zr-accordion-content #params-section {
  margin-bottom: 0;
}

#snippets-categories-container {
  display: flex;
  flex-direction: column;
  gap: var(--zr-space-4);
}

.zr-snippet-category .zr-snippet-category-header {
  display: flex;
  align-items: center;
  gap: var(--zr-space-2);
  margin-bottom: var(--zr-space-2);
  font-size: var(--zr-text-xs);
  font-weight: var(--zr-font-semibold);
  color: var(--zr-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--zr-tracking-wide);
}
.zr-snippet-category .zr-snippet-category-header i {
  font-size: var(--zr-text-sm);
  opacity: 0.7;
}

.zr-snippets-thumbs-scroll {
  display: flex;
  gap: var(--zr-space-3);
  overflow-x: auto;
  padding-bottom: var(--zr-space-2);
}
.zr-snippets-thumbs-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.zr-snippets-thumbs-scroll::-webkit-scrollbar-track {
  background: var(--zr-bg-secondary);
}
.zr-snippets-thumbs-scroll::-webkit-scrollbar-thumb {
  background: var(--zr-border);
  border-radius: var(--zr-radius-full);
}
.zr-snippets-thumbs-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--zr-border-hover);
}

.zr-snippet-thumb-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90px;
  cursor: pointer;
  text-align: center;
}
.zr-snippet-thumb-item .zr-snippet-name {
  margin-top: var(--zr-space-1);
  font-size: var(--zr-text-xs);
  font-weight: var(--zr-font-medium);
  color: var(--zr-text-secondary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.zr-snippet-thumb-item:hover .zr-snippet-name {
  color: var(--zr-text-primary);
}

.zr-snippet-thumb {
  width: 90px;
  height: 90px;
  border-radius: var(--zr-radius-lg);
  border: 2px solid var(--zr-border);
  background-size: cover;
  background-position: center;
  background-color: var(--zr-bg-tertiary);
  transition: var(--zr-transition-colors);
}
.zr-snippet-thumb:hover {
  border-color: var(--zr-border-hover);
}
.zr-snippet-thumb.active {
  border-color: var(--zr-primary);
  box-shadow: 0 0 0 2px var(--zr-bg-primary), 0 0 0 4px var(--zr-primary);
}

.zr-snippet-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--zr-space-1);
  padding: var(--zr-space-1) var(--zr-space-2);
  background: var(--zr-bg-primary);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-full);
  font-size: var(--zr-text-xs);
  color: var(--zr-text-secondary);
  cursor: pointer;
  transition: var(--zr-transition-colors);
}
.zr-snippet-chip:hover {
  background: var(--zr-bg-tertiary);
  border-color: var(--zr-border-hover);
  color: var(--zr-text-primary);
}
.zr-snippet-chip.active {
  background: var(--zr-primary);
  border-color: var(--zr-primary);
  color: white;
}
.zr-snippet-chip.is-negative.active {
  background: var(--zr-error);
  border-color: var(--zr-error);
}
.zr-snippet-chip .zr-chip-icon {
  font-size: var(--zr-text-sm);
}
.zr-snippet-chip .zr-chip-thumb {
  width: 20px;
  height: 20px;
  border-radius: var(--zr-radius-xs);
  object-fit: cover;
}

.zr-params-section {
  flex-shrink: 0;
}
.zr-params-section > label {
  display: none;
}

.zr-params-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--zr-space-3);
}

.zr-param-group .zr-param-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--zr-space-1);
  font-size: var(--zr-text-xs);
  color: var(--zr-text-secondary);
}
.zr-param-group .zr-param-header .zr-param-value {
  font-weight: var(--zr-font-semibold);
  color: var(--zr-primary);
}
.zr-param-group .zr-param-header .zr-param-hint {
  font-size: 10px;
  color: var(--zr-text-muted);
}
.zr-param-group .zr-form-input,
.zr-param-group .zr-form-select {
  padding: var(--zr-space-2);
  font-size: var(--zr-text-xs);
}

.zr-slider {
  width: 100%;
  height: 4px;
  border-radius: var(--zr-radius-full);
  background: var(--zr-bg-tertiary);
  outline: none;
  appearance: none;
  cursor: pointer;
}
.zr-slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--zr-primary);
  cursor: pointer;
  border: 2px solid var(--zr-bg-primary);
  box-shadow: var(--zr-shadow-sm);
}
.zr-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--zr-primary);
  cursor: pointer;
  border: 2px solid var(--zr-bg-primary);
}

.zr-prompt-preview {
  padding: var(--zr-space-2) var(--zr-space-3);
  background: var(--zr-bg-primary);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-md);
  font-size: var(--zr-text-xs);
  color: var(--zr-text-primary);
  line-height: 1.4;
  max-height: 80px;
  overflow-y: auto;
}
.zr-prompt-preview::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.zr-prompt-preview::-webkit-scrollbar-track {
  background: var(--zr-bg-secondary);
}
.zr-prompt-preview::-webkit-scrollbar-thumb {
  background: var(--zr-border);
  border-radius: var(--zr-radius-full);
}
.zr-prompt-preview::-webkit-scrollbar-thumb:hover {
  background: var(--zr-border-hover);
}
.zr-prompt-preview .zr-text-muted {
  color: var(--zr-text-muted);
  font-style: italic;
}
.zr-prompt-preview .zr-preview-negative {
  display: block;
  margin-top: var(--zr-space-1);
  padding-top: var(--zr-space-1);
  border-top: 1px dashed var(--zr-border);
  color: var(--zr-error);
  font-size: 10px;
}

.zr-studio-generate {
  display: flex;
  flex-direction: column;
  gap: var(--zr-space-2);
  padding-top: var(--zr-space-3);
  border-top: 1px solid var(--zr-border);
  margin-top: auto;
  flex-shrink: 0;
}
.zr-studio-generate .zr-generation-status {
  font-size: var(--zr-text-xs);
  color: var(--zr-text-muted);
  text-align: center;
  min-height: 18px;
}
.zr-studio-generate .zr-generation-status.generating {
  color: var(--zr-primary);
}
.zr-studio-generate .zr-generation-status.error {
  color: var(--zr-error);
}
.zr-studio-generate .zr-generation-status.success {
  color: var(--zr-success);
}

.zr-btn-block {
  width: 100%;
  justify-content: center;
}

.zr-studio-result {
  display: flex;
  flex-direction: column;
  background: var(--zr-bg-primary);
  overflow: hidden;
}
@media (max-width: 900px) {
  .zr-studio-result {
    min-height: 400px;
  }
}

.zr-result-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--zr-space-4);
  min-height: 300px;
  overflow: hidden;
}

.zr-result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--zr-space-3);
  color: var(--zr-text-muted);
  text-align: center;
  padding: var(--zr-space-8);
}
.zr-result-placeholder i {
  font-size: 4rem;
  opacity: 0.3;
}
.zr-result-placeholder p {
  font-size: var(--zr-text-sm);
  margin: 0;
}

.zr-result-image-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.zr-result-image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--zr-radius-lg);
  box-shadow: var(--zr-shadow-lg);
}
.zr-result-image-wrapper .zr-result-actions {
  position: absolute;
  top: var(--zr-space-2);
  right: var(--zr-space-2);
  display: flex;
  gap: var(--zr-space-1);
  opacity: 0;
  transition: opacity var(--zr-transition-fast);
}
.zr-result-image-wrapper .zr-result-actions .zr-btn {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  backdrop-filter: blur(4px);
}
.zr-result-image-wrapper .zr-result-actions .zr-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}
.zr-result-image-wrapper:hover .zr-result-actions {
  opacity: 1;
}

.zr-result-history {
  flex-shrink: 0;
  border-top: 1px solid var(--zr-border);
  background: var(--zr-bg-secondary);
  padding: var(--zr-space-3);
}

.zr-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--zr-space-2);
  font-size: var(--zr-text-xs);
  color: var(--zr-text-muted);
}
.zr-history-header span:first-child {
  display: flex;
  align-items: center;
  gap: var(--zr-space-1);
  font-weight: var(--zr-font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--zr-tracking-wide);
}

.zr-history-thumbs {
  display: flex;
  gap: var(--zr-space-2);
  overflow-x: auto;
  padding-bottom: var(--zr-space-2);
}
.zr-history-thumbs::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.zr-history-thumbs::-webkit-scrollbar-track {
  background: var(--zr-bg-secondary);
}
.zr-history-thumbs::-webkit-scrollbar-thumb {
  background: var(--zr-border);
  border-radius: var(--zr-radius-full);
}
.zr-history-thumbs::-webkit-scrollbar-thumb:hover {
  background: var(--zr-border-hover);
}
.zr-history-thumbs:empty::after {
  content: "Las imágenes generadas aparecerán aquí";
  display: block;
  width: 100%;
  text-align: center;
  font-size: var(--zr-text-xs);
  color: var(--zr-text-muted);
  padding: var(--zr-space-4);
}

.zr-history-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--zr-radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--zr-transition-colors);
}
.zr-history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.zr-history-thumb:hover {
  border-color: var(--zr-border-hover);
}
.zr-history-thumb.active {
  border-color: var(--zr-primary);
}

.zr-prompt-input-wrapper {
  position: relative;
}
.zr-prompt-input-wrapper .zr-form-textarea {
  padding-right: 40px;
  resize: none;
  width: 100%;
}
.zr-prompt-input-wrapper .zr-btn-translate {
  position: absolute;
  right: var(--zr-space-2);
  bottom: var(--zr-space-2);
  padding: var(--zr-space-1);
  background: var(--zr-bg-tertiary);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-sm);
  color: var(--zr-text-muted);
  cursor: pointer;
  transition: var(--zr-transition-colors);
  line-height: 1;
}
.zr-prompt-input-wrapper .zr-btn-translate:hover {
  background: var(--zr-primary);
  color: white;
  border-color: var(--zr-primary);
}
.zr-prompt-input-wrapper .zr-btn-translate i {
  font-size: var(--zr-text-sm);
}

.zr-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}
.zr-btn.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.zr-footer-button-image-config {
  background: linear-gradient(135deg, var(--zr-primary), var(--zr-accent));
  color: var(--zr-text-inverse);
  border: none;
  padding: var(--zr-space-3) var(--zr-space-5);
  border-radius: var(--zr-button-radius);
  font-weight: var(--zr-font-semibold);
  transition: var(--zr-transition-normal);
}
.zr-footer-button-image-config > i, .zr-footer-button-image-config span {
  color: var(--zr-text-inverse);
  transition: color var(--zr-duration-150) var(--zr-ease-out);
}
.zr-footer-button-image-config:hover {
  background: var(--zr-gradient-accent);
  box-shadow: var(--zr-shadow-accent);
  transform: scale(1.02);
}
.zr-footer-button-image-config:active {
  background: var(--zr-accent-700);
  box-shadow: none;
  transform: scale(0.98);
  transition-duration: var(--zr-duration-75);
}

.zr-image-reference-upload {
  margin-bottom: var(--zr-space-3);
}

.zr-upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--zr-space-2);
  padding: var(--zr-space-6) var(--zr-space-4);
  border: 2px dashed var(--zr-border);
  border-radius: var(--zr-radius-lg);
  background: var(--zr-bg-primary);
  cursor: pointer;
  transition: var(--zr-transition-colors);
}
.zr-upload-dropzone:hover, .zr-upload-dropzone.dragover {
  border-color: var(--zr-primary);
  background: rgba(var(--zr-primary-rgb), 0.05);
}
.zr-upload-dropzone:hover i, .zr-upload-dropzone.dragover i {
  color: var(--zr-primary);
  transform: translateY(-2px);
}
.zr-upload-dropzone i {
  font-size: 2rem;
  color: var(--zr-text-muted);
  transition: var(--zr-transition-colors), transform 0.2s ease;
}
.zr-upload-dropzone p {
  margin: 0;
  font-size: var(--zr-text-sm);
  color: var(--zr-text-secondary);
  font-weight: var(--zr-font-medium);
}
.zr-upload-dropzone .zr-text-muted {
  font-size: var(--zr-text-xs);
}

.zr-image-reference-preview {
  display: flex;
  align-items: center;
  gap: var(--zr-space-3);
  padding: var(--zr-space-3);
  background: var(--zr-bg-primary);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-lg);
}

.zr-reference-thumb {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: var(--zr-radius-md);
  overflow: hidden;
}
.zr-reference-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.zr-reference-thumb .zr-btn-remove-reference {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--zr-transition-fast);
}
.zr-reference-thumb .zr-btn-remove-reference:hover {
  background: var(--zr-error);
}
.zr-reference-thumb .zr-btn-remove-reference i {
  font-size: 12px;
}
.zr-reference-thumb:hover .zr-btn-remove-reference {
  opacity: 1;
}

.zr-reference-info {
  display: flex;
  flex-direction: column;
  gap: var(--zr-space-1);
  min-width: 0;
}
.zr-reference-info .zr-reference-name {
  font-size: var(--zr-text-sm);
  font-weight: var(--zr-font-medium);
  color: var(--zr-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.zr-reference-info .zr-reference-size {
  font-size: var(--zr-text-xs);
  color: var(--zr-text-muted);
}

.zr-param-hints {
  display: flex;
  justify-content: space-between;
  margin-top: var(--zr-space-1);
  font-size: 10px;
  color: var(--zr-text-muted);
}

.zr-image-reference-preview {
  display: none;
  flex-wrap: wrap;
  gap: var(--zr-space-2);
  padding: var(--zr-space-2);
  background: var(--zr-bg-primary);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-lg);
  margin-bottom: var(--zr-space-3);
}

.zr-reference-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--zr-space-1);
  width: 80px;
}

.zr-reference-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--zr-radius-md);
  overflow: hidden;
  border: 2px solid var(--zr-border);
  transition: border-color var(--zr-transition-fast);
}
.zr-reference-thumb:hover {
  border-color: var(--zr-primary);
}
.zr-reference-thumb:hover .zr-btn-remove-reference {
  opacity: 1;
}
.zr-reference-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.zr-reference-thumb .zr-btn-remove-reference {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--zr-transition-fast), background var(--zr-transition-fast);
}
.zr-reference-thumb .zr-btn-remove-reference:hover {
  background: var(--zr-error);
}
.zr-reference-thumb .zr-btn-remove-reference i {
  font-size: 10px;
}

.zr-reference-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
  width: 100%;
}
.zr-reference-info .zr-reference-name {
  font-size: 10px;
  font-weight: var(--zr-font-medium);
  color: var(--zr-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.zr-reference-info .zr-reference-size {
  font-size: 9px;
  color: var(--zr-text-muted);
}

.zr-image-reference-preview[style*="display: flex"] ~ .zr-image-reference-upload .zr-upload-dropzone {
  padding: var(--zr-space-3) var(--zr-space-2);
}
.zr-image-reference-preview[style*="display: flex"] ~ .zr-image-reference-upload .zr-upload-dropzone i {
  font-size: 1.5rem;
}
.zr-image-reference-preview[style*="display: flex"] ~ .zr-image-reference-upload .zr-upload-dropzone p {
  font-size: var(--zr-text-xs);
}
.zr-image-reference-preview[style*="display: flex"] ~ .zr-image-reference-upload .zr-upload-dropzone .zr-text-muted {
  display: none;
}

.zr-reference-count {
  font-size: var(--zr-text-xs);
  color: var(--zr-text-muted);
  text-align: center;
  margin-top: var(--zr-space-1);
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  height: 100%;
  font-family: var(--zr-font-primary);
  font-size: var(--zr-text-base);
  line-height: var(--zr-leading-normal);
  color: var(--zr-text-primary);
  background-color: var(--zr-bg-primary);
  overflow-x: hidden;
  transition: var(--zr-transition-colors);
}

@media (max-width: 767px) {
  .desktop-only {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .mobile-only {
    display: none !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.zr-app.public-page {
  height: auto;
  min-height: 100vh;
  overflow-y: auto;
}

.zr-public-main {
  height: auto;
  min-height: 100vh;
  overflow-y: auto;
}

.zr-app-container {
  display: flex;
  width: 100%;
}
@media (max-width: 767px) {
  .zr-app-container {
    flex-direction: column;
    padding-top: var(--zr-mobile-header-height);
  }
}

.zr-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-left: var(--zr-sidebar-current-width);
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (max-width: 767px) {
  .zr-main-content {
    height: calc(100vh - var(--zr-mobile-header-height));
    margin-left: 0;
  }
}

.zr-page-header {
  flex-shrink: 0;
  width: 100%;
}

.zr-chat-header {
  display: flex;
  align-items: center;
  padding: var(--zr-space-4);
  width: 100%;
  max-width: var(--zr-chat-max-width);
  margin-inline: auto;
}
.zr-chat-header .zr-chat-title-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.zr-chat-header .zr-chat-title-area h1 {
  font-size: var(--zr-text-2xl);
}
.zr-chat-header .zr-chat-title-area button {
  font-size: var(--zr-text-lg);
}
.zr-chat-header .zr-chat-title-area .zr-chat-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.zr-chat-header .zr-chat-title-area .zr-chat-meta .zr-model-badge {
  background: var(--zr-bg-secondary);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-xl);
  padding: var(--zr-space-1) var(--zr-space-3);
  font-size: var(--zr-text-sm);
  color: var(--zr-text-primary);
}
.zr-chat-header .zr-chat-title-area .zr-chat-meta .zr-message-count {
  font-size: var(--zr-text-sm);
  color: var(--zr-text-secondary);
}

.zr-messages-wrapper {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  background: var(--zr-bg-primary);
}

.zr-messages-container {
  width: 100%;
  max-width: var(--zr-chat-max-width);
  margin-inline: auto;
  padding: var(--zr-space-6) var(--zr-space-4);
  padding-bottom: var(--zr-space-8);
}
@media (max-width: 767px) {
  .zr-messages-container {
    padding: var(--zr-space-4);
    padding-bottom: var(--zr-space-6);
  }
}

.zr-welcome-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.zr-welcome-content {
  margin-top: 10vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.zr-welcome-content .zr-welcome-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
}
.zr-welcome-content .zr-welcome-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.zr-welcome-content h2 {
  font-family: var(--zr-font-display);
  font-size: var(--zr-text-2xl);
  font-weight: var(--zr-font-bold);
  margin-bottom: var(--zr-space-4);
  letter-spacing: var(--zr-tracking-tight);
  color: var(--zr-text-primary);
}
@media (max-width: 767px) {
  .zr-welcome-content h2 {
    font-size: var(--zr-text-xl);
  }
}
.zr-welcome-content p {
  font-size: var(--zr-text-lg);
  color: var(--zr-text-secondary);
  line-height: var(--zr-leading-relaxed);
  margin-bottom: var(--zr-space-8);
}
@media (max-width: 767px) {
  .zr-welcome-content p {
    font-size: var(--zr-text-base);
  }
}

.zr-suggested-prompts {
  margin-top: var(--zr-space-8);
}
.zr-suggested-prompts h3 {
  font-size: var(--zr-text-lg);
  font-weight: var(--zr-font-semibold);
  margin-bottom: var(--zr-space-4);
  text-align: center;
  color: var(--zr-text-secondary);
}

.zr-prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--zr-space-4);
  max-width: 600px;
  margin: 0 auto;
}
@media (max-width: 767px) {
  .zr-prompt-grid {
    grid-template-columns: 1fr;
    max-width: 300px;
  }
}

.zr-prompt-card {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--zr-bg-secondary);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-xl);
  padding: var(--zr-space-4);
  text-align: center;
  transition: var(--zr-transition-colors);
  cursor: pointer;
}
.zr-prompt-card:hover {
  background: var(--zr-bg-tertiary);
  border-color: var(--zr-primary);
  transform: translateY(-2px);
}
.zr-prompt-card .zr-prompt-icon {
  font-size: var(--zr-text-2xl);
  margin-bottom: var(--zr-space-2);
}
.zr-prompt-card .zr-prompt-text {
  font-size: var(--zr-text-sm);
  color: var(--zr-text-primary);
  line-height: var(--zr-leading-tight);
}

.zr-messages-list {
  display: block;
  padding-bottom: 25vh;
}

.zr-message {
  margin-bottom: var(--zr-space-6);
  display: flex;
  gap: var(--zr-space-3);
}
.zr-message.zr-message-user {
  flex-direction: row-reverse;
}
.zr-message.zr-message-user .zr-message-content {
  background: var(--zr-user-message-bg);
  border: 1px solid var(--zr-user-message-border);
  border-radius: var(--zr-radius-xl) var(--zr-radius-xl) var(--zr-radius-sm) var(--zr-radius-xl);
  padding: var(--zr-space-3) var(--zr-space-4);
  max-width: 90%;
  display: flex;
  align-items: center;
  gap: var(--zr-space-6);
  min-width: 20vw;
}
.zr-message.zr-message-user .zr-message-content .zr-message-text {
  color: var(--zr-text-primary);
  font-weight: var(--zr-font-medium);
}
.zr-message.zr-message-user .zr-message-avatar {
  background: var(--zr-primary);
  color: white;
}
.zr-message.zr-message-assistant .zr-message-content {
  background: transparent;
  max-width: 100%;
}
.zr-message.zr-message-assistant .zr-message-content .zr-message-text {
  color: var(--zr-text-primary);
  line-height: var(--zr-leading-relaxed);
}
.zr-message.zr-message-assistant .zr-message-avatar {
  background: var(--zr-bg-tertiary);
  color: var(--zr-primary);
  width: 40px;
  height: 40px;
}
.zr-message.zr-message-assistant .zr-message-avatar img {
  object-fit: contain;
  width: 100%;
  height: 100%;
}

.zr-message-avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.zr-message-body {
  flex: 1;
  min-width: 0;
}

.zr-message-meta {
  display: flex;
  align-items: center;
  gap: var(--zr-space-3);
  margin-top: var(--zr-space-2);
  font-size: var(--zr-text-xs);
  color: var(--zr-text-muted);
}
.zr-message-meta .zr-message-model {
  font-weight: var(--zr-font-medium);
  color: var(--zr-primary);
}
.zr-message-meta .zr-message-timing {
  color: var(--zr-success);
}

.zr-message-actions {
  display: flex;
  gap: var(--zr-space-1);
  opacity: 0;
  transition: var(--zr-transition-opacity);
}

.zr-message:hover .zr-message-actions {
  opacity: 1;
}

.zr-typing-indicator {
  margin-bottom: var(--zr-space-4);
}
.zr-typing-indicator:not(.show) {
  display: none;
}
.zr-typing-indicator.show {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

.zr-typing-animation {
  display: flex;
  align-items: center;
  gap: var(--zr-space-2);
  padding: var(--zr-space-3);
}
.zr-typing-animation .zr-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--zr-primary);
  animation: typing-pulse 1.4s infinite ease-in-out;
}
.zr-typing-animation .zr-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.zr-typing-animation .zr-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-pulse {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.zr-chat-input-area {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin-left: var(--zr-sidebar-current-width);
  background: var(--zr-bg-primary);
  padding: var(--zr-space-4);
  padding-bottom: var(--zr-space-6);
  z-index: var(--zr-z-10);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (max-width: 767px) {
  .zr-chat-input-area {
    margin-left: 0;
    padding: var(--zr-space-3);
    padding-bottom: var(--zr-space-4);
  }
}
@media (max-width: 767px) {
  .zr-chat-input-area {
    left: 0;
    padding: var(--zr-space-3);
  }
}
@media (max-width: 767px) {
  .zr-sidebar.collapsed ~ .zr-main-content .zr-chat-input-area {
    left: 0;
  }
}

.zr-input-container {
  width: 100%;
  max-width: var(--zr-chat-max-width);
  margin-inline: auto;
}

.zr-input-wrapper {
  position: relative;
  background: var(--zr-input-bg);
  border: 1px solid var(--zr-input-border);
  border-radius: var(--zr-input-radius);
  display: flex;
  align-items: flex-end;
  transition: var(--zr-transition-colors);
}
.zr-input-wrapper:focus-within {
  border-color: var(--zr-input-border-focus);
}

.zr-message-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--zr-input-text);
  font-family: var(--zr-font-primary);
  font-size: var(--zr-text-base);
  line-height: var(--zr-leading-normal);
  padding: var(--zr-space-4);
  resize: none;
  max-height: 200px;
  min-height: 52px;
}
.zr-message-input::placeholder {
  color: var(--zr-input-placeholder);
}

.zr-input-actions {
  display: flex;
  align-items: center;
  gap: var(--zr-space-2);
  padding: var(--zr-space-2);
}

.zr-input-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: var(--zr-space-2);
}
.zr-input-footer .zr-input-stats {
  font-size: var(--zr-text-xs);
  color: var(--zr-text-muted);
  margin-top: 4px;
}
@media (max-width: 767px) {
  .zr-input-footer {
    flex-direction: column;
    gap: var(--zr-space-2);
  }
  .zr-input-footer .zr-input-stats {
    align-self: flex-end;
    margin-top: 0;
  }
}

.zr-file-upload-area {
  width: 100%;
  max-width: var(--zr-chat-max-width);
  margin: var(--zr-space-3) auto 0 auto;
  background: var(--zr-bg-secondary);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-md);
  padding: var(--zr-space-2);
}
@media (min-width: 1024px) {
  .zr-file-upload-area {
    max-width: var(--zr-chat-max-width-lg);
  }
}

.zr-uploaded-files {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--zr-space-2);
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: var(--zr-space-1);
}
.zr-uploaded-files::-webkit-scrollbar {
  height: 6px;
}
.zr-uploaded-files::-webkit-scrollbar-track {
  background: var(--zr-bg-primary);
  border-radius: var(--zr-radius-sm);
}
.zr-uploaded-files::-webkit-scrollbar-thumb {
  background: var(--zr-border);
  border-radius: var(--zr-radius-sm);
}
.zr-uploaded-files::-webkit-scrollbar-thumb:hover {
  background: var(--zr-text-muted);
}
.zr-uploaded-files {
  scrollbar-width: thin;
  scrollbar-color: var(--zr-border) var(--zr-bg-primary);
}

.zr-file-item {
  display: inline-flex;
  align-items: center;
  gap: var(--zr-space-2);
  padding: var(--zr-space-2);
  background: var(--zr-bg-primary);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-sm);
  transition: var(--zr-transition-colors);
  max-width: 280px;
  min-width: 150px;
  flex-shrink: 0;
  min-height: 60px;
}
.zr-file-item:hover {
  background: var(--zr-bg-tertiary);
  border-color: var(--zr-primary);
}
.zr-file-item .zr-file-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.zr-file-item .zr-file-name {
  font-size: 12px;
  font-weight: var(--zr-font-normal);
  color: var(--zr-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.zr-file-item .zr-file-size {
  font-size: 10px;
  color: var(--zr-text-muted);
  margin-left: var(--zr-space-1);
  flex-shrink: 0;
}
.zr-file-item .zr-file-remove {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--zr-error);
  color: white;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--zr-transition-colors);
  flex-shrink: 0;
  margin-left: var(--zr-space-1);
}
.zr-file-item .zr-file-remove:hover {
  background: var(--zr-error-hover);
  transform: scale(1.1);
}

.zr-file-item.zr-file-image {
  height: auto;
  min-height: 60px;
  max-width: 200px;
  min-width: 180px;
  padding: var(--zr-space-2);
}
.zr-file-item.zr-file-image .zr-file-thumbnail {
  width: 50px;
  height: 50px;
  border-radius: var(--zr-radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--zr-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.zr-file-item.zr-file-image .zr-file-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.zr-file-item.zr-file-image .zr-file-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.zr-file-item.zr-file-image .zr-file-info .zr-file-name {
  font-size: 11px;
  line-height: 1.2;
}
.zr-file-item.zr-file-image .zr-file-info .zr-file-size {
  font-size: 9px;
  margin-left: 0;
}
.zr-file-item.zr-file-image .zr-file-remove {
  align-self: flex-start;
  margin-top: 2px;
}

@media (max-width: 767px) {
  .zr-file-item {
    min-width: 140px;
    max-width: 250px;
  }
  .zr-file-item.zr-file-image {
    min-width: 160px;
    max-width: 180px;
  }
  .zr-file-item.zr-file-image .zr-file-thumbnail {
    width: 40px;
    height: 40px;
  }
}
.zr-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--zr-space-3) var(--zr-space-4);
  border-radius: var(--zr-button-radius);
  font-family: var(--zr-font-primary);
  font-weight: var(--zr-font-medium);
  font-size: var(--zr-text-sm);
  gap: var(--zr-space-2);
  transition: var(--zr-transition-colors);
  text-decoration: none;
  cursor: pointer;
}
.zr-btn:focus-visible {
  outline: 2px solid var(--zr-primary);
  outline-offset: 2px;
}
.zr-btn:disabled {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

.zr-btn-primary {
  background: var(--zr-button-bg);
  color: var(--zr-button-text);
  border: 1px solid var(--zr-button-bg);
}
.zr-btn-primary:hover:not(:disabled) {
  background: var(--zr-button-bg-hover);
  border-color: var(--zr-button-bg-hover);
}

.zr-btn-ghost {
  background: transparent;
  color: var(--zr-text-primary);
  border: 1px solid transparent;
}
.zr-btn-ghost:hover:not(:disabled) {
  background: var(--zr-bg-hover);
  border-color: var(--zr-border-hover);
}

.zr-btn-sm {
  padding: var(--zr-space-2) var(--zr-space-3);
  font-size: var(--zr-text-xs);
}

.zr-btn-lg {
  padding: var(--zr-space-4) var(--zr-space-6);
  font-size: var(--zr-text-lg);
}

.zr-btn-block {
  width: 100%;
  justify-content: center;
}

.zr-code-block-wrapper {
  margin: var(--zr-space-4) 0;
  border-radius: var(--zr-radius-lg);
  overflow: hidden;
  border: 1px solid var(--zr-border);
  background: var(--zr-code-bg);
}
.zr-code-block-wrapper .zr-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--zr-space-3) var(--zr-space-4);
  background: var(--zr-code-bg-alt);
  border-bottom: 1px solid var(--zr-border);
}
.zr-code-block-wrapper .zr-code-header .zr-language-label {
  font-size: var(--zr-text-xs);
  color: var(--zr-text-secondary);
  text-transform: uppercase;
  font-weight: var(--zr-font-medium);
  letter-spacing: 0.05em;
}
.zr-code-block-wrapper .zr-code-header .zr-copy-button {
  background: var(--zr-button-bg);
  color: var(--zr-button-text);
  border: none;
  padding: var(--zr-space-1) var(--zr-space-2);
  border-radius: var(--zr-radius-sm);
  font-size: var(--zr-text-xs);
  cursor: pointer;
  transition: var(--zr-transition-colors);
}
.zr-code-block-wrapper .zr-code-header .zr-copy-button:hover {
  background: var(--zr-button-bg-hover);
}
.zr-code-block-wrapper pre {
  margin: 0;
  padding: var(--zr-space-4);
  overflow-x: auto;
  background: transparent;
}
.zr-code-block-wrapper pre code {
  font-family: var(--zr-font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre;
  word-wrap: normal;
}

.zr-inline-code {
  background: var(--zr-inline-code-bg);
  color: var(--zr-inline-code-text);
  padding: 0.125rem 0.375rem;
  border-radius: var(--zr-radius-sm);
  font-family: var(--zr-font-mono);
  font-size: 0.875em;
  border: 1px solid var(--zr-inline-code-border);
}

.zr-auth-required {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--zr-space-6);
}
.zr-auth-required .zr-auth-content {
  text-align: center;
  max-width: 400px;
}
.zr-auth-required .zr-auth-content .zr-brand-large {
  margin-bottom: var(--zr-space-8);
}
.zr-auth-required .zr-auth-content .zr-brand-large .zr-brand-icon-large {
  font-size: 5rem;
  margin-bottom: var(--zr-space-4);
  opacity: 0.8;
}
.zr-auth-required .zr-auth-content .zr-brand-large h1 {
  font-family: var(--zr-font-display);
  font-size: var(--zr-text-3xl);
  font-weight: var(--zr-font-bold);
  letter-spacing: var(--zr-tracking-tight);
  margin-bottom: var(--zr-space-2);
}
.zr-auth-required .zr-auth-content .zr-brand-large p {
  color: var(--zr-text-secondary);
  font-size: var(--zr-text-lg);
}

.zr-toasts {
  position: fixed;
  top: var(--zr-space-4);
  right: var(--zr-space-4);
  z-index: var(--zr-z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--zr-space-2);
}
@media (max-width: 767px) {
  .zr-toasts {
    top: calc(var(--zr-mobile-header-height) + var(--zr-space-4));
    left: var(--zr-space-4);
    right: var(--zr-space-4);
  }
}

.zr-toast {
  background: var(--zr-bg-tertiary);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-lg);
  padding: var(--zr-space-3) var(--zr-space-4);
  display: flex;
  align-items: center;
  gap: var(--zr-space-3);
  min-width: 300px;
  opacity: 0;
  transform: translateX(100%);
  transition: all var(--zr-transition-normal);
}
@media (max-width: 767px) {
  .zr-toast {
    min-width: auto;
  }
}
.zr-toast.zr-toast-success {
  border-color: var(--zr-success);
}
.zr-toast.zr-toast-error {
  border-color: var(--zr-error);
}
.zr-toast.zr-toast-warning {
  border-color: var(--zr-warning);
}
.zr-toast .zr-toast-content {
  display: flex;
  align-items: center;
  gap: var(--zr-space-2);
  flex: 1;
}
.zr-toast .zr-toast-content .zr-toast-icon {
  font-size: var(--zr-text-lg);
}
.zr-toast .zr-toast-content .zr-toast-message {
  font-size: var(--zr-text-sm);
  color: var(--zr-text-primary);
}
.zr-toast .zr-toast-close {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--zr-radius-full);
  background: transparent;
  color: var(--zr-text-muted);
}
.zr-toast .zr-toast-close:hover {
  background: var(--zr-bg-hover);
  color: var(--zr-text-primary);
}

.zr-spinner-small {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--zr-border);
  border-top: 2px solid var(--zr-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.zr-text-muted {
  color: var(--zr-text-muted) !important;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
pre.line-numbers {
  position: relative;
  padding-left: 3.8em;
  counter-reset: linenumber;
}

pre.line-numbers > code {
  position: relative;
  white-space: pre !important;
  word-wrap: normal !important;
  overflow-wrap: normal !important;
}

pre.line-numbers .line-numbers-rows {
  position: absolute;
  pointer-events: none;
  top: 0;
  font-size: 100%;
  left: -3.8em;
  width: 3em;
  letter-spacing: -1px;
  border-right: 1px solid var(--zr-border);
  user-select: none;
}

pre.line-numbers .line-numbers-rows > span {
  pointer-events: none;
  display: block;
  counter-increment: linenumber;
}

pre.line-numbers .line-numbers-rows > span:before {
  content: counter(linenumber);
  color: var(--zr-text-muted);
  display: block;
  padding-right: 0.8em;
  text-align: right;
}

.language-javascript,
.language-python,
.language-html,
.language-css {
  white-space: pre !important;
  overflow-x: auto !important;
  display: block !important;
}

.zr-task-selection-section {
  padding: var(--zr-space-2) var(--zr-space-3);
  margin-bottom: var(--zr-space-2);
}

.zr-task-selection-header {
  margin-bottom: var(--zr-space-2);
}
.zr-task-selection-header .zr-task-selection-title {
  font-size: 14px;
  font-weight: var(--zr-font-medium);
  color: var(--zr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.zr-task-selector-row {
  display: flex;
  gap: var(--zr-space-2);
  justify-content: center;
  margin-bottom: var(--zr-space-2);
}
@media (max-width: 767px) {
  .zr-task-selector-row {
    gap: 4px;
  }
}

.zr-task-option {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: var(--zr-bg-primary);
  border: 1px solid var(--zr-border);
  border-radius: var(--zr-radius-sm);
  transition: all var(--zr-transition-fast);
  min-width: 60px;
}
.zr-task-option input[type=radio] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.zr-task-option i {
  font-size: 16px;
  color: var(--zr-text-muted);
  transition: var(--zr-transition-colors);
}
.zr-task-option span {
  font-size: 12px;
  font-weight: var(--zr-font-medium);
  color: var(--zr-text-secondary);
  text-align: center;
  line-height: 1;
  transition: var(--zr-transition-colors);
}
.zr-task-option:hover {
  border-color: var(--zr-primary);
}
.zr-task-option:hover i, .zr-task-option:hover span {
  color: var(--zr-primary);
}
.zr-task-option:has(input[type=radio]:checked) {
  border-color: var(--zr-primary);
  background: var(--zr-primary-bg);
}
.zr-task-option:has(input[type=radio]:checked) i, .zr-task-option:has(input[type=radio]:checked) span {
  color: var(--zr-primary);
  font-weight: var(--zr-font-semibold);
}
@media (max-width: 767px) {
  .zr-task-option {
    min-width: 40px;
    padding: 4px 6px;
  }
  .zr-task-option span {
    font-size: 8px;
  }
}

.zr-model-selector-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--zr-space-2);
}
.zr-model-selector-row .zr-model-selector-label {
  font-size: 10px;
  color: var(--zr-text-muted);
  font-weight: var(--zr-font-medium);
}
.zr-model-selector-row .zr-model-selector .zr-select {
  background: var(--zr-input-bg);
  border: 1px solid var(--zr-input-border);
  border-radius: var(--zr-radius-sm);
  color: var(--zr-input-text);
  padding: 4px 8px;
  font-size: 11px;
  outline: none;
  min-width: 150px;
}
.zr-model-selector-row .zr-model-selector .zr-select:focus {
  border-color: var(--zr-input-border-focus);
}
@media (max-width: 767px) {
  .zr-model-selector-row .zr-model-selector-label {
    display: none;
  }
  .zr-model-selector-row .zr-model-selector .zr-select {
    min-width: 120px;
    font-size: 10px;
  }
}

.zr-model-selector select:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background-color: var(--zr-bg-secondary);
}

.zr-model-selector select:disabled option {
  color: var(--zr-text-muted);
  font-style: italic;
}

@supports not selector(:has(*)) {
  .zr-task-option input[type=radio]:checked + i, .zr-task-option input[type=radio]:checked ~ span {
    color: var(--zr-primary);
    font-weight: var(--zr-font-semibold);
  }
}
@media (max-width: 767px) {
  .zr-chat-input-area {
    padding: var(--zr-space-3);
    padding-bottom: var(--zr-space-4);
  }
  .zr-messages-container {
    padding: var(--zr-space-4) var(--zr-space-3);
    padding-bottom: var(--zr-space-6);
  }
  .zr-message {
    gap: var(--zr-space-2);
    margin-bottom: var(--zr-space-4);
  }
  .zr-message.zr-message-user .zr-message-content {
    max-width: 85%;
  }
  .zr-message-avatar {
    width: 28px;
    height: 28px;
  }
  .zr-suggested-prompts {
    margin-top: var(--zr-space-6);
  }
  .zr-uploaded-files {
    flex-direction: column;
    align-items: stretch;
  }
  .zr-file-item {
    max-width: none;
    width: 100%;
  }
}
@media (min-width: 1024px) {
  .zr-messages-container {
    padding: var(--zr-space-8);
    padding-bottom: var(--zr-space-8);
  }
  .zr-chat-input-area {
    padding: var(--zr-space-5);
    padding-bottom: var(--zr-space-6);
  }
}
.zr-scroll-to-bottom {
  position: fixed;
  bottom: 160px;
  left: 50%;
  width: 40px;
  height: 40px;
  border-radius: var(--zr-radius-full);
  background: var(--zr-bg-secondary);
  border: 1px solid var(--zr-border);
  color: var(--zr-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--zr-shadow-lg);
  transition: all 0.2s ease;
  z-index: var(--zr-z-10);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
}
.zr-scroll-to-bottom.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.zr-scroll-to-bottom:hover {
  background: var(--zr-bg-tertiary);
  border-color: var(--zr-primary);
  transform: translateY(-2px);
  box-shadow: var(--zr-shadow-xl);
}
.zr-scroll-to-bottom:active {
  transform: translateY(0);
}
.zr-scroll-to-bottom i {
  font-size: 1.25rem;
}
@media (max-width: 767px) {
  .zr-scroll-to-bottom {
    bottom: 160px;
    right: var(--zr-space-4);
    width: 36px;
    height: 36px;
  }
}

.zr-mini-header {
  position: fixed;
  top: 0;
  left: var(--zr-sidebar-current-width);
  right: 0;
  height: 56px;
  background: var(--zr-bg-primary);
  border-bottom: 1px solid var(--zr-border);
  z-index: var(--zr-z-10);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  justify-content: center;
}
.zr-mini-header.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
@media (max-width: 767px) {
  .zr-mini-header {
    left: 0;
  }
}

.zr-mini-header-inner {
  width: 100%;
  max-width: var(--zr-chat-max-width);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--zr-space-4);
}

.zr-mini-header-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.zr-mini-header-title {
  font-size: var(--zr-text-base);
  font-weight: var(--zr-font-semibold);
  color: var(--zr-text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zr-mini-header-meta {
  display: flex;
  align-items: center;
  gap: var(--zr-space-3);
  font-size: var(--zr-text-xs);
  color: var(--zr-text-muted);
}

.zr-mini-header-model {
  background: var(--zr-bg-secondary);
  padding: 2px var(--zr-space-2);
  border-radius: var(--zr-radius-sm);
}

.zr-mini-header-actions {
  display: flex;
  align-items: center;
  gap: var(--zr-space-1);
}

.zr-mini-header-edit {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--zr-radius-md);
  background: transparent;
  color: var(--zr-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.zr-mini-header-edit:hover {
  background: var(--zr-bg-secondary);
  color: var(--zr-text-primary);
}
.zr-mini-header-edit i {
  font-size: 0.875rem;
}

.zr-favorite-btn[data-favorite=true] i {
  color: var(--zr-accent);
}
.zr-favorite-btn:hover i {
  color: var(--zr-accent);
}

.zr-file-warning {
  margin: 1rem 0;
  margin-bottom: 1.5rem;
  border-left: 4px solid #ffc107;
  background-color: #fff3cd;
  border-color: #ffc107;
  padding: 1rem;
  border-radius: 0.375rem;
  position: relative;
}
.zr-file-warning .bi-exclamation-triangle-fill {
  color: #ff9800;
  flex-shrink: 0;
}
.zr-file-warning strong {
  color: #856404;
  font-weight: 600;
}
.zr-file-warning p {
  color: #856404;
  font-size: 0.95rem;
}
.zr-file-warning small.text-muted {
  font-size: 0.85rem;
  color: #6c757d !important;
}
.zr-file-warning small.text-muted .bi-info-circle {
  margin-right: 0.25rem;
}
.zr-file-warning .btn-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.5rem;
  font-size: 1.25rem;
  background: transparent;
  border: none;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.2s;
}
.zr-file-warning .btn-close:hover {
  opacity: 1;
}
.zr-file-warning .btn-close .bi-x {
  font-size: 1.5rem;
  font-weight: bold;
  color: #856404;
}

@media (max-width: 768px) {
  .zr-file-warning {
    margin: 0.75rem 0;
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  .zr-file-warning .bi-exclamation-triangle-fill {
    font-size: 1rem !important;
  }
  .zr-file-warning strong {
    font-size: 0.95rem;
  }
}/*# sourceMappingURL=zenreflex.css.map */