.privacy-v3 {
  --privacy-line: rgba(174, 116, 145, .2);
  --privacy-soft: rgba(255, 249, 247, .92);
  display: grid;
  gap: 22px;
}

.privacy-v3-section-title {
  margin: 0 0 9px;
  color: #877b88;
  font-size: .88rem;
  font-weight: 650;
}

.privacy-v3-group {
  overflow: hidden;
  margin: 0 0 10px;
  border: 1px solid var(--privacy-line);
  border-radius: 14px;
  background: var(--privacy-soft);
  box-shadow: 0 8px 24px rgba(74, 53, 70, .04);
}

.privacy-v3-row,
.privacy-v3-summary,
.privacy-v3-person {
  min-height: 58px;
  box-sizing: border-box;
}

.privacy-v3-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--privacy-line);
}

.privacy-v3-row:last-child,
.privacy-v3-person:last-child {
  border-bottom: 0;
}

.privacy-v3-row > span:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.privacy-v3-row strong,
.privacy-v3-summary strong,
.privacy-v3-person strong {
  color: #392e42;
  font-size: .94rem;
}

.privacy-v3-row small,
.privacy-v3-summary small,
.privacy-v3-person small {
  display: block;
  color: #8c818e;
  font-size: .78rem;
  line-height: 1.45;
}

.privacy-v3-row select,
.privacy-v3-add select,
.privacy-v3-add input {
  min-height: 42px;
  border: 1px solid rgba(174, 116, 145, .25);
  border-radius: 10px;
  background: #fff;
  color: #45374c;
  box-shadow: none;
  outline: none;
}

.privacy-v3-row select {
  width: auto;
  min-width: 142px;
  padding: 0 34px 0 12px;
  text-align: right;
}

.privacy-v3-row select:focus-visible,
.privacy-v3-add select:focus-visible,
.privacy-v3-add input:focus-visible,
.privacy-profile-more:focus-visible,
.community-mention-tools button:focus-visible,
.community-mention-tools input:focus-visible {
  border-color: #d889a8;
  outline: 2px solid rgba(216, 137, 168, .24);
  outline-offset: 2px;
}

.privacy-v3-summary {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid var(--privacy-line);
  background: transparent;
  text-align: left;
}

.privacy-v3-summary > span:first-child {
  display: grid;
  gap: 3px;
}

.privacy-v3-summary > span:last-child {
  flex: 0 0 auto;
  color: #9a8794;
  font-size: .83rem;
}

.privacy-v3-people {
  max-height: 256px;
  overflow: auto;
}

.privacy-v3-person {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--privacy-line);
}

.privacy-v3-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe2e6, #e7f7f5);
  color: #8b506a;
  font-weight: 750;
}

.privacy-v3-empty {
  margin: 0;
  padding: 16px;
  color: #918590;
  text-align: center;
}

