/* ===== DarkGPT Web - Professional Dark Aesthetic ===== */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Core Dark Palette - Refined */
  --bg-abyss: #030306;      /* Deepest background */
  --bg-base: #0a0a0f;       /* Base background */
  --bg-layer-1: #111118;    /* Elevated layer 1 */
  --bg-layer-2: #181822;    /* Elevated layer 2 */
  --bg-layer-3: #20202d;    /* Elevated layer 3 */
  --bg-surface: #0f0f1a;    /* Surface for cards/input */
  --bg-surface-hover: #171724; /* Hover state */

  /* Borders & Dividers */
  --border-faint: #1e1e2a;          /* 10% opacity */
  --border-subtle: #2a2a3a;         /* 20% opacity */
  --border-default: #353548;        /* 30% opacity */
  --border-medium: #42425a;         /* 40% opacity */
  --border-strong: #4e4e66;         /* 50% opacity */

  /* Text Hierarchy - WCAG 2.1 AA Compliant */
  --text-primary: #f8f9ff;          /* Pure text */
  --text-secondary: #e0e0f0;        /* Secondary text */
  --text-tertiary: #b0b0d0;         /* Tertiary/muted */
  --text-muted: #8080a0;            /* Disabled/hint */
  --text-inverse: #0a0a0f;          /* On accent */
  --text-link: #6ee7ff;
  --text-link-hover: #8efdff;

  /* Brand Accents - Professional Gradients */
  --accent-primary: #ff3d4a;        /* DarkGPT Red */
  --accent-primary-rgb: 255, 61, 74;
  --accent-primary-5: rgba(255, 61, 74, 0.05);
  --accent-primary-10: rgba(255, 61, 74, 0.1);
  --accent-primary-20: rgba(255, 61, 74, 0.2);
  --accent-primary-30: rgba(255, 61, 74, 0.3);

  --accent-secondary: #14f195;      /* Success/Teal */
  --accent-secondary-10: rgba(20, 241, 149, 0.1);
  --accent-secondary-20: rgba(20, 241, 149, 0.2);

  --accent-tertiary: #7c6fff;       /* Accent/Purple */
  --accent-tertiary-10: rgba(124, 111, 255, 0.1);

  --accent-warning: #ffd166;        /* Warning */
  --accent-info: #60a5fa;           /* Info/Blue */

  /* Advanced Gradients */
  --gradient-primary: linear-gradient(135deg, #ff3d4a 0%, #ff6b3d 100%);
  --gradient-primary-soft: linear-gradient(135deg, rgba(255,61,74,0.08) 0%, rgba(255,107,61,0.03) 100%);
  --gradient-surface: linear-gradient(145deg, #0f0f1a 0%, #0a0a0f 100%);
  --gradient-glass: linear-gradient(145deg, rgba(15,15,26,0.7) 0%, rgba(10,10,15,0.4) 100%);
  --gradient-glass-hover: linear-gradient(145deg, rgba(22,22,34,0.8) 0%, rgba(16,16,24,0.5) 100%);
  --gradient-mesh:
    radial-gradient(800px 400px at 50% -20%, rgba(255,61,74,0.4), transparent 50%),
    radial-gradient(600px 300px at 100% 100%, rgba(20,241,149,0.06)0%, transparent 50%),
    radial-gradient(500px 250px at 0% 100%, rgba(124,111,255,0.05)0%, transparent 50%);

  /* Sophisticated Shadow System */
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.45);
  --shadow-xl: 0 12px 32px rgba(0,0,0,0.5);
  --shadow-2xl: 0 16px 48px rgba(0,0,0,0.55);

  /* Glow Effects */
  --shadow-inner: 0px 0px 10px rgba(255,61,74,0.15);
  --shadow-glow-outer: 0 0 20px rgba(20,241,149,0.12);
  --shadow-focus: 0 0 0 3px rgba(255,61,74,0.25);
  --shadow-inset: inset 0 1px 3px rgba(0,0,0,0.4);

  /* Border Radius System */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Transitions - Naturel et professionnel */
  --ease-out: cubic-bezier(0.25, 0.8, 0.25, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --transition-fast: 100ms var(--ease-out);
  --transition-normal: 180ms var(--ease-out);
  --transition-slow: 500ms var(--ease-out);
  --transition-bounce: 350ms var(--ease-spring);

  /* Layout - Professional Spacing */
  --sidebar-width: 320px;
  --sidebar-collapsed: 72px;
  --header-height: 76px;
  --input-min-h: 64px;
  --input-max-h: 240px;
  --content-max-w: 1200px;

  /* Typography Scale - Professional */
  --font-sans: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;

  /* Text Scale */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  --text-5xl: 3rem;      /* 48px */

  /* Font Weights */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Z-Index - Layered System */
  --z-bg: 0;
  --z-base: 10;
  --z-docked: 20;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-overlay: 400;
  --z-toast: 500;
  --z-tooltip: 600;
}

/* --- Global Styles --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-abyss);
  color: var(--text-primary);
  line-height: 1.65;
  height: 100%;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

/* Background Systems */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--gradient-mesh);
  pointer-events: none;
  z-index: var(--z-bg);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
  z-index: var(--z-bg);
}

