
:root {
  /* Colors */
  --color-background: rgba(252, 252, 249, 1);
  --color-surface: rgba(255, 255, 253, 1);
  --color-text: rgba(19, 52, 59, 1);
  --color-text-secondary: rgba(98, 108, 113, 1);
  --color-primary: rgba(33, 128, 141, 1);
  --color-primary-hover: rgba(29, 116, 128, 1);
  --color-primary-active: rgba(26, 104, 115, 1);
  --color-secondary: rgba(94, 82, 64, 0.12);
  --color-secondary-hover: rgba(94, 82, 64, 0.2);
  --color-secondary-active: rgba(94, 82, 64, 0.25);
  --color-border: rgba(94, 82, 64, 0.2);
  --color-btn-primary-text: rgba(252, 252, 249, 1);
  --color-card-border: rgba(94, 82, 64, 0.12);
  --color-card-border-inner: rgba(94, 82, 64, 0.12);
  --color-error: rgba(192, 21, 47, 1);
  --color-success: rgba(33, 128, 141, 1);
  --color-warning: rgba(168, 75, 47, 1);
  --color-info: rgba(98, 108, 113, 1);
  --color-focus-ring: rgba(33, 128, 141, 0.4);
  --color-select-caret: rgba(19, 52, 59, 0.8);

  /* Common style patterns */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for opacity control */
  --color-success-rgb: 33, 128, 141;
  --color-error-rgb: 192, 21, 47;
  --color-warning-rgb: 168, 75, 47;
  --color-info-rgb: 98, 108, 113;

  /* Typography */
  --font-family-base: "FKGroteskNeue", "Geist", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-mono: "Berkeley Mono", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, monospace;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 30px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 550;
  --font-weight-bold: 600;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --letter-spacing-tight: -0.01em;

  /* Spacing */
  --space-0: 0;
  --space-1: 1px;
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04),
    0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04),
    0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03);

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
}

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
  :root {
    --color-background: rgba(31, 33, 33, 1);
    --color-surface: rgba(38, 40, 40, 1);
    --color-text: rgba(245, 245, 245, 1);
    --color-text-secondary: rgba(167, 169, 169, 0.7);
    --color-primary: rgba(50, 184, 198, 1);
    --color-primary-hover: rgba(45, 166, 178, 1);
    --color-primary-active: rgba(41, 150, 161, 1);
    --color-secondary: rgba(119, 124, 124, 0.15);
    --color-secondary-hover: rgba(119, 124, 124, 0.25);
    --color-secondary-active: rgba(119, 124, 124, 0.3);
    --color-border: rgba(119, 124, 124, 0.3);
    --color-error: rgba(255, 84, 89, 1);
    --color-success: rgba(50, 184, 198, 1);
    --color-warning: rgba(230, 129, 97, 1);
    --color-info: rgba(167, 169, 169, 1);
    --color-focus-ring: rgba(50, 184, 198, 0.4);
    --color-btn-primary-text: rgba(19, 52, 59, 1);
    --color-card-border: rgba(119, 124, 124, 0.2);
    --color-card-border-inner: rgba(119, 124, 124, 0.15);
    --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    --button-border-secondary: rgba(119, 124, 124, 0.2);
    --color-border-secondary: rgba(119, 124, 124, 0.2);
    --color-select-caret: rgba(245, 245, 245, 0.8);

    /* Common style patterns - updated for dark mode */
    --focus-ring: 0 0 0 3px var(--color-focus-ring);
    --focus-outline: 2px solid var(--color-primary);
    --status-bg-opacity: 0.15;
    --status-border-opacity: 0.25;
    --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

    /* RGB versions for dark mode */
    --color-success-rgb: 50, 184, 198;
    --color-error-rgb: 255, 84, 89;
    --color-warning-rgb: 230, 129, 97;
    --color-info-rgb: 167, 169, 169;
  }
}

