/**
 * DZD Public Profile — production styles aligned to design system + locked 8.5.1 preview.
 */

.dzd-public-profile-page {
  max-width: var(--dzd-layout-max, 1310px);
  margin: 0 auto;
  padding: var(--dzd-space-5) var(--dzd-space-4) var(--dzd-space-8);
}

@media (min-width: 768px) {
  .dzd-public-profile-page {
    padding-inline: var(--dzd-layout-gutter, 24px);
  }
}

.dzd-profile {
  display: grid;
  gap: var(--dzd-space-5);
  min-width: 0;
}

.dzd-profile__hero {
  position: relative;
  padding: 24px;
  border-radius: 24px;
  background: var(--dzd-color-surface);
  border: 1px solid var(--dzd-color-border);
  box-shadow: var(--dzd-shadow-soft);
  overflow: visible;
  isolation: isolate;
}

.dzd-profile__hero--personal::before,
.dzd-profile__hero--business::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 220px;
  border-radius: 24px 24px 0 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 62%, rgba(255, 255, 255, 0.22)),
    linear-gradient(135deg, rgba(94, 67, 214, 0.78), rgba(123, 97, 255, 0.58) 48%, rgba(196, 186, 255, 0.42));
}

.dzd-profile__hero--business {
  border-color: rgba(94, 67, 214, 0.28);
  box-shadow: var(--dzd-shadow-elevated);
}

.dzd-profile__hero--business::before {
  height: 236px;
  background:
    linear-gradient(180deg, transparent 60%, rgba(255, 255, 255, 0.18)),
    linear-gradient(135deg, rgba(94, 67, 214, 0.96), rgba(74, 52, 180, 0.9) 42%, rgba(143, 189, 255, 0.55));
}

.dzd-profile__cover {
  position: absolute;
  inset: 0 0 auto;
  height: 220px;
  border-radius: 24px 24px 0 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.dzd-profile__cover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.dzd-profile__hero-overlay {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 240px);
  grid-template-areas:
    "main aside"
    "toolbar toolbar";
  gap: var(--dzd-space-4);
  align-items: end;
  min-width: 0;
}

