/* ============================================
   WRITE IN FRENCH - DESIGN SYSTEM V2
   Modern, warm, and accessible design system
   ============================================ */

/* ===== DESIGN TOKENS ===== */
:root {
  /* Color Palette - Warmer tones */
  --primary: #5B47E5;
  --primary-light: #7C65F0;
  --primary-dark: #4338ca;
  --accent-warm: #FF6B9D;
  --success: #059669;
  --success-light: #10b981;
  --success-dark: #047857;

  /* Background layers - warmer */
  --bg-canvas: #FAFBFC;
  --bg-card: #FFFFFF;
  --bg-hover: #F1F5F9;
  --bg-subtle: #F8FAFC;

  /* Borders & Dividers */
  --border: #e5e7eb;
  --border-light: #f1f3f5;
  --border-focus: #a5b4fc;
  --card-border: #e2e8f0;

  /* Text colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-placeholder: #94a3b8;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);

  /* Section accent colors */
  --notebook-accent: #3b82f6;
  --verbs-accent: #14b8a6;
  --vocab-accent: #f97316;
  --expressions-accent: #ea580c;
  --improve-accent: #9333ea;
  --ap-accent: #e11d48;
  --grammar-accent: #4f46e5;

  /* Typography */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  --font-mono: 'SF Mono', 'Consolas', 'Monaco', monospace;

  /* Spacing scale */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 0.75rem;
  --spacing-lg: 1rem;
  --spacing-xl: 1.5rem;
  --spacing-2xl: 2rem;

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  --primary: #7C65F0;
  --primary-light: #9B8BF5;
  --primary-dark: #5B47E5;
  --accent-warm: #FF8BB5;

  /* Dark backgrounds */
  --bg-canvas: #1a1a2e;
  --bg-card: #252538;
  --bg-hover: #2f2f45;
  --bg-subtle: #1f1f35;

  /* Dark borders */
  --border: #3a3a4e;
  --border-light: #2f2f45;
  --border-focus: #7C65F0;
  --card-border: #3a3a4e;

  /* Dark text */
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0c0;
  --text-muted: #8888a0;
  --text-placeholder: #666680;

  /* Dark shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.6), 0 4px 8px rgba(0, 0, 0, 0.5);
}

/* ===== GLOBAL STYLES ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-canvas);
  transition: background var(--transition-base), color var(--transition-base);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h1 { font-size: 2rem; line-height: 1.2; }
h2 { font-size: 1.5rem; line-height: 1.3; }
h3 { font-size: 1.25rem; line-height: 1.4; }

p {
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  padding: var(--spacing-xl);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: scale(1.02);
}

/* Card with gradient border effect */
.card-gradient {
  position: relative;
  overflow: hidden;
}

.card-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card-gradient:hover::before {
  opacity: 1;
}

/* ===== BUTTONS ===== */
button, .btn {
  font-family: var(--font-body);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.95rem;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Primary button with gradient */
.btn-primary, button.bg-emerald-500, button.bg-green-600 {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
  border: none !important;
}

.btn-primary:hover, button.bg-emerald-500:hover, button.bg-green-600:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
}

.btn-primary:active, button.bg-emerald-500:active, button.bg-green-600:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

/* Purple primary button (for improve/style features) */
.btn-purple, button.bg-purple-600 {
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}

.btn-purple:hover, button.bg-purple-600:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(147, 51, 234, 0.4);
}

/* Secondary button */
.btn-secondary, button.border-gray-300 {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover, button.border-gray-300:hover {
  background: var(--bg-hover);
  border-color: #cbd5e1 !important;
  box-shadow: var(--shadow-md);
}

/* Icon button with frosted glass effect */
.accent-btn {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--text-primary);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all var(--transition-fast);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

[data-theme="dark"] .accent-btn {
  background: rgba(37, 37, 56, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
}

.accent-btn:hover {
  background: rgba(249, 250, 251, 1);
  border-color: rgba(91, 71, 229, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .accent-btn:hover {
  background: rgba(47, 47, 69, 1);
  border-color: rgba(124, 101, 240, 0.5);
}

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

.accent-btn:focus {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* ===== ACCENT BAR (French characters) ===== */
.accent-bar {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  box-shadow: var(--shadow-sm);
}

.accent-row {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  padding: 0.125rem 0;
}

.accent-row::-webkit-scrollbar {
  height: 6px;
}

.accent-row::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
}

.accent-sep {
  display: inline-block;
  width: 1px;
  height: 1.25rem;
  background: var(--border);
  margin: 0 0.25rem;
}

/* Better touch targets on mobile */
@media (max-width: 640px) {
  .accent-btn {
    min-width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
}

/* Accent button with character name tooltip */
.accent-btn[data-char]::after {
  content: attr(data-char-name);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 0.375rem 0.625rem;
  background: var(--text-primary);
  color: var(--bg-card);
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-fast);
}

.accent-btn[data-char]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* ===== INPUTS & TEXTAREAS ===== */
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  line-height: 1.5;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(165, 180, 252, 0.15), var(--shadow-md);
}

textarea {
  resize: vertical;
  min-height: 8rem;
}

/* Main notebook textarea enhancement */
#ta {
  font-size: 1rem !important;
  line-height: 1.7 !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
  transition: all var(--transition-base) !important;
}

#ta:focus {
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 4px rgba(165, 180, 252, 0.12), var(--shadow-lg) !important;
}

/* ===== HEADER ===== */
header.bg-indigo-600 {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
  box-shadow: 0 2px 8px rgba(91, 71, 229, 0.2);
  position: relative;
  z-index: 2000;
  isolation: isolate;
}

header.bg-indigo-600 select,
header.bg-indigo-600 input,
header.bg-indigo-600 button {
  position: relative;
  z-index: 2001;
  pointer-events: auto;
}

#langSelect,
#langSelectMobile {
  position: relative;
  z-index: 2100;
  pointer-events: auto;
}

