/* Общая основа обоих вариантов: сброс, безопасные зоны, доступность. Цвет, шрифт, форма и моушн — у варианта. */

:root {
  /* Безопасные зоны: вне Telegram — env() iPhone; в Telegram fullscreen — его переменные (Bot API 8.0). */
  --safe-top: max(env(safe-area-inset-top, 0px),
                  calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --kb-inset: 0px;          /* высота клавиатуры — lib/telegram.js */
  --hit: 44px;              /* минимальная зона касания */
  color-scheme: dark;
}

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

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

html, body { margin: 0; min-height: 100%; overscroll-behavior-y: none; }

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea { font: inherit; color: inherit; }

button {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: inherit;
  -webkit-user-select: none;
  user-select: none;
}

button:disabled { cursor: default; }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 24px;
  height: 24px;
  flex: none;
  stroke-width: var(--icon-stroke, 1.8);
}

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

/* Уменьшенное движение: без сдвигов, пружин и циклов; смысл передают цвет и текст. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