/* Data attribute for manual theme switching */
[data-color-scheme="dark"] {
  --color-background: rgba(31, 33, 33, 1);
  --color-surface: rgba(38, 40, 40, 1);
  --color-text: rgba(245, 245, 245, 1);
  --color-text-secondary: rgba(167, 169, 169, 0.7);
  --color-primary: rgba(50, 184, 198, 1);
  --color-primary-hover: rgba(45, 166, 178, 1);
  --color-primary-active: rgba(41, 150, 161, 1);
  --color-secondary: rgba(119, 124, 124, 0.15);
  --color-secondary-hover: rgba(119, 124, 124, 0.25);
  --color-secondary-active: rgba(119, 124, 124, 0.3);
  --color-border: rgba(119, 124, 124, 0.3);
  --color-error: rgba(255, 84, 89, 1);
  --color-success: rgba(50, 184, 198, 1);
  --color-warning: rgba(230, 129, 97, 1);
  --color-info: rgba(167, 169, 169, 1);
  --color-focus-ring: rgba(50, 184, 198, 0.4);
  --color-btn-primary-text: rgba(19, 52, 59, 1);
  --color-card-border: rgba(119, 124, 124, 0.15);
  --color-card-border-inner: rgba(119, 124, 124, 0.15);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  --color-border-secondary: rgba(119, 124, 124, 0.2);
  --color-select-caret: rgba(245, 245, 245, 0.8);

  /* Common style patterns - updated for dark mode */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for dark mode */
  --color-success-rgb: 50, 184, 198;
  --color-error-rgb: 255, 84, 89;
  --color-warning-rgb: 230, 129, 97;
  --color-info-rgb: 167, 169, 169;
}

[data-color-scheme="light"] {
  --color-background: rgba(252, 252, 249, 1);
  --color-surface: rgba(255, 255, 253, 1);
  --color-text: rgba(19, 52, 59, 1);
  --color-text-secondary: rgba(98, 108, 113, 1);
  --color-primary: rgba(33, 128, 141, 1);
  --color-primary-hover: rgba(29, 116, 128, 1);
  --color-primary-active: rgba(26, 104, 115, 1);
  --color-secondary: rgba(94, 82, 64, 0.12);
  --color-secondary-hover: rgba(94, 82, 64, 0.2);
  --color-secondary-active: rgba(94, 82, 64, 0.25);
  --color-border: rgba(94, 82, 64, 0.2);
  --color-btn-primary-text: rgba(252, 252, 249, 1);
  --color-card-border: rgba(94, 82, 64, 0.12);
  --color-card-border-inner: rgba(94, 82, 64, 0.12);
  --color-error: rgba(192, 21, 47, 1);
  --color-success: rgba(33, 128, 141, 1);
  --color-warning: rgba(168, 75, 47, 1);
  --color-info: rgba(98, 108, 113, 1);
  --color-focus-ring: rgba(33, 128, 141, 0.4);

  /* RGB versions for light mode */
  --color-success-rgb: 33, 128, 141;
  --color-error-rgb: 192, 21, 47;
  --color-warning-rgb: 168, 75, 47;
  --color-info-rgb: 98, 108, 113;
}

/* Base styles */
html {
  font-size: var(--font-size-base);
  font-family: var(--font-family-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
  min-height: 100vh;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0; /* Updated in media query for mobile nav */
}

#root {
  flex: 1;
  display: flex;
  flex-direction: column;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-4xl);
}
h2 {
  font-size: var(--font-size-3xl);
}
h3 {
  font-size: var(--font-size-2xl);
}
h4 {
  font-size: var(--font-size-xl);
}
h5 {
  font-size: var(--font-size-lg);
}
h6 {
  font-size: var(--font-size-md);
}

p {
  margin: 0 0 var(--space-16) 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
  color: var(--color-primary-hover);
}

code,
pre {
  font-family: var(--font-family-mono);
  font-size: calc(var(--font-size-base) * 0.95);
  background-color: var(--color-secondary);
  border-radius: var(--radius-sm);
}

code {
  padding: var(--space-1) var(--space-4);
}

pre {
  padding: var(--space-16);
  margin: var(--space-16) 0;
  overflow: auto;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-base);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  border: none;
  text-decoration: none;
  position: relative;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
}

.btn--primary:hover {
  background: var(--color-primary-hover);
}

.btn--primary:active {
  background: var(--color-primary-active);
}

.btn--secondary {
  background: var(--color-secondary);
  color: var(--color-text);
}

.btn--secondary:hover {
  background: var(--color-secondary-hover);
}

.btn--secondary:active {
  background: var(--color-secondary-active);
}

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

.btn--outline:hover {
  background: var(--color-secondary);
}

.btn--danger {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.btn--danger:hover {
  background: rgba(220, 53, 69, 0.2);
  border-color: rgba(220, 53, 69, 0.5);
}

.btn--danger:active {
  background: rgba(220, 53, 69, 0.3);
}

.btn--sm {
  padding: var(--space-4) var(--space-12);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: var(--space-10) var(--space-20);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-md);
}

