:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --fg-muted: #6b6b6b;
  --border: #e5e5e5;
  --accent: #1a1a1a;
  --danger: #b00020;
  --nav-bg: #1a1a1a;
  --nav-fg: #9a9a9a;
  --nav-fg-active: #ffffff;
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --nav-h: 60px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.app-root {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* --- общий layout (с нижней навигацией) --- */
.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--safe-top);
}

.content {
  flex: 1;
  padding: 16px 16px calc(var(--nav-h) + var(--safe-bottom) + 24px);
  overflow-y: auto;
}

.view-header h1 {
  font-size: 24px;
  margin: 8px 0 16px;
}

.view-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.placeholder {
  color: var(--fg-muted);
  padding: 32px 16px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
}

/* --- нижняя навигация --- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--nav-bg);
  color: var(--nav-fg);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 10;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: inherit;
  text-decoration: none;
  font-size: 11px;
  padding: 6px 4px;
}

.bottom-nav a .nav-icon {
  font-size: 20px;
  line-height: 1;
}

.bottom-nav a.active {
  color: var(--nav-fg-active);
}

/* --- экран логина --- */
.login {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  padding-top: calc(32px + var(--safe-top));
  padding-bottom: calc(32px + var(--safe-bottom));
}

.login form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login h1 {
  font-size: 28px;
  margin: 0 0 8px;
  text-align: center;
}

.login label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: var(--fg-muted);
}

.login input {
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
}

.login input:focus {
  outline: none;
  border-color: var(--fg);
}

.btn {
  font-size: 16px;
  font-weight: 600;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}

.error {
  color: var(--danger);
  font-size: 14px;
  min-height: 1.2em;
}

/* --- settings --- */
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.settings-row .muted {
  color: var(--fg-muted);
}