.privacy-v3-add {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

.privacy-v3-add select,
.privacy-v3-add input {
  padding: 0 12px;
}

.privacy-v3-relation-group {
  margin-bottom: 0;
}

.privacy-v3-relation-entry {
  display: grid;
  width: 100%;
  min-height: 74px;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 11px 16px;
  border: 0;
  border-bottom: 1px solid var(--privacy-line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.privacy-v3-relation-entry:last-child {
  border-bottom: 0;
}

.privacy-v3-relation-entry:hover {
  background: linear-gradient(90deg, rgba(255, 240, 244, .66), rgba(240, 250, 249, .52));
}

.privacy-v3-relation-entry:focus-visible,
.privacy-relation-search-row input:focus-visible,
.privacy-relation-remove:focus-visible {
  border-color: #d889a8;
  outline: 2px solid rgba(216, 137, 168, .24);
  outline-offset: -2px;
}

.privacy-v3-relation-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.privacy-v3-relation-copy strong {
  color: #392e42;
  font-size: .94rem;
}

.privacy-v3-relation-copy small {
  overflow: hidden;
  color: #8c818e;
  font-size: .78rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.privacy-v3-relation-glance {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.privacy-v3-preview-person {
  display: flex;
  max-width: 116px;
  align-items: center;
  gap: 5px;
  color: #665a68;
  font-size: .78rem;
}

.privacy-v3-preview-person > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.privacy-v3-preview-person .privacy-v3-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  font-size: .74rem;
}

.privacy-v3-no-users,
.privacy-v3-more-users,
.privacy-v3-relation-count {
  color: #948691;
  font-size: .78rem;
  white-space: nowrap;
}

.privacy-v3-relation-count {
  min-width: 38px;
  text-align: right;
}

.privacy-v3-relation-glance svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #a28f9c;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.privacy-relation-panel {
  width: min(680px, calc(100vw - 32px));
  max-height: min(82vh, 720px);
  grid-template-rows: auto auto minmax(180px, 1fr);
}

.privacy-relation-head {
  border-bottom: 1px solid rgba(203, 184, 201, .46);
}

.privacy-relation-manage {
  padding: 14px 22px 9px;
}

.privacy-relation-search-label {
  display: block;
  margin-bottom: 7px;
  color: #655866;
  font-size: .8rem;
  font-weight: 700;
}

.privacy-relation-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.privacy-relation-search-row input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(203, 184, 201, .65);
  border-radius: 11px;
  background: rgba(255, 253, 248, .94);
  box-shadow: none;
  outline: none;
}

.privacy-relation-search-row .button {
  min-width: 112px;
}

.privacy-relation-status {
  min-height: 20px;
  margin: 5px 0 0;
  text-align: left;
}

.privacy-relation-list {
  padding-top: 0;
}

.privacy-relation-user {
  display: grid;
  min-height: 74px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(203, 184, 201, .38);
}

.privacy-relation-user:last-child {
  border-bottom: 0;
}

.privacy-relation-user > .privacy-v3-avatar {
  width: 42px;
  height: 42px;
}

.privacy-relation-user-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.privacy-relation-user-copy strong,
.privacy-relation-user-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.privacy-relation-user-copy strong {
  color: #392e42;
  font-size: .94rem;
}

.privacy-relation-user-copy small {
  color: #8c818e;
  font-size: .76rem;
}

.privacy-relation-remove {
  min-width: 88px;
  color: #a74f6e;
}

.privacy-relation-empty {
  display: grid;
  min-height: 210px;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: #8d818c;
  text-align: center;
}

.privacy-relation-empty strong {
  color: #5c4f60;
}

.privacy-relation-empty small {
  max-width: 320px;
  line-height: 1.55;
}

.privacy-relation-empty .privacy-v3-avatar {
  width: 44px;
  height: 44px;
}
.privacy-v3-advanced {
  border-top: 1px solid var(--privacy-line);
  padding-top: 16px;
}

.privacy-v3-advanced summary {
  min-height: 44px;
  color: #746778;
  cursor: pointer;
  font-weight: 700;
}

.privacy-profile-menu {
  position: relative;
  z-index: 30;
}

.privacy-profile-more {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .78);
  color: #4a3b50;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
}

#view-user .public-profile-hero > .privacy-profile-menu {
  position: absolute;
  z-index: 40;
  top: 14px;
  right: 14px;
}

.privacy-profile-more > span {
  display: block;
  letter-spacing: .4px;
  transform: translateY(-1px);
}
.privacy-profile-popover {
  position: absolute;
  z-index: 9999;
  top: calc(100% + 8px);
  right: 0;
  width: min(260px, calc(100vw - 32px));
  padding: 6px;
  border: 1px solid rgba(174, 116, 145, .22);
  border-radius: 14px;
  background: #fffdfa;
  box-shadow: 0 16px 38px rgba(69, 48, 64, .16);
}

.privacy-profile-popover.is-hidden {
  display: none;
}

.privacy-profile-popover button {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #362c3d;
  text-align: left;
}

.privacy-profile-popover button:hover {
  background: #fff1f3;
}

.privacy-profile-popover small {
  color: #a08291;
}

.community-mention-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.community-mention-panel {
  position: absolute;
  z-index: 200;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(360px, calc(100vw - 36px));
  max-height: 380px;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(174, 116, 145, .22);
  border-radius: 14px;
  background: #fffdfa;
  box-shadow: 0 16px 38px rgba(69, 48, 64, .16);
}

.community-mention-panel.is-hidden {
  display: none;
}

.community-mention-panel label {
  display: grid;
  gap: 6px;
  color: #655866;
  font-size: .8rem;
}