/* Scrollbar - Professionnel */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-abyss);
  transition: background var(--transition-normal);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}
::-webkit-scrollbar-corner { background: transparent; }

/* Selection */
::selection {
  background: var(--accent-primary);
  color: var(--text-inverse);
}

/* Focus Ring - Accessible */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.25);
}

/* Links */
a {
  color: var(--text-link);
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}
a:hover {
  color: var(--text-link-hover);
}
a:active {
  transform: translateY(1px);
}

/* ===== Layout Container ===== */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
  z-index: var(--z-base);
}

/* ===== Sidebar - Professionnel ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-layer-1);
  border-right: 1px solid var(--border-faint);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  z-index: var(--z-sticky);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

/* Sidebar Background Noise */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h200v200H0z' fill='none' stroke='%23ffffff' stroke-opacity='0.01' stroke-width='1'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.15;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  box-shadow: var(--shadow-lg), var(--shadow-glow-outer);
  border-top-right-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-faint);
  min-height: var(--header-height);
  background: linear-gradient(to bottom, transparent 0%, rgba(10,10,15,0.3) 100%);
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .sidebar-actions,
.sidebar.collapsed .history-list,
.sidebar.collapsed .sidebar-footer {
  display: none;
}

/* Logo avec animation subtile */
.sidebar-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  position: relative;
  overflow: hidden;
}

.sidebar-header h2::before {
  content: '';
  position: absolute;
  left: -100%;
  top: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.1),
    transparent
  );
  transform: skewX(-25deg);
}
.sidebar-header h2:hover::before {
  left: 100%;
  transition: left 1.5s ease;
}

.sidebar-header h2 svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform var(--transition-normal);
}
.sidebar-header h2:hover svg {
  transform: rotate(-10deg) scale(1.1);
}

/* Actions Section */
.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-faint);
  background: rgba(10,10,15,0.2);
}

/* Button Styles - Professionnels */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.1),
    transparent
  );
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.btn:hover::before {
  opacity: 1;
}

/* Primary Button */
.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
  border: none;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Secondary Button */
.btn-secondary {
  background: var(--accent-primary-20);
  color: var(--accent-primary);
  border-color: var(--accent-primary-30);
}
.btn-secondary:hover {
  background: var(--accent-primary-30);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--accent-primary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--accent-primary-10);
  color: var(--accent-primary);
  border-color: var(--accent-primary-20);
}

