/* ========== Design Tokens - Unikode Design System ========== */
/* Source of truth: index.html */

:root {
  /* Surface Colors - Dark Theme */
  --color-bg: #000000;
  --color-surface: #0a0a0a;
  --color-surface-variant: #121212;
  --color-surface-container: #1a1a1a;
  --color-surface-container-high: #222222;
  --color-surface-elevated: #2a2a2a;

  /* Text Colors - White/Grey Opacity Scale */
  --color-text: rgba(255, 255, 255, 0.95);
  --color-text-secondary: rgba(255, 255, 255, 0.72);
  --color-text-tertiary: rgba(255, 255, 255, 0.60);
  --color-text-muted: rgba(255, 255, 255, 0.18);

  /* Border Colors */
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.16);
  --color-border-subtle: rgba(255, 255, 255, 0.05);

  /* Status Indicators ONLY */
  --color-success: #22C55E;
  --color-warning: #EAB308;
  --color-error: #EF4444;

  /* Liquid Glass Material */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-prominent: rgba(255, 255, 255, 0.08);
  --glass-bg-ultrathin: rgba(255, 255, 255, 0.02);
  --glass-blur: 24px;
  --glass-saturation: 1.2;
  --glass-border-top: rgba(255, 255, 255, 0.12);
  --glass-border-bottom: rgba(0, 0, 0, 0.4);

  /* Concentric Corner Radius Scale */
  --radius-device: 44px;
  --radius-window: 20px;
  --radius-container: 16px;
  --radius-component: 12px;
  --radius-element: 8px;
  --radius-micro: 4px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Monaco", "Inconsolata", "Fira Mono", monospace;

  /* M3 Type Scale */
  --text-display-xl: 72px;
  --text-display-lg: 57px;
  --text-display-md: 45px;
  --text-display-sm: 36px;
  --text-headline-lg: 32px;
  --text-headline-md: 28px;
  --text-headline-sm: 24px;
  --text-title-lg: 22px;
  --text-title-md: 18px;
  --text-title-sm: 16px;
  --text-body-lg: 18px;
  --text-body-md: 16px;
  --text-body-sm: 14px;
  --text-label-lg: 14px;
  --text-label-md: 13px;
  --text-label-sm: 11px;

  /* 8px Grid Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --space-9: 64px;
  --space-10: 80px;
  --space-11: 96px;
  --space-12: 128px;

  /* Section Spacing */
  --section-padding: 96px;
  --section-padding-sm: 64px;
  --nav-height: 80px;

  /* M3 Duration Tokens */
  --duration-short-1: 50ms;
  --duration-short-2: 100ms;
  --duration-short-3: 150ms;
  --duration-short-4: 200ms;
  --duration-medium-1: 250ms;
  --duration-medium-2: 300ms;
  --duration-medium-4: 400ms;
  --duration-long-1: 450ms;
  --duration-long-2: 500ms;

  /* M3 Easing Curves */
  --easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --easing-emphasized-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
  --easing-emphasized-accelerate: cubic-bezier(0.3, 0, 0.8, 0.15);

  /* Spring Presets */
  --spring-gentle: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-responsive: cubic-bezier(0.22, 1.0, 0.36, 1);
  --spring-snappy: cubic-bezier(0.18, 0.89, 0.32, 1.28);
  --spring-bouncy: cubic-bezier(0.68, -0.55, 0.27, 1.55);

  /* State Layers */
  --state-hover: 0.08;
  --state-focus: 0.12;
  --state-pressed: 0.12;

  /* Focus Ring */
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;
  --focus-ring-color: rgba(255, 255, 255, 0.72);

  /* Icon System - Material Symbols */
  --icon-font: 'Material Symbols Outlined';
  --font-icon: 'Material Symbols Outlined';
  --icon-weight: 300;
  --icon-grade: 0;
  --icon-optical-size: 24;
  --icon-fill: 0;
}

/* ========== Font Loading ========== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/jetbrainsmono/v18/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxjPVmUsaaDhw.woff2') format('woff2');
}

/* Material Symbols - Variable Icon Font */
@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap; /* Changed from block for ~480ms mobile improvement */
  src: url('https://fonts.gstatic.com/s/materialsymbolsoutlined/v205/kJEhBvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oFsI.woff2') format('woff2');
}

