body.profile-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  user-select: text;
  background:
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(37, 211, 102, 0.22), transparent 55%),
    var(--ym-bg-gradient);
}

.profile-header {
  background: linear-gradient(180deg, var(--ym-purple-light), var(--ym-purple) 55%, var(--ym-purple-dark));
  color: white;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(0, 143, 114, 0.35);
}

.profile-header h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.profile-back {
  color: white;
  background: rgba(255, 255, 255, 0.14);
}

.profile-back:hover {
  background: rgba(255, 255, 255, 0.26);
  color: white;
}

html.ym-embedded .profile-back {
  display: none !important;
}

.profile-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 28px;
  -webkit-overflow-scrolling: touch;
}

/* ── WhatsApp Business-style profile (WhatsApp green) ── */

.profile-wa-page .profile-scroll {
  padding-bottom: 32px;
}

.profile-wa-hero {
  position: relative;
  margin-bottom: 8px;
}

.profile-wa-cover {
  position: relative;
  width: 100%;
  height: clamp(140px, 28vw, 200px);
  background:
    linear-gradient(135deg, rgba(0, 168, 132, 0.92) 0%, rgba(37, 211, 102, 0.78) 45%, rgba(0, 143, 114, 0.95) 100%);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.profile-wa-cover-edit {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(17, 27, 33, 0.45);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.profile-wa-cover-edit .yoyo-icon {
  width: 14px;
  height: 14px;
}

.profile-wa-cover-edit:hover {
  background: rgba(17, 27, 33, 0.62);
}

.profile-wa-identity {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 0 16px;
  margin-top: -52px;
}

.profile-wa-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-wa-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--ym-purple-light), var(--ym-purple-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 700;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 16px rgba(0, 143, 114, 0.28);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.profile-wa-avatar:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 143, 114, 0.32);
}

.profile-wa-avatar:focus-visible {
  outline: 2px solid var(--ym-purple);
  outline-offset: 3px;
}

.profile-wa-avatar-edit {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #25d366 0%, #00a884 100%);
  color: #fff;
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 143, 114, 0.3);
}

.profile-wa-avatar-edit .yoyo-icon {
  width: 16px;
  height: 16px;
}

.profile-wa-names {
  flex: 1;
  min-width: 0;
  padding-bottom: 8px;
  padding-top: 56px;
}

.profile-wa-display-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--ym-purple-dark);
  line-height: 1.25;
  margin-bottom: 4px;
  word-break: break-word;
}

.profile-wa-handle-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-wa-handle {
  font-size: 13px;
  font-weight: 600;
  color: var(--ym-purple);
  letter-spacing: 0.02em;
  word-break: break-all;
}

.profile-wa-block {
  margin: 0 0 10px;
}

.profile-wa-section-label {
  padding: 10px 16px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ym-purple);
}

.profile-wa-panel,
.profile-wa-about,
.profile-wa-links {
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid rgba(209, 215, 219, 0.35);
  border-bottom: 1px solid rgba(209, 215, 219, 0.35);
  box-shadow: 0 1px 2px rgba(0, 143, 114, 0.05);
}

.profile-wa-panel {
  padding: 14px 16px 16px;
}

.profile-wa-about {
  padding: 14px 16px 12px;
}

.profile-wa-about-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ym-purple-dark);
  margin-bottom: 8px;
}

.profile-wa-about-input {
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid rgba(209, 215, 219, 0.65);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  color: #2f1b47;
  background: #fff;
  resize: vertical;
}

.profile-wa-about-input:focus {
  outline: none;
  border-color: var(--ym-purple);
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.15);
}

.profile-wa-about-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.profile-wa-about-hint {
  margin: 0;
  flex: 1;
  min-width: 140px;
}

.profile-wa-about-save {
  flex-shrink: 0;
}

.profile-wa-links {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.profile-wa-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(0, 168, 132, 0.08);
  background: transparent;
  text-align: start;
  padding: 14px 16px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-decoration: none;
}

.profile-wa-row:first-child {
  border-top: 0;
}

.profile-wa-row:hover {
  background: rgba(0, 168, 132, 0.05);
}

