/* Account nextgen — compact layout + theme-safe contrast under .account-nextgen */

.account-nextgen {
  --account-panel-heading: #f8fafc;
  --account-panel-text: rgba(226, 232, 240, 0.92);
  --account-panel-muted: rgba(203, 213, 225, 0.82);
  --account-light-heading: #13212c;
  --account-light-text: #1a2b36;
  --account-light-muted: #526673;
  --account-border: color-mix(in srgb, var(--accent, #3d8bfd) 18%, #d5e1e8);
  --account-accent: var(--accent, #3d8bfd);
  --account-focus: color-mix(in srgb, var(--accent, #3d8bfd) 70%, #fff);
  max-width: 1180px;
  margin: 28px auto;
  padding: 0 16px;
  display: grid;
  gap: 16px;
}

.site-scene[data-theme="poisoned"] .account-nextgen {
  --account-panel-heading: #fcf7ff;
  --account-panel-text: color-mix(in srgb, #fcf7ff 88%, #c8b5d2);
  --account-panel-muted: color-mix(in srgb, #fcf7ff 72%, #887495);
  --account-light-heading: #2a1540;
  --account-light-text: #311a4a;
  --account-light-muted: #6a4f7d;
  --account-border: color-mix(in srgb, var(--accent, #b760ff) 22%, #d8c7e8);
  --account-accent: var(--accent, #b760ff);
  --account-focus: color-mix(in srgb, var(--accent, #b760ff) 70%, #fff);
}

.site-scene[data-theme="immolated"] .account-nextgen {
  --account-panel-heading: #fff5ed;
  --account-panel-text: color-mix(in srgb, #fff5ed 88%, #cbb6b0);
  --account-panel-muted: color-mix(in srgb, #fff5ed 72%, #846e6d);
  --account-light-heading: #3a1412;
  --account-light-text: #4a1a16;
  --account-light-muted: #7a4a42;
  --account-border: color-mix(in srgb, var(--accent, #ff3d1f) 22%, #e8cfc6);
  --account-accent: var(--accent, #ff3d1f);
  --account-focus: color-mix(in srgb, var(--accent, #ff3d1f) 70%, #fff);
}

.site-scene[data-theme="flayed"] .account-nextgen {
  --account-panel-heading: #f2fbe7;
  --account-panel-text: color-mix(in srgb, #f2fbe7 88%, #afc2b3);
  --account-panel-muted: color-mix(in srgb, #f2fbe7 72%, #6f8877);
  --account-light-heading: #13251a;
  --account-light-text: #17301f;
  --account-light-muted: #456055;
  --account-border: color-mix(in srgb, var(--accent, #83e64a) 22%, #cfe0d4);
  --account-accent: var(--accent, #83e64a);
  --account-focus: color-mix(in srgb, var(--accent, #83e64a) 70%, #fff);
}

/* Compact spacing (~20–25% tighter) */
.account-nextgen .profile-section-head {
  margin-bottom: 16px;
}

.account-nextgen .profile-section-head h2 {
  margin: 0 0 6px;
}

.account-nextgen .profile-hero__layout {
  gap: 18px;
}

.account-nextgen .profile-hero__subtitle {
  margin-bottom: 14px;
}

.account-nextgen .profile-hero-panel {
  gap: 10px;
  padding: 14px 14px 12px;
}

.account-nextgen .profile-overview-grid {
  gap: 6px;
}

.account-nextgen .profile-learning-section--premium {
  padding: 24px 26px;
}

.account-nextgen .profile-learning-grid--premium .profile-learning-card,
.account-nextgen .profile-learning-card {
  min-height: 180px;
  padding: 16px;
  gap: 10px;
}

.account-nextgen .profile-next-step {
  padding: 24px;
}

.account-nextgen .profile-next-step-card {
  gap: 16px;
  padding: 18px;
}

.account-nextgen .profile-next-step-number {
  min-height: 72px;
}

.account-nextgen .favorite-empty-card,
.account-nextgen .profile-monetization-empty,
.account-nextgen .top-error-empty,
.account-nextgen .profile-empty-line {
  min-height: 0;
  padding: 16px 18px;
}

.account-nextgen .profile-stats-dashboard,
.account-nextgen .profile-stats-dashboard--access-only {
  padding: 20px 24px;
}

.account-nextgen .funnel-offer--profile {
  margin-top: 4px;
}

/* Dark panels → light text (defeat theme inheritance) */
.account-nextgen .profile-panel,
.account-nextgen .profile-next-step,
.account-nextgen .profile-hero-panel,
.account-nextgen .favorite-tasks-panel,
.account-nextgen .top-error-numbers-profile,
.account-nextgen .profile-learning-section--premium,
.account-nextgen .profile-stats-dashboard,
.account-nextgen .profile-learning-card,
.account-nextgen .profile-start-screen,
.account-nextgen .profile-pro-analytics-lock {
  color: var(--account-panel-text) !important;
}

.account-nextgen .profile-section-head h2,
.account-nextgen .profile-hero-panel__rank-top strong,
.account-nextgen .profile-next-step-content strong,
.account-nextgen .favorite-empty-card strong,
.account-nextgen .profile-learning-card__title,
.account-nextgen .profile-stats-dashboard__head h2,
.account-nextgen .top-error-number-advice strong {
  color: var(--account-panel-heading) !important;
  -webkit-text-fill-color: var(--account-panel-heading) !important;
}

.account-nextgen .profile-section-head p,
.account-nextgen .profile-hero-panel__label,
.account-nextgen .profile-hero-panel__rank-top em,
.account-nextgen .profile-next-step-content p,
.account-nextgen .favorite-empty-card p,
.account-nextgen .profile-learning-card__text,
.account-nextgen .profile-stats-dashboard__head p,
.account-nextgen .top-error-number-advice p,
.account-nextgen .profile-empty-line,
.account-nextgen .profile-monetization-empty,
.account-nextgen .top-error-empty {
  color: var(--account-panel-muted) !important;
  -webkit-text-fill-color: var(--account-panel-muted) !important;
}

/* Light cards → dark text (never white on light) */
.account-nextgen .profile-overview-stat {
  background: #f7fafc !important;
  border: 1px solid var(--account-border) !important;
  color: var(--account-light-text) !important;
}

.account-nextgen .profile-overview-stat--accent {
  background: color-mix(in srgb, var(--account-accent) 8%, #fff) !important;
  border-color: color-mix(in srgb, var(--account-accent) 28%, var(--account-border)) !important;
}

.account-nextgen .profile-overview-stat span {
  color: var(--account-light-muted) !important;
  -webkit-text-fill-color: var(--account-light-muted) !important;
}

.account-nextgen .profile-overview-stat strong {
  color: var(--account-light-heading) !important;
  -webkit-text-fill-color: var(--account-light-heading) !important;
}

.account-nextgen .profile-overview-stat em {
  color: var(--account-light-muted) !important;
  -webkit-text-fill-color: var(--account-light-muted) !important;
}

.account-nextgen .profile-next-step-tags span,
.account-nextgen .profile-mini-group-card__chip {
  color: var(--account-light-text) !important;
  -webkit-text-fill-color: var(--account-light-text) !important;
  background: #f4f8fb !important;
  border: 1px solid var(--account-border);
}

.account-nextgen .funnel-offer-card {
  color: var(--account-light-text) !important;
}

.account-nextgen .funnel-offer-card__title,
.account-nextgen .funnel-offer-card__label {
  color: var(--account-light-heading) !important;
  -webkit-text-fill-color: var(--account-light-heading) !important;
}

.account-nextgen .funnel-offer-card__text {
  color: var(--account-light-muted) !important;
  -webkit-text-fill-color: var(--account-light-muted) !important;
}

.account-nextgen a:focus-visible,
.account-nextgen button:focus-visible {
  outline: 2px solid var(--account-focus);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  .account-nextgen {
    margin: 18px auto;
    padding: 0 12px;
    gap: 14px;
  }

  .account-nextgen .profile-learning-section--premium,
  .account-nextgen .profile-next-step,
  .account-nextgen .profile-stats-dashboard {
    padding: 18px;
  }

  .account-nextgen .profile-learning-grid--premium .profile-learning-card,
  .account-nextgen .profile-learning-card {
    min-height: 0;
  }
}