/* Icon Button */
.btn-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-primary-10);
  border: 1px solid var(--accent-primary-20);
  border-radius: var(--radius-lg);
  color: var(--accent-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-icon:hover:not(:disabled) {
  background: var(--accent-primary-20);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: scale(1.05);
}
.btn-icon:active:not(:disabled) {
  transform: scale(0.95);
}
.btn-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* History List */
.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  flex: 1;
}
.empty-state svg {
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  opacity: 0.2;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
.empty-state p {
  font-weight: var(--font-medium);
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.empty-state span {
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
}

/* History Items */
.history-item {
  padding: 14px 18px;
  background: var(--bg-layer-2);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: visible;
  will-change: transform, border-color;
}
.history-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-primary);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform var(--transition-bounce);
}
.history-item:hover {
  background: var(--bg-layer-3);
  border-color: var(--border-subtle);
  transform: translateX(4px);
}
.history-item:hover::before {
  transform: scaleY(1);
}
.history-item.active {
  border-color: var(--accent-primary);
  background: var(--accent-primary-10);
  box-shadow: 0 0 0 1px var(--accent-primary-20);
}
.history-item.active::before {
  transform: scaleY(1);
}

/* History Item Content */
.history-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: var(--text-xs);
}
.history-item-time {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.history-item-message-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding: 2px 8px;
  background: var(--bg-layer-1);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-faint);
}
.history-item-preview {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  transition: color var(--transition-fast);
}
.history-item:hover .history-item-preview {
  color: var(--text-primary);
}

/* History Item Delete Button */
.history-item-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-danger);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  color: #fff;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(255, 61, 74, 0.4);
}
.history-item:hover .history-item-delete {
  opacity: 1;
  transform: scale(1);
}
.history-item-delete:hover {
  transform: scale(1.15) !important;
  box-shadow: 0 3px 12px rgba(255, 61, 74, 0.6);
}
.history-item-delete:active {
  transform: scale(0.95) !important;
}
.history-item-delete svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.5;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-faint);
  background: rgba(10,10,15,0.3);
}
.version {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.version::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-secondary);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(20,241,149,0.4);
  animation: pulse-dot 2.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Sidebar Toggle (Mobile) */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: var(--z-modal);
  width: 52px;
  height: 52px;
  background: var(--bg-layer-2);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg), var(--shadow-glow-outer);
  transition: all var(--transition-fast);
}
.sidebar-toggle:hover {
  background: var(--bg-layer-3);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: transparent;
  position: relative;
}

/* Header - Professionnel */
.header {
  height: var(--header-height);
  background: var(--bg-layer-1);
  border-bottom: 1px solid var(--border-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  position: relative;
  z-index: var(--z-sticky);
}
.header::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  text-decoration: none;
}
.logo svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--accent-primary);
  filter: drop-shadow(0 0 8px rgba(255,61,74,0.2));
  transition: transform var(--transition-normal);
}
.logo:hover svg {
  transform: rotate(-5deg) scale(1.08);
}
.logo span {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  letter-spacing: -0.02em;
  background: linear-gradient(
    135deg,
    var(--text-primary) 0%,
    var(--accent-primary) 40%,
    var(--accent-secondary) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradient-shift 6s ease infinite;
}
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-terciary);
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}
.status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-secondary);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(20,241,149,0.3);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.85); opacity: 0.6; }
}
.status-indicator.disconnected .status-dot {
  background: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(255,61,74,0.3);
  animation: none;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Chat Container - Professionnel */
.chat-container {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  padding-bottom: 80px; /* Space for input */
}

/* Welcome State */
.welcome-message {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  max-width: var(--content-max-w);
  width: 100%;
  animation: fadeInUp 0.7s var(--ease-out) both;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.welcome-content {
  max-width: 500px;
}
.welcome-icon {
  color: var(--accent-primary);
  opacity: 0.15;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 20px rgba(255,61,74,0.1));
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(-2deg); }
}
.welcome-content h1 {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  color: var(--accent-primary);
}
.welcome-content p {
  font-size: var(--text-base);
  margin: 0 auto 24px;
}
.welcome-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  flex: 1;
}
.hint {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  padding: 8px 14px;
  background: var(--bg-layer-2);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
  cursor: default;
  position: relative;
  overflow: hidden;
}
.hint:hover {
  border-color: var(--border-default);
  color: var(--text-primary);
}
.hint kbd {
  font-family: var(--font-mono);
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: var(--text-xs);
  color: var(--accent-secondary);
  margin-right: 3px;
}

