.profile-page {
  background: linear-gradient(180deg, #F8FAFC 0%, #EEF2FF 100%);
  padding-bottom: 120px;
}

.profile-page .container {
  width: min(1080px, 92%);
}

.profile-hero {
  padding: 80px 0 48px;
}

.section-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
}

.profile-hero h1 {
  font-size: clamp(2.2rem, 3.8vw, 3.4rem);
  margin: 16px 0 12px;
}

.profile-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 560px;
}

.profile-shell {
  padding: 32px 0 40px;
  border-top: 1px solid #E2E8F0;
}

.profile-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
}

.profile-sidebar {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  padding: 22px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
}

.profile-avatar--readonly {
  cursor: default;
}

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

.profile-initial {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.profile-avatar-dot {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #22C55E;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.profile-avatar:hover .profile-avatar-overlay,
.profile-avatar:focus-visible .profile-avatar-overlay {
  opacity: 1;
}

#profileAvatarInput {
  display: none;
}

.profile-name {
  font-size: 1.2rem;
  font-weight: 700;
}

.profile-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.profile-meta {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}

.profile-meta span {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.profile-meta strong {
  display: block;
  margin-top: 4px;
  font-weight: 700;
}

.profile-note {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.profile-main {
  display: grid;
  gap: 20px;
}

.profile-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  padding: 22px;
  display: grid;
  gap: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.card-header h2 {
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.card-header p {
  color: var(--text-secondary);
}

.card-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-tertiary);
  font-size: 0.8rem;
  font-weight: 600;
}

.activity-feed {
  display: grid;
  gap: 14px;
}

.activity-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
  align-items: start;
}

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.5);
  margin-top: 6px;
}

.activity-item strong {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.activity-item p {
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.activity-item span {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.subscription-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.subscription-item {
  padding: 14px;
  border-radius: 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}

.subscription-item span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.subscription-item strong {
  display: block;
  margin-top: 8px;
  font-weight: 700;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.community-item {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  display: grid;
  gap: 6px;
}

.community-item strong {
  font-weight: 600;
}

.community-item span {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

@media (max-width: 1024px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
  .profile-sidebar {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: center;
  }
  .profile-avatar {
    margin-right: auto;
  }
}

@media (max-width: 640px) {
  .profile-hero {
    padding: 64px 0 36px;
  }
  .profile-hero h1 {
    font-size: 2rem;
  }
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