[data-theme="dark"] header.bg-indigo-600 {
  background: linear-gradient(135deg, #4338ca 0%, #5B47E5 100%) !important;
}

/* ===== SECTION ACCENTS ===== */
/* Notebook section - Blue theme */
#notebookBox h2 {
  color: #1e40af;
  border-bottom: 2px solid #dbeafe;
  padding-bottom: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

#notebookBox {
  border-left: 3px solid var(--notebook-accent);
}

/* Verbs section - Teal theme */
#verbsSection h2 {
  color: #0f766e;
  border-bottom: 2px solid #ccfbf1;
  padding-bottom: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

#verbsSection {
  border-left: 3px solid var(--verbs-accent);
}

#v-out {
  background: linear-gradient(to right, #ccfbf1, #f0fdfa) !important;
  padding: var(--spacing-md) !important;
  border-radius: var(--radius-md) !important;
  border-left: 3px solid var(--verbs-accent) !important;
}

/* Vocabulary section - Orange theme */
#addVocabSection h2 {
  color: #7c2d12;
  border-bottom: 2px solid #fed7aa;
  padding-bottom: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

#addVocabSection {
  border-left: 3px solid var(--vocab-accent);
}

/* Improve section - Purple theme */
#improveBox h2 {
  color: #6b21a8;
  border-bottom: 2px solid #f3e8ff;
  padding-bottom: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

#improveBox {
  border-left: 3px solid var(--improve-accent);
}

/* Grammar check panel with gradient */
#gcOut {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
  border-left: 4px solid var(--success) !important;
  padding: var(--spacing-lg) !important;
  border-radius: var(--radius-md) !important;
  font-size: 0.875rem !important;
  box-shadow: var(--shadow-sm) !important;
}

#gcWhy {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  border-left: 4px solid #f59e0b !important;
  padding: var(--spacing-lg) !important;
  border-radius: var(--radius-md) !important;
  font-size: 0.875rem !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Style improve panel - matching grammar check */
#siOut {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%) !important;
  border-left: 4px solid var(--improve-accent) !important;
  padding: var(--spacing-lg) !important;
  border-radius: var(--radius-md) !important;
  font-size: 0.875rem !important;
  box-shadow: var(--shadow-sm) !important;
}

#siNotes {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  border-left: 4px solid #f59e0b !important;
  padding: var(--spacing-lg) !important;
  border-radius: var(--radius-md) !important;
  font-size: 0.875rem !important;
  box-shadow: var(--shadow-sm) !important;
}

/* ===== LAYOUT ===== */
.layout-grid {
  display: grid;
  grid-template-columns: clamp(16rem, 24vw, 22rem) minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1rem;
}

@media (max-width: 1023px) {
  .layout-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Better spacing in cards */
.card {
  padding: 1.5rem;
}

@media (min-width: 1024px) {
  .card {
    padding: 1.75rem;
  }
}

/* Left rail specific styling */
.left-rail .card {
  padding: 1.25rem;
}

@media (min-width: 1024px) {
  .left-rail .card {
    padding: 1.5rem;
  }
}

/* Sticky left rail on large screens */
@media (min-width: 1024px) {
  .left-rail .stick {
    position: sticky;
    top: 1rem;
  }
}

/* ===== TABS ===== */
/* Tab buttons with clear visual hierarchy */
#avToggle button {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  font-weight: 500;
}

