/* VarChat — единые токены оформления. Меняются только здесь. */

:root {
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --bg-raised: #ffffff;
  --bg-hover: #f4f4f5;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #09090b;
  --text-muted: #71717a;
  --text-faint: #a1a1aa;
  --accent: #09090b;
  --accent-hover: #27272a;
  --accent-text: #ffffff;
  --focus: #2563eb;
  --success: #16a34a;
  --warning: #ca8a04;
  --danger: #dc2626;

  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --r-full: 999px;

  --shadow-sm: 0 1px 2px rgba(9, 9, 11, .04);
  --shadow-md: 0 8px 24px rgba(9, 9, 11, .08);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --max-width: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0a0a0a;
    --bg-subtle: #111111;
    --bg-raised: #161616;
    --bg-hover: #1c1c1c;
    --border: #262626;
    --border-strong: #333333;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --text-faint: #71717a;
    --accent: #fafafa;
    --accent-hover: #e4e4e7;
    --accent-text: #09090b;
    --focus: #3b82f6;
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #0a0a0a;
  --bg-subtle: #111111;
  --bg-raised: #161616;
  --bg-hover: #1c1c1c;
  --border: #262626;
  --border-strong: #333333;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-faint: #71717a;
  --accent: #fafafa;
  --accent-hover: #e4e4e7;
  --accent-text: #09090b;
  --focus: #3b82f6;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

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

/* Атрибут hidden сильнее любых наших правил отображения: у [hidden] и у класса
   одинаковая специфичность, и собственные стили, идущие после браузерных,
   иначе оставляют элемент видимым. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
