.photoButton {
  width: 48px;
  height: 48px;
  margin: 0;
  border: 1px solid #ffffff18;
  border-radius: 15px;
  background: #ffffff10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  cursor: pointer;
  font-size: 20px;
}

.avatar,
#peopleTab .person img,
.giftPersonRow img,
.privateChatItem img,
.chatImage {
  cursor: zoom-in;
}

.photoModal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, .82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.photoModal.hidden {
  display: none;
}

.photoModalBox {
  position: relative;
  max-width: min(960px, 96vw);
  max-height: 92vh;
}

.photoModalBox img {
  display: block;
  max-width: 100%;
  max-height: 84vh;
  border-radius: 14px;
  background: #111;
  object-fit: contain;
}

#closePhotoModal {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: #dc2626;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

#photoModalCaption {
  margin-top: 10px;
  color: #e5e7eb;
  text-align: center;
  font-weight: 800;
}

.photoButton input {
  display: none;
}

.chatImage {
  display: block;
  max-width: min(280px, 68vw);
  max-height: 360px;
  margin-top: 8px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid #ffffff18;
}

#chatScreen.active {
  display: flex;
  flex-direction: column;
  height: var(--app-height, 100dvh);
  min-height: 0;
  overflow: hidden;
}

#chatScreen main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#chatScreen .topbar,
#chatScreen .tabs {
  flex: 0 0 auto;
}

.topActions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profileChip {
  width: auto;
  max-width: 170px;
  margin: 0;
  padding: 6px 10px 6px 6px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  background: #ffffff12;
  border: 1px solid #ffffff18;
}

.profileChip img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
}

.profileChip span {
  max-width: 95px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.giftsTabButton {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  border-color: #fbbf24;
  box-shadow: 0 0 0 1px #f59e0b44, 0 0 18px #ec489944;
}

.giftsTabButton.active {
  background: linear-gradient(135deg, #f97316, #ec4899);
  box-shadow: 0 0 0 1px #fbbf2466, 0 0 24px #f9731666;
}

.giftsTabButton:not(.active) {
  animation: giftGlow 2.4s ease-in-out infinite;
}

.tabPanel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.tabPanel.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.messages {
  min-height: 0;
  overflow-y: auto;
}

.composer {
  flex: 0 0 auto;
  position: relative;
  z-index: 30;
  padding-bottom: 10px;
  border-top: 1px solid #ffffff12;
}

.keyboard-open #chatScreen.active {
  height: var(--app-height, 100dvh);
}

.keyboard-open .tabPanel.active {
  min-height: 0;
  overflow: hidden;
}

.keyboard-open .messages {
  min-height: 0;
}

.keyboard-open .composer {
  box-shadow: 0 -12px 22px rgba(0, 0, 0, .45);
}

#peopleTab {
  gap: 10px;
  overflow: hidden;
}

#peopleTab .peopleSearch {
  flex: 0 0 auto;
  margin: -2px 0 0;
  padding: 11px 14px;
  border-radius: 14px;
}

#peopleTab .filters {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: -8px -8px 2px;
  padding: 10px 10px 12px;
  background: linear-gradient(180deg, #090910 0%, #090910ee 78%, #09091000 100%);
  border-bottom: 1px solid #ffffff10;
}

#peopleTab .filter {
  min-width: max-content;
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: #ffffff14;
  border: 1px solid #ffffff18;
}

#peopleTab .filter.active {
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
}

#peopleTab .peopleGrid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

#peopleTab .person {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 9px 10px;
  border-radius: 14px;
  min-width: 0;
}

#peopleTab .person img {
  width: 46px;
  height: 46px;
}

#peopleTab .personInfo {
  min-width: 0;
}

#peopleTab .person b {
  display: block;
  margin-top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#peopleTab .person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#peopleTab .personActions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

#peopleTab .person button {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 7px 7px;
  border-radius: 12px;
  font-size: 11px;
  white-space: nowrap;
}

#peopleTab .person .blockPersonBtn {
  background: #dc2626;
  min-width: 0;
}

#giftsTab {
  gap: 10px;
  overflow: auto;
}

.giftStoreHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #32135e, #102437);
  border: 1px solid #ffffff1a;
}

