/* Profile UI repair v42: readable account page, balanced cards, mobile-safe layout. */
body:not(.admin-view) .profile-v2-page {
  gap: 22px;
}

body:not(.admin-view) .profile-v2-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(16px, 3vw, 28px);
  align-items: center;
  padding: clamp(20px, 3.8vw, 34px);
  border-color: color-mix(in srgb, var(--frontend-accent) 22%, var(--frontend-line));
  background:
    radial-gradient(circle at 8% 10%, color-mix(in srgb, var(--frontend-gold) 23%, transparent), transparent 18rem),
    radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--frontend-accent) 14%, transparent), transparent 22rem),
    linear-gradient(135deg, color-mix(in srgb, var(--frontend-surface) 92%, var(--frontend-surface-strong)), var(--frontend-surface));
  overflow: hidden;
}

body:not(.admin-view) .profile-v2-avatar {
  display: grid;
  width: clamp(70px, 10vw, 96px);
  height: clamp(70px, 10vw, 96px);
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--frontend-accent) 34%, var(--frontend-line));
  border-radius: 28px;
  background: linear-gradient(135deg, var(--frontend-accent), var(--frontend-accent-strong));
  color: #fff;
  box-shadow: 0 20px 40px color-mix(in srgb, var(--frontend-accent) 22%, transparent);
  font-size: clamp(1.7rem, 4vw, 2.55rem);
  font-weight: 1000;
  letter-spacing: -.04em;
}

body:not(.admin-view) .profile-v2-copy {
  min-width: 0;
}

body:not(.admin-view) .profile-v2-copy h1 {
  margin: 6px 0 5px;
  overflow-wrap: anywhere;
  color: var(--frontend-text);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
}

body:not(.admin-view) .profile-v2-copy p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--frontend-muted);
  font-weight: 800;
}

body:not(.admin-view) .profile-v2-tags,
body:not(.admin-view) .profile-v2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body:not(.admin-view) .profile-v2-tags {
  margin-top: 14px;
}

body:not(.admin-view) .profile-v2-tags span {
  border: 1px solid color-mix(in srgb, var(--frontend-accent) 20%, var(--frontend-line));
  border-radius: 999px;
  padding: 8px 11px;
  background: color-mix(in srgb, var(--frontend-surface-strong) 88%, var(--frontend-accent));
  color: color-mix(in srgb, var(--frontend-text) 88%, var(--frontend-accent));
  font-size: .82rem;
  font-weight: 1000;
}

body:not(.admin-view) .profile-v2-actions {
  justify-content: flex-end;
  max-width: 310px;
}

body:not(.admin-view) .profile-v2-actions .btn {
  min-height: 42px;
}

body:not(.admin-view) .profile-v2-actions .btn.danger {
  border-color: color-mix(in srgb, #c62835 35%, var(--frontend-line));
  background: color-mix(in srgb, #c62835 9%, var(--frontend-surface-strong));
  color: #b71c2a;
}

body.dark:not(.admin-view) .profile-v2-actions .btn.danger {
  color: #ffb4bd;
}

body:not(.admin-view) .profile-v2-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

body:not(.admin-view) .profile-v2-metric,
body:not(.admin-view) .profile-v2-panel {
  border: 1px solid var(--frontend-line);
  background: color-mix(in srgb, var(--frontend-surface) 96%, var(--frontend-surface-strong));
  box-shadow: var(--frontend-shadow);
}

body:not(.admin-view) .profile-v2-metric {
  border-radius: 20px;
  padding: 16px;
}

body:not(.admin-view) .profile-v2-metric span,
body:not(.admin-view) .profile-v2-metric small {
  display: block;
  color: var(--frontend-muted);
  font-weight: 800;
}

body:not(.admin-view) .profile-v2-metric strong {
  display: block;
  margin: 5px 0 2px;
  color: var(--frontend-text);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

body:not(.admin-view) .profile-v2-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 18px;
  align-items: start;
}

body:not(.admin-view) .profile-v2-main,
body:not(.admin-view) .profile-v2-side,
body:not(.admin-view) .profile-progress-list,
body:not(.admin-view) .profile-v2-feed {
  display: grid;
  gap: 14px;
}

body:not(.admin-view) .profile-v2-duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body:not(.admin-view) .profile-v2-form {
  display: grid;
  align-content: start;
  gap: 11px;
}

body:not(.admin-view) .profile-v2-form label {
  color: var(--frontend-text);
  font-size: .9rem;
  font-weight: 1000;
}

body:not(.admin-view) .profile-v2-form input {
  min-height: 46px;
  border-radius: 14px;
  font-weight: 800;
}

body:not(.admin-view) .profile-progress-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--frontend-line) 82%, var(--frontend-accent));
  border-radius: 18px;
  padding: 14px 14px 18px;
  background: var(--frontend-surface-strong);
  color: var(--frontend-text);
  text-decoration: none;
}

