#auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 20px;
  padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
  box-sizing: border-box;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -.5px;
}

.auth-card .subtitle {
  color: var(--muted);
  margin-bottom: 28px;
  font-size: 15px;
}

.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  background: var(--bg);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.auth-tab {
  flex: 1;
  padding: 9px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 8px;
  transition: all .2s;
}

.auth-tab.active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn-passkey {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 14px;
  border: 1.5px solid rgba(0,0,0,.1);
  background: var(--card, #fff);
  color: var(--text, #1a1a1a);
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: background .15s, box-shadow .15s;
}

.btn-passkey:hover {
  background: rgba(0,0,0,.04);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.passkey-icon {
  font-size: 18px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  color: var(--muted, #999);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, rgba(0,0,0,.1));
}

.tab-subtitle {
  margin-top: -6px;
  margin-bottom: 18px;
  color: var(--text-secondary, #888);
  font-size: 13px;
  line-height: 1.5;
  opacity: .85;
}

#app {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
}

#app.visible { display: block; }

.main-content {
  padding: 20px 14px calc(var(--nav-h) + var(--safe-bottom) + 20px);
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  background: var(--card);
  border-top: 1.5px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  padding-bottom: var(--safe-bottom);
}

.nav-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  transition: all .2s;
  padding: 6px 2px;
  line-height: 1.1;
}

.nav-btn .icon { font-size: 20px; line-height: 1; }
.nav-btn.active { color: var(--text); font-weight: 700; }
.nav-btn.active .icon { transform: scale(1.12); }

.screen { display: none; }
.screen.active { display: block; }

@media (max-width: 900px) {
  .auth-card {
    margin: 0 auto;
    max-width: 430px;
  }
}

@media (max-width: 640px) {
  .auth-card {
    margin: 0 auto;
    padding: 26px 18px;
  }
}
