* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  line-height: 1.4;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: calc(70px + env(safe-area-inset-bottom, 16px));
}

/* Шапка приложения */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-primary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-brand .logo-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-primary);
}

.app-brand h1 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  letter-spacing: -0.3px;
}

.app-brand .badge-env {
  font-size: var(--font-size-xs);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* Основной контейнер контента */
.app-main {
  flex: 1;
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* Нижняя панель навигации */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-around;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 10px));
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: 500;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.nav-item .nav-icon {
  width: 22px;
  height: 22px;
}

.nav-item.active {
  color: var(--accent-primary);
}

/* Скрытие экранов */
.screen {
  display: none;
}
.screen.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