.btn--full-width {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form elements */
.form-control {
  display: block;
  width: 100%;
  padding: var(--space-8) var(--space-12);
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

textarea.form-control {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
}

select.form-control {
  padding: var(--space-8) var(--space-12);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: var(--select-caret-light);
  background-repeat: no-repeat;
  background-position: right var(--space-12) center;
  background-size: 16px;
  padding-right: var(--space-32);
}

/* Add a dark mode specific caret */
@media (prefers-color-scheme: dark) {
  select.form-control {
    background-image: var(--select-caret-dark);
  }
}

/* Also handle data-color-scheme */
[data-color-scheme="dark"] select.form-control {
  background-image: var(--select-caret-dark);
}

[data-color-scheme="light"] select.form-control {
  background-image: var(--select-caret-light);
}

.form-control:focus {
  border-color: var(--color-primary);
  outline: var(--focus-outline);
}

.form-label {
  display: block;
  margin-bottom: var(--space-8);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.form-group {
  margin-bottom: var(--space-16);
}

/* Card component */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-standard);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card__body {
  padding: var(--space-16);
}

.card__header,
.card__footer {
  padding: var(--space-16);
  border-bottom: 1px solid var(--color-card-border-inner);
}

/* Status indicators - simplified with CSS variables */
.status {
  display: inline-flex;
  align-items: center;
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.status--success {
  background-color: rgba(
    var(--color-success-rgb, 33, 128, 141),
    var(--status-bg-opacity)
  );
  color: var(--color-success);
  border: 1px solid
    rgba(var(--color-success-rgb, 33, 128, 141), var(--status-border-opacity));
}

.status--error {
  background-color: rgba(
    var(--color-error-rgb, 192, 21, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-error);
  border: 1px solid
    rgba(var(--color-error-rgb, 192, 21, 47), var(--status-border-opacity));
}

.status--warning {
  background-color: rgba(
    var(--color-warning-rgb, 168, 75, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-warning);
  border: 1px solid
    rgba(var(--color-warning-rgb, 168, 75, 47), var(--status-border-opacity));
}

.status--info {
  background-color: rgba(
    var(--color-info-rgb, 98, 108, 113),
    var(--status-bg-opacity)
  );
  color: var(--color-info);
  border: 1px solid
    rgba(var(--color-info-rgb, 98, 108, 113), var(--status-border-opacity));
}

/* Container layout */
.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--space-16);
  padding-left: var(--space-16);
}

@media (min-width: 640px) {
  .container {
    max-width: var(--container-sm);
  }
}
@media (min-width: 768px) {
  .container {
    max-width: var(--container-md);
  }
}
@media (min-width: 1024px) {
  .container {
    max-width: var(--container-lg);
  }
}
@media (min-width: 1280px) {
  .container {
    max-width: var(--container-xl);
  }
}

/* Utility classes */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-4 {
  gap: var(--space-4);
}
.gap-8 {
  gap: var(--space-8);
}
.gap-16 {
  gap: var(--space-16);
}

.m-0 {
  margin: 0;
}
.mt-8 {
  margin-top: var(--space-8);
}
.mb-8 {
  margin-bottom: var(--space-8);
}
.mx-8 {
  margin-left: var(--space-8);
  margin-right: var(--space-8);
}
.my-8 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.p-0 {
  padding: 0;
}
.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}
.px-8 {
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}
.py-16 {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}
.px-16 {
  padding-left: var(--space-16);
  padding-right: var(--space-16);
}

.block {
  display: block;
}
.hidden {
  display: none;
}

/* 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 {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* Dark mode specifics */
[data-color-scheme="dark"] .btn--outline {
  border: 1px solid var(--color-border-secondary);
}

@font-face {
  font-family: 'FKGroteskNeue';
  src: url('https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2')
    format('woff2');
}

:root {
  /* Colors */
  --color-background: rgba(252, 252, 249, 1);
  --color-surface: rgba(255, 255, 253, 1);
  --color-text: rgba(19, 52, 59, 1);
  --color-text-secondary: rgba(98, 108, 113, 1);
  --color-primary: rgba(33, 128, 141, 1);
  --color-primary-hover: rgba(29, 116, 128, 1);
  --color-primary-active: rgba(26, 104, 115, 1);
  --color-secondary: rgba(94, 82, 64, 0.12);
  --color-secondary-hover: rgba(94, 82, 64, 0.2);
  --color-secondary-active: rgba(94, 82, 64, 0.25);
  --color-border: rgba(94, 82, 64, 0.2);
  --color-btn-primary-text: rgba(252, 252, 249, 1);
  --color-card-border: rgba(94, 82, 64, 0.12);
  --color-card-border-inner: rgba(94, 82, 64, 0.12);
  --color-error: rgba(192, 21, 47, 1);
  --color-success: rgba(33, 128, 141, 1);
  --color-warning: rgba(168, 75, 47, 1);
  --color-info: rgba(98, 108, 113, 1);
  --color-focus-ring: rgba(33, 128, 141, 0.4);
  --color-select-caret: rgba(19, 52, 59, 0.8);

  /* Common style patterns */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for opacity control */
  --color-success-rgb: 33, 128, 141;
  --color-error-rgb: 192, 21, 47;
  --color-warning-rgb: 168, 75, 47;
  --color-info-rgb: 98, 108, 113;

  /* Typography */
  --font-family-base: "FKGroteskNeue", "Geist", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-mono: "Berkeley Mono", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, monospace;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 30px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 550;
  --font-weight-bold: 600;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --letter-spacing-tight: -0.01em;

  /* Spacing */
  --space-0: 0;
  --space-1: 1px;
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04),
    0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04),
    0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03);

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
}

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
  :root {
    --color-background: rgba(31, 33, 33, 1);
    --color-surface: rgba(38, 40, 40, 1);
    --color-text: rgba(245, 245, 245, 1);
    --color-text-secondary: rgba(167, 169, 169, 0.7);
    --color-primary: rgba(50, 184, 198, 1);
    --color-primary-hover: rgba(45, 166, 178, 1);
    --color-primary-active: rgba(41, 150, 161, 1);
    --color-secondary: rgba(119, 124, 124, 0.15);
    --color-secondary-hover: rgba(119, 124, 124, 0.25);
    --color-secondary-active: rgba(119, 124, 124, 0.3);
    --color-border: rgba(119, 124, 124, 0.3);
    --color-error: rgba(255, 84, 89, 1);
    --color-success: rgba(50, 184, 198, 1);
    --color-warning: rgba(230, 129, 97, 1);
    --color-info: rgba(167, 169, 169, 1);
    --color-focus-ring: rgba(50, 184, 198, 0.4);
    --color-btn-primary-text: rgba(19, 52, 59, 1);
    --color-card-border: rgba(119, 124, 124, 0.2);
    --color-card-border-inner: rgba(119, 124, 124, 0.15);
    --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    --button-border-secondary: rgba(119, 124, 124, 0.2);
    --color-border-secondary: rgba(119, 124, 124, 0.2);
    --color-select-caret: rgba(245, 245, 245, 0.8);

    /* Common style patterns - updated for dark mode */
    --focus-ring: 0 0 0 3px var(--color-focus-ring);
    --focus-outline: 2px solid var(--color-primary);
    --status-bg-opacity: 0.15;
    --status-border-opacity: 0.25;
    --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

    /* RGB versions for dark mode */
    --color-success-rgb: 50, 184, 198;
    --color-error-rgb: 255, 84, 89;
    --color-warning-rgb: 230, 129, 97;
    --color-info-rgb: 167, 169, 169;
  }
}