.community-mention-panel input {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid rgba(174, 116, 145, .25);
  border-radius: 10px;
  padding: 0 11px;
  outline: none;
}

[data-mention-results] {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

[data-mention-results] button {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 9px;
  background: #fff7f5;
  color: #3c3041;
  text-align: left;
}

[data-mention-selected] {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

[data-mention-selected] small {
  width: 100%;
  color: #8b7d89;
}

[data-mention-selected] button,
.community-comment-mention {
  border: 0;
  border-radius: 999px;
  background: #fff0f4;
  color: #b34e78;
  font: inherit;
}

.community-comment-mention {
  padding: 0 2px;
  font-weight: 700;
}

.community-comment.is-mention-target {
  animation: privacy-target-pulse 1.8s ease;
  box-shadow: 0 0 0 3px rgba(216, 137, 168, .28);
}

@keyframes privacy-target-pulse {
  0%, 100% { background: transparent; }
  35% { background: #fff1f3; }
}

@media (max-width: 720px) {
  .privacy-v3-row {
    gap: 10px;
    padding-inline: 12px;
  }

  .privacy-v3-row select {
    min-width: 116px;
  }

  .privacy-v3-add {
    grid-template-columns: 1fr;
  }

  .privacy-v3-add .button {
    width: 100%;
  }

  .privacy-v3-relation-entry {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding-inline: 12px;
  }

  .privacy-v3-preview-person:nth-of-type(n + 2),
  .privacy-v3-more-users {
    display: none;
  }

  .privacy-v3-preview-person {
    max-width: 92px;
  }

  .privacy-v3-relation-count {
    display: none;
  }

  .privacy-relation-panel {
    width: calc(100vw - 16px);
    max-height: 88vh;
  }

  .privacy-relation-manage,
  .privacy-relation-list,
  .privacy-relation-head {
    padding-right: 14px;
    padding-left: 14px;
  }

  .privacy-relation-search-row {
    grid-template-columns: 1fr;
  }

  .privacy-relation-search-row .button {
    width: 100%;
  }

  .privacy-relation-user {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .privacy-relation-remove {
    min-width: 76px;
    padding-inline: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .community-comment.is-mention-target {
    animation: none;
  }
}

/* Public-profile relationship actions and private remark dialog. */
.privacy-profile-popover button:disabled {
  cursor: not-allowed;
  opacity: .52;
}

.privacy-profile-popover button.is-danger:not(:disabled) {
  color: #a13f57;
}

.privacy-profile-popover .privacy-profile-menu-divider {
  height: 1px;
  margin: 4px 7px;
  background: rgba(174, 116, 145, .18);
}

.user-remark-panel {
  width: min(480px, calc(100vw - 32px));
}

.user-remark-panel form {
  display: grid;
  gap: 12px;
}

.user-remark-original {
  margin: -3px 0 0;
  color: #837586;
  font-size: .84rem;
}

.user-remark-panel .text-input {
  min-height: 44px;
}
/* Community-paused privacy settings remain visible, but only search, blocks, and DMs are editable. */
.privacy-v3-community-note {
  padding: 12px 14px;
  border: 1px solid rgba(174, 116, 145, .22);
  border-radius: 12px;
  background: rgba(249, 246, 247, .96);
  color: #746b76;
  font-size: .88rem;
  line-height: 1.6;
}

.privacy-v3 .is-community-paused {
  filter: grayscale(1);
  opacity: .5;
}

.privacy-v3-row.is-community-paused,
.privacy-v3-relation-entry.is-community-paused,
.privacy-v3-advanced.is-community-paused summary,
.privacy-v3 .is-community-paused select:disabled,
.privacy-v3 .is-community-paused input:disabled {
  cursor: not-allowed;
}

.privacy-v3-relation-entry.is-community-paused:hover {
  background: transparent;
}
/* User reporting remains available while community publishing is paused. */
.privacy-profile-popover button[data-profile-action="report"]:not(:disabled) small {
  color: #8f5368;
  font-weight: 650;
}

.privacy-profile-popover button[data-profile-action="report"]:not(:disabled):focus-visible {
  outline: 2px solid #b84d76;
  outline-offset: 2px;
}