* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-app);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── TOP BAR ──────────────────────────────────────────── */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--topbar-h);
  background: rgba(6, 12, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
#topbar-brand {
  font-size: 13px;
  font-weight: 600;
  color: #94A3B8;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
#progress-track {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}
#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3B82F6, #34D399);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.3);
}
#progress-pct {
  color: #34D399;
  font-size: 12px;
  font-weight: 700;
  min-width: 34px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#checks-wrap { display: flex; gap: 5px; align-items: center; }
.prog-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(99,130,246,0.4);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.prog-dot.done {
  background: #34D399;
  border-color: #34D399;
  box-shadow: 0 0 8px rgba(52,211,153,0.6);
}

/* ── Dark mode toggle button ─────────────────────────── */
.theme-toggle {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748B;
  font-size: 14px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}
.theme-toggle:hover {
  background: rgba(255,255,255,0.1);
  color: #E2E8F0;
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* ── XP DISPLAY (topbar) ─────────────────────────────── */
#xp-display {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(217, 119, 6, 0.12);
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #FBBF24;
  white-space: nowrap;
  flex-shrink: 0;
}
#xp-current {
  color: #FCD34D;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.xp-max {
  color: rgba(251, 191, 36, 0.6);
  font-weight: 600;
}

/* ── XP TOAST ────────────────────────────────────────── */
.xp-toast {
  position: fixed;
  top: 56px;
  right: 20px;
  background: linear-gradient(135deg, #16A34A, #22C55E);
  color: white;
  padding: 8px 18px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 15px;
  z-index: 500;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
  font-family: var(--font-display);
}
.xp-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── USER INFO (topbar) ──────────────────────────────── */
#user-info {
  display: none;
  align-items: center;
  gap: 8px;
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
}
.user-name {
  font-size: 13px;
  font-weight: 500;
  color: #CBD5E1;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.signout-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #94A3B8;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.signout-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #E2E8F0;
}

/* ── APP LAYOUT ───────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  padding-top: var(--topbar-h);
}