/* Messages - Professionnel */
.message {
  display: flex;
  gap: 14px;
  max-width: var(--content-max-w);
  width: 100%;
  animation: messageIn 0.4s var(--ease-out) both;
  will-change: transform, opacity;
  position: relative;
}
@keyframes messageIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.message.user {
  flex-direction: row-reverse;
}
.message.user .message-content {
  margin-left: auto;
}
.message-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
  box-shadow: var(--shadow-sm), var(--shadow-inner);
  position: relative;
  overflow: hidden;
}
.message.user .message-avatar {
  background: var(--gradient-primary);
  color: var(--text-inverse);
}
.message.assistant .message-avatar {
  background: var(--bg-layer-2);
  border: 1px solid var(--border-faint);
  color: var(--accent-primary);
}
.message.assistant .message-avatar::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-lg);
  background: var(--gradient-primary);
  opacity: 0;
  filter: blur(12px);
  transition: opacity var(--transition-normal);
  z-index: -1;
}
.message.assistant:hover .message-avatar::after {
  opacity: 0.3;
}
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-lg);
  padding: 3px;
}
.message-content {
  flex: 1;
  min-width: 0;
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-xl);
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  will-change: border-color, box-shadow, background-color;
}
.message-content:hover {
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-md);
  background: var(--bg-surface-hover);
}
.message.user .message-content {
  background: var(--bg-layer-2);
  border-color: var(--border-default);
  border-bottom-right-radius: 8px;
}
.message.user .message-content:hover {
  background: var(--bg-layer-3);
  border-color: var(--border-strong);
}
.message.assistant .message-content {
  border-bottom-left-radius: 8px;
}
.message-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.message-role {
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--text-xs);
}
.message.user .message-role { color: var(--accent-primary); }
.message.assistant .message-role { color: var(--accent-secondary); }
.message-time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.message-text {
  font-family: var(--font-sans);
  line-height: 1.75;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: var(--text-base);
  color: var(--text-primary);
}

