/* Сброс и основа UI Core (css-architecture.md §2): системный шрифт, числовые поля без спиннеров, видимый фокус. */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--ui-font-family);
  font-size: var(--ui-font-size-md);
  line-height: var(--ui-line-height-normal);
  color: var(--ui-color-text);
  background: var(--ui-color-page);
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--ui-color-primary);
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* Скрытый элемент скрыт и при display компонента: селектор сильнее одного класса, без !important (CS3). */
html [hidden] {
  display: none;
}

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

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Область касания (hit area, решение И-56; ui-style-standard.md §4 п. 7): невидимый слой по центру мелкого интерактивного
   элемента, не меньше --ui-hit-min по ширине и высоте; визуальный размер и раскладка не меняются. Элементу нужен
   position (relative по умолчанию; absolute компонента тоже подходит). */
.ui-hit {
  position: relative;
}

.ui-hit::before {
  content: "";
  position: absolute;
  inset: min(0px, calc((100% - var(--ui-hit-min)) / 2));
}

.ui-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ui-text-center {
  text-align: center;
}