/* ========== CSS Reset ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========== Material Symbol Base Class ========== */
.material-symbol {
  font-family: var(--font-icon);
  font-weight: var(--icon-weight, 300);
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'liga';
  font-variation-settings:
    'FILL' var(--icon-fill, 0),
    'wght' var(--icon-weight, 300),
    'GRAD' var(--icon-grade, 0),
    'opsz' var(--icon-optical-size, 24);
}

/* ========== Base Styles ========== */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ========== 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;
  }
}

/* ========== Light Theme ========== */
[data-theme="light"] {
  /* Surface Colors - Light Theme */
  --color-bg: #ffffff;
  --color-surface: #fafafa;
  --color-surface-variant: #f5f5f5;
  --color-surface-container: #eeeeee;
  --color-surface-container-high: #e0e0e0;
  --color-surface-elevated: #ffffff;

  /* Text Colors - Dark on Light */
  --color-text: rgba(0, 0, 0, 0.87);
  --color-text-secondary: rgba(0, 0, 0, 0.60);
  --color-text-tertiary: rgba(0, 0, 0, 0.55);
  --color-text-muted: rgba(0, 0, 0, 0.12);

  /* Border Colors */
  --color-border: rgba(0, 0, 0, 0.08);
  --color-border-strong: rgba(0, 0, 0, 0.16);
  --color-border-subtle: rgba(0, 0, 0, 0.04);

  /* Liquid Glass Material - Light */
  --glass-bg: rgba(0, 0, 0, 0.02);
  --glass-bg-prominent: rgba(0, 0, 0, 0.04);
  --glass-bg-ultrathin: rgba(0, 0, 0, 0.01);
  --glass-border-top: rgba(255, 255, 255, 0.8);
  --glass-border-bottom: rgba(0, 0, 0, 0.08);

  /* Focus Ring - Light */
  --focus-ring-color: rgba(0, 0, 0, 0.72);
}

/* ========== Theme Toggle Component ========== */
.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-medium-1) var(--easing-standard);
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
  background: var(--glass-bg-prominent);
  border-color: var(--color-border-strong);
}

.theme-toggle:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  font-family: var(--font-icon);
  font-size: 20px;
  font-weight: 300;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  transition: all var(--duration-medium-2) var(--easing-emphasized);
  color: var(--color-text-secondary);
}

.theme-toggle:hover .icon-sun,
.theme-toggle:hover .icon-moon {
  color: var(--color-text);
}

.theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="light"] .theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="light"] .theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

/* Theme transition for smooth switching */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color var(--duration-medium-2) var(--easing-standard),
              color var(--duration-medium-2) var(--easing-standard),
              border-color var(--duration-medium-2) var(--easing-standard),
              box-shadow var(--duration-medium-2) var(--easing-standard) !important;
}

/* ========== Advanced Animation System ========== */

/* Reveal Animation Base */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-long-2) var(--easing-emphasized-decelerate),
              transform var(--duration-long-2) var(--easing-emphasized-decelerate);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered Reveal Delays */
.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }
.reveal-delay-5 { transition-delay: 500ms; }

/* Fade In Variants */
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
}

.fade-in-down {
  opacity: 0;
  transform: translateY(-40px);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
}

.fade-in-up.visible,
.fade-in-down.visible,
.fade-in-left.visible,
.fade-in-right.visible {
  opacity: 1;
  transform: translate(0);
  transition: opacity var(--duration-long-2) var(--easing-emphasized-decelerate),
              transform var(--duration-long-2) var(--easing-emphasized-decelerate);
}

/* Scale Animations */
.scale-in {
  opacity: 0;
  transform: scale(0.9);
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
  transition: opacity var(--duration-medium-4) var(--easing-emphasized-decelerate),
              transform var(--duration-medium-4) var(--spring-gentle);
}

/* Blur In Animation */
.blur-in {
  opacity: 0;
  filter: blur(10px);
}