/* Enhanced Markdown */
.message-text h1, .message-text h2, .message-text h3,
.message-text h4, .message-text h5, .message-text h6 {
  margin: 20px 0 12px;
  font-weight: var(--font-semibold);
  line-height: 1.3;
  color: var(--text-primary);
}
.message-text h1 {
  font-size: var(--text-2xl);
  border-bottom: 1px solid var(--border-faint);
  padding-bottom: 8px;
}
.message-text h2 {
  font-size: var(--text-xl);
}
.message-text h3 {
  font-size: var(--text-lg);
  color: var(--accent-tertiary);
}
.message-text p {
  margin: 12px 0;
}
.message-text ul, .message-text ol {
  margin: 12px 0;
  padding-left: 28px;
}
.message-text li {
  margin: 8px 0;
  position: relative;
  padding-left: 4px;
}
.message-text li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  opacity: 0.7;
}
.message-text blockquote {
  margin: 16px 0;
  padding: 14px 20px;
  border-left: 3px solid var(--accent-primary);
  background: var(--accent-primary-5);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-style: italic;
  position: relative;
}
.message-text blockquote::before {
  content: '“';
  position: absolute;
  top: -12px;
  left: 14px;
  font-size: 3rem;
  color: var(--accent-primary);
  opacity: 0.1;
  font-family: serif;
  line-height: 1;
}
.message-text a {
  color: var(--accent-info);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all var(--transition-fast);
  position: relative;
}
.message-text a:hover {
  border-bottom-color: var(--accent-info);
  color: var(--accent-tertiary);
}
.message-text a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-normal);
}
.message-text a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}
.message-text hr {
  border: none;
  border-top: 1px solid var(--border-faint);
  margin: 28px 0;
}
.message-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: var(--text-sm);
  overflow-x: auto;
  display: block;
}
.message-text th, .message-text td {
  padding: 12px 16px;
  border: 1px solid var(--border-faint);
  text-align: left;
}
.message-text th {
  background: var(--bg-layer-2);
  font-weight: var(--font-medium);
  color: var(--accent-secondary);
}
.message-text code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-surface);
  padding: 0.2em 0.5em;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-faint);
  color: var(--accent-info);
}
.message-text pre {
  margin: 16px 0;
  padding: 20px;
  background: #05050a;
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  position: relative;
  box-shadow: var(--shadow-inner), var(--shadow-sm);
}
.message-text pre::before {
  content: attr(data-lang) '';
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 0.75rem;
  font-weight: var(--font-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}
.message-text pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  line-height: 1.7;
}
.message-text .token.comment { color: var(--text-muted); }
.message-text .token.keyword { color: #ff6b9d; }
.message-text .token.function { color: var(--accent-tertiary); }
.message-text .token.string { color: var(--accent-secondary); }
.message-text .token.number { color: var(--accent-warning); }
.message-text .token.operator { color: var(--accent-info); }

/* Streaming Cursor - Professionnel */
.message-text .streaming-cursor {
  display: inline-block;
  width: 8px;
  height: 1.3em;
  background: var(--accent-primary);
  border-radius: 1px;
  animation: cursorBlink 1.1s ease-in-out infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
  box-shadow: 0 0 8px rgba(255,61,74,0.3);
}
@keyframes cursorBlink {
  0%, 40% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
/* Thinking text "réfléchit" */
.thinking-text {
  color: var(--text-tertiary);
  font-style: italic;
  animation: thinkPulse 1.2s ease-in-out infinite;
}
@keyframes thinkPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ===== Thinking Section (détection de raisonnement) ===== */
.thinking-section {
  max-width: var(--content-max-w);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  animation: messageIn 0.3s var(--ease-out) both;
  position: relative;
}
.thinking-section.expanded {
  background: var(--bg-layer-1);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
}
.thinking-section.expanded::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-tertiary);
  opacity: 0.5;
  border-radius: 0 2px 2px 0;
}
.thinking-section.collapsed {
  background: var(--accent-tertiary-10);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  margin-bottom: 4px;
}
.thinking-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 20px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}
.thinking-section.collapsed .thinking-header {
  padding: 6px 14px 6px 18px;
}
.thinking-header:hover {
  color: var(--text-primary);
}
.thinking-section.expanded .thinking-header:hover {
  background: var(--accent-tertiary-10);
}
.thinking-section.collapsed .thinking-header:hover {
  background: var(--accent-tertiary-10);
  border-radius: var(--radius-sm);
}
.thinking-header-icon {
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
}
.thinking-header-label {
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--text-xs);
  flex: 1;
}
.thinking-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  width: 12px;
  height: 12px;
}
.thinking-duration {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.thinking-content {
  padding: 0 20px 12px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  border-top: 1px solid var(--border-faint);
  margin: 0 8px 0 16px;
  padding-top: 10px;
}
/* État replié */
.thinking-section.collapsed .thinking-content {
  display: none;
}
.thinking-section.collapsed .thinking-chevron {
  transform: rotate(-90deg);
}
.thinking-section.expanded .thinking-chevron {
  transform: rotate(0deg);
}

/* Markdown léger dans le thinking */
.thinking-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-surface);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-faint);
  color: var(--accent-info);
}
.thinking-content strong {
  color: var(--text-primary);
}
.thinking-content em {
  color: var(--text-muted);
}


/* Input Area - Professionnel */
.input-area {
  padding: 24px 32px 28px;
  background: var(--bg-layer-1);
  border-top: 1px solid var(--border-faint);
  flex-shrink: 0;
  position: relative;
  z-index: var(--z-sticky);
}
.input-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}
.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: var(--content-max-w);
  margin: 0 auto;
}
#messageInput {
  flex: 1;
  min-height: var(--input-min-h);
  max-height: var(--input-max-h);
  padding: 20px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  resize: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-inner), 0 2px 12px rgba(0,0,0,0.2);
}
#messageInput::placeholder {
  color: var(--text-muted);
}
#messageInput:focus {
  border-color: var(--accent-primary);
  background: var(--bg-surface-hover);
  box-shadow:
    0 0 0 3px rgba(var(--accent-primary-rgb), 0.2),
    var(--shadow-inner),
    var(--shadow-lg);
  outline: none;
}
#messageInput:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.input-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-bottom: 10px;
}