/* Gaming theme overrides */
:root {
  --gaming-bg: #1a1a1a;
  --gaming-card: #2d2d2d;
  --gaming-gold: #ffd700;
  --gaming-text: #ffffff;
  --gaming-text-secondary: #b0b0b0;
  --gaming-border: #404040;
  --gaming-hover: #3a3a3a;
  --gaming-accent: #00ff88;
  --gaming-t-color: #ff6b47;
  --gaming-ct-color: #4a90e2;
}

body {
  background-color: var(--gaming-bg);
  color: var(--gaming-text);
  font-family: var(--font-family-base);
  margin: 0;
  padding: 0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: rgba(45, 45, 45, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: var(--space-16) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

@media (max-width: 768px) {
  /* Prevent iOS auto-zoom on input focus */
  input, select, textarea {
    font-size: 16px !important;
  }
  .header {
    padding: 6px 0;
  }
  .main {
    padding: 0;
  }
  #section-info {
    padding: 14px !important;
    margin-bottom: 14px !important;
  }
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  color: var(--gaming-gold) !important;
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  margin: 0;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.logo:hover {
  color: #ffed4e !important;
  text-shadow: 0 0 15px rgba(255, 237, 78, 0.7);
  transform: scale(1.05);
}

.logo h1 {
  color: inherit;
  margin: 0;
}

.nav-tabs {
  display: flex;
  gap: var(--space-8);
}

.nav-tab {
  background: transparent;
  border: 2px solid var(--gaming-border);
  color: var(--gaming-text-secondary);
  padding: var(--space-12) var(--space-24);
  border-radius: var(--radius-base);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  font-weight: var(--font-weight-medium);
}

.nav-tab:hover {
  border-color: var(--gaming-gold);
  color: var(--gaming-text);
}

.nav-tab.active {
  background: var(--gaming-gold);
  color: var(--gaming-bg);
  border-color: var(--gaming-gold);
}

/* Main Content */
.main {
  flex: 1;
  padding: 0 0 var(--space-32) 0;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Sets Grid */
.sets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-24);
  margin-top: var(--space-24);
}

.set-card {
  background: var(--gaming-card);
  border: 1px solid var(--gaming-border);
  border-radius: var(--radius-lg);
  padding: var(--space-20);
  transition: all var(--duration-normal) var(--ease-standard);
  cursor: pointer;
}

.set-card:hover {
  border-color: var(--gaming-gold);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.2);
}