.blur-in.visible {
  opacity: 1;
  filter: blur(0);
  transition: opacity var(--duration-long-1) var(--easing-standard),
              filter var(--duration-long-1) var(--easing-standard);
}

/* Staggered Children Animation */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-medium-4) var(--easing-emphasized-decelerate),
              transform var(--duration-medium-4) var(--easing-emphasized-decelerate);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 50ms; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 100ms; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 150ms; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 200ms; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 250ms; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 300ms; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 350ms; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 400ms; }

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Page Transition Overlay */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-bg);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-medium-2) var(--easing-standard);
}

.page-transition.active {
  opacity: 1;
  pointer-events: all;
}

/* Parallax Container */
.parallax-container {
  overflow: hidden;
  position: relative;
}

.parallax-element {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* Floating Animation */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.float {
  animation: float 3s ease-in-out infinite;
  will-change: transform; /* GPU compositing hint */
}

.float-delay-1 { animation-delay: 0.5s; }
.float-delay-2 { animation-delay: 1s; }
.float-delay-3 { animation-delay: 1.5s; }

/* Pulse Animation */
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
  will-change: transform, opacity; /* GPU compositing hint */
}

/* Shimmer Effect */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  will-change: background-position; /* GPU compositing hint */
}

[data-theme="light"] .shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.05) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
}

/* Slide In From Edge */
.slide-in-bottom {
  transform: translateY(100%);
  transition: transform var(--duration-long-1) var(--easing-emphasized-decelerate);
}

.slide-in-bottom.visible {
  transform: translateY(0);
}

/* Spring Bounce */
@keyframes spring-bounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.1); }
  50% { transform: scale(0.95); }
  70% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.spring-bounce {
  animation: spring-bounce var(--duration-long-2) var(--spring-bouncy);
  will-change: transform; /* GPU compositing hint */
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .fade-in-up,
  .fade-in-down,
  .fade-in-left,
  .fade-in-right,
  .scale-in,
  .blur-in,
  .stagger-children > *,
  .parallax-element,
  .slide-in-bottom {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  .float,
  .pulse,
  .shimmer,
  .spring-bounce {
    animation: none;
  }
}

/* ========== Tooltip System ========== */
/* Base Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip::before,
.tooltip::after {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--duration-short-4) var(--easing-standard),
              transform var(--duration-short-4) var(--easing-emphasized-decelerate);
  z-index: 1000;
}

/* Tooltip Arrow */
.tooltip::before {
  content: '';
  border: 6px solid transparent;
}

/* Tooltip Content */
.tooltip::after {
  content: attr(data-tooltip);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font-size: var(--text-label-md);
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  border-radius: var(--radius-element);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.24),
              0 2px 8px rgba(0, 0, 0, 0.16);
  border: 1px solid var(--color-border);
}

[data-theme="light"] .tooltip::after {
  background: var(--color-surface-container-high);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12),
              0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Tooltip Hover State */
.tooltip:hover::before,
.tooltip:hover::after,
.tooltip:focus::before,
.tooltip:focus::after {
  opacity: 1;
  visibility: visible;
}

/* Tooltip Positions - Top (default) */
.tooltip::before {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border-top-color: var(--color-surface-elevated);
}

.tooltip::after {
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
}

.tooltip:hover::before,
.tooltip:focus::before {
  transform: translateX(-50%) translateY(0);
}

.tooltip:hover::after,
.tooltip:focus::after {
  transform: translateX(-50%) translateY(0);
}

/* Tooltip Position - Bottom */
.tooltip-bottom::before {
  bottom: auto;
  top: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--color-surface-elevated);
  transform: translateX(-50%) translateY(-4px);
}

.tooltip-bottom::after {
  bottom: auto;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px);
}

.tooltip-bottom:hover::before,
.tooltip-bottom:focus::before {
  transform: translateX(-50%) translateY(0);
}

.tooltip-bottom:hover::after,
.tooltip-bottom:focus::after {
  transform: translateX(-50%) translateY(0);
}

/* Tooltip Position - Left */
.tooltip-left::before {
  bottom: auto;
  left: auto;
  right: 100%;
  top: 50%;
  border-top-color: transparent;
  border-left-color: var(--color-surface-elevated);
  transform: translateY(-50%) translateX(4px);
}