/* Buttons - Refined */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.1),
    transparent
  );
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.btn:hover::before {
  opacity: 1;
}
.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm), 0 0 20px rgba(255,61,74,0.15);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 28px rgba(255,61,74,0.2);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn-secondary {
  background: var(--accent-primary-20);
  color: var(--accent-primary);
  border-color: var(--accent-primary-30);
}
.btn-secondary:hover {
  background: var(--accent-primary-30);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}
.btn-ghost {
  background: transparent;
  color: var(--accent-primary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--accent-primary-10);
  color: var(--accent-primary);
  border-color: var(--accent-primary-20);
}

/* Input Hints */
.input-hints {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
  letter-spacing: 0.01em;
  padding: 8px 0 4px;
}
.input-hints kbd {
  font-family: var(--font-mono);
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: var(--text-xs);
  color: var(--accent-secondary);
  margin: 0 2px;
}

/* Toast Notifications - Professionnel */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 420px;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-layer-2);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), var(--shadow-glow-outer);
  animation: toastIn 0.4s var(--ease-spring) both;
  min-width: 320px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.96); }
  to { opacity: 1; translateX: 0; scale: 1; }
}
.toast.removing {
  animation: toastOut 0.25s var(--ease-out) forwards;
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(40px) scale(0.96); }
}
.toast.success { border-left: 4px solid var(--accent-secondary); box-shadow: var(--shadow-xl); }
.toast.error { border-left: 4px solid var(--accent-primary); box-shadow: var(--shadow-xl), var(--shadow-glow-outer); }
.toast.warning { border-left: 4px solid var(--accent-warning); box-shadow: var(--shadow-xl), 0 0 24px rgba(255,209,102,0.2); }
.toast.info { border-left: 4px solid var(--accent-primary); }
.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 2px;
}
.toast.success .toast-icon { color: var(--accent-secondary); }
.toast.error .toast-icon { color: var(--accent-primary); }
.toast.warning .toast-icon { color: var(--accent-warning); }
.toast.info .toast-icon { color: var(--accent-primary); }
.toast-message {
  flex: 1;
  font-size: var(--text-base);
  color: var(--text-primary);
  line-height: 1.5;
}
.toast-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  margin-top: -3px;
  margin-right: -4px;
}
.toast-close:hover {
  background: var(--bg-layer-2);
  color: var(--text-primary);
}

/* Responsive Breakpoints - Professionnel */
@media (max-width: 1200px) {
  .messages { padding: 24px 20px; }
  .header { padding: 0 20px; }
  .input-area { padding: 20px 20px; }
  .welcome-content h1 { font-size: var(--text-3xl); }
}
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl), var(--shadow-glow-outer);
    z-index: var(--z-modal);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.collapsed { width: var(--sidebar-width); transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .main-content { width: 100%; }
  .messages { padding: 20px 16px; gap: 20px; }
  .input-area { padding: 18px 16px; }
  .header { padding: 0 16px; }
  .welcome-content h1 { font-size: var(--text-2xl); }
  .welcome-content p { font-size: var(--text-lg); }
}
@media (max-width: 640px) {
  html { font-size: 13px; }
  .logo span { display: none; }
  .status-indicator span { display: none; }
  .status-indicator { padding: 6px 10px; }
  .messages { padding: 16px 12px; gap: 16px; }
  .message { gap: 12px; }
  .message-avatar { width: 40px; height: 40px; font-size: 1.1rem; }
  .message-content { padding: 8px 14px; border-radius: var(--radius-lg); }
  .message.user .message-content { border-bottom-right-radius: 6px; }
  .message.assistant .message-content { border-bottom-left-radius: 6px; }
  .input-wrapper { gap: 8px; }
  #messageInput {
    padding: 16px 18px;
    font-size: 16px;
    border-radius: var(--radius-lg);
    min-height: 56px;
  }
  .input-actions { gap: 8px; padding-bottom: 8px; }
  .btn { padding: 10px 16px; font-size: var(--text-sm); }
  .btn-icon { width: 40px; height: 40px; }
  .toast-container { left: 16px; right: 16px; bottom: 16px; max-width: none; }
  .toast { min-width: auto; padding: 16px 18px; }
}