.profile-wa-row:active {
  background: rgba(0, 168, 132, 0.09);
}

.profile-wa-row-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-wa-row-title {
  font-size: 15px;
  font-weight: 600;
  color: #2f1b47;
}

.profile-wa-row-sub {
  font-size: 12px;
  color: #75658a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-wa-row-chevron {
  flex-shrink: 0;
  color: #8696a0;
  width: 18px;
  height: 18px;
}

.profile-msg {
  padding: 10px 16px;
  border-radius: 0;
  margin-bottom: 0;
  font-size: 12px;
  line-height: 1.35;
}

.profile-msg.ok {
  background: #e8f8e8;
  border-bottom: 1px solid #7bc67b;
  color: #0d5c0d;
}

.profile-msg.err {
  background: #fdeaea;
  border-bottom: 1px solid #e08888;
  color: #a01010;
}

.profile-hint {
  font-size: 11px;
  color: #666;
  margin-top: 4px;
  line-height: 1.4;
}

.profile-meta-line {
  font-size: 12px;
  color: #4a3a5c;
  line-height: 1.4;
  margin-top: 6px;
}

.profile-actions {
  margin-bottom: 10px;
}

.profile-chip-btn {
  min-height: 24px;
  padding: 2px 10px;
  font-size: 10px;
}

.profile-wa-panel .ym-btn {
  margin-top: 4px;
}

.profile-wa-panel .ym-field {
  margin-bottom: 12px;
}

.profile-wa-panel .ym-field input,
.profile-wa-panel .ym-field select {
  padding: 7px 9px;
  font-size: 12px;
  border-radius: 6px;
  border-color: rgba(209, 215, 219, 0.7);
  background: #fff;
}

.profile-wa-panel .ym-field input:focus,
.profile-wa-panel .ym-field select:focus {
  outline: none;
  border-color: var(--ym-purple);
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.15);
}

.profile-wa-panel input[readonly] {
  background: #f0f2f5;
  color: #444;
}

.profile-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.12s ease;
}

.profile-toggle:hover {
  background: rgba(240, 242, 245, 0.55);
}

.profile-toggle input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--ym-purple);
}

.profile-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(17, 27, 33, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.profile-lightbox.hidden {
  display: none !important;
}

.profile-lightbox img {
  max-width: min(92vw, 520px);
  max-height: 84vh;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  object-fit: contain;
  background: #111b21;
}

.profile-lightbox-close {
  position: absolute;
  top: 14px;
  inset-inline-end: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.profile-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Legacy layout still used by privacy-settings.html */
.profile-content {
  width: min(640px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(209, 215, 219, 0.55);
  border-radius: 10px;
  padding: 16px 16px 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0, 143, 114, 0.06);
}

.profile-content .profile-card {
  margin-bottom: 0;
}

.profile-card h2,
.profile-card h2.yoyo-section-heading {
  font-size: 13px;
  color: var(--ym-purple);
  margin-bottom: 10px;
  font-weight: 700;
}

.profile-hero {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding-top: 18px;
  padding-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(240, 242, 245, 0.95) 0%, rgba(255, 255, 255, 0.96) 48%, rgba(244, 238, 252, 0.98) 100%);
}

.profile-avatar-block {
  position: relative;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.profile-avatar {
  width: 104px;
  height: 104px;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--ym-purple-light), var(--ym-purple-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 700;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 14px rgba(0, 143, 114, 0.22);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.profile-avatar:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 143, 114, 0.28);
}

.profile-avatar:focus-visible {
  outline: 2px solid var(--ym-purple);
  outline-offset: 3px;
}

.profile-avatar-change {
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, #25d366 0%, #00a884 50%, #00a884 100%);
  color: #fff;
  border: 1px solid var(--ym-purple-dark);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 143, 114, 0.25);
}

.profile-avatar-change .yoyo-icon {
  width: 12px;
  height: 12px;
}

.profile-avatar-change:hover {
  filter: brightness(1.06);
}

.profile-hero-meta {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.profile-hero-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--ym-purple-dark);
  line-height: 1.25;
  margin-bottom: 6px;
  word-break: break-word;
}