.tooltip-left::after {
  bottom: auto;
  left: auto;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
}

.tooltip-left:hover::before,
.tooltip-left:focus::before {
  transform: translateY(-50%) translateX(0);
}

.tooltip-left:hover::after,
.tooltip-left:focus::after {
  transform: translateY(-50%) translateX(0);
}

/* Tooltip Position - Right */
.tooltip-right::before {
  bottom: auto;
  left: 100%;
  top: 50%;
  border-top-color: transparent;
  border-right-color: var(--color-surface-elevated);
  transform: translateY(-50%) translateX(-4px);
}

.tooltip-right::after {
  bottom: auto;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
}

.tooltip-right:hover::before,
.tooltip-right:focus::before {
  transform: translateY(-50%) translateX(0);
}

.tooltip-right:hover::after,
.tooltip-right:focus::after {
  transform: translateY(-50%) translateX(0);
}

/* Multiline Tooltip */
.tooltip-multiline::after {
  white-space: normal;
  max-width: 250px;
  text-align: center;
}

/* ========== Popover System ========== */
.popover-trigger {
  position: relative;
  cursor: pointer;
}

.popover {
  position: absolute;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(0.96);
  transition: opacity var(--duration-medium-1) var(--easing-standard),
              transform var(--duration-medium-1) var(--easing-emphasized-decelerate),
              visibility var(--duration-medium-1);
}

.popover.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.popover-content {
  background: var(--color-surface-container);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-container);
  padding: var(--space-4);
  min-width: 200px;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24),
              0 4px 16px rgba(0, 0, 0, 0.16);
}

[data-theme="light"] .popover-content {
  background: #ffffff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
              0 4px 16px rgba(0, 0, 0, 0.08);
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.popover-title {
  font-size: var(--text-title-sm);
  font-weight: 600;
  color: var(--color-text);
}

.popover-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-micro);
  transition: background var(--duration-short-3) var(--easing-standard),
              color var(--duration-short-3) var(--easing-standard);
}

.popover-close:hover {
  background: var(--color-surface-elevated);
  color: var(--color-text);
}

.popover-body {
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.popover-footer {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

/* Popover Positions */
.popover-top {
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(8px) scale(0.96);
}

.popover-top.active {
  transform: translateX(-50%) translateY(0) scale(1);
}

.popover-bottom {
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px) scale(0.96);
}

.popover-bottom.active {
  transform: translateX(-50%) translateY(0) scale(1);
}

.popover-left {
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(8px) scale(0.96);
}

.popover-left.active {
  transform: translateY(-50%) translateX(0) scale(1);
}

.popover-right {
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-8px) scale(0.96);
}

.popover-right.active {
  transform: translateY(-50%) translateX(0) scale(1);
}

/* ========== Contextual Help ========== */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 12px;
  font-weight: 600;
  background: var(--color-border-strong);
  color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  cursor: help;
  transition: background var(--duration-short-3) var(--easing-standard),
              color var(--duration-short-3) var(--easing-standard);
}

.help-icon:hover {
  background: var(--color-text-tertiary);
  color: var(--color-text);
}

.help-icon::after {
  content: '?';
}

/* Info Badge */
.info-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-label-sm);
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: all var(--duration-short-3) var(--easing-standard);
}

.info-badge:hover {
  background: var(--glass-bg-prominent);
  color: var(--color-text-secondary);
}

/* Hint Text */
.hint {
  font-size: var(--text-label-sm);
  color: var(--color-text-tertiary);
  margin-top: var(--space-1);
}

.hint-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: var(--space-1);
  vertical-align: middle;
}

/* Keyboard Shortcut Badge */
.kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: var(--text-label-sm);
  color: var(--color-text-secondary);
  background: var(--color-surface-container);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-micro);
  box-shadow: 0 2px 0 var(--color-border);
}

[data-theme="light"] .kbd {
  background: #f5f5f5;
  border-color: #d4d4d4;
  box-shadow: 0 2px 0 #d4d4d4;
}