.set-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-16);
}

.set-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin: 0;
  color: var(--gaming-text);
}

.set-side {
  background: var(--gaming-gold);
  color: var(--gaming-bg);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
}

.set-author {
  color: var(--gaming-text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-12);
}

/* Set Preview */
.set-preview {
  margin: var(--space-16) 0;
  padding: var(--space-12);
  background: var(--gaming-bg);
  border-radius: var(--radius-base);
  border: 1px solid var(--gaming-border);
}

.preview-skin {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-6) var(--space-8);
  margin-bottom: var(--space-4);
  background: var(--gaming-card);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
}

.preview-skin:last-child {
  margin-bottom: 0;
}

.preview-skin-name {
  font-size: var(--font-size-xs);
  color: var(--gaming-text);
  flex: 1;
  margin-right: var(--space-8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-skin-price {
  font-size: var(--font-size-xs);
  color: var(--gaming-gold);
  font-weight: var(--font-weight-bold);
}

.set-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-16);
}

.set-interactions {
  display: flex;
  gap: var(--space-16);
  align-items: center;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--gaming-text-secondary);
  font-size: var(--font-size-sm);
}

.set-price {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--gaming-gold);
}

.set-actions {
  margin-top: var(--space-16);
  text-align: center;
}

.like-btn {
  background: transparent;
  border: none;
  color: var(--gaming-text-secondary);
  cursor: pointer;
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast) var(--ease-standard);
}

.like-btn:hover, .like-btn.liked {
  color: #ff4757;
}

/* Set Detail View */
.set-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-24);
  flex-wrap: wrap;
  gap: var(--space-16);
}

.set-detail-info {
  flex: 1;
}

.set-detail-meta {
  display: flex;
  gap: var(--space-16);
  align-items: center;
  margin-top: var(--space-8);
  color: var(--gaming-text-secondary);
  font-size: var(--font-size-sm);
}

.set-detail-actions {
  display: flex;
  gap: var(--space-12);
  align-items: center;
}

.set-detail-stats {
  display: flex;
  gap: var(--space-24);
  margin-bottom: var(--space-24);
  padding: var(--space-16);
  background: var(--gaming-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gaming-border);
}

.set-description {
  margin-bottom: var(--space-24);
  padding: var(--space-16);
  background: var(--gaming-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gaming-border);
  color: var(--gaming-text-secondary);
  line-height: 1.6;
}

.set-description p {
  margin: 0;
}

/* Create Set */
.create-set-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-32);
  flex-wrap: wrap;
  gap: var(--space-16);
}

.set-info {
  display: flex;
  gap: var(--space-24);
  align-items: center;
}

.cost-value {
  color: var(--gaming-gold);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
}

/* Side Selection */
.side-selection {
  margin-bottom: var(--space-32);
}

.side-selection h3 {
  margin-bottom: var(--space-16);
  color: var(--gaming-text);
}

.side-buttons {
  display: flex;
  gap: var(--space-12);
}

.side-btn {
  background: var(--gaming-card);
  border: 2px solid var(--gaming-border);
  color: var(--gaming-text);
  padding: var(--space-12) var(--space-24);
  border-radius: var(--radius-base);
  cursor: pointer;
  font-weight: var(--font-weight-bold);
  transition: all var(--duration-normal) var(--ease-standard);
  min-width: 80px;
  position: relative;
  overflow: hidden;
}

.side-btn:hover {
  border-color: var(--gaming-gold);
  transform: translateY(-1px);
}

.side-btn.active {
  background: var(--gaming-gold);
  color: var(--gaming-bg);
  border-color: var(--gaming-gold);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
}

.side-btn[data-side="T"]:not(.active):hover {
  border-color: var(--gaming-t-color);
  color: var(--gaming-t-color);
}

