/* X-style profile layout polish */
.x-center-head:has(+ .x-profile-hero),
.x-profile-topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.x-profile-topbar {
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
}

.x-profile-topbar .x-profile-topbar-main {
  flex: 1;
  min-width: 0;
}

.x-profile-topbar-main h3.x-identity-line {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.yal-profile-restrict-btn {
  opacity: 0.55;
}

.yal-profile-restrict-btn.is-active {
  opacity: 1;
  color: #e7e9ea;
}

.x-profile-hero {
  padding-bottom: 0.25rem;
}

.x-profile-banner {
  background: linear-gradient(180deg, #3b3f45 0%, #2a2d31 100%);
  background-size: cover;
  background-position: center;
  height: 200px;
}

.x-profile-banner.x-profile-banner-has-image {
  background-color: #2a2d31;
}

.x-profile-meta {
  margin-top: -56px;
  padding: 0 1rem 0.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
}

.x-profile-meta.yal-profile-meta-other {
  align-items: flex-end;
}

.x-profile-avatar {
  width: 134px;
  height: 134px;
  border-width: 4px;
}

.yal-profile-actions {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  padding-bottom: 0.35rem;
  min-width: 0;
}

.yal-profile-actions-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.yal-profile-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #536471;
  background: transparent;
  color: #e7e9ea;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.yal-profile-icon-btn svg {
  width: 18px;
  height: 18px;
}

.yal-profile-icon-btn:hover:not(:disabled) {
  background: rgba(239, 243, 244, 0.1);
}

.yal-profile-icon-btn.is-disabled,
.yal-profile-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.yal-profile-icon-btn.is-restricted {
  opacity: 0.72;
}

.yal-profile-icon-btn.is-restricted:hover {
  background: rgba(239, 243, 244, 0.1);
}

.yal-profile-follow-btn {
  border: 1px solid #eff3f4;
  background: #eff3f4;
  color: #0f1419;
  border-radius: 999px;
  padding: 0.45rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 700;
  min-width: 88px;
  cursor: pointer;
}

.yal-profile-follow-btn.is-following {
  background: transparent;
  color: #e7e9ea;
  border-color: #536471;
}

.yal-profile-follow-btn:hover {
  filter: brightness(0.95);
}

.yal-profile-more-menu {
  position: fixed;
  z-index: 200;
  min-width: 220px;
  background: #000;
  border: 1px solid #2f3336;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.yal-profile-more-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 0;
  padding: 0.85rem 1rem;
  background: transparent;
  color: #e7e9ea;
  font-weight: 600;
}

.yal-profile-more-menu button:hover {
  background: rgba(239, 243, 244, 0.08);
}

.yal-profile-followed-by {
  padding: 0 1rem 0.75rem;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.35;
}

.x-profile-action-btn {
  border: 1px solid #eff3f4;
  color: #eff3f4;
  background: transparent;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  min-width: 120px;
}

.x-profile-action-btn:hover {
  background: rgba(239, 243, 244, 0.1);
}

.x-profile-action-btn.x-profile-following {
  border-color: #536471;
  color: var(--text);
}

.x-profile-hero .x-identity-line {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
  padding: 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
}

.x-profile-hero > h3.x-identity-line {
  margin-block: 0;
  margin-top: 12px;
}

.x-profile-hero .x-identity-handle {
  margin: 0;
  padding: 0 1rem;
  line-height: 1.15;
  font-size: 0.9375rem;
  color: var(--muted);
}

.x-profile-hero > h3.x-identity-line + .x-identity-handle {
  margin-top: 1px;
  margin-bottom: 0.5rem;
}

.x-profile-hero .x-identity-line .x-check {
  margin-inline-start: 0.15em;
}

.x-profile-hero > p:not(.x-profile-meta-line):not(.x-identity-handle) {
  margin-bottom: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.x-profile-meta-line {
  margin-bottom: 0.75rem;
  gap: 0.65rem 1rem;
}

.x-profile-meta-line svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.x-profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 0 1rem;
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.x-profile-stats strong {
  color: var(--text);
  font-weight: 700;
}

.x-profile-communities {
  padding: 0 1rem 1rem;
}

.x-profile-communities h4 {
  margin-bottom: 0.5rem;
}

.x-community-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.x-community-flag {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1d9bf0 40%, #20bf55 100%);
  flex-shrink: 0;
}

.x-profile-tabs {
  margin-top: 0;
  border-top: 1px solid var(--border);
}

.x-profile-tabs button {
  padding: 0.95rem 0.25rem;
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}

.x-profile-tabs button.active {
  color: var(--text);
  border-bottom-color: var(--blue);
}

/* Verified badges styled in yal-checkmarks.css */
.x-identity-line .x-check,
.x-profile-topbar .x-check,
.x-post-header .x-check {
  flex-shrink: 0;
}
