.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inbox-button {
  position: relative;
  padding: 8px 12px;
  border: 1px solid rgba(255, 23, 111, .35);
  border-radius: 999px;
  background: rgba(255, 23, 111, .09);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.inbox-button:hover,
.inbox-button:focus-visible {
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(22, 217, 227, .18);
  outline: 0;
}

.inbox-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.inbox-button span {
  position: absolute;
  top: -8px;
  right: -7px;
  display: grid;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-size: 9px;
  place-items: center;
}

.app-inbox-button {
  display: none;
}

.nido-app-embed .app-inbox-button {
  position: absolute;
  z-index: 8;
  top: 7px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 23, 111, .38);
  border-radius: 999px;
  background: rgba(8, 11, 25, .94);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}

.nido-app-embed .app-inbox-button span {
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--pink);
  place-items: center;
}

.profile-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.profile-actions button {
  padding: 10px 15px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.profile-message {
  border: 0;
  background: linear-gradient(100deg, var(--pink), var(--violet), var(--cyan));
  color: #fff;
}

.profile-message:disabled {
  filter: saturate(.2);
  cursor: not-allowed;
  opacity: .5;
}

.profile-block {
  border: 1px solid rgba(255, 255, 255, .16);
  background: #0c1021;
  color: var(--muted);
}

.profile-block:hover {
  border-color: var(--pink);
  color: #fff;
}

.private-layer[hidden] {
  display: none !important;
}

.private-layer {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  padding: 14px;
  place-items: center;
}

.private-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(2, 3, 10, .88);
  backdrop-filter: blur(9px);
}

.private-card {
  position: relative;
  display: flex;
  width: min(1040px, 100%);
  height: min(760px, calc(100dvh - 28px));
  min-height: 440px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(22, 217, 227, .42);
  border-radius: 26px;
  background: radial-gradient(circle at 2% 0, rgba(255, 23, 111, .17), transparent 35%), radial-gradient(circle at 100% 20%, rgba(22, 217, 227, .13), transparent 32%), #080b19;
  box-shadow: -16px 0 55px rgba(255, 23, 111, .16), 16px 0 55px rgba(22, 217, 227, .14), 0 28px 85px rgba(0, 0, 0, .62);
}

.private-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.private-eyebrow {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .18em;
}

.private-header h2 {
  margin: 3px 0 0;
  font-size: 23px;
}

.private-header-actions {
  display: flex;
  gap: 7px;
}

.private-header-actions button,
.private-settings > button {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: #10152a;
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.private-header-actions #private-close {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  place-items: center;
}

.private-settings {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 11px;
  padding: 11px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(145, 76, 255, .06);
  color: var(--muted);
  font-size: 10px;
}

.private-settings[hidden] {
  display: none !important;
}

.private-settings label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.private-settings input {
  accent-color: var(--cyan);
}

.private-settings p {
  flex: 1 1 100%;
  margin: 0;
  color: #747991;
  font-size: 9px;
}

.private-settings > span {
  color: var(--cyan);
}

.private-layout {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: 300px minmax(0, 1fr);
}

.private-inbox {
  min-width: 0;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, .08);
  background: rgba(5, 7, 17, .48);
  scrollbar-color: var(--violet) transparent;
}