body:not(.admin-view) .profile-progress-item:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--frontend-accent) 34%, var(--frontend-line));
}

body:not(.admin-view) .profile-progress-item strong,
body:not(.admin-view) .profile-progress-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:not(.admin-view) .profile-progress-item strong {
  color: var(--frontend-text);
  font-weight: 1000;
}

body:not(.admin-view) .profile-progress-item small {
  margin-top: 4px;
  color: var(--frontend-muted);
  font-weight: 750;
}

body:not(.admin-view) .profile-progress-item > span {
  color: var(--frontend-accent);
  font-weight: 1000;
}

body:not(.admin-view) .profile-progress-item > i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 5px;
  min-width: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--frontend-accent), var(--frontend-gold));
}

body:not(.admin-view) .profile-v2-summary-card .soft-link {
  margin-top: 12px;
}

body:not(.admin-view) .profile-v2-stat-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

body:not(.admin-view) .profile-v2-stat-list div {
  border: 1px solid var(--frontend-line);
  border-radius: 16px;
  padding: 12px;
  background: color-mix(in srgb, var(--frontend-soft) 54%, var(--frontend-surface));
}

body:not(.admin-view) .profile-v2-stat-list span,
body:not(.admin-view) .profile-v2-stat-list strong {
  display: block;
}

body:not(.admin-view) .profile-v2-stat-list span {
  color: var(--frontend-muted);
  font-size: .78rem;
  font-weight: 900;
}

body:not(.admin-view) .profile-v2-stat-list strong {
  color: var(--frontend-text);
  font-size: 1.35rem;
  line-height: 1.05;
}

body:not(.admin-view) .profile-v2-feed .notification-item,
body:not(.admin-view) .profile-v2-feed .payment-history-item {
  border-color: var(--frontend-line);
  background: var(--frontend-surface-strong);
  color: var(--frontend-text);
}

@media (max-width: 980px) {
  body:not(.admin-view) .profile-v2-hero,
  body:not(.admin-view) .profile-v2-layout,
  body:not(.admin-view) .profile-v2-duo {
    grid-template-columns: 1fr;
  }

  body:not(.admin-view) .profile-v2-actions {
    justify-content: flex-start;
    max-width: none;
  }

  body:not(.admin-view) .profile-v2-actions .btn {
    flex: 1 1 160px;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  body:not(.admin-view) .profile-v2-metrics,
  body:not(.admin-view) .profile-v2-stat-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.admin-view) .profile-v2-hero {
    padding: 18px;
  }

  body:not(.admin-view) .profile-v2-avatar {
    border-radius: 22px;
  }
}

@media (max-width: 480px) {
  body:not(.admin-view) .profile-v2-metrics,
  body:not(.admin-view) .profile-v2-stat-list,
  body:not(.admin-view) .profile-progress-item {
    grid-template-columns: 1fr;
  }

  body:not(.admin-view) .profile-v2-actions .btn {
    width: 100%;
    flex-basis: 100%;
  }
}