.side-btn[data-side="CT"]:not(.active):hover {
  border-color: var(--gaming-ct-color);
  color: var(--gaming-ct-color);
}

/* Weapon Grid */
.weapon-grid {
  margin-bottom: var(--space-32);
}

.weapon-category {
  margin-bottom: var(--space-32);
}

.category-title {
  color: var(--gaming-gold);
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-16);
  border-bottom: 2px solid var(--gaming-gold);
  padding-bottom: var(--space-8);
}

.weapon-slots {
  display: grid;
  gap: var(--space-16);
}

.weapon-slots.pistols {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.weapon-slots.smg,
.weapon-slots.rifles,
.weapon-slots.heavy,
.weapon-slots.grenades {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.weapon-slots.snipers {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.weapon-slots.melee {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.weapon-slot {
  background: var(--gaming-card);
  border: 2px solid var(--gaming-border);
  border-radius: var(--radius-lg);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  position: relative;
  padding: var(--space-12);
  text-align: center;
  overflow: hidden;
}

.weapon-slot:hover:not(.weapon-unavailable) {
  border-color: var(--gaming-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
}

.weapon-slot.filled {
  border-color: var(--gaming-accent);
  background: linear-gradient(145deg, var(--gaming-card), #1f4a2e);
}

.weapon-slot.weapon-unavailable {
  cursor: not-allowed;
  opacity: 0.3;
  filter: grayscale(1);
  transform: scale(0.95);
}

/* Weapon Side Indicator */
.weapon-side-indicator {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-sm);
  line-height: 1;
}

.weapon-side-indicator.side-t {
  background: var(--gaming-t-color);
  color: white;
}

.weapon-side-indicator.side-ct {
  background: var(--gaming-ct-color);
  color: white;
}

.weapon-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--gaming-text);
  margin-bottom: var(--space-4);
}

.weapon-price {
  font-size: var(--font-size-xs);
  color: var(--gaming-gold);
  font-weight: var(--font-weight-bold);
}

.skin-name {
  font-size: var(--font-size-xs);
  color: var(--gaming-accent);
  margin-top: var(--space-4);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}

.skin-price {
  font-size: var(--font-size-xs);
  color: var(--gaming-gold);
  font-weight: var(--font-weight-bold);
}

/* Detail weapon slots */
.detail-slot {
  cursor: default;
}

.detail-slot:hover {
  transform: none;
  box-shadow: none;
}

.detail-slot.filled .skin-info {
  display: block !important;
}

/* Set Form */
.set-form {
  background: var(--gaming-card);
  padding: var(--space-24);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gaming-border);
}

.form-group {
  margin-bottom: var(--space-16);
}

.form-label {
  display: block;
  margin-bottom: var(--space-8);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  color: var(--gaming-text);
}

.form-control {
  display: block;
  width: 100%;
  padding: var(--space-8) var(--space-12);
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--gaming-text);
  background: var(--gaming-bg);
  border: 1px solid var(--gaming-border);
  border-radius: var(--radius-base);
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

.form-control:focus {
  border-color: var(--gaming-gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
  outline: none;
}

textarea.form-control {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  resize: vertical;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--gaming-card);
  border-radius: var(--radius-lg);
  border: 2px solid var(--gaming-gold);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1001;
}

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

.modal-header h3 {
  margin: 0;
  color: var(--gaming-gold);
}

.modal-close {
  background: none;
  border: none;
  color: var(--gaming-text);
  font-size: var(--font-size-2xl);
  cursor: pointer;
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  transition: background-color var(--duration-fast) var(--ease-standard);
}

.modal-close:hover {
  background: var(--gaming-hover);
}

.modal-body {
  padding: var(--space-20);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-12);
  padding: var(--space-20);
  border-top: 1px solid var(--gaming-border);
}

/* Rarity Filters */
.rarity-filters {
  display: flex;
  gap: var(--space-8);
  margin-bottom: var(--space-16);
  flex-wrap: wrap;
}

.rarity-filter {
  background: var(--gaming-bg);
  border: 1px solid var(--gaming-border);
  color: var(--gaming-text-secondary);
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: all var(--duration-fast) var(--ease-standard);
}

.rarity-filter:hover,
.rarity-filter.active {
  border-color: var(--gaming-gold);
  color: var(--gaming-gold);
}

/* Search Bar */
.search-bar {
  margin-bottom: var(--space-20);
}

/* Skins Grid */
.skins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-16);
}

