/* ===== css/auth.css ===== */
/* authentication styles extracted from landing.css */
/* includes: nav auth buttons, user menu, auth modal, consent checkboxes */

/* ==========================================================================
   SOURCE: landing.css -- nav auth buttons
   ========================================================================== */

/* nav auth buttons */
.auth-nav-btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
}

.auth-nav-btn--login {
  color: var(--text-secondary);
}

.auth-nav-btn--login:hover {
  color: var(--text-primary);
}

.auth-nav-btn--signup {
  min-height: 44px;
  color: #fff;
  padding: 0 20px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  box-shadow: 0 var(--btn-depth-offset) 0 0 var(--btn-depth-color);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.18s ease, border-color 0.18s ease;
}

.auth-nav-btn--signup:hover {
  color: #fff;
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 var(--btn-depth-offset) 0 0 var(--btn-depth-color);
}

.auth-nav-btn--signup:active {
  transform: translateY(var(--btn-depth-press));
  box-shadow: 0 1px 0 0 var(--btn-depth-color);
}

/* ==========================================================================
   SOURCE: landing.css -- user menu
   ========================================================================== */

/* user menu */
.user-menu {
  position: relative;
}

.user-menu-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: none;
}

.user-menu-avatar--image {
  padding: 0;
  color: transparent;
  overflow: hidden;
}

.user-menu-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.user-menu-avatar:hover {
  background: rgba(16, 185, 129, 0.25);
  transform: scale(1.05);
}

/* user-menu dropdown shell, header, divider, preference rows, and account
   items live in nav.css (single source). nav.css always loads before auth.css
   wherever the menu renders, so the duplicate rules that used to sit here were
   removed in the 2026-05-21 redesign to stop auth.css overriding it. only the
   XP / level / streak stats block below stays here. */

.user-menu-stats {
  padding: 2px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.user-menu-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
}

.user-menu-stat-label {
  color: var(--text-primary);
  font-weight: 500;
}

.user-menu-stat-value {
  color: var(--accent);
  font-weight: 700;
}

.user-menu-xp-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: -2px 0;
}

.user-menu-xp-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

/* .user-menu-item styles moved to nav.css (single source) */

/* ==========================================================================
   auth modal: the app's surface language (2026-09-05)
   --------------------------------------------------------------------------
   flat scrim, one opaque card with a single low shadow, segmented pill tabs,
   soft-well inputs and the emerald ledge button. same tokens as
   css/app-surface.css (--al-*), carried locally as --am-* because the modal is
   appended to <body> on every page, restyled or not, and has to look the same
   everywhere. class names are unchanged: js/supabase-auth.js builds the markup.
   ========================================================================== */

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/source-serif-4.woff2') format('woff2');
}

.auth-modal-overlay {
  --am-card: #ffffff;
  --am-well: #eef0ee;
  --am-line: #e4e7e4;
  --am-ink: #131517;
  --am-ink-2: #5b6168;
  --am-ink-3: #8b9096;
  --am-accent: #10b981;
  --am-accent-ink: #0a8f63;
  --am-ledge: #047852;
  --am-mint: #e6f7f0;
  --am-mint-ink: #0f8a5f;
  --am-danger: #dc2626;
  --am-shadow: 0 12px 32px rgba(20, 32, 26, 0.07), 0 1px 2px rgba(20, 32, 26, 0.04);
  --am-shadow-lift: 0 22px 48px rgba(20, 32, 26, 0.14), 0 2px 4px rgba(20, 32, 26, 0.05);
  --am-ring: rgba(16, 185, 129, 0.16);
  --am-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  position: fixed;
  inset: 0;
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(19, 21, 23, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

[data-theme="dark"] .auth-modal-overlay {
  --am-card: #212128;
  --am-well: #26262e;
  --am-line: #32323a;
  --am-ink: #e8e8ec;
  --am-ink-2: #b4b4b8;
  --am-ink-3: #8a8a92;
  --am-accent-ink: #34d39e;
  --am-ledge: #059666;
  --am-mint: rgba(52, 211, 158, 0.14);
  --am-mint-ink: #34d39e;
  --am-danger: #f87171;
  --am-shadow: 0 2px 6px rgba(0, 0, 0, 0.22), 0 0 0 1px var(--am-line);
  --am-shadow-lift: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--am-line);
  --am-ring: rgba(52, 211, 158, 0.22);
  background: rgba(0, 0, 0, 0.6);
}

.auth-modal-overlay--visible {
  opacity: 1;
  visibility: visible;
}

.auth-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 20px;
  /* the close button is 40px at the top corner; the tab pill starts under it */
  padding: 64px 28px 28px;
  color: var(--am-ink);
  background: var(--am-card);
  border: 1px solid var(--am-line);
  border-radius: 24px;
  box-shadow: var(--am-shadow-lift);
  transform: translateY(10px) scale(0.985);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.auth-modal-overlay--visible .auth-modal {
  transform: none;
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--am-well);
  color: var(--am-ink-2);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.auth-modal-close:hover {
  color: var(--am-ink);
  background: var(--am-line);
}

/* segmented control, the same pill track the app's account screen uses */
.auth-modal-tabs {
  display: flex;
  gap: 3px;
  margin-bottom: 24px;
  padding: 3px;
  border: 1px solid var(--am-line);
  border-radius: 999px;
  background: var(--am-well);
}

.auth-modal-tab {
  flex: 1;
  padding: 10px 0;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--am-ink-2);
  background: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-align: center;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.auth-modal-tab:hover {
  color: var(--am-ink);
}

.auth-modal-tab--active {
  color: var(--am-ink);
  background: var(--am-card);
  box-shadow: var(--am-shadow);
}

.auth-modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-modal-label {
  padding-left: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--am-ink-2);
}

.auth-modal-input {
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 16px;
  color: var(--am-ink);
  background: var(--am-well);
  border: 1.5px solid var(--am-line);
  border-radius: 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-modal-input::placeholder {
  color: var(--am-ink-3);
}

.auth-modal-input:focus {
  border-color: var(--am-accent);
  background: var(--am-card);
  box-shadow: 0 0 0 4px var(--am-ring);
}

.auth-modal-forgot {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
  margin-bottom: 4px;
}

.auth-modal-forgot-link {
  color: var(--am-accent-ink);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.auth-modal-forgot-link:hover {
  text-decoration: underline;
}

.auth-modal-hint {
  font-size: 0.78rem;
  color: var(--am-ink-3);
  margin-top: 4px;
  line-height: 1.35;
}

.auth-modal-hint--error {
  color: var(--am-danger);
}

.auth-modal-hint--success {
  color: var(--am-accent-ink);
}

/* the emerald pill with the darker bottom edge, the one button both surfaces
   already share */
.auth-modal-submit {
  width: 100%;
  min-height: 52px;
  padding: 0 24px;
  margin-top: 4px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--am-accent);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 5px 0 0 var(--am-ledge);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease, opacity 0.15s ease;
}

.auth-modal-submit:hover:not(:disabled) {
  filter: brightness(1.04);
}

.auth-modal-submit:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 2px 0 0 var(--am-ledge);
}

.auth-modal-submit:disabled {
  opacity: 0.7;
  cursor: default;
}

.auth-modal-error {
  font-size: 0.84rem;
  color: var(--am-danger);
  display: none;
  text-align: center;
  line-height: 1.4;
}

.auth-modal-note {
  margin-top: 18px;
  font-size: 0.78rem;
  color: var(--am-ink-3);
  text-align: center;
}

/* purchase context banner (shown when signup is triggered from a paywall) */
.auth-modal-purchase-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--am-mint-ink);
  background: var(--am-mint);
  border: 0;
  border-radius: 16px;
}

.auth-modal-purchase-banner svg {
  flex-shrink: 0;
}

/* email confirmation success state */
.auth-modal-confirmation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 0 8px;
  text-align: center;
}

.auth-modal-confirmation-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--am-mint);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--am-mint-ink);
}

.auth-modal-confirmation-title {
  font-family: var(--am-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--am-ink);
}

.auth-modal-confirmation-text {
  font-size: 0.9rem;
  color: var(--am-ink-2);
  line-height: 1.5;
  max-width: 300px;
}

.auth-modal-confirmation-close {
  margin-top: 6px;
  min-height: 46px;
  padding: 0 26px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--am-ink);
  background: var(--am-card);
  border: 1.5px solid var(--am-line);
  border-radius: 999px;
  box-shadow: var(--am-shadow);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.auth-modal-confirmation-close:hover {
  border-color: var(--am-ink-3);
}

.auth-modal-consent {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-modal-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 2px 4px;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--am-ink-2);
}

.auth-modal-checkbox input[type="checkbox"] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--am-accent);
  cursor: pointer;
}

