/* Основа: сброс, типографика, поведение прокрутки. */

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-base);
  background-image: var(--page-glow);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--size-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Резинка прокрутки на iOS не должна открывать белый фон под приложением. */
  overscroll-behavior-y: none;
}

h1,
h2,
h3,
p,
figure,
ul,
ol {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

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

/* Клавиатурная навигация должна быть видна, мышиная — нет. */
:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 6px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Суммы обязаны стоять в столбце ровно (docs/DESIGN.md §3). */
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.positive {
  color: var(--positive);
}

.negative {
  color: var(--negative);
}

.muted {
  color: var(--text-muted);
}

/* Длинное название счёта не должно ломать вёрстку (docs/DESIGN.md §9). */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Атрибут hidden обязан прятать.
   Без этого правила любой элемент с собственным display (а у нас это все
   поля формы — они flex) остаётся на экране: display перебивает hidden.
   Из-за этого поле «Имя» висело на экране входа, хотя код его прятал. */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: var(--radius-pill);
}

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