.skin-item {
  background: var(--gaming-bg);
  border: 2px solid var(--gaming-border);
  border-radius: var(--radius-base);
  padding: var(--space-12);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  text-align: center;
}

.skin-item:hover {
  border-color: var(--gaming-gold);
  transform: translateY(-2px);
}

.skin-item.selected {
  border-color: var(--gaming-accent);
  background: linear-gradient(145deg, var(--gaming-bg), #1f4a2e);
}

.skin-item-name {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
  color: var(--gaming-text);
  word-wrap: break-word;
}

.skin-item-rarity {
  font-size: var(--font-size-xs);
  margin-bottom: var(--space-8);
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.skin-item-price {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--gaming-gold);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-base);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  border: none;
  text-decoration: none;
  position: relative;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.4);
}

.btn--primary {
  background: var(--gaming-gold);
  color: var(--gaming-bg);
  border: none;
}

.btn--primary:hover {
  background: #e6c200;
  transform: translateY(-1px);
}

.btn--primary:active {
  background: #ccac00;
}

.btn--secondary {
  background: var(--gaming-card);
  color: var(--gaming-text);
  border: 1px solid var(--gaming-border);
}

.btn--secondary:hover {
  border-color: var(--gaming-gold);
  color: var(--gaming-gold);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--gaming-border);
  color: var(--gaming-text);
}

.btn--outline:hover {
  background: var(--gaming-card);
  border-color: var(--gaming-gold);
}

.btn--danger {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.btn--danger:hover {
  background: rgba(220, 53, 69, 0.2);
  border-color: rgba(220, 53, 69, 0.5);
}

.btn--danger:active {
  background: rgba(220, 53, 69, 0.3);
}

.btn--sm {
  padding: var(--space-4) var(--space-12);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: var(--space-10) var(--space-20);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-md);
}

.btn--full-width {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Progress Bar */
.progress-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gaming-border);
  z-index: 100;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gaming-gold), var(--gaming-accent));
  width: 0%;
  transition: width var(--duration-normal) var(--ease-standard);
}

/* Spinner animation (global) */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  text-align: center;
  color: var(--gaming-text-secondary);
  font-size: var(--font-size-lg);
  margin-top: var(--space-32);
  padding: var(--space-32);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--gaming-text);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-4xl);
}
h2 {
  font-size: var(--font-size-3xl);
}
h3 {
  font-size: var(--font-size-2xl);
}
h4 {
  font-size: var(--font-size-xl);
}
h5 {
  font-size: var(--font-size-lg);
}
h6 {
  font-size: var(--font-size-md);
}

/* Mobile Navigation Bottom Bar */
.mobile-bottom-nav {
  display: none;
}

.mobile-header-bell {
  display: none;
}

.mobile-header-actions {
  display: none;
}

.nav-support-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  text-decoration: none;
}

.nav-support-link:hover {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.1);
}

.mobile-hamburger {
  display: none;
}

/* Mobile Slide Menu (hidden on desktop) */
.mobile-slide-menu {
  display: none;
}