.auth-modal-checkbox a {
  color: var(--am-accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.auth-modal-checkbox a:hover {
  text-decoration: underline;
}

/* google sign-in: a white pill that keeps Google's own mark colours in both
   themes, per their brand rules */
.auth-modal-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 1.5px solid var(--am-line);
  border-radius: 999px;
  background: #fff;
  color: #1f2937;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--am-shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

.auth-modal-oauth:hover:not(:disabled) {
  border-color: #c9cfca;
  box-shadow: var(--am-shadow-lift);
}

.auth-modal-oauth:active:not(:disabled) {
  transform: translateY(1px);
}

.auth-modal-oauth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-modal-oauth.is-loading span {
  opacity: 0.7;
}

[data-theme="dark"] .auth-modal-oauth {
  border-color: #3c3c46;
}

.auth-modal-oauth-error {
  display: none;
  margin-top: 8px;
  color: var(--am-danger);
  font-size: 0.85rem;
  text-align: center;
}

.auth-modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--am-ink-3);
  font-size: 0.8rem;
  font-weight: 600;
}

.auth-modal-divider::before,
.auth-modal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--am-line);
}

.auth-modal-oauth-cancel {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--am-ink-3);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}

/* post-OAuth onboarding panel: confirms the Google sign-in succeeded, then
   collects the two things OAuth could not carry (handle + terms consent) */
.pa-onboard {
  max-width: 440px;
  text-align: left;
}

.pa-onboard-head {
  text-align: center;
  padding-bottom: 4px;
}

.pa-onboard-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--am-mint);
  color: var(--am-mint-ink);
}

.pa-onboard-title {
  font-family: var(--am-serif);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--am-ink);
}

.pa-onboard-sub {
  margin-top: 6px;
  color: var(--am-ink-2);
  font-size: 0.9rem;
  word-break: break-word;
}

.pa-onboard-form {
  margin-top: 22px;
}

.pa-onboard-handle-label {
  margin-bottom: 8px;
  padding-left: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--am-ink-2);
}

/* the generated handle reads as an assigned identity, not an empty field the
   user has to invent something for; the reroll button carries the affordance */
.pa-onboard-handle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px 5px 18px;
  border: 1.5px solid var(--am-line);
  border-radius: 16px;
  background: var(--am-well);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.pa-onboard-handle:focus-within {
  border-color: var(--am-accent);
  background: var(--am-card);
  box-shadow: 0 0 0 4px var(--am-ring);
}

.pa-onboard-handle-input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: var(--am-ink);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
}

.pa-onboard-handle-input:focus {
  outline: none;
}

.pa-onboard-reroll {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 0;
  border-radius: 12px;
  background: var(--am-mint);
  color: var(--am-mint-ink);
  cursor: pointer;
  transition: filter 0.15s ease;
}

.pa-onboard-reroll:hover {
  filter: brightness(0.96);
}

.pa-onboard-reroll.is-spinning svg {
  animation: pa-onboard-spin 0.4s ease;
}

@keyframes pa-onboard-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.pa-onboard-hint {
  margin-top: 8px;
  padding-left: 4px;
  color: var(--am-ink-3);
  font-size: 0.8rem;
  line-height: 1.45;
}

.pa-onboard-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  padding: 2px 4px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--am-ink-2);
  cursor: pointer;
}

.pa-onboard-consent a {
  color: var(--am-accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.pa-onboard-consent a:hover {
  text-decoration: underline;
}

.pa-onboard-consent input {
  flex-shrink: 0;
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--am-accent);
}

@media (max-width: 768px) {
  .auth-nav-btn--login,
  .auth-nav-btn--signup {
    font-size: 0.9rem;
  }

  .auth-nav-btn--signup {
    padding: 8px 16px;
  }

  .auth-modal {
    margin: 14px;
    padding: 60px 20px 22px;
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-modal-overlay,
  .auth-modal,
  .auth-modal-input,
  .auth-modal-submit,
  .auth-modal-tab,
  .auth-modal-checkbox,
  .auth-modal-close,
  .auth-modal-forgot-link,
  .auth-modal-oauth,
  .blog-signup-nudge {
    transition: none;
  }

  .auth-modal {
    transform: none;
  }

  .pa-onboard-reroll.is-spinning svg {
    animation: none;
  }
}

/* ==========================================================================
   BLOG: first-time signup nudge for logged-out visitors
   ========================================================================== */

/* matheus 2026-09-06: Blorb on his cloud peeks in from the bottom-left with a
   speech bubble ("Psst. Sign up to save your progress."). Bottom-left on
   purpose: the chatbot bubble owns the bottom-right corner, so the two never
   overlap. Flat card, one soft shadow, no glow (the app surface rules). */
.blog-signup-nudge {
  --nudge-card: #ffffff;
  --nudge-line: #e4e7e4;
  --nudge-ink: #131517;
  --nudge-ink-2: #5b6168;
  --nudge-well: #eef0ee;
  --nudge-shadow: 0 12px 32px rgba(20, 32, 26, 0.10), 0 1px 2px rgba(20, 32, 26, 0.05);
  position: fixed;
  left: 20px;
  bottom: 0;
  z-index: 1100;
  width: 430px;
  height: 236px;
  pointer-events: none;
  font-family: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] .blog-signup-nudge {
  --nudge-card: #212128;
  --nudge-line: #32323a;
  --nudge-ink: #e8e8ec;
  --nudge-ink-2: #b4b4b8;
  --nudge-well: #26262e;
  --nudge-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 0 1px #32323a;
}

.blog-signup-nudge__art {
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 148px;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.blog-signup-nudge__bubble {
  position: absolute;
  left: 146px;
  bottom: 48px;
  width: 284px;
  padding: 18px 18px 16px;
  border-radius: 22px 22px 22px 6px;
  border: 1px solid var(--nudge-line);
  background: var(--nudge-card);
  box-shadow: var(--nudge-shadow);
  color: var(--nudge-ink);
  pointer-events: auto;
}

.blog-signup-nudge__title {
  margin: 0;
  padding-right: 30px;
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--nudge-ink);
}

.blog-signup-nudge__text {
  margin: 6px 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--nudge-ink-2);
}

.blog-signup-nudge__actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.blog-signup-nudge__btn {
  flex: 1 1 0;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--nudge-line);
  background: var(--nudge-well);
  color: var(--nudge-ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.blog-signup-nudge__btn--primary {
  border: 0;
  background: #10b981;
  color: #ffffff;
  box-shadow: inset 0 -3px 0 #047852;
}

.blog-signup-nudge__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--nudge-line);
  background: var(--nudge-card);
  color: var(--nudge-ink-2);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 768px) {
  .blog-signup-nudge {
    left: 0;
    right: 0;
    width: auto;
    height: 270px;
  }
  /* Blorb and the bubble both ride above the chatbot bubble (56px at
     bottom:16px, bottom-right), so the two never overlap on a phone */
  .blog-signup-nudge__art {
    left: 6px;
    bottom: 56px;
    width: 108px;
  }
  .blog-signup-nudge__bubble {
    left: 102px;
    right: 12px;
    bottom: 86px;
    width: auto;
  }
}

/* ==========================================================================
   APP LAUNCH PROMPT: site-wide "join the waiting list" modal (2026-09-06)
   ========================================================================== */

/* the same card as the landing hero's capture, centred over a scrim. Token
   fallbacks matter: blog posts and peptide pages do not carry body.app-surface,
   so the --al-* variables are not defined there. */
.pa-launch-scrim {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(19, 21, 23, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 180ms ease;
}

.pa-launch-scrim.is-open {
  opacity: 1;
}

.pa-launch {
  --lp-card: #ffffff;
  --lp-well: #eef0ee;
  --lp-line: #e4e7e4;
  --lp-ink: #131517;
  --lp-ink-2: #5b6168;
  --lp-shadow: 0 22px 48px rgba(20, 32, 26, 0.16), 0 2px 4px rgba(20, 32, 26, 0.05);
  position: relative;
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 260px 1fr;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--lp-line);
  background: var(--lp-card);
  box-shadow: var(--lp-shadow);
  color: var(--lp-ink);
  font-family: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transform: translateY(8px);
  transition: transform 180ms ease;
}

.pa-launch-scrim.is-open .pa-launch {
  transform: none;
}

[data-theme="dark"] .pa-launch {
  --lp-card: #212128;
  --lp-well: #26262e;
  --lp-line: #32323a;
  --lp-ink: #e8e8ec;
  --lp-ink-2: #b4b4b8;
  --lp-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 0 1px #32323a;
}

.pa-launch-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 28px 28px 0;
  background: var(--lp-well);
}

.pa-launch-art img {
  display: block;
  width: 204px;
  height: auto;
  border: 6px solid #0b0f14;
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
}

.pa-launch-body {
  position: relative;
  padding: 34px 34px 30px;
}

.pa-launch-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--lp-well);
  color: var(--lp-ink-2);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pa-launch-title {
  margin: 12px 0 0;
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--lp-ink);
}

.pa-launch-sub {
  margin: 8px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--lp-ink-2);
}

.pa-launch-form {
  margin: 0;
}