/* Tooltip for Disabled Elements */
.tooltip-disabled {
  cursor: not-allowed;
}

.tooltip-disabled::after {
  background: var(--color-error);
  color: white;
}

.tooltip-disabled::before {
  border-top-color: var(--color-error);
}

/* ========== Data Visualization System ========== */
/* Chart Container */
.chart-container {
  position: relative;
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-container);
}

.chart-title {
  font-size: var(--text-title-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.chart-subtitle {
  font-size: var(--text-body-sm);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-4);
}

/* Bar Chart */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.bar-label {
  min-width: 80px;
  font-size: var(--text-label-md);
  color: var(--color-text-secondary);
  text-align: right;
}

.bar-track {
  flex: 1;
  height: 8px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-text-tertiary), var(--color-text-secondary));
  border-radius: var(--radius-full);
  transition: width var(--duration-long-2) var(--easing-emphasized-decelerate);
}

.bar-fill.success {
  background: linear-gradient(90deg, #16a34a, var(--color-success));
}

.bar-fill.warning {
  background: linear-gradient(90deg, #ca8a04, var(--color-warning));
}

.bar-fill.error {
  background: linear-gradient(90deg, #dc2626, var(--color-error));
}

.bar-value {
  min-width: 50px;
  font-family: var(--font-mono);
  font-size: var(--text-label-md);
  color: var(--color-text);
  text-align: right;
}

/* Horizontal Bar Chart */
.bar-chart-horizontal {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  height: 200px;
  padding-top: var(--space-4);
}

.bar-vertical {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.bar-vertical-track {
  flex: 1;
  width: 100%;
  max-width: 32px;
  background: var(--color-border);
  border-radius: var(--radius-element);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.bar-vertical-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--color-text-secondary), var(--color-text-tertiary));
  border-radius: var(--radius-element);
  transition: height var(--duration-long-2) var(--easing-emphasized-decelerate);
}

.bar-vertical-label {
  margin-top: var(--space-2);
  font-size: var(--text-label-sm);
  color: var(--color-text-tertiary);
}

/* Progress Ring / Circular Progress */
.progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-ring svg {
  transform: rotate(-90deg);
}

.progress-ring-track {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 8;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--color-text-secondary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset var(--duration-long-2) var(--easing-emphasized-decelerate);
}

.progress-ring-fill.success {
  stroke: var(--color-success);
}

.progress-ring-fill.warning {
  stroke: var(--color-warning);
}

.progress-ring-fill.error {
  stroke: var(--color-error);
}

.progress-ring-value {
  position: absolute;
  font-family: var(--font-mono);
  font-size: var(--text-headline-sm);
  font-weight: 700;
  color: var(--color-text);
}

.progress-ring-label {
  position: absolute;
  bottom: -24px;
  font-size: var(--text-label-sm);
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

/* Linear Progress */
.progress-linear {
  width: 100%;
}

.progress-linear-track {
  height: 8px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-linear-fill {
  height: 100%;
  background: var(--color-text-secondary);
  border-radius: var(--radius-full);
  transition: width var(--duration-long-2) var(--easing-emphasized-decelerate);
}

.progress-linear-fill.animated {
  background: linear-gradient(
    90deg,
    var(--color-text-tertiary) 0%,
    var(--color-text-secondary) 50%,
    var(--color-text-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: progress-shimmer 1.5s infinite;
}

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

.progress-linear-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
}

.progress-linear-label {
  font-size: var(--text-label-sm);
  color: var(--color-text-tertiary);
}

.progress-linear-value {
  font-family: var(--font-mono);
  font-size: var(--text-label-sm);
  color: var(--color-text);
}

/* Sparkline */
.sparkline {
  display: inline-block;
  vertical-align: middle;
}

.sparkline-path {
  fill: none;
  stroke: var(--color-text-secondary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline-area {
  fill: url(#sparkline-gradient);
  opacity: 0.2;
}

.sparkline.success .sparkline-path {
  stroke: var(--color-success);
}

.sparkline.warning .sparkline-path {
  stroke: var(--color-warning);
}

.sparkline.error .sparkline-path {
  stroke: var(--color-error);
}

/* Gauge / Meter */
.gauge {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.gauge-dial {
  position: relative;
  overflow: hidden;
}

.gauge-track {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 12;
}

.gauge-fill {
  fill: none;
  stroke: var(--color-text-secondary);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset var(--duration-long-2) var(--easing-emphasized-decelerate);
}

.gauge-value {
  position: absolute;
  bottom: 0;
  font-family: var(--font-mono);
  font-size: var(--text-display-sm);
  font-weight: 700;
  color: var(--color-text);
}

.gauge-unit {
  font-size: var(--text-body-md);
  color: var(--color-text-tertiary);
}

.gauge-label {
  margin-top: var(--space-2);
  font-size: var(--text-label-md);
  color: var(--color-text-secondary);
}

/* Data Grid / Heatmap Cell */
.data-grid {
  display: grid;
  gap: 2px;
}

.data-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-micro);
  background: var(--color-border);
  transition: background var(--duration-short-3) var(--easing-standard);
}

.data-cell.level-1 { background: rgba(255, 255, 255, 0.1); }
.data-cell.level-2 { background: rgba(255, 255, 255, 0.2); }
.data-cell.level-3 { background: rgba(255, 255, 255, 0.3); }
.data-cell.level-4 { background: rgba(255, 255, 255, 0.5); }
.data-cell.level-5 { background: rgba(255, 255, 255, 0.7); }

[data-theme="light"] .data-cell.level-1 { background: rgba(0, 0, 0, 0.1); }
[data-theme="light"] .data-cell.level-2 { background: rgba(0, 0, 0, 0.2); }
[data-theme="light"] .data-cell.level-3 { background: rgba(0, 0, 0, 0.35); }
[data-theme="light"] .data-cell.level-4 { background: rgba(0, 0, 0, 0.5); }
[data-theme="light"] .data-cell.level-5 { background: rgba(0, 0, 0, 0.7); }

/* Stat Card */
.stat-card {
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-container);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-display-sm);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.stat-label {
  font-size: var(--text-label-md);
  color: var(--color-text-tertiary);
  margin-top: var(--space-2);
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-label-sm);
  margin-top: var(--space-2);
}

.stat-change.positive {
  color: var(--color-success);
}

.stat-change.negative {
  color: var(--color-error);
}

/* Legend */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-text-secondary);
}

.legend-line {
  width: 20px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--color-text-secondary);
}

.legend-label {
  font-size: var(--text-label-md);
  color: var(--color-text-tertiary);
}

/* Axis Labels */
.axis-label {
  font-size: var(--text-label-sm);
  color: var(--color-text-tertiary);
}

.axis-label-x {
  text-align: center;
  margin-top: var(--space-3);
}

.axis-label-y {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-right: var(--space-3);
}

/* Metric Badge */
.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-element);
}