.giftStoreHead strong {
  display: block;
  font-size: 16px;
}

.giftStoreHead span {
  display: block;
  color: #c9c3d7;
  font-size: 12px;
  margin-top: 2px;
}

#giftStoreTotal {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 11px;
  background: #ffffff16;
  color: #fff;
}

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

.giftStoreCard {
  min-height: 142px;
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #ffffff18;
  background: linear-gradient(160deg, #211630, #101724);
  box-shadow: inset 0 1px 0 #ffffff12;
  color: #fff;
  text-align: left;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 9px;
}

.giftStoreCard.active {
  border-color: #fbbf24;
  box-shadow: 0 0 0 1px #fbbf2455, 0 12px 26px #f59e0b22;
}

.giftStorePick {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 7px;
  width: 100%;
  min-height: 88px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  text-align: left;
}

.giftStoreIcon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff14;
  font-size: 20px;
}

.giftStoreName {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.15;
}

.giftStoreCard strong {
  font-size: 18px;
}

.giftStoreQty {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 7px;
}

.giftStoreQty button {
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: #ffffff16;
  font-size: 18px;
  line-height: 1;
}

.giftStoreQty span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: 32px;
  border-radius: 10px;
  background: #ffffff10;
  font-weight: 800;
}

.giftSendTo {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.giftSendTo > strong {
  font-size: 13px;
  color: #d9d3e7;
}

.giftPeopleList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: visible;
}

.giftPersonRow {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 9px 10px;
  border-radius: 14px;
  background: #ffffff10;
  border: 1px solid #ffffff16;
  text-align: left;
}

.giftPersonRow img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.giftPersonRow span,
.giftPersonRow b,
.giftPersonRow small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.giftPersonRow small {
  color: #bbb;
  font-weight: 500;
}

.giftPersonRow strong {
  border-radius: 999px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
}

.privateTabButton.hasUnread {
  animation: privatePulse 1.05s ease-in-out infinite;
  border-color: #facc15;
  box-shadow: 0 0 0 1px #facc1555, 0 0 18px #facc1544;
}

.privateTabButton.hasUnread .badge {
  animation: badgePop .75s ease-in-out infinite;
}

.dmMsgBtn {
  width: auto;
  margin: 0 0 0 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  border: 0;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.giftMsgBtn,
.giftPersonBtn,
.inlineGiftBtn {
  width: auto;
  margin: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  border: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.blockMsgBtn {
  background: #dc2626;
  border-color: #ef4444;
  color: #fff;
}

.messageMeta {
  min-width: 0;
}

.messageTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.messageTop b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messageActions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.messageActions .dmMsgBtn,
.messageActions .giftMsgBtn,
.messageActions .blockMsgBtn {
  margin: 0;
}

.giftModal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: #0009;
}

.giftBox {
  width: min(460px, 100%);
  max-height: min(680px, 88dvh);
  overflow: auto;
  border: 1px solid #ffffff20;
  border-radius: 20px;
  background: #101018;
  box-shadow: 0 24px 70px #000c;
  padding: 16px;
}

.giftHead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.giftHead span {
  display: block;
  color: #bbb;
  font-size: 13px;
}

#closeGiftBtn {
  width: 42px;
  height: 42px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  background: #ffffff14;
  font-size: 26px;
}

.giftProducts {
  display: grid;
  gap: 8px;
}

.giftProduct {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #ffffff14;
  border-radius: 14px;
  background: #ffffff0d;
}

.giftProduct strong,
.giftProduct span {
  display: block;
}

.giftProduct span {
  color: #bbb;
  font-size: 13px;
}

.giftQty {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 6px;
}

.giftQty button {
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

.giftQty span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: 34px;
  border-radius: 10px;
  background: #ffffff12;
  font-weight: 800;
}

.giftProduct input {
  margin: 0;
  text-align: center;
}

.giftTotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px 6px;
}

.messageStatus {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  color: #a9a9b8;
}

.messageStatus span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messageStatus time {
  flex: 0 0 auto;
  color: #d7d7e5;
  font-size: 11px;
}