.pa-launch-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.pa-launch-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--lp-line);
  background: var(--lp-well);
  color: var(--lp-ink);
  font: inherit;
  font-size: 0.95rem;
}

.pa-launch-input:focus {
  outline: none;
  border-color: #10b981;
}

.pa-launch-submit {
  flex: 0 0 auto;
  height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #10b981;
  color: #ffffff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 #047852;
}

/* the store buttons are links */
a.pa-launch-submit,
a.pa-appbar-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.pa-launch-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

/* only carries a status line (validation, success); empty until then */
.pa-launch-fine {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--lp-ink-2);
}

.pa-launch-fine:empty {
  display: none;
}

.pa-launch-fine--error {
  color: #b91c1c;
}

.pa-launch-fine--success {
  color: #047852;
  font-weight: 600;
}

[data-theme="dark"] .pa-launch-fine--success {
  color: #34d399;
}

/* a child of the card, not the body column, so it sits in the card's own
   top-right corner on both layouts (on phones the body is below the art) */
.pa-launch-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--lp-line);
  background: var(--lp-card);
  color: var(--lp-ink-2);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 640px) {
  .pa-launch {
    grid-template-columns: 1fr;
    width: calc(100% - 8px);
  }
  .pa-launch-art {
    padding: 20px 20px 0;
  }
  .pa-launch-art img {
    width: 150px;
  }
  .pa-launch-body {
    padding: 22px 20px 20px;
  }
  .pa-launch-title {
    font-size: 1.5rem;
  }
  .pa-launch-row {
    flex-direction: column;
  }
}

/* site-wide app waitlist bar (initAppBar in js/components.js). sits under the
   launch modal's scrim (1200) and over the blog nudge (1100) */
.pa-appbar {
  --ab-card: #ffffff;
  --ab-well: #eef0ee;
  --ab-line: #e4e7e4;
  --ab-ink: #131517;
  --ab-ink-2: #5b6168;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1150;
  background: var(--ab-card);
  border-top: 1px solid var(--ab-line);
  box-shadow: 0 -8px 24px rgba(20, 32, 26, 0.08);
  color: var(--ab-ink);
  font-family: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(100%);
  transition: transform 220ms ease;
}

.pa-appbar.is-visible {
  transform: none;
}

[data-theme="dark"] .pa-appbar {
  --ab-card: #212128;
  --ab-well: #26262e;
  --ab-line: #32323a;
  --ab-ink: #e8e8ec;
  --ab-ink-2: #b4b4b8;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}

.pa-appbar-row {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.pa-appbar-text {
  flex: 1 1 auto;
  min-width: 0;
}

.pa-appbar-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.pa-appbar-sub {
  margin: 2px 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--ab-ink-2);
}

.pa-appbar-fine {
  margin: 2px 0 0;
  font-size: 0.8rem;
  font-weight: 600;
}

.pa-appbar-fine:empty {
  display: none;
}

.pa-appbar-fine--error {
  color: #b91c1c;
}

.pa-appbar-fine--success {
  color: #047852;
}

[data-theme="dark"] .pa-appbar-fine--error {
  color: #f87171;
}

[data-theme="dark"] .pa-appbar-fine--success {
  color: #34d399;
}

/* the status line replaces the subline while it has something to say */
.pa-appbar-text:has(.pa-appbar-fine:not(:empty)) .pa-appbar-sub {
  display: none;
}

.pa-appbar-form {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  margin: 0;
}

.pa-appbar-input {
  width: 240px;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--ab-line);
  background: var(--ab-well);
  color: var(--ab-ink);
  font: inherit;
  font-size: 0.9rem;
}

.pa-appbar-input:focus {
  outline: none;
  border-color: #10b981;
}

.pa-appbar-submit {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #10b981;
  color: #ffffff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 #047852;
}

.pa-appbar-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.pa-appbar-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--ab-line);
  background: var(--ab-card);
  color: var(--ab-ink-2);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

/* keep the page end and other bottom-fixed widgets clear of the bar */
body.pa-has-appbar {
  padding-bottom: var(--pa-appbar-h, 64px);
}

body.pa-has-appbar .blog-signup-nudge {
  bottom: var(--pa-appbar-h, 64px);
}

body.pa-has-appbar .chatbot-bubble {
  bottom: calc(var(--pa-appbar-h, 64px) + 16px);
}

@media (max-width: 640px) {
  .pa-appbar-row {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 12px;
  }
  .pa-appbar-text {
    flex: 1 1 0;
  }
  .pa-appbar-sub {
    display: none;
  }
  .pa-appbar-form {
    flex: 0 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pa-launch-scrim,
  .pa-launch,
  .pa-appbar {
    transition: none;
  }
}



/* ===== css/gamification.css ===== */
/* gamification styles extracted from styles.css and landing.css */
/* includes: xp bar, xp toast, level toast, streak badge, sound toggle, achievement toast, daily quests */

/* ==========================================================================
   SOURCE: styles.css -- XP bar + toast system
   ========================================================================== */

.xp-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    margin: 0 0.75rem;
}

.xp-bar-level {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--color-warning);
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
}

.xp-bar-level svg {
    color: var(--color-warning);
    flex-shrink: 0;
}

.xp-bar-level-num {
    font-variant-numeric: tabular-nums;
}

.xp-bar-track {
    width: 80px;
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.xp-bar-text {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* xp toast */
.xp-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg, 8px);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-toast);
    pointer-events: none;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.xp-toast-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.xp-toast-exit {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.xp-toast-amount {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-success);
}

.xp-toast-reason {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* level up toast */
.level-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--color-warning);
    border-radius: var(--radius-xl, 13px);
    box-shadow: 0 0 40px rgba(249, 115, 22, 0.15), var(--shadow-lg);
    z-index: var(--z-toast-top);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.level-toast-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.level-toast-exit {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.level-toast-icon {
    color: var(--color-warning);
    display: flex;
    align-items: center;
    animation: levelPulse 0.6s ease-in-out infinite alternate;
}

.level-toast-text {
    font-weight: 800;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--color-warning), var(--color-danger));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes levelPulse {
    from { transform: scale(1); }
    to { transform: scale(1.15); }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
    .xp-toast,
    .level-toast {
        transition: opacity 0.15s ease;
    }
    .level-toast-icon {
        animation: none;
    }
    .xp-bar-fill {
        transition: none;
    }
}

/* responsive xp bar */
@media (max-width: 768px) {
    .xp-bar-container {
        margin: 0 0.35rem;
    }
    .xp-bar-track {
        width: 50px;
    }
    .xp-bar-text {
        display: none;
    }
}

@media (max-width: 480px) {
    .xp-bar-track {
        width: 36px;
    }
}

/* ==========================================================================
   SOURCE: styles.css -- streak badge
   ========================================================================== */

.streak-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(251, 146, 60, 0.1);
    border: 1px solid rgba(251, 146, 60, 0.2);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-warning);
    margin: 0 0.35rem;
    transition: transform 0.2s ease, background 0.2s ease;
    cursor: default;
}

.streak-badge:hover {
    background: rgba(251, 146, 60, 0.15);
    transform: scale(1.05);
}

.streak-icon {
    color: var(--color-text-muted);
    transition: color 0.3s ease;
}

.streak-icon.streak-active {
    color: var(--color-warning);
    fill: var(--color-warning);
    filter: drop-shadow(0 0 3px rgba(251, 146, 60, 0.5));
}

.streak-count {
    line-height: 1;
}

.streak-badge-new {
    animation: streakPulse 0.6s ease;
}

@keyframes streakPulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.2); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .streak-badge-new {
        animation: none;
    }
}

@media (max-width: 480px) {
    .streak-badge {
        padding: 0.15rem 0.35rem;
        font-size: 0.7rem;
    }
}

/* the flame reopens an unanswered streak repair question */
.streak-badge[role="button"] {
    cursor: pointer;
}