/* Unselected tabs - subtle */
#avToggle button.bg-white,
#avToggle button.text-gray-800 {
  background: var(--bg-subtle) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
  opacity: 0.7;
  box-shadow: none !important;
}

#avToggle button.bg-white:hover,
#avToggle button.text-gray-800:hover {
  opacity: 1;
  background: var(--bg-hover) !important;
  transform: translateY(-1px);
}

/* Selected tabs with specific colors */
#avToggle button[data-tab="lookup"].bg-indigo-600,
#avToggle button[data-tab="lookup"].text-white {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  border-color: #2563eb !important;
  color: white !important;
  font-weight: 600 !important;
  opacity: 1 !important;
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.4) !important;
  transform: translateY(-1px);
}

#avToggle button[data-tab="topic"].bg-indigo-600,
#avToggle button[data-tab="topic"].text-white {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  border-color: #d97706 !important;
  color: white !important;
  font-weight: 600 !important;
  opacity: 1 !important;
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.4) !important;
  transform: translateY(-1px);
}

#avToggle button[data-tab="synonyms"].bg-indigo-600,
#avToggle button[data-tab="synonyms"].text-white {
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%) !important;
  border-color: #7e22ce !important;
  color: white !important;
  font-weight: 600 !important;
  opacity: 1 !important;
  box-shadow: 0 3px 8px rgba(147, 51, 234, 0.4) !important;
  transform: translateY(-1px);
}

/* ===== ANIMATIONS ===== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

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

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

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

.slide-up {
  animation: slideUp 0.4s ease-out;
}

/* Breathing animation for cards */
@keyframes breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.01);
  }
}

.card.breathing:hover {
  animation: breathe 2s ease-in-out infinite;
}

/* ===== MOBILE IMPROVEMENTS ===== */
@media (max-width: 640px) {
  /* Mobile bottom navigation */
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0.5rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-decoration: none;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    min-width: 4rem;
  }

  .mobile-nav-item:active {
    background: var(--bg-hover);
  }

  .mobile-nav-item.active {
    color: var(--primary);
    font-weight: 600;
  }

  .mobile-nav-icon {
    font-size: 1.5rem;
  }

  /* Add padding to body to account for fixed nav */
  body {
    padding-bottom: 5rem;
  }
}

/* ===== DARK MODE TOGGLE ===== */
.theme-toggle {
  position: relative;
  width: 3rem;
  height: 1.5rem;
  background: var(--border);
  border-radius: 9999px;
  cursor: pointer;
  transition: background var(--transition-base);
}

.theme-toggle:hover {
  background: var(--text-muted);
}

.theme-toggle-thumb {
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--bg-card);
  border-radius: 50%;
  transition: transform var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

[data-theme="dark"] .theme-toggle {
  background: var(--primary);
}

[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(1.5rem);
}

[data-theme="dark"] #themeToggle .theme-toggle-thumb,
[data-theme="dark"] #themeToggleMobile .theme-toggle-thumb {
  transform: none;
}

/* ===== DARK MODE UTILITY OVERRIDES ===== */
[data-theme="dark"] .bg-white {
  background-color: var(--bg-card) !important;
}

[data-theme="dark"] .bg-gray-50 {
  background-color: var(--bg-subtle) !important;
}

[data-theme="dark"] .bg-gray-100 {
  background-color: var(--bg-hover) !important;
}

[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-gray-800 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-gray-600 {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-gray-500 {
  color: var(--text-muted) !important;
}

[data-theme="dark"] .border-gray-300,
[data-theme="dark"] .border-gray-200 {
  border-color: var(--border) !important;
}

[data-theme="dark"] .hover\:bg-gray-50:hover,
[data-theme="dark"] .hover\:bg-gray-200:hover {
  background-color: var(--bg-hover) !important;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background-color: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--text-placeholder) !important;
}

/* ===== PROGRESSIVE DISCLOSURE ===== */
/* DISABLED: This feature was too aggressive and interfered with normal interaction */
/* Users reported the page becoming unfocused and staying that way when clicking elements */

/* Dim inactive sections when one is focused - DISABLED
.layout-grid.has-focus > * {
  opacity: 0.6;
  transition: opacity var(--transition-base);
}

.layout-grid.has-focus > .focused {
  opacity: 1;
}
*/

/* Visual connector animation - DISABLED
@keyframes connect {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 100%;
    opacity: 1;
  }
}

.connector-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  animation: connect 0.5s ease-out;
}
*/

/* ===== UTILITY CLASSES ===== */
.minw0 { min-width: 0; }
.break-any { overflow-wrap: anywhere; word-break: break-word; }
.note { font-size: 0.875rem; color: var(--text-muted); }

/* ===== LOADING STATES ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-subtle) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

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

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--bg-canvas);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--border);
}

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

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}