.profile-handle-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.profile-handle {
  font-size: 13px;
  font-weight: 600;
  color: var(--ym-purple);
  letter-spacing: 0.02em;
  word-break: break-all;
}

.profile-status-line {
  font-size: 12px;
  color: #4a3a5c;
  line-height: 1.4;
  margin-top: 4px;
}

.profile-status-label {
  color: #6b5a7e;
  font-weight: 600;
}

.profile-avatar-hint {
  margin-top: 10px;
}

.profile-link-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.profile-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 28px;
}

.profile-card .ym-btn {
  margin-top: 4px;
}

.profile-card .ym-field {
  margin-bottom: 12px;
}

.profile-card .ym-field input,
.profile-card .ym-field select {
  padding: 7px 9px;
  font-size: 12px;
  border-radius: 6px;
  border-color: rgba(209, 215, 219, 0.7);
  background: #fff;
}

.profile-card .ym-field input:focus,
.profile-card .ym-field select:focus {
  outline: none;
  border-color: var(--ym-purple);
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.15);
}

.profile-card input[readonly] {
  background: #f0f2f5;
  color: #444;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 520px) {
  .profile-wa-identity {
    flex-direction: column;
    align-items: flex-start;
    margin-top: -48px;
  }

  .profile-wa-names {
    padding-top: 0;
    width: 100%;
  }

  .profile-wa-avatar {
    width: 96px;
    height: 96px;
    font-size: 36px;
  }

  .profile-wa-about-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-wa-about-save {
    width: 100%;
  }

  .profile-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 22px;
  }

  .profile-hero-meta {
    width: 100%;
  }

  .profile-handle-row {
    justify-content: center;
  }

  .profile-link-stack {
    flex-direction: column;
  }

  .profile-link-btn {
    width: 100%;
  }

  .profile-avatar {
    width: 112px;
    height: 112px;
  }
}

/* Dark mode — WhatsApp surfaces */
html.ym-theme-dark body.profile-page {
  background: #111b21;
  color: #e9edef;
  color-scheme: dark;
}
html.ym-theme-dark .profile-scroll,
html.ym-theme-dark .profile-wa-page .profile-scroll {
  background: #111b21;
}
html.ym-theme-dark .profile-wa-card,
html.ym-theme-dark .profile-section,
html.ym-theme-dark .profile-wa-section,
html.ym-theme-dark .ym-field input,
html.ym-theme-dark .ym-field select,
html.ym-theme-dark .ym-field textarea {
  background: #202c33;
  color: #e9edef;
  border-color: #2a3942;
}
html.ym-theme-dark .profile-wa-section-title,
html.ym-theme-dark .profile-section-title,
html.ym-theme-dark h2,
html.ym-theme-dark h3,
html.ym-theme-dark label {
  color: #e9edef;
}
html.ym-theme-dark .profile-wa-panel,
html.ym-theme-dark .profile-wa-about,
html.ym-theme-dark .profile-wa-links,
html.ym-theme-dark .profile-card {
  background: #202c33;
  border-top-color: #222d34;
  border-bottom-color: #222d34;
  box-shadow: none;
}
html.ym-theme-dark .profile-wa-about-input,
html.ym-theme-dark .profile-wa-panel .ym-field input,
html.ym-theme-dark .profile-wa-panel .ym-field select,
html.ym-theme-dark .profile-wa-panel input[readonly] {
  background: #111b21;
  color: #e9edef;
  border-color: #2a3942;
}
html.ym-theme-dark .profile-wa-display-name,
html.ym-theme-dark .profile-wa-about-label,
html.ym-theme-dark .profile-wa-row-title,
html.ym-theme-dark .profile-card h2 {
  color: #e9edef;
}
html.ym-theme-dark .profile-wa-section-label {
  color: #00a884;
}
html.ym-theme-dark .profile-wa-handle,
html.ym-theme-dark .profile-wa-row-sub,
html.ym-theme-dark .profile-hint,
html.ym-theme-dark .profile-wa-about-hint {
  color: #8696a0;
}
html.ym-theme-dark .profile-wa-row:hover {
  background: rgba(0, 168, 132, 0.08);
}