.metric-badge-value {
  font-family: var(--font-mono);
  font-size: var(--text-body-md);
  font-weight: 600;
  color: var(--color-text);
}

.metric-badge-label {
  font-size: var(--text-label-sm);
  color: var(--color-text-tertiary);
}

/* Comparison Indicator */
.comparison {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-label-sm);
}

.comparison-arrow {
  font-size: 10px;
}

.comparison.up {
  color: var(--color-success);
}

.comparison.down {
  color: var(--color-error);
}

.comparison.neutral {
  color: var(--color-text-tertiary);
}

/* ========== Sprint 191-200: Final Polish System ========== */

/* Enhanced Shadow / Elevation System */
.elevation-0 {
  box-shadow: none;
}

.elevation-1 {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 1px 3px 1px rgba(0, 0, 0, 0.15);
}

.elevation-2 {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 2px 6px 2px rgba(0, 0, 0, 0.15);
}

.elevation-3 {
  box-shadow:
    0 4px 8px 3px rgba(0, 0, 0, 0.15),
    0 1px 3px rgba(0, 0, 0, 0.3);
}

.elevation-4 {
  box-shadow:
    0 6px 10px 4px rgba(0, 0, 0, 0.15),
    0 2px 3px rgba(0, 0, 0, 0.3);
}