.officialMessage .avatar {
  border: 2px solid #fbbf24;
  box-shadow: 0 0 14px rgba(251, 191, 36, .55);
}

.officialMessage .bubble {
  background: linear-gradient(135deg, rgba(120, 53, 15, .92), rgba(88, 28, 135, .92));
  border: 1px solid #fbbf24;
  box-shadow: 0 8px 24px rgba(245, 158, 11, .18);
}

.officialMessage .messageTop b {
  color: #fff7d6;
  font-size: 14px;
  font-weight: 900;
}

.officialMessage .messageStatus {
  color: #fde68a;
}

.officialBadge {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fbbf24;
  color: #351500;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .5px;
  vertical-align: 1px;
}

.privateChatItem.officialPrivateChat {
  border-color: #fbbf24;
  background: linear-gradient(135deg, rgba(120, 53, 15, .48), rgba(88, 28, 135, .48));
  box-shadow: 0 0 14px rgba(245, 158, 11, .18);
}

.privateChatItem.officialPrivateChat img {
  border: 2px solid #fbbf24;
}

.officialPrivateBadge {
  display: inline-flex;
  width: auto;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fbbf24;
  color: #351500;
  font-size: 8px;
  font-weight: 900;
  line-height: 1.3;
  vertical-align: 1px;
}

.giftAnnouncementMessage {
  justify-content: center;
  margin: 16px 0;
}

.giftAnnouncementMessage .avatar {
  width: 48px;
  height: 48px;
  border: 2px solid #fbbf24;
  background: #6d164b;
  box-shadow: 0 0 18px rgba(251, 191, 36, .65);
}

.giftAnnouncementMessage .bubble {
  max-width: min(84%, 620px);
  padding: 13px 16px;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  border: 1px solid #fde68a;
  color: #fff;
  box-shadow: 0 10px 28px rgba(236, 72, 153, .28);
}

.giftAnnouncementMessage .messageTop b {
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.giftAnnouncementMessage .messageStatus,
.giftAnnouncementMessage .messageStatus time {
  color: #fff7d6;
}

.giftAnnouncementMessage .bubble > div:last-child {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

@keyframes privatePulse {
  0%, 100% {
    background: #ffffff0d;
  }

  50% {
    background: linear-gradient(135deg, #f59e0b, #7c3aed);
  }
}

@keyframes badgePop {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.18);
  }
}

@keyframes giftGlow {
  0%, 100% {
    box-shadow: 0 0 0 1px #f59e0b33, 0 0 10px #ec489933;
  }

  50% {
    box-shadow: 0 0 0 1px #fbbf2477, 0 0 22px #ec489966;
  }
}

@media (max-width: 600px) {
  .topActions {
    gap: 6px;
  }

  .profileChip {
    max-width: 128px;
    padding-right: 8px;
  }

  .profileChip img {
    width: 28px;
    height: 28px;
  }

  .profileChip span {
    max-width: 62px;
    font-size: 12px;
  }

  .composer {
    padding-bottom: 10px;
  }

  .messages {
    padding-bottom: 8px;
  }

  .privateLayout {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .privateThread {
    min-height: 0;
    overflow: hidden;
  }

  #peopleTab .filters {
    margin: 0 -8px 4px;
    padding: 12px 10px 14px;
  }

  #peopleTab .filter {
    font-size: 13px;
    padding: 9px 13px;
  }

  #peopleTab .person {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 7px;
  }

  #peopleTab .person img {
    width: 38px;
    height: 38px;
  }

  #peopleTab .person button {
    min-width: 0;
    padding: 6px 5px;
    font-size: 10px;
  }

  #peopleTab .person .blockPersonBtn {
    grid-column: auto;
    min-width: 0;
  }

  .giftPersonRow {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    padding: 8px;
  }

  .giftPersonRow img {
    width: 40px;
    height: 40px;
  }

  .bubble {
    max-width: 86%;
  }

  .messageActions {
    gap: 4px;
  }

  .messageActions .dmMsgBtn,
  .messageActions .giftMsgBtn,
  .messageActions .blockMsgBtn {
    padding: 4px 5px;
    font-size: 10px;
  }

  #peopleTab .personActions {
    gap: 3px;
  }
}
