/* Сброс и каркас приложения */

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--body-size);
  line-height: var(--body-line);
  font-weight: var(--body-weight);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  overflow: hidden;
}

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

button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }

h1, h2, h3, p { margin: 0; }

h1, .h1 {
  font-size: var(--h1-size);
  line-height: var(--h1-line);
  font-weight: var(--h1-weight);
  letter-spacing: -0.4px;
}

h2, .h2 {
  font-size: var(--h2-size);
  line-height: var(--h2-line);
  font-weight: var(--h2-weight);
}

.caption {
  font-size: var(--caption-size);
  line-height: var(--caption-line);
  color: var(--text-secondary);
}

.micro {
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  font-weight: var(--micro-weight);
  color: var(--text-secondary);
}

.text-secondary { color: var(--text-secondary); }
.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hidden { display: none !important; }

/* --- Каркас --- */

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding-top: var(--safe-top);
}

.app-header {
  display: flex;
  align-items: center;
  gap: var(--gap);
  min-height: var(--header-height);
  padding: 6px var(--space-screen);
  flex: 0 0 auto;
}

.brand {
  flex: 1 1 auto;
  text-align: center;
  min-width: 0;
}

.brand__word {
  font-size: 19px;
  line-height: 24px;
  font-weight: 700;
  letter-spacing: 2px;
}

.brand__tagline {
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Горизонтальная лента экранов --- */

.screens {
  flex: 1 1 auto;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.screens::-webkit-scrollbar { display: none; }

.screen {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 4px var(--space-screen) 24px;
}

.screen__title { margin-top: 4px; }
.screen__subtitle {
  color: var(--text-secondary);
  margin-bottom: var(--gap-lg);
}

.section { margin-top: var(--gap-lg); }
.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gap);
}

/* --- Нижняя навигация --- */

.tabbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  height: var(--tabbar-height);
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: var(--hairline) solid var(--border);
}

.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.tabbar__item[aria-selected='true'] { color: var(--text); }
.tabbar__item[aria-selected='true'] .tabbar__icon { color: var(--accent); }

.tabbar__label {
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  font-weight: var(--micro-weight);
  letter-spacing: 0.5px;
}

.tabbar__icon { display: block; width: 22px; height: 22px; }