/* Utility Classes */
.hidden { 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;
}

/* Loading Shimmer */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.message-text.skeleton {
  background: linear-gradient(90deg, var(--bg-layer-2) 25%, var(--bg-layer-3) 50%, var(--bg-layer-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
  border-radius: var(--radius-xs);
  height: 1em;
}

/* Scroll Hint */
.scroll-hint {
  position: sticky;
  bottom: 0;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  color: var(--text-muted);
  font-size: var(--text-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--transition-normal);
}
.scroll-hint.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-hint svg {
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
  60% { transform: translateY(-3px); }
}

/* Data Saver Mode - Optional */
.data-saver .hint,
.data-saver .welcome-hints { display: none; }

/* ===== Authentication Styles ===== */

/* Login Overlay */
.login-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bg-abyss);
    z-index: var(--z-overlay);
    padding: 20px;
}

.login-overlay::before {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--gradient-mesh);
    pointer-events: none;
}

.login-overlay::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
}

.login-card {
    position: relative;
    z-index: 2;
    background: var(--bg-layer-1);
    border: 1px solid var(--border-faint);
    border-radius: var(--radius-2xl);
    padding: 48px 40px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-2xl);
    animation: fadeInUp 0.7s var(--ease-out) both;
}

.login-logo {
    margin-bottom: 24px;
}

.login-logo svg {
    width: 72px;
    height: 72px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 20px rgba(255,61,74,0.2));
    animation: float 6s ease-in-out infinite;
}

.login-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    margin-bottom: 12px;
    background: linear-gradient(
        135deg,
        var(--text-primary) 0%,
        var(--accent-primary) 40%,
        var(--accent-secondary) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: var(--text-tertiary);
    font-size: var(--text-base);
    margin-bottom: 32px;
    line-height: 1.6;
}

.login-footer {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-faint);
}

/* Discord Login Button */
.btn-discord-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    font-family: var(--font-sans);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-xl);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    background: #5865F2;
    color: #fff;
    box-shadow: var(--shadow-md), 0 0 24px rgba(88, 101, 242, 0.2);
    width: 100%;
}

.btn-discord-login:hover {
    transform: translateY(-2px);
    background: #4752C4;
    box-shadow: var(--shadow-lg), 0 0 32px rgba(88, 101, 242, 0.35);
}

.btn-discord-login:active {
    transform: translateY(0);
}

.btn-discord-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.1),
        transparent
    );
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn-discord-login:hover::before {
    opacity: 1;
}

.btn-discord-login svg {
    flex-shrink: 0;
}

/* User Info in Header */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-faint);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.user-info:hover {
    border-color: var(--border-subtle);
    background: var(--bg-surface-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 8px rgba(255,61,74,0.2);
}

.user-name {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-sm {
    padding: 6px 10px;
    font-size: var(--text-xs);
    border-radius: var(--radius-md);
}

/* Responsive adjustments for auth */
@media (max-width: 640px) {
    .login-card {
        padding: 32px 24px;
    }
    .login-title {
        font-size: var(--text-3xl);
    }
    .btn-discord-login {
        padding: 14px 24px;
        font-size: var(--text-base);
    }
    .user-name {
        max-width: 80px;
    }
}

/* Print Styles */
@media print {
  body::before,
  body::after,
  .sidebar-toggle,
  .toast-container,
  .input-hints { display: none !important; }
  body { background: white; color: black; }
  .message.user .message-content { background: #f0f0f0; }
  .message.assistant .message-content { background: #e8f4fc; }
  .border-* { border-color: #ddd !important; }
}