.go-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  transition: background var(--ease);
}
.go-back:hover {
  background: var(--bg-3);
}
.go-back svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.timeline-searchbar {
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.timeline-searchbar__form {
  width: 100%;
}
.keyword-input {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}
.keyword-input input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--bg-3);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color var(--ease), background var(--ease);
}
.keyword-input input:focus {
  border-color: var(--accent);
  background: var(--bg-2);
}
.keyword-input input::placeholder {
  color: var(--text-3);
}
.keyword-input__left-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
  display: flex;
  align-items: center;
}
.keyword-input__left-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.keyword-input__right-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
  display: flex;
  align-items: center;
  cursor: pointer;
}
.keyword-input__right-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.chats {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-height: calc(100vh - 120px);
}
.chat-contacts {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.contacts-list__item {
  display: block;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  transition: background var(--ease);
}
.contacts-list__item:hover {
  background: var(--surface-hover);
}
.contacts-list__item.hidden {
  display: none !important;
}
.contacts-list__item .block-link {
  display: block;
  text-decoration: none;
  color: var(--text);
}
.contact-data {
  display: flex;
  padding: 12px 16px;
  gap: 12px;
  align-items: center;
}
.contact-data__avatar {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  position: relative;
}
.contact-data__avatar .user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-3);
}
.contact-data__avatar .user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.user-avatar-online::after {
  content: '';
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  background: var(--success);
  border: 2px solid var(--bg);
  border-radius: 50%;
}
.contact-data__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.contact-data__body-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.flex-item-left {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.user-name-holder {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.user-name-holder__badge svg {
  width: 14px;
  height: 14px;
  fill: var(--accent);
}
.flex-item-right {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 8px;
}
.contact-data__body-midline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.last-message {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.last-message.unseen-message {
  color: var(--text);
  font-weight: 600;
}
.new-message {
  flex-shrink: 0;
  margin-left: 8px;
}
.new-message .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
}

.timeline-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 56px 24px;
  text-align: center;
  min-height: 320px;
  background: var(--bg);
}
.timeline-placeholder .icon__bg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
}
.timeline-placeholder .icon__bg svg {
  width: 36px;
  height: 36px;
  display: block;
}
.timeline-placeholder .pl-message h4 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.timeline-placeholder .pl-message p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
  max-width: 340px;
}


.timeline-header__botline .lp.lp__avatar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-link-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: var(--bg-3);
}
.nav-link-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nav-link-avatar.online::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  background: var(--success);
  border: 2px solid var(--bg);
  border-radius: 50%;
}
.conversation {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  background: var(--bg);
}
.conversation__body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.conversation-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-overflow-scrolling: touch;
}
.load-old-btn {
  align-self: center;
  margin-bottom: 16px;
  background: var(--bg-3);
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ease);
}
.load-old-btn:hover {
  background: var(--bg-4);
}
.chat-bottom-spacer {
  height: 20px;
  flex-shrink: 0;
}

.conversation-messages__item {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  margin-bottom: 4px;
  position: relative;
}
.conversation-messages__item.left {
  align-self: flex-start;
}
.conversation-messages__item.right {
  align-self: flex-end;
  align-items: flex-end;
}
.message-data {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.right .message-data {
  flex-direction: row-reverse;
}
.message-data__body {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.4;
  word-wrap: break-word;
  position: relative;
}
.left .message-data__body {
  background: var(--bg-3);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.right .message-data__body {
  background: var(--accent);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}
.message-time {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  padding: 0 4px;
}
.right .message-time {
  text-align: right;
}

.message-media img {
  max-width: 250px;
  max-height: 300px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  margin: -4px 0;
}
.message-media video {
  max-width: 250px;
  max-height: 300px;
  border-radius: 12px;
  background: #000;
  display: block;
  margin: -4px 0;
}
.right .message-media img,
.right .message-media video {
  border-bottom-right-radius: 4px;
}
.left .message-media img,
.left .message-media video {
  border-bottom-left-radius: 4px;
}

.chat-gift-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
}
.gift-big {
  font-size: 48px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}
.gift-text {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
}

.message-data__ctrls {
  opacity: 0;
  transition: opacity var(--ease);
  display: flex;
  align-items: center;
}
.conversation-messages__item:hover .message-data__ctrls {
  opacity: 1;
}
.message-data__ctrls .dropdown-toggle {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  border-radius: 50%;
  color: var(--text-2);
  cursor: pointer;
}
.message-data__ctrls .dropdown-toggle svg {
  width: 16px;
  height: 16px;
}

.conversation__footer {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 50;
}
.message-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}
.message-input-cont {
  flex: 1;
  display: flex;
  align-items: flex-end;
  background: var(--bg-3);
  border-radius: 24px;
  padding: 6px 12px;
  min-height: 44px;
}
.message-input__field {
  flex: 1;
  min-width: 0;
  display: flex;
}
.message-input textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  resize: none;
  outline: none;
  max-height: 100px;
  padding: 8px 0;
  margin: 0;
}
.message-input textarea::placeholder {
  color: var(--text-2);
}
.message-input__ctrl {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--ease);
  flex-shrink: 0;
}
.message-input__ctrl:hover {
  background: var(--accent-soft);
}
.message-input__ctrl svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.message-input__ctrl[type="submit"] {
  background: var(--accent);
  color: #fff;
}
.message-input__ctrl[type="submit"]:disabled {
  background: var(--bg-4);
  color: var(--text-3);
  cursor: not-allowed;
}
.message-input__ctrl.ml-auto {
  margin-left: 0;
}

.message-audio-recstat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  padding: 0 12px;
}
.wave-animation {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
  overflow: hidden;
}
.wave-animation__item {
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  animation: wave 1s ease-in-out infinite alternate;
}
@keyframes wave {
  0% { transform: scaleY(0.5); }
  100% { transform: scaleY(1); }
}
.record-timer {
  font-size: 14px;
  font-weight: 700;
  color: var(--danger);
  font-variant-numeric: tabular-nums;
}

.chat-gift-btn {
  position: fixed;
  left: 16px;
  bottom: 80px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff8a00, #ff3d7f);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 61, 127, 0.4);
  z-index: 90;
  transition: transform var(--ease);
}
.chat-gift-btn:active {
  transform: scale(0.9);
}

.gift-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90%;
  max-width: 400px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}
.gift-panel.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}
.gift-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.gift-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-3);
  color: var(--text-2);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.gift-close:hover {
  background: var(--bg-4);
  color: var(--text);
}
.gift-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px;
  max-height: 60vh;
  overflow-y: auto;
}
.gift-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 8px;
  text-align: center;
}
.gift-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.gift-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.gift-price {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}
.gift-send {
  width: 100%;
  padding: 6px 0;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--ease);
}
.gift-send:hover {
  background: var(--accent-hover);
}