.elevation-5 {
  box-shadow:
    0 8px 12px 6px rgba(0, 0, 0, 0.15),
    0 4px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .elevation-1 {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.1),
    0 1px 3px 1px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .elevation-2 {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.1),
    0 2px 6px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .elevation-3 {
  box-shadow:
    0 4px 8px 3px rgba(0, 0, 0, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .elevation-4 {
  box-shadow:
    0 6px 10px 4px rgba(0, 0, 0, 0.05),
    0 2px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .elevation-5 {
  box-shadow:
    0 8px 12px 6px rgba(0, 0, 0, 0.05),
    0 4px 4px rgba(0, 0, 0, 0.1);
}

/* Hover Elevation Transitions */
.elevation-hover {
  transition: box-shadow var(--duration-short-4) var(--easing-standard);
}

.elevation-hover:hover {
  box-shadow:
    0 6px 10px 4px rgba(0, 0, 0, 0.15),
    0 2px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .elevation-hover:hover {
  box-shadow:
    0 6px 10px 4px rgba(0, 0, 0, 0.05),
    0 2px 3px rgba(0, 0, 0, 0.1);
}

/* Focus States & Accessibility */
.focus-ring:focus,
.focus-ring:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.focus-ring-inset:focus,
.focus-ring-inset:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.focus-within:focus-within {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--color-primary);
  color: var(--color-text);
  z-index: 9999;
  transition: top var(--duration-short-3) var(--easing-standard);
}

.skip-link:focus {
  top: 0;
}

/* Screen Reader Only */
.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;
}

.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* 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;
    scroll-behavior: auto !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --color-border: #ffffff;
    --color-text: #ffffff;
    --color-text-secondary: #e0e0e0;
  }

  .btn, .card, .stat-card, .metric-badge {
    border-width: 2px;
  }
}

/* Micro-Interactions */
.interactive {
  cursor: pointer;
  transition:
    transform var(--duration-short-2) var(--easing-standard),
    opacity var(--duration-short-2) var(--easing-standard);
}

.interactive:hover {
  transform: translateY(-1px);
}

.interactive:active {
  transform: translateY(0) scale(0.98);
}

.press-effect {
  transition: transform var(--duration-short-1) var(--easing-standard);
}

.press-effect:active {
  transform: scale(0.95);
}

.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple-effect 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-effect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

[data-theme="light"] .ripple {
  background: rgba(0, 0, 0, 0.1);
}

/* Pulse Effect */
.pulse {
  animation: pulse-effect 2s var(--easing-standard) infinite;
}

@keyframes pulse-effect {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Glow Effects */
.glow {
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.glow-primary {
  box-shadow: 0 0 20px rgba(var(--color-primary-rgb, 99, 102, 241), 0.3);
}

.glow-success {
  box-shadow: 0 0 20px rgba(var(--color-success-rgb, 34, 197, 94), 0.3);
}

.glow-warning {
  box-shadow: 0 0 20px rgba(var(--color-warning-rgb, 234, 179, 8), 0.3);
}

.glow-error {
  box-shadow: 0 0 20px rgba(var(--color-error-rgb, 239, 68, 68), 0.3);
}

/* Enhanced Glass/Blur Effects */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  border: 1px solid var(--glass-border);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.glass-subtle {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
  border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .glass-strong {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .glass-subtle {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Frosted Surface */
.frosted {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  backdrop-filter: blur(var(--blur-md)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .frosted {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.7) 100%
  );
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Typography Polish */
.text-gradient {
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary, #8b5cf6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-balance {
  text-wrap: balance;
}

.text-pretty {
  text-wrap: pretty;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-uppercase {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.text-capitalize {
  text-transform: capitalize;
}

.font-tabular {
  font-variant-numeric: tabular-nums;
}

.font-slashed-zero {
  font-variant-numeric: slashed-zero;
}

/* Selection Styling */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--color-text);
}

[data-theme="light"] ::selection {
  background: rgba(99, 102, 241, 0.2);
}

/* Spacing Utilities */
.gap-0 { gap: 0; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.gap-10 { gap: var(--space-10); }
.gap-12 { gap: var(--space-12); }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: var(--space-1); padding-right: var(--space-1); }
.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-5 { padding-left: var(--space-5); padding-right: var(--space-5); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: var(--space-1); padding-bottom: var(--space-1); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-5 { padding-top: var(--space-5); padding-bottom: var(--space-5); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

.m-0 { margin: 0; }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-auto { margin: auto; }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* Layout Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-none { flex: none; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.items-baseline { align-items: baseline; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }

.self-start { align-self: flex-start; }
.self-center { align-self: center; }
.self-end { align-self: flex-end; }
.self-stretch { align-self: stretch; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }

.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-6 { grid-column: span 6 / span 6; }
.col-span-full { grid-column: 1 / -1; }

/* Position Utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.inset-0 { inset: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* Size Utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-screen { width: 100vw; }
.w-fit { width: fit-content; }
.w-min { width: min-content; }
.w-max { width: max-content; }

.h-full { height: 100%; }
.h-auto { height: auto; }
.h-screen { height: 100vh; }
.h-fit { height: fit-content; }

.min-h-0 { min-height: 0; }
.min-h-full { min-height: 100%; }
.min-h-screen { min-height: 100vh; }

.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-full { max-width: 100%; }
.max-w-prose { max-width: 65ch; }

/* Overflow Utilities */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }
.overflow-visible { overflow: visible; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-hidden { overflow-y: hidden; }

/* Border Radius Utilities */
.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: var(--radius-micro); }
.rounded { border-radius: var(--radius-element); }
.rounded-md { border-radius: var(--radius-element); }
.rounded-lg { border-radius: var(--radius-container); }
.rounded-xl { border-radius: var(--radius-section); }
.rounded-2xl { border-radius: var(--radius-panel); }
.rounded-full { border-radius: var(--radius-full); }

/* Opacity Utilities */
.opacity-0 { opacity: 0; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* Visibility */
.visible { visibility: visible; }
.invisible { visibility: hidden; }
.hidden { display: none; }

/* Z-Index Scale */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-auto { z-index: auto; }

/* Cursor Utilities */
.cursor-auto { cursor: auto; }
.cursor-default { cursor: default; }
.cursor-pointer { cursor: pointer; }
.cursor-wait { cursor: wait; }
.cursor-text { cursor: text; }
.cursor-move { cursor: move; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-grab { cursor: grab; }
.cursor-grabbing { cursor: grabbing; }

/* User Select */
.select-none { user-select: none; }
.select-text { user-select: text; }
.select-all { user-select: all; }
.select-auto { user-select: auto; }

/* Pointer Events */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* Aspect Ratio */
.aspect-auto { aspect-ratio: auto; }
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-4-3 { aspect-ratio: 4 / 3; }
.aspect-3-2 { aspect-ratio: 3 / 2; }

/* Dividers */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-4) 0;
}

.divider-vertical {
  width: 1px;
  height: 100%;
  background: var(--color-border);
  margin: 0 var(--space-4);
}

/* Scrollbar Styling */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-tertiary);
}

.scrollbar-hidden {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scrollbar-hidden::-webkit-scrollbar {
  display: none;
}

/* Print Styles */
@media print {
  .no-print { display: none !important; }
  .print-only { display: block !important; }

  body {
    background: white;
    color: black;
  }

  .glass, .glass-strong, .glass-subtle, .frosted {
    background: white;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid #ccc;
  }
}

/* Container Queries Support */
.container-query {
  container-type: inline-size;
}

@container (min-width: 400px) {
  .cq\:flex-row { flex-direction: row; }
  .cq\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container (min-width: 600px) {
  .cq\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@container (min-width: 800px) {
  .cq\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Color Mode Transition */
.color-mode-transition,
.color-mode-transition *,
.color-mode-transition *::before,
.color-mode-transition *::after {
  transition:
    background-color var(--duration-medium-2) var(--easing-standard),
    border-color var(--duration-medium-2) var(--easing-standard),
    color var(--duration-medium-2) var(--easing-standard),
    fill var(--duration-medium-2) var(--easing-standard),
    stroke var(--duration-medium-2) var(--easing-standard) !important;
}