.mobile-menu-overlay {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding-bottom: 72px; /* Space for bottom nav */
  }

  .profile-stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0 !important;
    border-radius: 12px !important;
    margin-bottom: 16px !important;
  }

  /* --- Mobile Profile Page --- */
  .profile-container {
    margin-top: 0 !important;
    padding: 50px 0 0 !important;
  }

  .profile-card {
    border-radius: 16px !important;
    margin-left: 8px !important;
    margin-right: 8px !important;
    margin-bottom: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
  }

  .profile-cover {
    height: 40px !important;
  }

  .profile-card-inner {
    padding: 0 16px 16px !important;
  }

  .profile-avatar-row {
    flex-direction: column !important;
    align-items: center !important;
    gap: 14px !important;
    margin-top: -80px !important;
    margin-bottom: 12px !important;
  }

  .profile-avatar-wrapper {
    margin-top: 0 !important;
  }

  .profile-avatar-wrapper > div:first-child {
    border-width: 3px !important;
  }

  .profile-info {
    min-width: 0 !important;
    width: 100% !important;
    padding-top: 0 !important;
  }

  .profile-name-row {
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
    margin-bottom: 4px !important;
  }

  .profile-name-group {
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .profile-name-group h1 {
    font-size: 24px !important;
    text-align: center;
  }

  .profile-actions {
    display: flex !important;
    gap: 8px !important;
    width: auto !important;
    justify-content: center !important;
    margin-top: 12px !important;
    margin-bottom: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
  }

  .profile-actions button {
    padding: 8px 18px !important;
    font-size: 13px !important;
    border-radius: 20px !important;
    min-width: 0 !important;
    flex: none !important;
  }

  .profile-info > .profile-bio {
    text-align: center !important;
    justify-content: center !important;
    max-width: none !important;
  }

  .profile-social {
    justify-content: center !important;
    margin-bottom: 4px !important;
  }

  .profile-social a,
  .profile-social > div {
    font-size: 12px !important;
    padding: 3px 10px !important;
  }

  .profile-stats-grid > div {
    padding: 14px 4px !important;
  }

  .profile-stats-grid > div > div:first-child {
    font-size: 20px !important;
    margin-bottom: 3px !important;
  }

  .profile-stats-grid > div > div:last-child {
    font-size: 9px !important;
    letter-spacing: 0.5px !important;
  }

  .profile-tabs-row {
    padding: 0 8px !important;
    margin-bottom: 12px !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .profile-tabs {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 12px !important;
  }

  .profile-tabs::-webkit-scrollbar {
    display: none;
  }

  .profile-tabs button {
    padding: 8px 14px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    flex-shrink: 0;
  }

  .profile-sort {
    width: 100% !important;
    border-radius: 10px !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
  }

  .desktop-only {
    display: none !important;
  }

  /* --- Mobile Header --- */
  .header .container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    padding-bottom: 6px;
    position: relative;
  }

  .mobile-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #ccc;
    padding: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s;
    z-index: 2;
  }

  .mobile-hamburger:active {
    color: #ffd600;
  }

  .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
  }

  .logo h1 {
    font-size: 1.1rem !important;
    margin: 0 !important;
  }

  .mobile-header-bell {
    display: flex;
    align-items: center;
    z-index: 2;
  }

  .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
  }

  /* --- Mobile Overlay --- */
  .mobile-menu-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1100;
    animation: overlayFadeIn 0.2s ease-out;
  }

  @keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  /* --- Mobile Slide-Out Menu --- */
  .mobile-slide-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 80vw;
    height: 100%;
    background: rgba(26, 26, 26, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow-y: auto;
  }

  .mobile-slide-menu.open {
    transform: translateX(0);
  }

  .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .mobile-menu-title {
    font-size: 15px;
    font-weight: 600;
    color: #ffd600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }

  .mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #888;
    padding: 6px;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-close:active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
  }

  .mobile-menu-links {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    gap: 2px;
  }

  .mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: #ccc;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 12px;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-link:active {
    background: rgba(255, 255, 255, 0.06);
  }

  .mobile-menu-link.active {
    color: #ffd600;
    background: rgba(255, 214, 0, 0.08);
  }

  .mobile-menu-link.active svg {
    stroke-width: 2;
  }

  /* --- Bottom Nav --- */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: rgba(28, 29, 31, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 16px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #888;
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    gap: 4px;
    width: 60px;
    height: 100%;
    transition: color 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-icon {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
  }

  .mobile-nav-item.active {
    color: #ffd600;
  }
  
  .mobile-nav-item.active .mobile-nav-icon {
    stroke-width: 2;
  }

  .mobile-nav-item--primary {
    position: relative;
    top: -12px;
    color: #fff;
    background: #ffd600;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(255, 214, 0, 0.4);
  }

  .mobile-nav-item--primary .mobile-nav-icon {
    width: 28px;
    height: 28px;
    stroke: #000;
    stroke-width: 2;
  }
  
  .mobile-nav-item--primary.active {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 214, 0, 0.6);
  }

  .create-set-header,
  .set-detail-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .set-info,
  .set-detail-meta {
    flex-direction: column;
    gap: var(--space-8);
    align-items: flex-start;
  }

  .set-detail-actions {
    align-self: stretch;
    justify-content: center;
  }

  .set-detail-stats {
    flex-direction: column;
    gap: var(--space-12);
  }

  .weapon-slots.pistols,
  .weapon-slots.smg,
  .weapon-slots.rifles,
  .weapon-slots.heavy,
  .weapon-slots.grenades,
  .weapon-slots.snipers,
  .weapon-slots.melee {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .modal-content {
    width: 95%;
    margin: var(--space-16);
  }

  .skins-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .sets-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .weapon-slots.pistols,
  .weapon-slots.smg,
  .weapon-slots.rifles,
  .weapon-slots.heavy,
  .weapon-slots.grenades,
  .weapon-slots.snipers,
  .weapon-slots.melee {
    grid-template-columns: repeat(2, 1fr);
  }

  .set-detail-meta {
    flex-wrap: wrap;
  }

  .side-buttons {
    width: 100%;
    justify-content: center;
  }
}