.private-empty {
  padding: 25px 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.private-thread-item {
  display: grid;
  width: 100%;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 13px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.private-thread-item:hover,
.private-thread-item.is-active {
  background: linear-gradient(100deg, rgba(255, 23, 111, .12), rgba(22, 217, 227, .07));
}

.private-thread-item img {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(22, 217, 227, .35);
  border-radius: 50%;
  object-fit: cover;
}

.private-thread-item span {
  min-width: 0;
}

.private-thread-item strong,
.private-thread-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.private-thread-item strong {
  font-size: 12px;
}

.private-thread-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.private-thread-item b {
  display: grid;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--pink);
  font-size: 9px;
  place-items: center;
}

.private-conversation {
  min-width: 0;
  min-height: 0;
}

.private-placeholder {
  display: grid;
  height: 100%;
  padding: 30px;
  color: var(--muted);
  place-content: center;
  text-align: center;
}

.private-placeholder[hidden] {
  display: none !important;
}

.private-placeholder span {
  color: var(--cyan);
  font-size: 48px;
}

.private-card.is-opening .private-placeholder span {
  animation: nido-private-opening 1.15s linear infinite;
  color: var(--pink);
  filter: drop-shadow(-7px 0 13px rgba(255, 23, 111, .48)) drop-shadow(7px 0 13px rgba(22, 217, 227, .42));
}

.private-card.is-opening .private-placeholder strong {
  background: linear-gradient(90deg, var(--pink), #fff 48%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@keyframes nido-private-opening {
  to { transform: rotate(1turn); }
}

.private-placeholder strong {
  margin-top: 8px;
  color: #fff;
  font-size: 18px;
}

.private-placeholder p {
  max-width: 380px;
  font-size: 11px;
  line-height: 1.55;
}

.private-thread {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.private-thread[hidden] {
  display: none !important;
}

.private-thread-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.private-thread-header > img {
  width: 39px;
  height: 39px;
  border: 1px solid rgba(22, 217, 227, .42);
  border-radius: 50%;
  object-fit: cover;
}

.private-thread-header > div {
  min-width: 0;
}

.private-thread-header strong,
.private-thread-header span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.private-thread-header strong {
  font-size: 12px;
}

.private-thread-header span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.private-thread-header button {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: #10152a;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.private-thread-header #private-back {
  display: none;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #fff;
  font-size: 24px;
}

.private-thread-header #private-thread-block {
  margin-left: auto;
}

.private-messages {
  min-height: 0;
  overflow-y: auto;
  padding: 17px;
  scrollbar-color: var(--violet) transparent;
}

.private-message {
  width: fit-content;
  max-width: min(78%, 620px);
  margin: 0 auto 9px 0;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 15px 15px 15px 4px;
  background: #11162a;
}

.private-message.is-mine {
  margin-right: 0;
  margin-left: auto;
  border-color: rgba(22, 217, 227, .25);
  border-radius: 15px 15px 4px 15px;
  background: linear-gradient(120deg, rgba(145, 76, 255, .24), rgba(22, 217, 227, .11));
}

.private-message p {
  margin: 0;
  color: #ececf4;
  font-size: 12px;
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.private-message time {
  display: block;
  margin-top: 4px;
  color: #83879e;
  font-size: 8px;
  text-align: right;
}

.private-message.has-link-preview {
  width: min(88%, 560px);
  max-width: min(88%, 560px);
}

.private-message .link-preview {
  width: 100%;
  margin: 8px 0 4px;
  border-color: rgba(255, 255, 255, .13);
  background: rgba(5, 8, 20, .88);
  text-align: left;
}

.private-message.is-mine .link-preview {
  border-color: rgba(22, 217, 227, .28);
}

.private-message .link-preview-media {
  max-height: 230px;
}

.private-composer {
  padding: 11px 14px calc(11px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: #080b19;
}

.private-composer textarea {
  min-height: 48px;
  max-height: 95px;
}

.private-composer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 7px;
}

.private-composer-foot > span {
  color: var(--muted);
  font-size: 9px;
}

.private-composer button {
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--pink), var(--violet), var(--cyan));
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.private-composer button:disabled {
  filter: saturate(.2);
  cursor: not-allowed;
  opacity: .5;
}

@media (max-width: 700px) {
  .chat-header-actions { gap: 5px; }
  .presence { display: none; }
  .private-layer { padding: 0; place-items: stretch; }
  .private-card { width: 100%; height: 100dvh; min-height: 0; border: 0; border-radius: 0; }
  .private-header { padding: 12px 13px; }
  .private-header h2 { font-size: 19px; }
  .private-layout { display: block; }
  .private-inbox, .private-conversation { height: 100%; border-right: 0; }
  .private-card.has-thread .private-inbox { display: none; }
  .private-card:not(.has-thread) .private-conversation { display: none; }
  .private-card.has-private-notice .private-inbox { display: none; }
  .private-card.has-private-notice .private-conversation { display: block; }
  .private-thread-header #private-back { display: grid; place-items: center; }
  .private-settings { align-items: flex-start; padding: 10px 13px; }
  .private-settings label { flex: 1 1 100%; }
  .private-message { max-width: 88%; }
  .private-message.has-link-preview { width: 94%; max-width: 94%; }
  .profile-actions { align-items: stretch; flex-direction: column; }
  .profile-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .private-card, .private-thread-item { scroll-behavior: auto; }
  .private-card.is-opening .private-placeholder span { animation: none; }
}