/* the profile streak card's way back to an unanswered repair offer */
.streak-repair-entry {
    position: relative;
    z-index: 1;
    margin-top: 10px;
    min-height: 36px;
    padding: 6px 14px;
    border-radius: 7px;
    border: 1px solid var(--accent, #10b981);
    background: transparent;
    color: var(--text-primary, #e9e9e9);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.streak-repair-entry:focus-visible {
    outline: 2px solid var(--accent, #10b981);
    outline-offset: 2px;
}

/* ==========================================================================
   streak repair dialog (js/streak.js): "Keep your 12-day streak?"
   same card language as the course unlock dialog, drawn from the palette
   tokens so it reads in both themes. lives here because gamification.css is
   in every bundle whose pages can check in a streak (learn, marketing, blog,
   landing-deferred)
   ========================================================================== */

.streak-repair-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal, 9999);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.streak-repair-modal[hidden] {
    display: none;
}

.streak-repair-modal.is-visible {
    opacity: 1;
}

.streak-repair-card {
    width: 100%;
    max-width: 400px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 28px 24px 22px;
    border-radius: 13px;
    /* an elevated surface, not the page black: over the dimmed page a
       --bg-primary card read as a hole rather than a card */
    background: var(--bg-hover, #1f1f1f);
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    text-align: center;
    transform: scale(0.95) translateY(8px);
    transition: transform 0.25s ease;
}

.streak-repair-modal.is-visible .streak-repair-card {
    transform: scale(1) translateY(0);
}

[data-theme="light"] .streak-repair-card {
    background: #fff;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
}

.streak-repair-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    margin-bottom: 14px;
}

.streak-repair-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 8px;
    color: var(--text-primary, #e9e9e9);
}

.streak-repair-body,
.streak-repair-note {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary, #a8a8a8);
    margin: 0 0 20px;
}

.streak-repair-note {
    font-size: 0.8rem;
    margin: 14px 0 0;
}

.streak-repair-error {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--color-danger, #ef4444);
    margin: -8px 0 16px;
}

.streak-repair-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.streak-repair-actions button {
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.streak-repair-actions button[hidden] {
    display: none;
}

.streak-repair-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.streak-repair-accept {
    color: #000;
    background: var(--accent, #10b981);
    border: none;
}

.streak-repair-accept:hover:not(:disabled) {
    opacity: 0.9;
}

.streak-repair-decline {
    color: var(--text-primary, #e9e9e9);
    background: transparent;
    border: 1px solid var(--accent, #10b981);
}

.streak-repair-actions button:focus-visible {
    outline: 2px solid var(--accent, #10b981);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .streak-repair-modal,
    .streak-repair-card {
        transition: none;
        transform: none;
    }
}

/* ==========================================================================
   SOURCE: styles.css -- sound toggle
   ========================================================================== */

.sound-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.2s, background-color 0.2s;
    padding: 0;
}

.sound-toggle-btn:hover {
    color: var(--color-text);
    background: var(--color-border);
}

@media (max-width: 480px) {
    .sound-toggle-btn {
        width: 28px;
        height: 28px;
    }

    .sound-toggle-btn svg {
        width: 14px;
        height: 14px;
    }
}

/* ==========================================================================
   SOURCE: styles.css -- achievement toast (rich, queued, tiered)
   ========================================================================== */

.achievement-toast {
  position: fixed;
  top: 80px;
  right: -440px;
  width: 360px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.95rem 1.05rem 0.8rem;
  --pa-toast-accent: #10b981;
  background: var(--glass-bg, rgba(20, 20, 30, 0.92));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  border-left: 4px solid var(--pa-toast-accent);
  border-radius: 11px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: var(--z-toast-top, 10000);
  transition: right 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

/* celebration tiers: common = green, medium = purple rarity, major = gold glow */
.achievement-toast--common { --pa-toast-accent: #10b981; }
.achievement-toast--medium { --pa-toast-accent: #10b981; }
.achievement-toast--major {
  --pa-toast-accent: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25), 0 18px 52px rgba(245, 158, 11, 0.22), 0 18px 48px rgba(0, 0, 0, 0.28);
}

.achievement-toast-visible { right: 20px; }

.achievement-toast-exit {
  right: -440px;
  opacity: 0;
}

.achievement-toast-main {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.achievement-toast-art {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 9px;
  overflow: hidden;
  background: color-mix(in srgb, var(--pa-toast-accent, #10b981) 14%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.achievement-toast--major .achievement-toast-art {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4), 0 6px 18px rgba(245, 158, 11, 0.28);
}

.achievement-toast-image { display: block; width: 100%; height: 100%; }
.achievement-toast-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.achievement-toast-image--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--pa-toast-accent, #10b981);
}

/* major-tier sheen sweeps the badge art twice, motion-safe */
.achievement-toast--major .achievement-toast-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 32%, rgba(255, 255, 255, 0.55) 50%, transparent 68%);
  transform: translateX(-120%);
  animation: paBadgeSheen 2.2s ease-in-out 0.3s 2;
}

@keyframes paBadgeSheen {
  to { transform: translateX(120%); }
}

.achievement-toast-content { flex: 1; min-width: 0; }

.achievement-toast-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pa-toast-accent, #10b981);
  margin-bottom: 0.12rem;
}

.achievement-toast-name {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary, #fafafa);
}

.achievement-toast-desc {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 0.15rem;
  line-height: 1.35;
}

.achievement-toast-close {
  flex-shrink: 0;
  align-self: flex-start;
  width: 26px;
  height: 26px;
  margin: -2px -4px 0 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.achievement-toast-close:hover {
  background: rgba(127, 127, 127, 0.16);
  color: var(--text-primary, #fafafa);
}

.achievement-toast-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
}

.achievement-toast-xp {
  font-size: 0.74rem;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  white-space: nowrap;
}

.achievement-toast-count {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.achievement-toast-cta {
  margin-left: auto;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--pa-toast-accent, #10b981);
  text-decoration: none;
  white-space: nowrap;
}

.achievement-toast-cta:hover { text-decoration: underline; }

[data-theme="light"] .achievement-toast {
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .achievement-toast--major {
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.3), 0 18px 52px rgba(245, 158, 11, 0.2), 0 18px 48px rgba(15, 23, 42, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .achievement-toast {
    right: 20px;
    transition: opacity 0.2s ease;
  }
  .achievement-toast-visible { right: 20px; }
  .achievement-toast-exit { right: 20px; opacity: 0; }
  .achievement-toast--major .achievement-toast-art::after { animation: none; display: none; }
}

@media (max-width: 480px) {
  .achievement-toast {
    top: auto;
    bottom: -110%;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    border-radius: 12px;
    padding-bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px));
    transition: bottom 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
  }
  .achievement-toast-visible { bottom: 16px; right: 12px; }
  .achievement-toast-exit { bottom: -110%; right: 12px; opacity: 0; }
  .achievement-toast-art { width: 56px; height: 56px; }
  .achievement-toast-name { font-size: 0.95rem; }
}

@media (max-width: 480px) and (prefers-reduced-motion: reduce) {
  .achievement-toast { bottom: 16px; transition: opacity 0.2s ease; }
  .achievement-toast-exit { bottom: 16px; opacity: 0; }
}

/* ==========================================================================
   SOURCE: styles.css -- daily quests
   ========================================================================== */

.quest-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-muted);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    z-index: var(--z-modal);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.quest-toggle.quest-toggle-nav {
    position: relative;
    bottom: auto;
    right: auto;
    width: 32px;
    height: 32px;
    border-radius: 5px;
    z-index: auto;
    flex-shrink: 0;
}

.quest-toggle.quest-toggle-nav:hover {
    color: var(--color-text);
    background: var(--color-border);
    transform: none;
}

.quest-toggle:hover {
    color: var(--color-text);
    background: var(--color-border);
    transform: none;
}

.quest-toggle-active {
    color: var(--color-primary);
    background: rgba(16, 185, 129, 0.1);
}

.quest-toggle-count {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-danger, #ef4444);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.quest-panel {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 280px;
    background: var(--color-bg-card, #1e1e2e);
    border: 1px solid var(--color-border, rgba(255,255,255,0.08));
    border-radius: 9px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    z-index: var(--z-modal-backdrop);
    padding: 1rem;
    transform: translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.quest-panel.quest-panel-nav {
    top: 74px;
    right: 24px;
    bottom: auto;
}

.quest-panel-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.quest-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.quest-panel-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text, #fafafa);
    margin: 0;
}

.quest-panel-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.quest-panel-items {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.quest-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
}

.quest-item-done {
    opacity: 0.6;
}

.quest-item-done .quest-item-text {
    text-decoration: line-through;
}

.quest-item-check {
    flex-shrink: 0;
    color: var(--color-success, #10b981);
}

.quest-item-circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--color-border, rgba(255,255,255,0.15));
}

.quest-item-content {
    flex: 1;
    min-width: 0;
}

.quest-item-text {
    font-size: 0.78rem;
    color: var(--color-text, #fafafa);
    display: block;
    margin-bottom: 0.25rem;
}

.quest-item-bar {
    height: 3px;
    border-radius: 2px;
    background: var(--color-border, rgba(255,255,255,0.08));
    overflow: hidden;
}

.quest-item-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: #10b981;
    transition: width 0.3s ease;
}

.quest-item-done .quest-item-bar-fill {
    background: var(--color-success, #10b981);
}

.quest-item-progress {
    font-size: 0.68rem;
    color: var(--color-text-muted, #94a3b8);
    flex-shrink: 0;
}

/* per-quest xp reward tag, rendered by questLabelHTML in every quest list
   (nav panel, daily tasks card, profile detail panel). inline-block so it
   escapes the parent link underline and the done-state line-through */
.quest-xp-tag {
    display: inline-block;
    margin-left: 4px;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    vertical-align: middle;
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
}

.quest-item-done .quest-xp-tag,
.dtc-item-done .quest-xp-tag,
.profile-quest-item--done .quest-xp-tag {
    opacity: 0.55;
}

.quest-panel-complete {
    margin-top: 0.75rem;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-success, #10b981);
    background: rgba(16, 185, 129, 0.08);
    border-radius: 5px;
}

@media (prefers-reduced-motion: reduce) {
    .quest-panel {
        transition: none;
    }
}

@media (max-width: 480px) {
    .quest-toggle {
        bottom: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
    }
    .quest-toggle.quest-toggle-nav {
        width: 28px;
        height: 28px;
    }
    .quest-panel {
        bottom: 68px;
        right: 16px;
        left: 16px;
        width: auto;
    }
    .quest-panel.quest-panel-nav {
        top: 70px;
        bottom: auto;
        right: 12px;
        left: 12px;
    }
}

/* ==========================================================================
   SOURCE: landing.css -- XP bar for landing nav
   ========================================================================== */

.xp-bar-container {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0;
}

.xp-bar-level {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  color: #f59e0b;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
}

.xp-bar-level svg {
  color: #f59e0b;
  flex-shrink: 0;
}

.xp-bar-level-num {
  font-variant-numeric: tabular-nums;
}

.xp-bar-track {
  width: 72px;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

[data-theme="light"] .xp-bar-track {
  background: rgba(0, 0, 0, 0.08);
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #10b981);
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.xp-bar-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* xp toast (shared across both css systems) */
.xp-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: var(--glass-bg, rgba(255,255,255,0.05));
  backdrop-filter: var(--glass-blur, blur(24px));
  -webkit-backdrop-filter: var(--glass-blur, blur(24px));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.1));
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: var(--z-toast);
  pointer-events: none;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.xp-toast-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.xp-toast-exit {
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.xp-toast-amount {
  font-weight: 700;
  font-size: 0.95rem;
  color: #22c55e;
}

.xp-toast-reason {
  font-size: 0.8rem;
  color: var(--text-muted, #737373);
}

/* level up toast */
.level-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--glass-bg, rgba(255,255,255,0.05));
  backdrop-filter: var(--glass-blur, blur(24px));
  -webkit-backdrop-filter: var(--glass-blur, blur(24px));
  border: 1px solid #f59e0b;
  border-radius: 13px;
  box-shadow: 0 0 40px rgba(249,115,22,0.15), 0 8px 24px rgba(0,0,0,0.5);
  z-index: var(--z-toast-top);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.level-toast-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.level-toast-exit {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.level-toast-icon {
  color: #f59e0b;
  display: flex;
  align-items: center;
  animation: levelPulse 0.6s ease-in-out infinite alternate;
}

.level-toast-text {
  font-weight: 800;
  font-size: 1.2rem;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes levelPulse {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .xp-toast,
  .level-toast {
    transition: opacity 0.15s ease;
  }
  .level-toast-icon {
    animation: none;
  }
  .xp-bar-fill {
    transition: none;
  }
}

@media (max-width: 768px) {
  .xp-bar-container {
    gap: 0.3rem;
  }
  .xp-bar-track {
    width: 44px;
  }
  .xp-bar-text {
    display: none;
  }
}

@media (max-width: 480px) {
  .xp-bar-track {
    width: 32px;
  }
}

/* ==========================================================================
   SOURCE: landing.css -- streak badge
   ========================================================================== */

.streak-badge {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(251, 146, 60, 0.1);
  border: 1px solid rgba(251, 146, 60, 0.2);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0.35rem;
  transition: transform 0.2s ease, background 0.2s ease;
  cursor: default;
}

.streak-badge:hover {
  background: rgba(251, 146, 60, 0.15);
  transform: scale(1.05);
}

.streak-icon {
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.streak-icon.streak-active {
  color: #fb923c;
  fill: #fb923c;
  filter: drop-shadow(0 0 3px rgba(251, 146, 60, 0.5));
}

.streak-count {
  line-height: 1;
}

.streak-badge-new {
  animation: streakPulse 0.6s ease;
}

@keyframes streakPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.2); }
  60% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

[data-theme="light"] .streak-badge {
  background: rgba(251, 146, 60, 0.08);
  border-color: rgba(251, 146, 60, 0.15);
  color: #ea580c;
}

[data-theme="light"] .streak-icon.streak-active {
  color: #ea580c;
  fill: #ea580c;
}

@media (prefers-reduced-motion: reduce) {
  .streak-badge-new {
    animation: none;
  }
}

@media (max-width: 480px) {
  .streak-badge {
    padding: 0.15rem 0.35rem;
    font-size: 0.7rem;
  }
}

/* ==========================================================================
   learning streak badge states (streak.js)
   ========================================================================== */

/* .streak-badge sets display:flex, which would override the hidden attribute
   the badge uses when there is no active streak */
.streak-badge[hidden] {
  display: none;
}

/* at risk: active streak from a previous day, no qualifying learning action
   yet today. dimmed dashed pill + gently pulsing outline flame as the
   loss-aversion cue */
.streak-badge--at-risk {
  background: transparent;
  border-style: dashed;
  border-color: rgba(251, 146, 60, 0.45);
}

.streak-badge--at-risk .streak-icon {
  color: #fb923c;
  fill: none;
  animation: streakAtRisk 2.6s ease-in-out infinite;
}

.streak-badge--at-risk .streak-count {
  opacity: 0.75;
}

@keyframes streakAtRisk {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

[data-theme="light"] .streak-badge--at-risk {
  background: transparent;
  border-color: rgba(234, 88, 12, 0.4);
}

[data-theme="light"] .streak-badge--at-risk .streak-icon {
  color: #ea580c;
}

@media (prefers-reduced-motion: reduce) {
  .streak-badge--at-risk .streak-icon {
    animation: none;
    opacity: 0.6;
  }
}

/* ==========================================================================
   SOURCE: landing.css -- sound toggle
   ========================================================================== */

.sound-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
  padding: 0;
}

.sound-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .sound-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

@media (max-width: 480px) {
  .sound-toggle-btn {
    width: 28px;
    height: 28px;
  }

  .sound-toggle-btn svg {
    width: 14px;
    height: 14px;
  }
}

/* ==========================================================================
   SOURCE: landing.css -- achievement toast (rich, queued, tiered)
   kept identical to the styles.css block above so the cascade is deterministic
   regardless of which bundle includes gamification.css.
   ========================================================================== */

.achievement-toast {
  position: fixed;
  top: 80px;
  right: -440px;
  width: 360px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.95rem 1.05rem 0.8rem;
  --pa-toast-accent: #10b981;
  background: var(--glass-bg, rgba(20, 20, 30, 0.92));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  border-left: 4px solid var(--pa-toast-accent);
  border-radius: 11px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: var(--z-toast-top, 10000);
  transition: right 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

/* celebration tiers: common = green, medium = purple rarity, major = gold glow */
.achievement-toast--common { --pa-toast-accent: #10b981; }
.achievement-toast--medium { --pa-toast-accent: #10b981; }
.achievement-toast--major {
  --pa-toast-accent: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25), 0 18px 52px rgba(245, 158, 11, 0.22), 0 18px 48px rgba(0, 0, 0, 0.28);
}

.achievement-toast-visible { right: 20px; }

.achievement-toast-exit {
  right: -440px;
  opacity: 0;
}

.achievement-toast-main {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.achievement-toast-art {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 9px;
  overflow: hidden;
  background: color-mix(in srgb, var(--pa-toast-accent, #10b981) 14%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.achievement-toast--major .achievement-toast-art {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4), 0 6px 18px rgba(245, 158, 11, 0.28);
}

.achievement-toast-image { display: block; width: 100%; height: 100%; }
.achievement-toast-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.achievement-toast-image--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--pa-toast-accent, #10b981);
}

/* major-tier sheen sweeps the badge art twice, motion-safe */
.achievement-toast--major .achievement-toast-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 32%, rgba(255, 255, 255, 0.55) 50%, transparent 68%);
  transform: translateX(-120%);
  animation: paBadgeSheen 2.2s ease-in-out 0.3s 2;
}

@keyframes paBadgeSheen {
  to { transform: translateX(120%); }
}

.achievement-toast-content { flex: 1; min-width: 0; }

.achievement-toast-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pa-toast-accent, #10b981);
  margin-bottom: 0.12rem;
}

.achievement-toast-name {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary, #fafafa);
}

.achievement-toast-desc {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 0.15rem;
  line-height: 1.35;
}

.achievement-toast-close {
  flex-shrink: 0;
  align-self: flex-start;
  width: 26px;
  height: 26px;
  margin: -2px -4px 0 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.achievement-toast-close:hover {
  background: rgba(127, 127, 127, 0.16);
  color: var(--text-primary, #fafafa);
}

.achievement-toast-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
}

.achievement-toast-xp {
  font-size: 0.74rem;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  white-space: nowrap;
}

.achievement-toast-count {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.achievement-toast-cta {
  margin-left: auto;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--pa-toast-accent, #10b981);
  text-decoration: none;
  white-space: nowrap;
}

.achievement-toast-cta:hover { text-decoration: underline; }

[data-theme="light"] .achievement-toast {
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .achievement-toast--major {
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.3), 0 18px 52px rgba(245, 158, 11, 0.2), 0 18px 48px rgba(15, 23, 42, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .achievement-toast {
    right: 20px;
    transition: opacity 0.2s ease;
  }
  .achievement-toast-visible { right: 20px; }
  .achievement-toast-exit { right: 20px; opacity: 0; }
  .achievement-toast--major .achievement-toast-art::after { animation: none; display: none; }
}

@media (max-width: 480px) {
  .achievement-toast {
    top: auto;
    bottom: -110%;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    border-radius: 12px;
    padding-bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px));
    transition: bottom 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
  }
  .achievement-toast-visible { bottom: 16px; right: 12px; }
  .achievement-toast-exit { bottom: -110%; right: 12px; opacity: 0; }
  .achievement-toast-art { width: 56px; height: 56px; }
  .achievement-toast-name { font-size: 0.95rem; }
}

@media (max-width: 480px) and (prefers-reduced-motion: reduce) {
  .achievement-toast { bottom: 16px; transition: opacity 0.2s ease; }
  .achievement-toast-exit { bottom: 16px; opacity: 0; }
}

/* ==========================================================================
   quest completion toast: shares the achievement toast shell (position,
   slide-in, queue timing, reduced-motion) but reads as a quest, not a
   badge: flag icon in a soft quest-green tile instead of badge art, no
   badge count, no cta
   ========================================================================== */

.quest-toast { --pa-toast-accent: #10b981; }

.quest-toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
}

.quest-toast .achievement-toast-name {
  font-size: 0.92rem;
  font-weight: 700;
}

/* ==========================================================================
   SOURCE: landing.css -- daily quests
   ========================================================================== */

.quest-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  z-index: var(--z-modal);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.quest-toggle.quest-toggle-nav {
  position: relative;
  bottom: auto;
  right: auto;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  z-index: auto;
  flex-shrink: 0;
}

.quest-toggle.quest-toggle-nav:hover {
  color: var(--text-primary);
  background: var(--border);
  transform: none;
}

.quest-toggle:hover {
  color: var(--text-primary);
  background: var(--border);
  transform: none;
}

.quest-toggle-active {
  color: var(--accent);
  background: rgba(16, 185, 129, 0.1);
}

.quest-toggle-count {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.quest-panel {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 280px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: var(--z-modal-backdrop);
  padding: 1rem;
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.quest-panel.quest-panel-nav {
  top: 74px;
  right: 24px;
  bottom: auto;
}

.quest-panel-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.quest-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.quest-panel-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.quest-panel-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.quest-panel-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.quest-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
}

.quest-item-done {
  opacity: 0.6;
}

.quest-item-done .quest-item-text {
  text-decoration: line-through;
}

.quest-item-check {
  flex-shrink: 0;
  color: #10b981;
}

.quest-item-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
}

.quest-item-content {
  flex: 1;
  min-width: 0;
}

.quest-item-text {
  font-size: 0.78rem;
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.25rem;
}

.quest-item-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--glass-border);
  overflow: hidden;
}

.quest-item-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.quest-item-done .quest-item-bar-fill {
  background: #10b981;
}

.quest-item-progress {
  font-size: 0.68rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.quest-panel-complete {
  margin-top: 0.75rem;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border-radius: 5px;
}

[data-theme="light"] .quest-panel {
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

@media (prefers-reduced-motion: reduce) {
  .quest-panel {
    transition: none;
  }
}

@media (max-width: 480px) {
  .quest-toggle {
    bottom: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
  }
  .quest-toggle.quest-toggle-nav {
    width: 28px;
    height: 28px;
  }
  .quest-panel {
    bottom: 68px;
    right: 16px;
    left: 16px;
    width: auto;
  }
  .quest-panel.quest-panel-nav {
    top: 70px;
    bottom: auto;
    right: 12px;
    left: 12px;
  }
}

/* ==========================================================================
   signup prompt overlay (post-quiz for logged-out users)
   ========================================================================== */

.signup-prompt-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.signup-prompt-visible {
    opacity: 1;
}

.signup-prompt-exit {
    opacity: 0;
    pointer-events: none;
}

.signup-prompt-card {
    background: var(--glass-bg, rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: 13px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    padding: 2rem 1.75rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.signup-prompt-visible .signup-prompt-card {
    transform: translateY(0) scale(1);
}

.signup-prompt-exit .signup-prompt-card {
    transform: translateY(10px) scale(0.98);
}

.signup-prompt-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #fafafa);
    margin: 0 0 0.5rem 0;
}

.signup-prompt-sub {
    font-size: 0.9rem;
    color: var(--text-muted, #94a3b8);
    margin: 0 0 1.25rem 0;
}

.signup-prompt-bullets {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.signup-prompt-bullets li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-primary, #fafafa);
}

.signup-prompt-bullets li svg {
    flex-shrink: 0;
}

.signup-prompt-primary {
    display: block;
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: var(--accent, #10b981);
    color: #000;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 0.75rem;
}

.signup-prompt-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.signup-prompt-primary:active {
    transform: translateY(0);
}

.signup-prompt-dismiss {
    display: block;
    width: 100%;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.signup-prompt-dismiss:hover {
    color: var(--text-primary, #fafafa);
}

[data-theme="light"] .signup-prompt-overlay {
    background: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .signup-prompt-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

@media (prefers-reduced-motion: reduce) {
    .signup-prompt-overlay {
        transition: none;
    }
    .signup-prompt-card {
        transition: none;
    }
}

@media (max-width: 480px) {
    .signup-prompt-card {
        padding: 1.5rem 1.25rem;
        border-radius: 11px;
    }
    .signup-prompt-heading {
        font-size: 1.1rem;
    }
}

/* ===== inline signup CTA banners ===== */

.signup-cta-banner {
    background: var(--glass-bg, rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: 11px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    max-width: 560px;
    margin: 2rem auto;
    text-align: center;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.signup-cta-visible {
    opacity: 1;
    transform: translateY(0);
}

.signup-cta-exit {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

.signup-cta-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, #fafafa);
    margin: 0 0 0.35rem 0;
}

.signup-cta-sub {
    font-size: 0.88rem;
    color: var(--text-muted, #94a3b8);
    margin: 0 0 1rem 0;
}

.signup-cta-bullets {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.signup-cta-bullets li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-primary, #fafafa);
}

.signup-cta-bullets li svg {
    flex-shrink: 0;
}

/* matheus 2026-08-30: a filled primary button with no depth. The site's raised
   ledge comes from the --btn-depth-* tokens in css/variables.css and presses
   down on :active rather than lifting on hover. */
.signup-cta-btn {
    display: inline-block;
    padding: 0.65rem 1.75rem;
    border: none;
    border-radius: 7px;
    background: var(--accent, #10b981);
    color: #000;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 var(--btn-depth-offset, 5px) 0 0 var(--btn-depth-color, #047852);
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.18s ease;
    margin-bottom: 0.5rem;
}

.signup-cta-btn:hover {
    background: var(--meadow-600, #059669);
    box-shadow: 0 var(--btn-depth-offset, 5px) 0 0 var(--btn-depth-color, #047852);
}

.signup-cta-btn:active {
    transform: translateY(var(--btn-depth-press, 4px));
    box-shadow: 0 1px 0 0 var(--btn-depth-color, #047852);
}

.signup-cta-dismiss {
    display: block;
    width: 100%;
    padding: 0.35rem;
    border: none;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.signup-cta-dismiss:hover {
    color: var(--text-primary, #fafafa);
}

[data-theme="light"] .signup-cta-banner {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

@media (prefers-reduced-motion: reduce) {
    .signup-cta-banner {
        transition: none;
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 480px) {
    .signup-cta-banner {
        padding: 1.25rem 1rem;
        border-radius: 8px;
        margin: 1.5rem 1rem;
    }
    .signup-cta-heading {
        font-size: 1.05rem;
    }
}

/* ===== zigzag progress path ===== */
.progress-path {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem 0;
}

.progress-path-track {
  display: flex;
  flex-direction: column;
}

.progress-path-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.progress-path-row-left {
  align-items: flex-start;
  padding-left: 20%;
}

.progress-path-row-right {
  align-items: flex-end;
  padding-right: 20%;
}

.progress-path-connector {
  width: 2px;
  height: 32px;
  background: var(--glass-border);
  margin: 0 auto;
  position: relative;
  left: 24px;
}

.progress-path-row-right .progress-path-connector {
  left: -24px;
}

.progress-path-connector-done {
  background: #10b981;
}

.progress-path-node {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 9px;
  text-decoration: none;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  max-width: 320px;
  width: 100%;
}

.progress-path-node:hover {
  transform: translateY(-2px);
}

.progress-path-node-available {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
}

.progress-path-node-available:hover {
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
  border-color: var(--accent);
}

.progress-path-node-complete {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  cursor: pointer;
}

.progress-path-node-complete:hover {
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
}

.progress-path-node-locked {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.progress-path-node-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.progress-path-node-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.progress-path-node-available .progress-path-node-icon {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent);
}

.progress-path-node-complete .progress-path-node-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.progress-path-node-locked .progress-path-node-icon {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.progress-path-node-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.progress-path-node-num {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.progress-path-node-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-path-node-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.progress-path-node-score {
  font-size: 0.68rem;
  font-weight: 600;
  color: #10b981;
  margin-top: 0.1rem;
}

.progress-path-current-badge {
  position: absolute;
  top: -8px;
  right: 12px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}

.progress-path-lock {
  color: var(--text-muted);
}

/* certificate summit node -- the finish line at the end of a course path.
   gold-tinted to read as a distinct reward, on top of its status styling. */
.progress-path-node-summit {
  border-color: rgba(212, 160, 23, 0.45);
}

.progress-path-node-summit .progress-path-node-icon {
  background: rgba(212, 160, 23, 0.14);
  color: #d4a017;
}

.progress-path-node-summit.progress-path-node-complete {
  background: rgba(212, 160, 23, 0.1);
  border-color: rgba(212, 160, 23, 0.4);
}

.progress-path-node-summit.progress-path-node-complete .progress-path-node-icon {
  background: rgba(212, 160, 23, 0.2);
  color: #d4a017;
}

.progress-path-node-summit.progress-path-node-current {
  box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.25);
}

.progress-path-node-summit .progress-path-current-badge {
  background: #d4a017;
}

[data-theme="light"] .progress-path-node-summit {
  background: rgba(212, 160, 23, 0.07);
  border-color: rgba(212, 160, 23, 0.35);
}

@media (max-width: 480px) {
  .progress-path-row-left,
  .progress-path-row-right {
    padding-left: 5%;
    padding-right: 5%;
    align-items: center;
  }
  .progress-path-connector {
    left: 0;
  }
  .progress-path-row-right .progress-path-connector {
    left: 0;
  }
  .progress-path-node {
    max-width: none;
  }
}

.progress-path-section {
  padding: 80px 40px;
  max-width: 700px;
  margin: 0 auto;
}

.progress-path-header {
  text-align: center;
  margin-bottom: 40px;
}

[data-theme="light"] .progress-path-node-available {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .progress-path-node-locked {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .progress-path-node-complete {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.15);
}

[data-theme="light"] .progress-path-connector {
  background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .progress-path-node-title {
  color: #1a1a2e;
}

[data-theme="light"] .progress-path-node-num,
[data-theme="light"] .progress-path-node-subtitle {
  color: #64748b;
}

@media (max-width: 768px) {
  .progress-path-section {
    padding: 60px 20px;
  }
}

/* --- clean floating XP gain (2026-07-08, drewbo) ---------------------------
   drop the glass box + reason line; the XP gain is now just a floating "+X XP"
   that rises and fades, keeping the screen as clean as possible. this block is
   last in the file so it wins over the two earlier .xp-toast declarations. */
.xp-toast {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  bottom: 5.25rem;
  right: 1.4rem;
  transform: translateY(8px);
  transition: opacity 0.28s ease, transform 0.6s cubic-bezier(0.22, 0.7, 0.2, 1);
}

.xp-toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.xp-toast-exit {
  opacity: 0;
  transform: translateY(-26px);
  transition: opacity 0.45s ease, transform 0.55s ease;
}

.xp-toast-amount {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent, #10b981);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
}

.xp-toast-reason {
  display: none;
}

.xp-toast-nudge {
  font-weight: 600;
  color: var(--text-muted, #9ca3af);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

@media (max-width: 768px) {
  .xp-toast {
    bottom: 6rem;
  }
}


/* ===== css/tour.css ===== */
/* css/tour.css - guided onboarding tour */

.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 7, 13, 0.28);
    z-index: 11000;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.tour-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

body.tour-active .cookie-banner {
    display: none !important;
}

/* when spotlight is active, overlay becomes transparent so dimming
   comes only from the spotlight box-shadow (no double-layer) */
.tour-overlay.has-spotlight {
    background: transparent;
    pointer-events: none;
}

.tour-spotlight {
    position: fixed;
    border-radius: 7px;
    box-shadow:
        0 0 0 9999px rgba(5, 7, 13, 0.34),
        0 0 0 3px rgba(16, 185, 129, 0.95),
        0 18px 60px rgba(16, 185, 129, 0.22);
    z-index: 11010;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0;
}

.tour-spotlight.visible {
    opacity: 1;
}

.tour-target-highlight {
    position: relative !important;
    z-index: 11011 !important;
    pointer-events: auto !important;
    isolation: isolate;
}

/* popover */
.tour-popover {
    position: fixed;
    z-index: 11012;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 5px;
    padding: 1.5rem 1.75rem;
    box-shadow:
        0 18px 50px rgba(15, 23, 42, 0.18),
        0 2px 10px rgba(15, 23, 42, 0.08);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
    color: #05070d;
}

[data-theme="light"] .tour-popover {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
    color: var(--text-primary);
}

[data-theme="dark"] .tour-popover {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

.tour-popover.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* arrow */
.tour-popover::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
    border-left: 1px solid rgba(15, 23, 42, 0.1);
    transform: rotate(45deg);
}

[data-theme="light"] .tour-popover::after {
    background: #ffffff;
    border-top-color: rgba(15, 23, 42, 0.1);
    border-left-color: rgba(15, 23, 42, 0.1);
}

[data-theme="dark"] .tour-popover::after {
    background: #111827;
    border-top-color: rgba(255, 255, 255, 0.12);
    border-left-color: rgba(255, 255, 255, 0.12);
}

.tour-popover[data-placement="bottom"]::after {
    top: -8px;
    left: var(--arrow-left, 50%);
    transform: rotate(45deg);
}

.tour-popover[data-placement="top"]::after {
    bottom: -8px;
    left: var(--arrow-left, 50%);
    transform: rotate(225deg);
}

.tour-popover[data-placement="center"]::after {
    display: none;
}

.tour-popover[data-placement="center"] {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
}

.tour-popover[data-placement="center"].visible {
    transform: translate(-50%, -50%);
}

.tour-step-counter {
    color: var(--mountain-meadow-600, #059666);
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.tour-guide-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #d1fae5;
    border: 1px solid rgba(16, 185, 129, 0.24);
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.16);
}

.tour-guide-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* header */
.tour-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.tour-title-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1 1 auto;
    margin: 0;
}

.tour-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: inherit;
    margin: 0;
    line-height: 1.3;
    min-width: 0;
    overflow-wrap: anywhere;
}

.tour-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    background: rgba(15, 23, 42, 0.06);
    border: none;
    color: rgba(15, 23, 42, 0.55);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

[data-theme="light"] .tour-close {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .tour-close {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.62);
}

.tour-close:hover {
    color: #05070d;
    background: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .tour-close:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.1);
}

/* content */
.tour-content {
    font-size: 0.94rem;
    color: #374151;
    line-height: 1.55;
    margin-bottom: 1.25rem;
}

[data-theme="light"] .tour-content {
    color: var(--text-secondary);
}

[data-theme="dark"] .tour-content {
    color: #cbd5e1;
}

.tour-action-hint {
    margin: -0.55rem 0 1rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mountain-meadow-600, #059666);
}

/* footer */
.tour-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* progress dots */
.tour-progress-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.tour-progress {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tour-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.3s, transform 0.3s;
}

[data-theme="light"] .tour-dot {
    background: rgba(0, 0, 0, 0.12);
}

.tour-dot.active {
    background: #10b981;
    transform: scale(1.2);
}

.tour-dot.completed {
    background: var(--mountain-meadow-600, #059666);
}

/* buttons */
.tour-buttons {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.tour-btn {
    min-height: 38px;
    padding: 0.55rem 1.05rem;
    font-size: 0.86rem;
    font-weight: 800;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.tour-btn-secondary {
    background: rgba(15, 23, 42, 0.06);
    color: #4b5563;
}

[data-theme="light"] .tour-btn-secondary {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
}

.tour-btn-secondary:hover {
    color: #05070d;
    background: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .tour-btn-secondary:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.1);
}

.tour-btn-primary {
    background: var(--mountain-meadow-500, #10b981);
    color: #fff;
    box-shadow: 0 var(--btn-depth-offset) 0 0 var(--btn-depth-color);
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.18s ease;
}

.tour-btn-primary:hover {
    background: var(--mountain-meadow-600, #059666);
    box-shadow: 0 var(--btn-depth-offset) 0 0 var(--btn-depth-color);
}

.tour-btn-primary:active {
    transform: translateY(var(--btn-depth-press));
    box-shadow: 0 1px 0 0 var(--btn-depth-color);
}

.tour-btn-primary:disabled,
.tour-btn-primary--disabled {
    cursor: default;
    opacity: 0.72;
    background: #d1fae5;
    color: #047857;
    box-shadow: none;
}

[data-theme="dark"] .tour-btn-primary:disabled,
[data-theme="dark"] .tour-btn-primary--disabled {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
}

/* tour chooser */
.tour-center-overlay {
    position: fixed;
    inset: 0;
    z-index: 11040;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(5, 7, 13, 0.34);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.tour-center-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.tour-center-card {
    width: min(780px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px); /* dynamic viewport so mobile browser chrome never hides the card bottom */
    overflow: auto;
    overscroll-behavior: contain;
    padding: 1.35rem;
    border-radius: 5px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow:
        0 24px 70px rgba(15, 23, 42, 0.22),
        0 4px 12px rgba(15, 23, 42, 0.08);
    color: #05070d;
    transform: translateY(10px) scale(0.985);
    transition: transform 0.18s cubic-bezier(0.25, 1, 0.5, 1);
}

.tour-center-overlay.visible .tour-center-card {
    transform: translateY(0) scale(1);
}

[data-theme="dark"] .tour-center-card {
    background: #111827;
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.12);
}

.tour-center-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.tour-center-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    background: #d1fae5;
    border: 1px solid rgba(16, 185, 129, 0.24);
    box-shadow: 0 12px 26px rgba(16, 185, 129, 0.18);
}

.tour-center-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tour-center-kicker {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--mountain-meadow-600, #059666);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tour-center-title {
    margin: 0;
    color: inherit;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    line-height: 1.05;
    letter-spacing: 0;
}

.tour-center-copy,
.tour-center-note {
    margin: 0;
    color: #475569;
    line-height: 1.5;
}

[data-theme="dark"] .tour-center-copy,
[data-theme="dark"] .tour-center-note {
    color: #cbd5e1;
}

.tour-center-close {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.06);
    color: #475569;
    cursor: pointer;
}

.tour-center-close:hover {
    background: rgba(15, 23, 42, 0.1);
    color: #05070d;
}

[data-theme="dark"] .tour-center-close {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

.tour-center-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    margin: 1.15rem 0 0.9rem;
}

.tour-center-option {
    min-height: 228px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid rgba(16, 185, 129, 0.22);
    border-radius: 5px;
    background:
        linear-gradient(180deg, rgba(16, 185, 129, 0.06), rgba(255, 255, 255, 0)),
        #ffffff;
}

[data-theme="dark"] .tour-center-option {
    background:
        linear-gradient(180deg, rgba(16, 185, 129, 0.12), rgba(17, 24, 39, 0)),
        #111827;
    border-color: rgba(16, 185, 129, 0.2);
}

.tour-center-option--locked {
    border-color: rgba(148, 163, 184, 0.3);
    background: #f8fafc;
}

[data-theme="dark"] .tour-center-option--locked {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.18);
}

.tour-center-option-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    margin-bottom: 0.8rem;
}

.tour-center-status {
    border-radius: 999px;
    padding: 0.22rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.tour-center-status--available {
    color: #047857;
    background: #d1fae5;
}

.tour-center-status--locked {
    color: #64748b;
    background: #e2e8f0;
}

.tour-center-meta {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 800;
    text-align: right;
}

[data-theme="dark"] .tour-center-meta {
    color: #94a3b8;
}

.tour-center-option h3 {
    margin: 0 0 0.45rem;
    color: inherit;
    font-size: 1rem;
    line-height: 1.2;
}

.tour-center-option p {
    margin: 0 0 0.9rem;
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.45;
}

[data-theme="dark"] .tour-center-option p {
    color: #cbd5e1;
}

.tour-center-action {
    margin-top: auto;
    min-height: 40px;
    padding: 0.62rem 0.9rem;
    border: 0;
    border-radius: 5px;
    background: var(--mountain-meadow-500, #10b981);
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.2);
}

.tour-center-action:hover {
    background: var(--mountain-meadow-600, #059666);
}

.tour-center-action--link {
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--mountain-meadow-600, #059666);
    box-shadow: none;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

.tour-center-action--link:hover {
    background: transparent;
    color: var(--mountain-meadow-700, #047857);
}

.tour-center-note {
    font-size: 0.86rem;
    font-weight: 700;
}

/* mobile */
@media (max-width: 480px) {
    .tour-popover {
        width: calc(100vw - 24px);
        padding: 1.25rem;
        border-radius: 5px;
    }

    .tour-footer {
        align-items: flex-start;
        gap: 1rem;
        flex-direction: column;
    }

    .tour-progress-row {
        align-self: flex-start;
    }

    .tour-buttons {
        width: 100%;
    }

    .tour-btn {
        flex: 1;
    }

    .tour-center-overlay {
        align-items: end;
        padding: 0.75rem;
    }

    .tour-center-card {
        width: 100%;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        padding: 1rem;
    }

    /* flatten the title wrap so the intro copy can span the full card width
       instead of wrapping in the narrow column beside the avatar */
    .tour-center-head {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-rows: auto auto auto;
        gap: 0.35rem 0.75rem;
        margin-bottom: 0.7rem;
    }

    .tour-center-title-wrap {
        display: contents;
    }

    .tour-center-avatar {
        grid-row: 1 / 3;
        grid-column: 1;
        align-self: center;
        width: 44px;
        height: 44px;
    }

    .tour-center-kicker {
        grid-row: 1;
        grid-column: 2;
        align-self: end;
        margin-bottom: 0;
    }

    .tour-center-close {
        grid-row: 1 / 3;
        grid-column: 3;
        align-self: start;
        width: 44px;
        height: 44px;
    }

    .tour-center-title {
        grid-row: 2;
        grid-column: 2;
        font-size: 1.45rem;
    }

    .tour-center-copy {
        grid-row: 3;
        grid-column: 1 / -1;
        margin-top: 0.25rem;
        font-size: 0.92rem;
        line-height: 1.4;
    }

    .tour-center-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
        margin-top: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .tour-center-option {
        min-height: 0;
        padding: 0.8rem;
    }

    .tour-center-option-top {
        margin-bottom: 0.6rem;
    }

    .tour-center-option p {
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }

    .tour-center-action {
        width: 100%;
        min-height: 44px;
    }

    .tour-center-action--link {
        width: auto;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .tour-center-note {
        font-size: 0.82rem;
    }
}

@media (min-width: 481px) and (max-width: 760px) {
    .tour-center-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tour-overlay,
    .tour-spotlight,
    .tour-popover,
    .tour-center-overlay,
    .tour-center-card {
        transition: none;
    }
}


/* ===== css/onboarding.css ===== */
/* academy purchase success panel */

.pa-success-onboarding {
  margin: 4px 0 22px;
  padding: 20px;
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(236, 253, 245, 0.78), rgba(255, 255, 255, 0.72)),
    linear-gradient(90deg, rgba(16, 185, 129, 0.12), transparent);
  text-align: left;
}

[data-theme="dark"] .pa-success-onboarding {
  border-color: rgba(16, 185, 129, 0.22);
  background:
    linear-gradient(135deg, rgba(6, 78, 59, 0.38), rgba(15, 23, 42, 0.72)),
    linear-gradient(90deg, rgba(16, 185, 129, 0.12), transparent);
}

.pa-success-onboarding-head {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.pa-success-onboarding h3 {
  margin: 0;
  color: var(--text-primary, #0f172a);
  font-size: 1.15rem;
  line-height: 1.2;
}

.pa-success-onboarding p {
  margin: 0;
  color: var(--text-secondary, #64748b);
  font-size: 0.88rem;
  line-height: 1.45;
}

[data-theme="dark"] .pa-success-onboarding h3 {
  color: #f8fafc;
}

[data-theme="dark"] .pa-success-onboarding p {
  color: rgba(248, 250, 252, 0.68);
}

.pa-success-onboarding-grid {
  display: grid;
  gap: 9px;
}

.pa-success-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 3px 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.8);
  color: inherit;
  text-decoration: none;
}

.pa-success-step:hover {
  border-color: rgba(16, 185, 129, 0.5);
}

[data-theme="dark"] .pa-success-step {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.72);
}

.pa-success-step span {
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent, #10b981);
  font-size: 0.78rem;
  font-weight: 900;
}

.pa-success-step--primary span {
  background: var(--accent, #10b981);
  color: #fff;
}

.pa-success-step strong {
  color: var(--text-primary, #0f172a);
  font-size: 0.93rem;
  line-height: 1.2;
}

.pa-success-step em {
  color: var(--text-secondary, #64748b);
  font-size: 0.8rem;
  font-style: normal;
  line-height: 1.35;
}

[data-theme="dark"] .pa-success-step strong {
  color: #f8fafc;
}

[data-theme="dark"] .pa-success-step em {
  color: rgba(248, 250, 252, 0.66);
}

.pa-success-onboarding-kicker {
  margin: 0;
  color: var(--accent, #10b981);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