.dzd-profile__hero-main { grid-area: main; min-width: 0; }
.dzd-profile__aside { grid-area: aside; min-width: 0; }
.dzd-profile__toolbar {
  grid-area: toolbar;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-self: end;
  justify-content: end;
  gap: 4px;
  position: relative;
  z-index: 50;
  overflow: visible;
  max-width: 100%;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--dzd-color-border, #d8dae3);
  box-shadow: var(--dzd-shadow-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.dzd-profile__quick-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 55;
  min-width: 0;
}
.dzd-profile__toolbar .dzd-profile-action-bar {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}

.dzd-profile__identity {
  display: flex;
  flex-direction: row;
  gap: var(--dzd-space-4);
  align-items: flex-end;
  /* Slightly more offset so the larger avatar still straddles the cover edge. */
  margin-top: 72px;
}

.dzd-profile__avatar {
  position: relative;
  width: 128px;
  height: 128px;
  border-radius: 32px;
  border: 4px solid rgba(255, 255, 255, 0.96);
  /* Solid brand fill when initials show through (no uploaded photo). */
  background: var(--dzd-color-accent, #5e43d6);
  box-shadow: 0 14px 38px rgba(35, 22, 94, 0.18);
  overflow: hidden;
  flex: 0 0 auto;
  display: grid;
  place-items: stretch;
  box-sizing: border-box;
  padding: 0;
  color: var(--dzd-color-on-accent, #ffffff);
}

.dzd-profile__avatar--round { border-radius: 50%; }

.dzd-profile__avatar .dzd-avatar {
  --dzd-avatar-size: 128px;
  position: relative;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  flex: none;
  border-radius: inherit;
  overflow: hidden;
  place-items: stretch;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  background: var(--dzd-color-accent, #5e43d6);
  color: var(--dzd-color-on-accent, #ffffff);
}

.dzd-profile__avatar:not(.dzd-profile__avatar--round) .dzd-avatar,
.dzd-profile__avatar:not(.dzd-profile__avatar--round) .dzd-avatar.dzd-avatar--business {
  /* Store: outer frame owns the radius; inner fills edge-to-edge. */
  border-radius: 0;
  overflow: hidden;
}

/* Photo avatars: no fill needed under the image. Initials keep solid purple. */
.dzd-profile__avatar:not(.dzd-profile__avatar--round) .dzd-avatar:has(.dzd-avatar__img),
.dzd-profile__avatar:not(.dzd-profile__avatar--round) .dzd-avatar.dzd-avatar--business:has(.dzd-avatar__img) {
  background: transparent;
}

.dzd-profile__avatar .dzd-avatar--initials,
.dzd-profile__avatar .dzd-avatar.dzd-avatar--initials {
  background: var(--dzd-color-accent, #5e43d6);
  color: var(--dzd-color-on-accent, #ffffff);
}

.dzd-profile__avatar img,
.dzd-profile__avatar .dzd-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: inherit;
}

.dzd-profile__avatar:not(.dzd-profile__avatar--round) img,
.dzd-profile__avatar:not(.dzd-profile__avatar--round) .dzd-avatar__img {
  /* Defeat theme/global img { max-width:100%; height:auto } letterboxing. */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  object-fit: cover;
  object-position: center;
}

.dzd-profile__avatar .dzd-avatar__initials {
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: inherit;
}

.dzd-profile__headline { min-width: 0; color: #fff; }

.dzd-profile__eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.dzd-profile__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: clamp(26px, 2.8vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  /* Beat theme h1 { color: text } — name sits on the dark cover. */
  color: #fff;
}

.dzd-profile__last-active {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.dzd-profile__verify-slot {
  display: inline-block;
  width: 64px;
  height: 26px;
  border-radius: var(--dzd-radius-pill);
  border: 1.5px dashed rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
}

.dzd-profile__badge--premium {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: var(--dzd-radius-pill);
  background: rgba(255, 255, 255, 0.95);
  color: var(--dzd-color-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dzd-profile__identity-panel {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  width: max-content;
  max-width: 100%;
  border-radius: 16px;
  background: rgba(31, 26, 61, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.dzd-profile__status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dzd-profile__status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: var(--dzd-radius-pill);
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.dzd-profile__status-badge--open {
  background: rgba(18, 140, 92, 0.22);
  border-color: rgba(110, 241, 188, 0.28);
  color: #d7fff0;
}

.dzd-profile__status-badge--closed {
  background: rgba(185, 28, 28, 0.22);
  border-color: rgba(252, 165, 165, 0.35);
  color: #ffe4e6;
}

.dzd-profile__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.94);
}

.dzd-profile__meta > li {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  line-height: 1.2;
}

.dzd-profile__meta li + li::before {
  content: "•";
  display: inline-flex;
  align-items: center;
  margin: 0 10px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1;
}

.dzd-profile__social-counters {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border-radius: var(--dzd-radius-pill);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  pointer-events: none;
  user-select: none;
}

.dzd-profile__social-counters--owner {
  pointer-events: auto;
  user-select: none;
}

.dzd-profile__social-item {
  color: #fff;
  font-size: 12px;
}

.dzd-profile__social-item strong {
  font-size: 15px;
  font-weight: 800;
}

button.dzd-profile__social-item--action {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  line-height: inherit;
  text-align: inherit;
}

button.dzd-profile__social-item--action:hover,
button.dzd-profile__social-item--action:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button.dzd-profile__social-item--action:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
  border-radius: 6px;
}

.dzd-profile__social-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.28);
}

/* —— Owner Followers / Following list modal —— */
html.dzd-follow-list-modal-open,
html.dzd-follow-list-modal-open body {
  overflow: hidden;
}

.dzd-follow-list-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.dzd-follow-list-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 19, 34, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.dzd-follow-list-modal__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 440px);
  max-height: min(88vh, 640px);
  padding: 0;
  background: var(--dzd-color-surface, #fff);
  border: 1px solid var(--dzd-color-border, #e6e8ef);
  border-radius: var(--dzd-radius-xl, 20px);
  box-shadow: var(--dzd-shadow-hover, 0 18px 48px rgba(17, 19, 34, 0.18));
  overflow: hidden;
}

.dzd-follow-list-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--dzd-color-border, #e6e8ef);
}

.dzd-follow-list-modal__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--dzd-color-text, #111322);
  line-height: 1.3;
}

.dzd-follow-list-modal__close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin: -4px -4px 0 0;
  border: 0;
  border-radius: var(--dzd-radius-sm, 10px);
  background: transparent;
  color: var(--dzd-color-text, #111322);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.dzd-follow-list-modal__close:hover,
.dzd-follow-list-modal__close:focus-visible {
  background: var(--dzd-color-surface-panel, #f8f8fb);
}

.dzd-follow-list-modal__list {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px 8px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(17, 19, 34, 0.28) transparent;
}

.dzd-follow-list-modal__list::-webkit-scrollbar {
  width: 8px;
}

.dzd-follow-list-modal__list::-webkit-scrollbar-thumb {
  background: rgba(17, 19, 34, 0.22);
  border-radius: 999px;
}

.dzd-follow-list-modal__empty,
.dzd-follow-list-modal__status {
  margin: 28px 12px;
  text-align: center;
  color: var(--dzd-color-text-muted, #6b7280);
  font-size: 14px;
  font-weight: 600;
}

.dzd-follow-list-modal__status {
  margin: 10px 12px 4px;
  font-weight: 550;
}

.dzd-follow-list-modal__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 6px 6px;
  border-radius: var(--dzd-radius-lg, 16px);
}

.dzd-follow-list-modal__user {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 6px;
  border-radius: var(--dzd-radius-lg, 16px);
  text-decoration: none;
  color: inherit;
}

.dzd-follow-list-modal__user:hover,
.dzd-follow-list-modal__user:focus-visible {
  background: var(--dzd-color-surface-panel, #f8f8fb);
  outline: none;
}

.dzd-follow-list-modal__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--dzd-color-surface-panel, #f8f8fb);
  border: 1px solid var(--dzd-color-border, #e6e8ef);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 750;
  color: var(--dzd-color-text-muted, #6b7280);
  overflow: hidden;
  flex: 0 0 auto;
}

.dzd-follow-list-modal__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dzd-follow-list-modal__meta {
  min-width: 0;
}

.dzd-follow-list-modal__name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--dzd-color-text, #111322);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dzd-follow-list-modal__username {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--dzd-color-text-muted, #6b7280);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dzd-follow-list-modal__follow {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: var(--dzd-radius-pill, 999px);
  border: 1px solid var(--dzd-color-border, #e6e8ef);
  background: #fff;
  color: var(--dzd-color-text, #111322);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.dzd-follow-list-modal__follow.is-active {
  background: var(--dzd-color-accent-soft, rgba(94, 67, 214, 0.08));
  border-color: var(--dzd-color-accent-border, rgba(94, 67, 214, 0.28));
  color: var(--dzd-color-accent, #5e43d6);
}

.dzd-follow-list-modal__follow:disabled {
  opacity: 0.65;
  cursor: wait;
}

@media (max-width: 767px) {
  .dzd-follow-list-modal {
    padding: 12px;
  }

  .dzd-follow-list-modal__panel {
    width: min(100%, calc(100vw - 24px));
    max-height: min(90vh, 680px);
  }
}

.dzd-profile__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dzd-profile__stat-card {
  padding: 14px;
  border-radius: var(--dzd-radius-lg);
  background: rgba(31, 26, 61, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 8px 24px rgba(31, 26, 61, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.dzd-profile__stat-value {
  display: block;
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.dzd-profile__stat-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
}

/* Action bar */
.dzd-profile-action-bar {
  position: relative;
  z-index: 50;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: 4px;
  max-width: 100%;
}

.dzd-profile-action-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(94, 67, 214, 0.16);
  background: #fff;
  color: var(--dzd-color-text, #111322);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.dzd-profile-action-bar__btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.dzd-profile-action-bar__btn--primary {
  background: #5e43d6;
  color: #fff;
  border-color: transparent;
}

.dzd-profile-action-bar__more { position: relative; z-index: 60; }
.dzd-profile-action-bar__more[open] { z-index: 80; }

.dzd-profile-action-bar__more > summary {
  list-style: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(94, 67, 214, 0.16);
  background: #fff;
  color: var(--dzd-color-text, #111322);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dzd-profile-action-bar__more > summary:hover,
.dzd-profile-action-bar__more[open] > summary {
  border-color: rgba(94, 67, 214, 0.35);
  background: rgba(94, 67, 214, 0.06);
  color: #5e43d6;
}

.dzd-profile-action-bar__more > summary::-webkit-details-marker { display: none; }

.dzd-profile-action-bar__menu {
  position: absolute;
  bottom: calc(100% + 8px);
  inset-inline-end: 0;
  inset-inline-start: auto;
  z-index: 100;
  min-width: 176px;
  max-width: min(220px, calc(100vw - 16px));
  padding: 6px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--dzd-color-border, #d8dae3);
  box-shadow: var(--dzd-shadow-elevated, 0 12px 32px rgba(17, 19, 34, 0.14));
  transform-origin: bottom inline-end;
}

.dzd-profile-action-bar__more[open] .dzd-profile-action-bar__menu {
  animation: dzd-profile-menu-in 160ms ease;
}

@keyframes dzd-profile-menu-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dzd-profile-action-bar__menu-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--dzd-color-text, #111322);
  font-size: 13px;
  font-weight: 600;
  text-align: start;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.dzd-profile-action-bar__menu-item:hover,
.dzd-profile-action-bar__menu-item:focus-visible {
  background: rgba(94, 67, 214, 0.08);
  color: #5e43d6;
  outline: none;
}

.dzd-profile__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 260px);
  gap: var(--dzd-space-5);
  align-items: start;
  min-width: 0;
}

.dzd-profile__main { display: grid; gap: var(--dzd-space-4); min-width: 0; }

.dzd-profile__section {
  padding: 18px;
  border-radius: 22px;
  background: var(--dzd-color-surface);
  border: 1px solid var(--dzd-color-border);
  box-shadow: var(--dzd-shadow-soft);
}

.dzd-profile--business .dzd-profile__section {
  border-color: rgba(94, 67, 214, 0.16);
  box-shadow: var(--dzd-shadow-elevated);
}

.dzd-profile__section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.dzd-profile__section-title {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.dzd-profile__listing-browser {
  display: grid;
  gap: 14px;
}

.dzd-profile__listing-toolbar {
  display: grid;
  gap: 12px;
}

.dzd-profile__listing-search input,
.dzd-profile__listing-filters select {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid var(--dzd-color-border);
  background: var(--dzd-color-surface);
  color: var(--dzd-color-text);
  font: inherit;
  font-size: 13px;
  box-shadow: var(--dzd-shadow-input);
}

.dzd-profile__listing-search input {
  padding: 0 14px;
}

.dzd-profile__listing-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dzd-profile__listing-filters label {
  display: grid;
  gap: 6px;
}

.dzd-profile__listing-filters span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dzd-color-text-subtle);
}

.dzd-profile__listing-filters select {
  padding: 0 38px 0 12px;
}

.dzd-profile__listing-results {
  margin: 0;
  color: var(--dzd-color-text-muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.dzd-profile__listing-empty[hidden] {
  display: none !important;
}

.dzd-profile__copy {
  margin: 0;
  color: var(--dzd-color-text-muted);
  line-height: var(--dzd-lh-body, 1.6);
  font-size: var(--dzd-fs-base, 16px);
}

/*
 * Profile listings reuse the canonical .dzd-home-card (homepage-engine.css).
 * Scope tokens + grid here; do not invent a second card language.
 */
.dzd-profile-home-cards {
  --hp-accent: var(--dzd-color-accent, #5e43d6);
  --hp-text: var(--dzd-color-text, #111322);
  --hp-muted: var(--dzd-color-text-muted, #5b5f73);
  --hp-muted-strong: var(--dzd-color-text-muted-strong, #5b5f73);
  --hp-border: var(--dzd-color-border, #d8dae3);
  --hp-surface: var(--dzd-color-surface, #ffffff);
  --hp-tint: var(--dzd-color-surface-tint, #f6f7fa);
  --hp-wash: var(--dzd-color-page, #eef0f5);
  --hp-radius: var(--dzd-radius-lg, 20px);
  --hp-radius-sm: var(--dzd-radius-md, 16px);
  --hp-shadow-soft: var(--dzd-shadow-soft);
  --hp-shadow-card: var(--dzd-shadow-card);
  --hp-shadow-elevated: var(--dzd-shadow-elevated);
  --hp-shadow-lift: var(--dzd-shadow-hover);
  --hp-ease: var(--dzd-ease, cubic-bezier(0.22, 1, 0.36, 1));
  --hp-duration: 200ms;
  min-width: 0;
}

/* Match Search Results grid (.dzd-sr__grid) */
.dzd-profile__listing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dzd-profile__listing-grid > .dzd-home-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#dzd-profile-archived [data-dzd-archived-listing] {
  cursor: pointer;
}

/* Lifecycle badges reuse .dzd-home-card__badge chrome; status colors are profile-only. */
.dzd-profile-home-cards .dzd-home-card__badge--sold {
  background: rgba(6, 118, 71, 0.92);
}

.dzd-profile-home-cards .dzd-home-card__badge--expired {
  background: rgba(122, 116, 152, 0.92);
}

.dzd-profile-home-cards .dzd-home-card__badge--archived {
  background: rgba(94, 67, 214, 0.88);
}

.dzd-profile-home-cards .dzd-home-card--sold,
.dzd-profile-home-cards .dzd-home-card--expired,
.dzd-profile-home-cards .dzd-home-card--archived {
  opacity: 0.88;
}

/* Favorite control (same as Search .dzd-sr-fav) when search-results.css is present. */
.dzd-profile-home-cards .dzd-sr-fav {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  z-index: 4;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  color: #8b83a8;
  box-shadow: var(--dzd-shadow-sm, 0 2px 8px rgba(17, 19, 34, 0.08));
  cursor: pointer;
}

.dzd-profile-home-cards .dzd-sr-fav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.dzd-profile-home-cards .dzd-sr-fav.is-active,
.dzd-profile-home-cards .dzd-sr-fav[aria-pressed="true"] {
  color: #fff;
  background: var(--dzd-color-accent, #5e43d6);
}

.dzd-profile-home-cards .dzd-sr-fav.is-active svg,
.dzd-profile-home-cards .dzd-sr-fav[aria-pressed="true"] svg {
  fill: currentColor;
  stroke: currentColor;
}

/* Mirror Search card responsive chrome (search-results.css .dzd-sr .dzd-home-card). */
@media (min-width: 1200px) {
  .dzd-profile-home-cards .dzd-home-card {
    border-radius: 14px;
  }

  .dzd-profile-home-cards .dzd-home-card__media {
    aspect-ratio: 5 / 4;
  }

  .dzd-profile-home-cards .dzd-home-card__title {
    font-size: var(--dzd-fs-card-title, var(--dzd-fs-lg));
  }

  .dzd-profile-home-cards .dzd-home-card__price {
    font-size: var(--dzd-fs-card-price, var(--dzd-fs-xl));
  }

  .dzd-profile-home-cards .dzd-home-card__meta {
    font-size: var(--dzd-fs-xs);
  }

  .dzd-profile-home-cards .dzd-home-card__body {
    padding: 9px 9px 10px;
    gap: 3px;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .dzd-profile__listing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .dzd-profile-home-cards .dzd-home-card {
    border-radius: 14px;
  }

  .dzd-profile-home-cards .dzd-home-card__media {
    aspect-ratio: 5 / 4;
  }

  .dzd-profile-home-cards .dzd-home-card__title {
    font-size: var(--dzd-fs-card-title, var(--dzd-fs-lg));
  }

  .dzd-profile-home-cards .dzd-home-card__price {
    font-size: var(--dzd-fs-card-price, var(--dzd-fs-xl));
  }

  .dzd-profile-home-cards .dzd-home-card__meta {
    font-size: var(--dzd-fs-xs);
  }

  .dzd-profile-home-cards .dzd-home-card__body {
    padding: 10px 10px 11px;
    gap: 3px;
  }
}

.dzd-profile__sidebar { display: grid; gap: var(--dzd-space-4); min-width: 0; }

.dzd-profile__sidebar-card {
  padding: 16px;
  border-radius: 18px;
  background: var(--dzd-color-surface);
  border: 1px solid var(--dzd-color-border);
  box-shadow: var(--dzd-shadow-soft);
}

.dzd-profile__sidebar-card--business {
  border-color: rgba(94, 67, 214, 0.18);
  box-shadow: var(--dzd-shadow-elevated);
}

.dzd-profile__sidebar-title {
  margin: 0 0 12px;
  font-size: 16px;
}

.dzd-profile__info-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--dzd-color-text-muted-strong);
}

.dzd-profile__info-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.dzd-profile__info-list span:last-child {
  color: var(--dzd-color-text);
  font-weight: 700;
  text-align: end;
}

.dzd-profile__info-list-item--reserved {
  opacity: 0.62;
}

.dzd-profile__info-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: var(--dzd-radius-pill);
  border: 1px dashed var(--dzd-color-accent-border);
  background: var(--dzd-color-surface-tint);
  color: var(--dzd-color-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dzd-profile__hours-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--dzd-color-text-muted-strong);
}

.dzd-profile__hours-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.dzd-profile__hours-list span:last-child {
  color: var(--dzd-color-text);
  font-weight: 700;
  text-align: end;
}

.dzd-profile__reviews-placeholder {
  display: grid;
  gap: 4px;
  text-decoration: none;
  color: inherit;
}

.dzd-profile__reviews-score {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--dzd-color-text);
  line-height: 1;
}

.dzd-profile__reviews-stars {
  margin: 0;
  font-size: 18px;
  letter-spacing: 2px;
  color: #e0d8f8;
}

.dzd-profile__reviews-stars--gold {
  color: #f5b301;
}

.dzd-profile__reviews-value {
  font-variant-numeric: tabular-nums;
}

.dzd-profile__reviews-empty {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--dzd-color-text-muted-strong);
}

.dzd-profile__reviews-copy {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--dzd-color-text-muted);
}

.dzd-profile__social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.dzd-profile__social-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: var(--dzd-radius-pill);
  background: var(--dzd-color-surface-tint);
  border: 1px solid var(--dzd-color-accent-border);
  font-size: 12px;
  font-weight: 700;
}

.dzd-profile__section--mobile-business,
.dzd-profile__section--mobile-personal { display: none; }

/* Wrappers stay inert on desktop (sidebar owns these cards). */
.dzd-profile__business-cards,
.dzd-profile__personal-cards {
  display: none;
}

.desktop-only { display: grid; }

@media (hover: hover) {
  .dzd-profile-action-bar__btn:hover:not(:disabled) {
    background: #f3f1fb;
    transform: translateY(-1px);
  }

  .dzd-profile-action-bar__btn--primary:hover:not(:disabled) {
    background: #5338c9;
  }

}

@media (max-width: 1199px) {
  .dzd-profile__hero-overlay {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "aside"
      "toolbar";
  }

  .dzd-profile__toolbar { justify-self: start; }
  .dzd-profile__body { grid-template-columns: 1fr; }
  .desktop-only { display: none; }

  .dzd-profile__business-cards,
  .dzd-profile__personal-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--dzd-space-4);
    min-width: 0;
    max-width: 100%;
  }

  .dzd-profile__section--mobile-business,
  .dzd-profile__section--mobile-personal { display: block; }

  .dzd-profile__section--mobile-personal {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .dzd-profile__section--mobile-personal .dzd-profile__reviews-placeholder {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: start;
    cursor: pointer;
    font: inherit;
    color: inherit;
  }

  .dzd-profile__section--mobile-personal .dzd-profile__reviews-copy {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* Tablet: one full-width action row — primary actions at inline-start, Share/⋮ at inline-end.
   Avatar + identity info straddle the cover edge (~50% / 50%). Desktop unchanged. */
@media (min-width: 768px) and (max-width: 1199px) {
  .dzd-profile__hero {
    --dzd-profile-cover-h: 220px;
    --dzd-hero-pad: 24px;
    --dzd-profile-avatar-h: 128px;
  }

  .dzd-profile__hero--business {
    --dzd-profile-cover-h: 236px;
  }

  .dzd-profile__hero-overlay {
    grid-template-columns: auto minmax(0, 1fr) minmax(140px, 200px);
    grid-template-areas:
      "avatar headline aside"
      "toolbar toolbar toolbar";
    align-items: end;
    column-gap: var(--dzd-space-3);
    row-gap: var(--dzd-space-3);
  }

  .dzd-profile__hero-main,
  .dzd-profile__identity {
    display: contents;
  }

  /* Push avatar down so its midpoint sits on the cover / white boundary. */
  .dzd-profile__avatar {
    grid-area: avatar;
    align-self: end;
    margin-top: calc(
      var(--dzd-profile-cover-h) - var(--dzd-hero-pad) - (var(--dzd-profile-avatar-h) / 2)
    );
  }

  /* End-aligned with avatar → identity panel straddles the cover edge too. */
  .dzd-profile__headline {
    grid-area: headline;
    align-self: end;
    min-width: 0;
  }

  .dzd-profile__aside {
    grid-area: aside;
    align-self: end;
  }

  .dzd-profile__toolbar {
    grid-area: toolbar;
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    column-gap: var(--dzd-space-4);
    row-gap: 8px;
  }

  .dzd-profile__toolbar .dzd-profile-action-bar {
    width: auto;
    max-width: 100%;
    flex: 0 1 auto;
    justify-content: start;
    border-radius: 999px;
  }

  .dzd-profile__quick-actions {
    flex: 0 0 auto;
    margin-inline-start: auto;
  }

  /* Business cards: 2×2 dashboard grid (tablet only). */
  .dzd-profile--business .dzd-profile__business-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--dzd-space-4);
    align-items: stretch;
  }

  .dzd-profile--business .dzd-profile__section--mobile-business {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
  }

  .dzd-profile--business .dzd-profile__section--mobile-business .dzd-profile__section-header {
    margin-bottom: 10px;
  }

  .dzd-profile--business .dzd-profile__section--mobile-business .dzd-profile__section-title {
    font-size: 16px;
  }

  .dzd-profile--business .dzd-profile__section--mobile-business .dzd-profile__info-list {
    gap: 8px;
    font-size: 12px;
  }

  /* Opening Hours: keep compact so it balances Reviews. */
  .dzd-profile--business .dzd-profile__section--hours {
    padding: 12px 14px;
  }

  .dzd-profile--business .dzd-profile__section--hours .dzd-profile__section-header {
    margin-bottom: 8px;
  }

  .dzd-profile--business .dzd-profile__section--hours .dzd-profile__hours-list {
    gap: 5px;
    font-size: 12px;
    line-height: 1.35;
  }

  .dzd-profile--business .dzd-profile__section--hours .dzd-profile__hours-list li {
    gap: 8px;
  }
}

/* Tablet + compact hero padding/avatar (≤899): keep 50/50 cover overlap math in sync. */
@media (min-width: 768px) and (max-width: 899px) {
  .dzd-profile__hero {
    --dzd-hero-pad: 18px;
    --dzd-profile-avatar-h: 100px;
  }
}

@media (max-width: 899px) {
  .dzd-public-profile-page { padding: var(--dzd-space-4); }
  .dzd-profile__hero { padding: 18px; }
  .dzd-profile__identity { margin-top: 64px; }
  .dzd-profile__avatar { width: 100px; height: 100px; }
  .dzd-profile__avatar .dzd-avatar { --dzd-avatar-size: 100px; }
  .dzd-profile__avatar .dzd-avatar__initials { font-size: 34px; }
  .dzd-profile__listing-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/*
 * Mobile only (≤767) — layout / hierarchy / spacing polish.
 * Keep existing visual language (colors, cards, icons, listing chrome).
 * Desktop + tablet rules above stay untouched.
 */
@media (max-width: 767px) {
  .dzd-public-profile-page {
    padding: 12px 12px 28px;
    overflow-x: hidden;
    max-width: 100%;
  }

  .dzd-profile {
    gap: 14px;
    width: 100%;
    max-width: 100%;
  }

  /* —— Profile header: short cover, avatar straddles, headline on white —— */
  .dzd-profile__hero {
    --dzd-profile-cover-h: 152px;
    --dzd-hero-pad: 14px;
    --dzd-profile-avatar-h: 100px;
    padding: 14px;
    border-radius: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .dzd-profile__hero--business {
    --dzd-profile-cover-h: 160px;
  }

  .dzd-profile__hero--personal::before,
  .dzd-profile__hero--business::before,
  .dzd-profile__cover {
    height: var(--dzd-profile-cover-h);
    border-radius: 20px 20px 0 0;
  }

  .dzd-profile__hero-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    max-width: 100%;
  }

  .dzd-profile__hero-overlay {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "main"
      "aside"
      "toolbar";
    gap: 14px;
    width: 100%;
  }

  .dzd-profile__identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
    margin-top: calc(
      var(--dzd-profile-cover-h) - var(--dzd-hero-pad) - (var(--dzd-profile-avatar-h) / 2)
    );
  }

  .dzd-profile__avatar {
    grid-area: auto;
    margin-top: 0;
    width: 100px;
    height: 100px;
    flex: 0 0 auto;
  }

  .dzd-profile__avatar .dzd-avatar {
    --dzd-avatar-size: 100px;
  }

  .dzd-profile__avatar .dzd-avatar__initials {
    font-size: 32px;
  }

  .dzd-profile__headline {
    grid-area: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    width: 100%;
    text-align: center;
    gap: 4px;
  }

  .dzd-profile__eyebrow,
  .dzd-profile__name,
  .dzd-profile__last-active {
    margin-bottom: 0;
  }

  .dzd-profile__name {
    font-size: 22px;
    justify-content: center;
  }

  .dzd-profile__identity-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: auto;
    max-width: 100%;
    margin-top: 8px;
    padding: 0;
    gap: 10px;
    box-sizing: border-box;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .dzd-profile__meta {
    justify-content: center;
  }

  .dzd-profile__social-counters {
    width: auto;
    max-width: 100%;
    justify-content: center;
    padding: 6px 12px;
  }

  .dzd-profile__aside {
    grid-area: aside;
    align-self: stretch;
    width: 100%;
    min-width: 0;
  }

  .dzd-profile__stats {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dzd-profile__stat-card {
    padding: 12px;
    background: var(--dzd-color-surface, #fff);
    border: 1px solid var(--dzd-color-border, #d8dae3);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .dzd-profile__stat-value {
    font-size: 20px;
    color: var(--dzd-color-text, #111322);
  }

  .dzd-profile__stat-label {
    color: var(--dzd-color-text-muted, #5b5f73);
  }

  /*
   * Mobile visitor actions — scoped ONLY to .dzd-profile__toolbar.
   * Center the button GROUP without touching hero/identity/listings layout.
   * direction:ltr is limited to this wrapper so Message→Share order is stable;
   * the rest of the profile keeps document RTL/LTR.
   */
  .dzd-profile__toolbar {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: center;
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 6px;
    margin: 0;
    padding: 8px;
    border-radius: 18px;
    direction: ltr;
  }

  .dzd-profile__toolbar .dzd-profile-action-bar {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    width: auto;
    max-width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 6px;
    border-radius: 18px;
  }

  .dzd-profile__toolbar .dzd-profile-action-bar:not(:has(.dzd-profile-action-bar__btn)) {
    display: none;
  }

  .dzd-profile__toolbar:not(:has(.dzd-profile-action-bar .dzd-profile-action-bar__btn)) {
    justify-content: center;
  }

  .dzd-profile__toolbar .dzd-profile__quick-actions {
    margin: 0;
    margin-inline-start: 0;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: center;
    min-width: 0;
  }

  .dzd-profile__toolbar .dzd-profile-action-bar__btn,
  .dzd-profile__toolbar .dzd-profile-action-bar__more > summary {
    min-height: 40px;
    flex: 0 0 auto;
  }

  .dzd-profile__toolbar .dzd-profile-action-bar__btn {
    padding: 0 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .dzd-profile__toolbar .dzd-profile-action-bar__more > summary {
    width: 40px;
    height: 40px;
  }

  /* —— Body sections: aligned stack —— */
  .dzd-profile__body {
    gap: 14px;
    width: 100%;
    max-width: 100%;
  }

  .dzd-profile__main {
    gap: 14px;
    width: 100%;
    max-width: 100%;
  }

  .dzd-profile__section {
    padding: 14px;
    border-radius: 18px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
  }

  .dzd-profile__section-header {
    margin-bottom: 10px;
    gap: 10px;
  }

  .dzd-profile__section-title {
    font-size: 17px;
  }

  /* About: keep card, avoid unused vertical height */
  #dzd-profile-about {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  #dzd-profile-about .dzd-profile__section-header {
    margin-bottom: 8px;
  }

  #dzd-profile-about .dzd-profile__copy {
    line-height: 1.5;
  }

  /* Active listings: filters grouped + compact 2×2 */
  #dzd-profile-listings {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .dzd-profile__listing-browser {
    gap: 10px;
    min-width: 0;
  }

  .dzd-profile__listing-toolbar {
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    background: var(--dzd-color-surface-muted, #f6f7fa);
    border: 1px solid var(--dzd-color-border, #e6e8ef);
    box-sizing: border-box;
    min-width: 0;
  }

  .dzd-profile__listing-search,
  .dzd-profile__listing-filters,
  .dzd-profile__listing-search input,
  .dzd-profile__listing-filters select {
    min-width: 0;
    max-width: 100%;
  }

  .dzd-profile__listing-search input,
  .dzd-profile__listing-filters select {
    min-height: 38px;
    border-radius: 12px;
    font-size: 12px;
  }

  .dzd-profile__listing-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dzd-profile__listing-filters label {
    gap: 4px;
    min-width: 0;
  }

  .dzd-profile__listing-filters span {
    font-size: 10px;
  }

  .dzd-profile__listing-results {
    margin: 2px 0 0;
  }

  .dzd-profile__listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
  }

  .dzd-profile-home-cards .dzd-home-card {
    border-radius: 12px;
    min-height: 0;
    min-width: 0;
  }

  .dzd-profile-home-cards .dzd-home-card__media {
    aspect-ratio: 4 / 3;
  }

  .dzd-profile-home-cards .dzd-home-card__title {
    font-size: var(--dzd-fs-card-title, var(--dzd-fs-lg));
    line-height: var(--dzd-lh-snug, 1.4);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .dzd-profile-home-cards .dzd-home-card__price {
    font-size: var(--dzd-fs-card-price, var(--dzd-fs-xl));
  }

  .dzd-profile-home-cards .dzd-home-card__meta {
    font-size: var(--dzd-fs-xs);
  }

  .dzd-profile-home-cards .dzd-home-card__body {
    padding: 8px 8px 9px;
    gap: 2px;
  }

  /* Archived: clear separation after Active */
  #dzd-profile-archived {
    margin-top: 2px;
  }

  .dzd-profile__business-cards,
  .dzd-profile__personal-cards {
    gap: 14px;
  }
}

/* Leftover WP chrome on profile pages. */
.dzd-profile__name {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

body.dzd-profile-active .widget_pages,
body.dzd-profile-active .wp-block-page-list,
body.dzd-profile-active .wp-block-pages-list,
body.dzd-profile-active .wp-page-menu,
body.dzd-profile-active #secondary,
body.dzd-profile-active .widget-area {
  display: none !important;
}

@media (max-width: 767px) {
  .dzd-profile__hero {
    margin-inline: auto;
  }

  /* Headline sits on the white card — override cover-white colors. */
  .dzd-profile__headline {
    color: var(--dzd-color-text, #111322);
  }

  .dzd-profile__eyebrow {
    color: var(--dzd-color-accent, #5e43d6);
  }

  .dzd-profile__name {
    color: var(--dzd-color-text, #111322);
    justify-content: center;
  }

  .dzd-profile__last-active {
    margin-bottom: 0;
    color: var(--dzd-color-text-muted, #5b5f73);
  }

  .dzd-profile__meta {
    justify-content: center;
    color: var(--dzd-color-text-muted, #5b5f73);
  }

  .dzd-profile__meta li + li::before {
    color: var(--dzd-color-text-subtle, #8b90a5);
  }

  .dzd-profile__verify-slot {
    border-color: var(--dzd-color-accent-border, #cfc4ff);
    background: var(--dzd-color-accent-soft, rgba(94, 67, 214, 0.1));
  }

  .dzd-profile__status-badge {
    background: var(--dzd-color-surface-muted, #f6f7fa);
    border-color: var(--dzd-color-border, #d8dae3);
    color: var(--dzd-color-text, #111322);
  }

  .dzd-profile__status-badge--open {
    background: rgba(18, 140, 92, 0.12);
    border-color: rgba(18, 140, 92, 0.28);
    color: #0f7a52;
  }

  .dzd-profile__status-badge--closed {
    background: rgba(185, 28, 28, 0.1);
    border-color: rgba(185, 28, 28, 0.28);
    color: #b91c1c;
  }

  .dzd-profile__social-counters {
    justify-content: center;
    background: var(--dzd-color-surface, #fff);
    border: 1px solid var(--dzd-color-border, #d8dae3);
  }

  .dzd-profile__social-item {
    color: var(--dzd-color-text, #111322);
  }

  .dzd-profile__social-sep {
    background: var(--dzd-color-border, #d8dae3);
  }

  button.dzd-profile__social-item--action:focus-visible {
    outline-color: var(--dzd-color-accent, #5e43d6);
  }

  .dzd-profile__stat-card {
    background: var(--dzd-color-surface, #fff);
    border: 1px solid var(--dzd-color-border, #d8dae3);
  }

  .dzd-profile__stat-value {
    color: var(--dzd-color-text, #111322);
  }

  .dzd-profile__stat-label {
    color: var(--dzd-color-text-muted, #5b5f73);
  }
}

/* —— Archived listing status modal / bottom sheet —— */
html.dzd-archived-listing-modal-open,
html.dzd-archived-listing-modal-open body {
  overflow: hidden;
}

.dzd-archived-listing-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: var(--dzd-space-4, 16px);
}

.dzd-archived-listing-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 19, 34, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.dzd-archived-listing-modal__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 440px);
  max-height: min(88vh, 680px);
  background: var(--dzd-color-surface, #fff);
  border: 1px solid var(--dzd-color-border, #e6e8ef);
  border-radius: var(--dzd-radius-xl, 20px);
  box-shadow: var(--dzd-shadow-hover, 0 18px 48px rgba(17, 19, 34, 0.18));
  overflow: hidden;
}

.dzd-archived-listing-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--dzd-space-3, 12px);
  flex: 0 0 auto;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--dzd-color-border, #e6e8ef);
}

.dzd-archived-listing-modal__title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--dzd-color-text, #111322);
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dzd-archived-listing-modal__close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin: -4px -4px 0 0;
  border: 0;
  border-radius: var(--dzd-radius-sm, 10px);
  background: transparent;
  color: var(--dzd-color-text, #111322);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.dzd-archived-listing-modal__close:hover,
.dzd-archived-listing-modal__close:focus-visible {
  background: var(--dzd-color-surface-panel, #f8f8fb);
}

.dzd-archived-listing-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dzd-archived-listing-modal__media {
  position: relative;
  z-index: 0;
  flex: 0 0 auto;
  width: 100%;
  min-height: 140px;
  aspect-ratio: 16 / 10;
  border-radius: var(--dzd-radius-lg, 16px);
  background:
    linear-gradient(135deg, rgba(94, 67, 214, 0.18), rgba(94, 67, 214, 0.04));
  border: 1px solid var(--dzd-color-border, #e6e8ef);
  overflow: hidden;
  isolation: isolate;
}

.dzd-archived-listing-modal__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.dzd-archived-listing-modal__status {
  position: relative;
  z-index: 1;
  margin: 0;
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: var(--dzd-radius-sm, 10px);
  background: var(--dzd-color-accent-soft, rgba(94, 67, 214, 0.08));
  border: 1px solid var(--dzd-color-accent-border, rgba(94, 67, 214, 0.28));
  color: var(--dzd-color-accent, #5e43d6);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.dzd-archived-listing-modal__status--sold {
  background: rgba(6, 118, 71, 0.1);
  border-color: rgba(6, 118, 71, 0.28);
  color: #067647;
}

.dzd-archived-listing-modal__status--expired {
  background: var(--dzd-color-surface-panel, #f8f8fb);
  border-color: var(--dzd-color-border, #e6e8ef);
  color: var(--dzd-color-text-muted-strong, #4b5163);
}

.dzd-archived-listing-modal__listing-title {
  position: relative;
  z-index: 1;
  margin: 0;
  flex: 0 0 auto;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--dzd-color-text, #111322);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dzd-archived-listing-modal__price {
  position: relative;
  z-index: 1;
  margin: 0;
  flex: 0 0 auto;
  font-size: 1rem;
  font-weight: 800;
  color: var(--dzd-color-accent, #5e43d6);
}

.dzd-archived-listing-modal__meta {
  position: relative;
  z-index: 1;
  margin: 0;
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
}

.dzd-archived-listing-modal__row {
  display: grid;
  grid-template-columns: minmax(0, 110px) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.dzd-archived-listing-modal__row dt {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--dzd-color-text-muted, #6b7280);
}

.dzd-archived-listing-modal__row dd {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--dzd-color-text, #111322);
  overflow-wrap: anywhere;
}

.dzd-archived-listing-modal__actions {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--dzd-color-border, #e6e8ef);
  background: var(--dzd-color-surface, #fff);
}

.dzd-archived-listing-modal__actions .dzd-ui-btn {
  width: 100%;
}

@media (max-width: 767px) {
  .dzd-archived-listing-modal {
    place-items: end center;
    padding: 0;
  }

  .dzd-archived-listing-modal__panel {
    width: 100%;
    max-width: 100%;
    max-height: min(92vh, 760px);
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
  }

  .dzd-archived-listing-modal__body {
    padding: 14px 16px;
    gap: 12px;
  }

  .dzd-archived-listing-modal__media {
    min-height: 120px;
  }

  .dzd-archived-listing-modal__row {
    grid-template-columns: minmax(0, 96px) minmax(0, 1fr);
  }
}


/* Profile listings inventory pages (View all) */
.dzd-profile-listings {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}
.dzd-profile-listings__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.dzd-profile-listings__title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.3;
}
.dzd-profile-listings__count {
  color: var(--dzd-color-text-muted, #6b7280);
  font-weight: 500;
}
.dzd-profile-listings__subtitle {
  margin: 4px 0 0;
  color: var(--dzd-color-text-muted, #6b7280);
}
.dzd-profile-listings__pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.dzd-profile-listings__search,
.dzd-profile-listings__grid-wrap {
  width: 100%;
  overflow-x: hidden;
}
@media (min-width: 768px) {
  .dzd-profile-listings {
    padding: 24px 24px 64px;
  }
  .dzd-profile-listings__header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

/*
 * RTL profile hero — same vertical positions as English.
 *
 * Do not re-margin or “raise” individual cards. Arabic UI sets a taller
 * line-height on `.dzd-public-profile`; with the English `align-items: end`
 * layout that extra height sinks بائع خاص / الاسم / متصل الآن / بطاقة العضوية
 * (and the shared end-aligned row). Match English line-box height inside the
 * hero only so existing LTR offsets place everything correctly.
 */
html[dir="rtl"] .dzd-profile__hero {
  line-height: 1.2;
}

html[dir="rtl"] .dzd-profile__hero .dzd-profile__name {
  line-height: 1.05;
}

html[dir="rtl"] .dzd-profile__hero .dzd-profile__social-counters,
html[dir="rtl"] .dzd-profile__hero .dzd-profile__meta {
  flex-wrap: nowrap;
  white-space: nowrap;
}

/*
 * Mobile profile back — corner control on the cover (not in-flow with avatar/name).
 * Base .dzd-mobile-back handles LTR← / RTL→ arrow flip and mobile-only display.
 */
.dzd-profile__hero > .dzd-mobile-back--profile-hero,
.dzd-profile__hero > .dzd-profile__mobile-back {
  z-index: 6;
}

@media (max-width: 767px) {
  .dzd-profile__hero > .dzd-mobile-back--profile-hero,
  .dzd-profile__hero > .dzd-profile__mobile-back {
    top: 10px;
    left: 10px;
    right: auto;
  }

  html[dir="rtl"] .dzd-profile__hero > .dzd-mobile-back--profile-hero,
  html[dir="rtl"] .dzd-profile__hero > .dzd-profile__mobile-back,
  .rtl .dzd-profile__hero > .dzd-mobile-back--profile-hero,
  .rtl .dzd-profile__hero > .dzd-profile__mobile-back {
    left: auto;
    right: 10px;
  }
}

/* Narrow phones: tighten ONLY the action toolbar (not nested inside other @media). */
@media (max-width: 360px) {
  .dzd-profile__toolbar {
    gap: 4px;
    padding: 6px;
  }

  .dzd-profile__toolbar .dzd-profile-action-bar,
  .dzd-profile__toolbar .dzd-profile__quick-actions {
    gap: 4px;
  }

  .dzd-profile__toolbar .dzd-profile-action-bar__btn {
    padding: 0 8px;
    font-size: 11px;
    min-height: 36px;
  }

  .dzd-profile__toolbar .dzd-profile-action-bar__more > summary {
    width: 36px;
    height: 36px;
    min-height: 36px;
  }
}

