/* ===== CHAT APP - 3 COLUMN LAYOUT ===== */

/* Override global bg for chat page */
html:has(.chat-app),
body:has(.chat-app) {
  height: 100%;
  overflow: hidden;
}

body:has(.chat-app) ::selection { background: rgba(255,45,107,.34); color: #fff; }
body:has(.chat-app) ::-moz-selection { background: rgba(255,45,107,.34); color: #fff; }
body:has(.chat-app) {
  background: #05000a !important;
  min-height: 100vh;
}
body:has(.chat-app) .bokeh-hearts,
body:has(.chat-app) #heartsCanvas {
  display: none !important;
}
/* Same static nebula background as other pages, no animation */
body:has(.chat-app)::before,
body:has(.chat-app)::after {
  display: block;
}

/* Navbar always shows the scrolled glass state on the chat page */
body:has(.chat-app) .header {
  background: rgba(5, 0, 10, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom-color: rgba(255,255,255,0.06);
}

.chat-app {
  display: flex;
  gap: 14px;
  padding: 14px;
  box-sizing: border-box;
  height: calc(100vh - 62px);
  margin-top: 62px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  background: transparent;
  transition: padding-left 0.3s cubic-bezier(0.4,0,0.2,1);
}

body[data-sidebar="open"] .chat-app { padding-left: 234px; }
body[data-sidebar="collapsed"] .chat-app { padding-left: 78px; }

/* ============================
   LEFT - CHAT LIST SIDEBAR
   ============================ */
.cl-sidebar {
  width: 322px;
  flex-shrink: 0;
  background: linear-gradient(165deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015)), #0f0a13;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
}

.cl-header {
  padding: 14px 16px 10px;
  flex-shrink: 0;
}


.cl-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cl-count {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

/* Online strip */
.cl-strip-wrap {
  position: relative;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.cl-strip {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.cl-strip::-webkit-scrollbar { display: none; }

.cl-strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex: 0 0 calc((100% - 30px) / 4);
  scroll-snap-align: start;
  transition: transform .2s;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
}
.cl-strip-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cl-strip-item:hover { transform: translateY(-2px); }

.cl-strip-avatar-wrap { position: relative; }

.cl-strip-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  display: block;
}

.cl-strip-dot {
  position: absolute;
  bottom: 4%; right: 4%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--online);
  border: 2px solid var(--bg-secondary);
}

.cl-strip-name {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cl-strip-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(20,20,20,0.85);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s;
}
.cl-strip-arrow:hover { background: rgba(255,45,107,0.7); }
.cl-strip-arrow-left { left: 2px; display: none; }
.cl-strip-arrow-left.visible { display: flex; }
.cl-strip-arrow-right { right: 2px; }


/* Search */
.cl-search-wrap {
  padding: 0 12px 8px;
  flex-shrink: 0;
}

.cl-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 9px 14px;
  transition: border-color 0.2s, background 0.2s;
}
.cl-search-box:focus-within { background: rgba(255,255,255,0.06); }
.cl-search-box svg { flex-shrink: 0; color: var(--text-secondary); }
.cl-search {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
}
.cl-search::placeholder { color: var(--text-secondary); }

/* Chat list */
.cl-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.cl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .15s;
  border-left: 3px solid transparent;
  width: 100%;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.cl-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cl-list,
.cl-item,
.cl-item *,
.cd-header,
.cd-header * {
  -webkit-user-select: none;
  user-select: none;
}
.cd-profile-trigger.is-placeholder {
  pointer-events: none;
  cursor: default !important;
  transform: none !important;
  box-shadow: none !important;
}
.cd-profile-trigger.is-placeholder .cd-hdr-avatar { display: none; }
.cd-profile-trigger.is-placeholder .cd-hdr-name { color: rgba(255,255,255,.72); font-weight: 600; }
.cl-item:hover { background: rgba(255,45,107,0.06); }
.cl-item.active {
  background: rgba(255,45,107,0.10);
  border-left-color: var(--accent);
}

.cl-item-avatar-wrap { position: relative; flex-shrink: 0; }

.cl-item-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  transition: border-color .2s;
}
.cl-item.active .cl-item-img { border-color: var(--accent); }

.cl-item-online-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--online);
  border: 2px solid var(--bg-secondary);
  display: none;
}
.cl-item-online-dot.visible { display: block; }
.cl-item-online-dot.busy { background: #ffb84d; }
.cl-item-online-dot.offline { background: rgba(255,255,255,0.38); }

.cl-item-body { flex: 1; min-width: 0; }

.cl-item-unread {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.cl-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.cl-item-name {
  font-size: 14px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cl-item-time {
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.cl-item-time.online { color: var(--online); font-weight: 500; }
.cl-item-time.busy { color: #ffb84d; font-weight: 500; }

.cl-item-preview {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 300;
}

.cl-item-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Balance button */
.cl-balance-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 12px 12px;
  padding: 11px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  box-shadow: 0 0 14px var(--accent-glow);
  transition: all 0.2s;
  flex-shrink: 0;
}
.cl-balance-btn:hover { background: var(--accent-dark); transform: translateY(-1px); }

/* Empty chat list state */
.cl-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  justify-content: center;
  min-height: 280px;
  padding: 32px 20px;
  text-align: center;
  gap: 8px;
}
.cl-empty-icon { font-size: 36px; }
.cl-empty-icon.img-icon { width: 90px; height: 90px; object-fit: contain; margin: 0 auto; }
.cl-empty-text { font-size: 14px; font-weight: 600; font-family: 'Montserrat', sans-serif; }
.cl-empty-sub  { font-size: 12px; color: var(--text-secondary); }
.cl-empty-btn  {
  margin-top: 10px;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  text-decoration: none;
  transition: all 0.2s;
}
.cl-empty-btn:hover { background: var(--accent-dark); }

/* ============================
   CENTER - DIALOG
   ============================ */
.cd-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 55, 115, 0.18), transparent 38%),
    radial-gradient(circle at 10% 75%, rgba(145, 55, 125, 0.13), transparent 42%),
    linear-gradient(160deg, #211627 0%, #17121e 48%, #241725 100%);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255,45,107,0.14);
  border-radius: 20px;
  box-shadow: 0 0 50px rgba(255,45,107,0.05), 0 8px 30px rgba(0,0,0,0.35);
  position: relative;
}

/* Decorative outline hearts behind the chat content (both desktop and mobile). */
.cd-bg-heart {
  position: absolute;
  z-index: -1;
  color: transparent;
  font-family: Arial, sans-serif;
  line-height: 1;
  -webkit-text-stroke: 2px rgba(255, 70, 125, 0.055);
  filter: blur(0.3px);
  user-select: none;
  pointer-events: none;
}
.cd-bg-heart-1 { top: 8%;  left: 6%;   font-size: 150px; transform: rotate(-18deg); }
.cd-bg-heart-2 { top: 34%; right: 7%;  font-size: 210px; transform: rotate(16deg); }
.cd-bg-heart-3 { bottom: 3%; left: 18%; font-size: 180px; transform: rotate(10deg); }
.cd-bg-heart-4 { top: 63%; right: 32%; font-size: 95px;  transform: rotate(-12deg); }

/* Chat header */
.cd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  height: 60px;
  flex-shrink: 0;
  background: rgba(22, 8, 20, 0.95);
  border-bottom: 1px solid var(--border-pink);
}

.cd-header-left { display: flex; align-items: center; gap: 10px; }

.cd-profile-trigger {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}
.cd-profile-trigger > span { min-width: 0; display: block; }

.cd-hdr-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  display: none;
}

.cd-hdr-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.cd-hdr-status {
  font-size: 11px;
  color: var(--online);
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cd-header-right { display: flex; align-items: center; gap: 8px; }

/* Empty state */
.cd-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}
.cd-empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 18px;
  padding: 26px 32px;
}
.cd-empty-strip-panel,
.cd-empty-girls { display: none; }

.chat-jump-bottom {
  position: absolute;
  right: 18px;
  bottom: 78px;
  z-index: 12;
  width: 42px;
  height: 42px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,45,107,.34);
  border-radius: 50%;
  background: rgba(27,15,24,.94);
  color: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,.38), 0 0 18px rgba(255,45,107,.14);
  cursor: pointer;
}
.chat-jump-bottom.visible { display: inline-flex; }
.chat-jump-bottom svg { width: 19px; height: 19px; }
.cd-empty-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.cd-empty-text {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}
.cd-empty-icon { font-size: 36px; }
.cd-empty-icon.img-icon { width: 92px; height: 92px; object-fit: contain; margin: 4px auto 0; }

/* Messages */
.cd-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message { display: flex; gap: 8px; max-width: 70%; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  align-self: flex-end;
  border: 1px solid var(--border-pink);
}

.msg-bubble {
  padding: 9px 13px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.5;
  word-break: break-word;
}

.message.girl .msg-bubble {
  background: rgba(40, 16, 38, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-pink);
  border-radius: 4px 16px 16px 16px;
  color: var(--text-primary);
}

.message.user .msg-bubble {
  background: var(--accent);
  border-radius: 16px 4px 16px 16px;
  color: #fff;
  box-shadow: 0 0 10px var(--accent-glow);
}

.msg-media {
  max-width: 240px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 6px;
}

.msg-media img,
.msg-media video {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
}

.msg-media img {
  cursor: zoom-in;
}

/* ===== CHAT IMAGE LIGHTBOX ===== */
.chat-lightbox {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.chat-lightbox img {
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  object-fit: contain;
}

.chat-lightbox .modal-close {
  top: -14px;
  right: -14px;
  background: var(--accent);
  color: #fff;
}

.msg-bubble.msg-media-only {
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.msg-bubble.msg-media-only .msg-media {
  margin-bottom: 0;
}

.message.girl .msg-bubble.msg-media-caption {
  margin-top: 6px;
  width: fit-content;
}

.msg-time {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 3px;
  opacity: 0.6;
}
.message.user .msg-time { text-align: right; }

/* Date divider */
.msg-date-divider {
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
  margin: 8px 0;
  position: relative;
}
.msg-date-divider::before,
.msg-date-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--border);
}
.msg-date-divider::before { left: 0; }
.msg-date-divider::after  { right: 0; }

/* Typing */
.cd-typing {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0 20px 6px;
}
.cd-typing.visible { display: flex; }

.cd-typing-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-pink);
}

.cd-typing-bubble {
  background: rgba(40,16,38,0.9);
  border: 1px solid var(--border-pink);
  border-radius: 4px 14px 14px 14px;
  padding: 9px 14px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: typingBounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce {
  0%,80%,100% { transform: translateY(0); opacity: .4; }
  40%         { transform: translateY(-4px); opacity: 1; }
}

/* Auth banner */
.cd-auth-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255,45,107,0.08);
  border-top: 1px solid var(--border-pink);
  flex-shrink: 0;
}
.cd-auth-banner.visible { display: flex; }
.cd-auth-title { font-size: 13px; font-weight: 600; font-family: 'Montserrat', sans-serif; }
.cd-auth-sub   { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* Low-balance reminder - closable */
.cd-low-balance-banner { position: relative; padding-right: 40px; }
.cd-banner-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.cd-banner-close:hover { background: var(--accent-soft); color: var(--accent); }

/* Closed-conversation banners (shown instead of the input area) */
.cd-closed-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--border-pink);
  flex-shrink: 0;
}
.cd-closed-banner.visible { display: flex; }

/* User-closed: neutral grey - chat ended gently, history kept */
.cd-closed-banner--user {
  background: rgba(255,255,255,0.04);
  border-top-color: rgba(255,255,255,0.08);
}

/* Girl-closed: pink/red - she needs space after bad behavior */
.cd-closed-banner--girl {
  background: rgba(255,45,107,0.1);
  border-top-color: var(--border-pink);
}
.cd-closed-banner--girl .cd-auth-title { color: var(--accent); }
#cooldownTimer { font-weight: 700; color: var(--text-primary); }

/* In-chat system divider card (e.g. "Диалог завершён ✓") */
.cd-system-card {
  align-self: center;
  max-width: 78%;
  margin: 10px auto;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}
.cd-system-card--girl {
  background: rgba(255,45,107,0.08);
  border-color: var(--border-pink);
  color: var(--accent);
}

/* Close-dialog button, next to the message input */
.cd-close-chat-btn {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s;
}
.cd-close-chat-btn:hover { opacity: 0.85; }
.cd-close-chat-icon { display: none; }

/* Cost hint under the input area */
.cd-cost-hint {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  margin: -6px 12px 10px;
}
.cd-cost-hint.visible { display: flex; }
.cd-cost-hint .hearts-icon-sm { width: 14px; height: 14px; }

/* Input */
.cd-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px;
  margin: 0 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.cd-input-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  cursor: pointer;
  transition: all .2s;
}
.cd-input-icon:hover { border-color: var(--accent); background: var(--accent-soft); }

.cd-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.cd-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 9px 16px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  resize: none;
  max-height: 100px;
  line-height: 1.4;
  transition: border-color .2s, box-shadow .2s;
}
.cd-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,45,107,0.08); outline: none; }
.cd-input::placeholder { color: #444; }
.cd-input.has-char-counter { padding-bottom: 25px !important; }
.cd-input.is-over-limit { border-color: #ff526f !important; }

.cd-char-counter {
  display: none;
  position: absolute;
  right: 14px;
  bottom: 7px;
  color: rgba(255,255,255,0.52);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: none;
  white-space: nowrap;
}
.cd-char-counter.visible { display: block; }
.cd-char-counter.warning { color: #ff6b9a; }
.cd-char-counter.at-limit,
.cd-char-counter.over-limit { color: #ff526f; }

.cd-send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
  box-shadow: 0 0 12px var(--accent-glow);
  transition: all .2s;
  border: none;
  cursor: pointer;
}

@media (max-width: 760px) {
  body.mobile-profile-view .cp-sidebar {
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }
}
.cd-send-btn svg { width: 18px; height: 18px; display: block; transform: translateX(1px); }
.cd-send-btn:hover { transform: scale(1.08); box-shadow: 0 0 20px var(--accent-glow); }
.cd-send-btn:disabled { opacity: .4; transform: none; cursor: not-allowed; }

/* ============================
   RIGHT - GIRL PROFILE
   ============================ */
.cp-sidebar {
  width: 326px;
  flex-shrink: 0;
  background: linear-gradient(165deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015)), #0f0a13;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
}

.cp-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
}

.cp-profile { display: flex; flex-direction: column; }

/* Photo */
.cp-photo-wrap {
  position: relative;
  width: 100%;
  height: 300px;
  flex-shrink: 0;
}

.cp-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.cp-photo-gradient {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(22,8,20,0.95), transparent);
}

.cp-like-btn {
  position: absolute;
  top: 10px; right: 10px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.22s;
  color: #fff;
}
.cp-like-btn:hover { transform: scale(1.12); border-color: rgba(255,255,255,0.5); }
.cp-like-btn.liked {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  color: #fff;
}
.cp-like-btn.liked .heart-icon { fill: none; stroke: #fff; }

.cp-status-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--online);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Info block */
.cp-info { padding: 12px 14px 20px; display: flex; flex-direction: column; gap: 10px; }

.cp-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.cp-stats-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 6px;
}
.cp-stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  color: rgba(255,255,255,0.75);
}
.cp-stat-divider {
  width: 1px;
  height: 14px;
  background: rgba(255,255,255,0.12);
}

.cp-section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 4px;
}

.cp-bio {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.6;
}

.cp-details { display: flex; flex-direction: column; gap: 6px; }

.cp-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.cp-detail-icon { font-size: 14px; width: 18px; text-align: center; }

.cp-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.cp-tag {
  padding: 5px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}


/* Responsive */
@media (max-width: 1100px) { .cp-sidebar { display: none; } }
@media (max-width: 760px)  { .cl-sidebar { display: none; } }

/* ========================================================================
   DATECHAT SITE-SYSTEM ALIGNMENT
   Visual-only layer: preserves the existing DOM, dimensions and behavior.
   ======================================================================== */

body:has(.chat-app) {
  background: #05000a !important;
}

body:has(.chat-app)::before {
  /* Keep the exact global DateChat background from style.css. */
}

.chat-app {
  gap: 12px;
  padding: 14px 16px 16px;
}

body[data-sidebar="open"] .chat-app { padding-left: 234px; }
body[data-sidebar="collapsed"] .chat-app { padding-left: 78px; }

.cl-sidebar,
.cp-sidebar,
.cd-main {
  border-radius: var(--card-radius);
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.025), rgba(255,255,255,0) 42%),
    rgba(15, 10, 19, 0.94);
  box-shadow: 0 14px 36px rgba(0,0,0,0.24);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.cl-sidebar { width: 322px; }
.cp-sidebar { width: 326px; }

.cl-sidebar,
.cp-sidebar {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.035), rgba(255,255,255,0) 44%),
    rgba(27, 28, 32, 0.96);
  border-color: rgba(255,255,255,0.085);
}

.cd-main {
  background:
    radial-gradient(circle at 90% 7%, rgba(255,45,107,0.16), transparent 30%),
    radial-gradient(circle at 5% 82%, rgba(196,12,68,0.14), transparent 34%),
    radial-gradient(ellipse 54% 38% at 53% 48%, rgba(118,15,80,0.10), transparent 72%),
    linear-gradient(150deg, rgba(38,10,32,0.97), rgba(17,7,20,0.985) 48%, rgba(31,9,27,0.98));
  border-color: rgba(255,45,107,0.13);
  box-shadow: 0 16px 42px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.025);
}

/* A quiet atmospheric signature near the edges, never a wallpaper. */
.cd-bg-heart {
  z-index: 0;
  -webkit-text-stroke: 0;
  color: rgba(255,45,107,0.12);
  filter: blur(4px);
  opacity: .82;
}
.cd-bg-heart-1 { top: 1%; left: -3%; font-size: 142px; }
.cd-bg-heart-2 { top: 31%; right: -5%; font-size: 184px; }
.cd-bg-heart-3 { bottom: -6%; left: 6%; font-size: 158px; }
.cd-bg-heart-4 { display: block; top: 62%; right: 27%; font-size: 92px; color: rgba(255,45,107,0.075); }

.cd-messages::before,
.cd-messages::after {
  content: none !important;
  position: absolute;
  z-index: 0;
  color: rgba(255,45,107,0.055);
  font-size: 70px;
  line-height: 1;
  filter: blur(2px);
  pointer-events: none;
}
.cd-messages::before {
  content: '♥';
  top: 22%;
  left: 16%;
  transform: rotate(-16deg);
}
.cd-messages::after {
  content: '♥';
  right: 14%;
  bottom: 17%;
  transform: rotate(14deg);
}
.cd-messages > * { position: relative; z-index: 1; }

.cd-header,
.cd-messages,
.cd-typing,
.cd-auth-banner,
.cd-closed-banner,
.cd-input-area,
.cd-cost-hint {
  position: relative;
  z-index: 1;
}

.cl-header {
  padding: 16px 16px 11px;
}

.cl-title {
  font-size: 16px;
  letter-spacing: -0.2px;
}

.cl-count {
  min-width: 22px;
  text-align: center;
  background: var(--accent);
  box-shadow: none;
}

.cl-strip-wrap {
  border-bottom-color: rgba(255,255,255,0.055);
}

.cl-strip {
  padding-top: 10px;
  padding-bottom: 11px;
}

.cl-strip-img {
  border-color: rgba(255,45,107,0.72);
  box-shadow: 0 0 0 3px rgba(255,45,107,0.055);
}

.cl-strip-item:hover .cl-strip-img {
  border-color: var(--accent);
}

.cl-strip-arrow {
  background: rgba(20,8,18,0.84);
  border-color: rgba(255,255,255,0.09);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.cl-strip-arrow:hover {
  color: var(--accent);
  background: rgba(255,45,107,0.12);
  border-color: rgba(255,45,107,0.28);
}

.cl-search-wrap { padding: 0 12px 10px; }
.cl-search-box {
  min-height: 38px;
  background: rgba(255,255,255,0.035);
  border-color: rgba(255,255,255,0.09);
  border-radius: 10px;
  padding: 8px 12px;
}
.cl-search-box:hover { border-color: var(--border-pink); }
.cl-search-box:focus-within {
  background: rgba(255,255,255,0.048);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.cl-list {
  padding: 3px 8px 8px;
}

.cl-item {
  margin: 2px 0;
  padding: 10px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
}
.cl-item:hover {
  background: rgba(255,255,255,0.045);
}
.cl-item.active {
  background: linear-gradient(135deg, #b3204b, #940037);
  border-color: transparent;
  box-shadow: 0 4px 13px rgba(255,45,107,0.13);
}
.cl-item.active:hover {
  background: linear-gradient(135deg, #c52455, #a6003d);
}
.cl-item.active .cl-item-name { color: #fff; }
.cl-item.active .cl-item-msg,
.cl-item.active .cl-item-time { color: rgba(255,255,255,0.76); }
.cl-item.active .cl-item-img {
  border-color: transparent;
  box-shadow: none;
}

.cl-balance-btn,
.cl-empty-btn,
.cd-close-chat-btn {
  background: var(--accent);
  border-radius: 50px;
  box-shadow: none;
}
.cl-balance-btn {
  margin: 10px 12px 12px;
  min-height: 40px;
}
.cl-balance-btn:hover,
.cl-empty-btn:hover,
.cd-close-chat-btn:hover {
  background: var(--accent-dark);
  opacity: 1;
  box-shadow: 0 5px 16px var(--accent-glow);
}

.cd-header {
  height: 60px;
  background: rgba(15,10,19,0.78);
  border-bottom-color: rgba(255,255,255,0.06);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.cd-hdr-avatar {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,45,107,0.06);
}

.cd-empty-card {
  width: 260px;
  max-width: calc(100% - 32px);
  min-width: 0;
  aspect-ratio: 1.15;
  justify-content: center;
  padding: 27px 34px 25px;
  background: linear-gradient(145deg, rgba(36,18,27,.82), rgba(22,13,20,.88));
  border-color: var(--border);
  border-radius: var(--card-radius);
  box-shadow: 0 12px 32px rgba(0,0,0,0.14);
}

.cd-messages {
  padding: 22px 20px 10px;
  gap: 9px;
}

.message.girl .msg-bubble {
  background: rgba(42,18,40,0.93);
  border-color: rgba(255,255,255,0.065);
  border-radius: 5px 15px 15px 15px;
  box-shadow: 0 5px 14px rgba(0,0,0,0.12);
  backdrop-filter: none;
}

.message.user .msg-bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 15px 5px 15px 15px;
  box-shadow: 0 7px 18px rgba(255,45,107,0.16);
}

.msg-avatar,
.cd-typing-avatar {
  border-color: rgba(255,45,107,0.28);
}

.msg-media,
.msg-media img,
.msg-media video {
  border-radius: 10px;
}

.cd-typing-bubble {
  background: rgba(42,18,40,0.93);
  border-color: rgba(255,255,255,0.065);
  box-shadow: 0 5px 14px rgba(0,0,0,0.12);
}
.typing-dot { background: rgba(255,255,255,0.62); }

.cd-input-area {
  gap: 8px;
  padding: 8px 9px;
  margin: 0 12px 12px;
  background: rgba(15,10,19,0.82);
  border-color: rgba(255,255,255,0.08);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.16);
}

.cd-input {
  min-height: 40px;
  background: rgba(255,255,255,0.045);
  border-color: rgba(255,255,255,0.075);
  border-radius: 10px;
  padding: 10px 14px;
}
.cd-input:hover { border-color: rgba(255,45,107,0.17); }
.cd-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cd-input::placeholder { color: rgba(255,255,255,0.28); }

.cd-send-btn {
  width: 40px;
  height: 40px;
  background: var(--accent);
  box-shadow: none;
}
.cd-send-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(255,45,107,0.22);
}

/* Final mobile messenger layer: keep this last so desktop restyle blocks cannot override it. */
@media (min-width: 761px) {
  .cd-mobile-back,
  .cp-mobile-close { display: none !important; }
}

@media (max-width: 760px) {
  .chat-app,
  body[data-sidebar="open"] .chat-app,
  body[data-sidebar="collapsed"] .chat-app,
  body[data-sidebar="mobile"] .chat-app { padding: 0 !important; }
  .cl-sidebar { display: flex !important; width: 100% !important; border-radius: 0 !important; }
  .cd-main,
  .cp-sidebar { display: none !important; width: 100% !important; border-radius: 0 !important; }
  body.mobile-chat-view .cl-sidebar,
  body.mobile-profile-view .cl-sidebar { display: none !important; }
  body.mobile-chat-view .cd-main { display: flex !important; }
  body.mobile-profile-view .cp-sidebar { display: flex !important; flex-direction: column; }
  .cd-mobile-back { display: inline-flex !important; }
  body.no-chat-history .cd-mobile-back { display: none !important; }
  body.no-chat-history .cd-header { display: none; }
  body.no-chat-history .cd-profile-trigger { padding-left: 10px; }
  body.no-chat-history .cd-messages { padding: 0 0 16px; }
  body.no-chat-history .cd-empty {
    min-height: 0;
    justify-content: center;
    padding: 22px 12px 34px;
  }
  body.no-chat-history .cd-empty-card {
    width: 260px;
    max-width: calc(100% - 56px);
    aspect-ratio: 1.15;
    padding: 25px 18px 23px;
  }
  body.no-chat-history .cd-empty-badge { display: flex; }
  body.no-chat-history .cd-empty-strip-panel {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    background: linear-gradient(165deg, rgba(255,255,255,.035), rgba(255,255,255,.008)), #180813;
    border-bottom: 1px solid rgba(255,255,255,.07);
    backdrop-filter: blur(14px);
  }
  .cd-empty-strip-wrap { overflow: hidden; }
  .cd-empty-girls {
    display: flex;
  }
  .cp-mobile-close { display: flex !important; }
}
.cd-send-btn:focus-visible,
.cl-balance-btn:focus-visible,
.cd-close-chat-btn:focus-visible {
  outline: 2px solid rgba(255,255,255,0.82);
  outline-offset: 2px;
}

.cd-auth-banner,
.cd-closed-banner {
  background: rgba(26,8,24,0.88);
  border-top-color: var(--border);
}

.cp-photo-wrap { height: 300px; }
.cp-photo-gradient {
  display: none;
}
.cp-like-btn,
.cp-status-badge {
  background: rgba(5,0,10,0.68);
  border-color: rgba(255,255,255,0.18);
}
.cp-info { padding: 14px 16px 22px; }
.cp-tag {
  background: rgba(255,45,107,0.065);
  border-color: rgba(255,45,107,0.12);
  color: rgba(255,255,255,0.64);
}

.cl-list,
.cd-messages,
.cp-sidebar {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.cl-list::-webkit-scrollbar,
.cd-messages::-webkit-scrollbar,
.cp-sidebar::-webkit-scrollbar { width: 2px; }
.cl-list::-webkit-scrollbar-track,
.cd-messages::-webkit-scrollbar-track,
.cp-sidebar::-webkit-scrollbar-track { background: transparent; }
.cl-list::-webkit-scrollbar-thumb,
.cd-messages::-webkit-scrollbar-thumb,
.cp-sidebar::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 999px; }

@media (max-width: 1100px) {
  .chat-app { gap: 10px; }
}

@media (max-width: 760px) {
  html:has(.chat-app),
  body:has(.chat-app) {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
  body:has(.chat-app) { padding-bottom: 0; }
  body:has(.chat-app) .header {
    top: 0;
    transform: translateY(var(--mobile-viewport-offset, 0px));
  }
  body:has(.chat-app) .mobile-bottom-nav { display: none !important; }
  .chat-app,
  body[data-sidebar="open"] .chat-app {
    padding: 0;
    position: fixed;
    inset: auto 0 auto 0;
    top: 62px;
    margin-top: 0;
    transform: translateY(var(--mobile-viewport-offset, 0px));
    height: calc(var(--mobile-viewport-height, 100dvh) - 62px);
  }
  body[data-sidebar="collapsed"] .chat-app,
  body[data-sidebar="mobile"] .chat-app {
    padding: 0;
    position: fixed;
    inset: auto 0 auto 0;
    top: 62px;
    margin-top: 0;
    transform: translateY(var(--mobile-viewport-offset, 0px));
    height: calc(var(--mobile-viewport-height, 100dvh) - 62px);
  }
  body.mobile-chat-view:not(.no-chat-history) .header,
  body.mobile-profile-view .header {
    display: none;
  }
  body.mobile-chat-view:not(.no-chat-history) .chat-app,
  body.mobile-profile-view .chat-app {
    top: 0;
    height: var(--mobile-viewport-height, 100dvh);
  }
  .cl-sidebar,
  .cd-main,
  .cp-sidebar {
    width: 100%;
    max-width: none;
    flex: 1 1 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .cl-sidebar { display: flex; }
  .cd-main,
  .cp-sidebar { display: none; }
  body.mobile-chat-view .cl-sidebar,
  body.mobile-profile-view .cl-sidebar { display: none; }
  body.mobile-chat-view .cd-main { display: flex; }
  body.mobile-profile-view .cd-main { display: none; }
  body.mobile-profile-view .cp-sidebar { display: flex; overflow-y: auto !important; overscroll-behavior: contain; background: #151019; }

  .cl-header { padding: 17px 16px 11px; }
  .cl-title { font-size: 20px; }
  .cl-search-wrap { padding: 4px 14px 10px; }
  .cl-list { padding: 4px 8px 12px; }
  .cl-item { min-height: 70px; padding: 10px; border: 0; border-radius: 15px; margin-bottom: 4px; }
  .cl-item-img { width: 54px; height: 54px; }
  .cl-item-name { font-size: 14px; }
  .cl-item-preview { font-size: 12px; }
  .cl-balance-btn { display: none; }

  .cd-main { border-radius: 0; border-top: 0; }
  .cd-header { padding: 0 10px 0 6px; height: 58px; }
  .cd-header-left { min-width: 0; gap: 2px; }
  .cd-mobile-back {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 34px;
    font-weight: 300;
    line-height: 1;
  }
  .cd-profile-trigger { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 3px 6px; border: 0; border-radius: 12px; background: transparent; color: inherit; text-align: left; }
  .cd-profile-trigger > span { min-width: 0; display: block; }
  .cd-hdr-name, .cd-hdr-status { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cd-hdr-avatar { width: 38px; height: 38px; flex: 0 0 38px; }
  .coins-badge { padding: 7px 9px; }
  .cd-messages { padding: 16px 11px 8px; }
  .message { max-width: 86%; }
  .cd-input-area { margin: 0 8px max(8px, env(safe-area-inset-bottom)); }
  .cd-close-chat-btn {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
  }
  .cd-close-chat-btn { display: grid; place-items: center; line-height: 1; }
  .cd-close-chat-label { display: none; }
  .cd-close-chat-icon {
    display: block;
    width: 21px;
    height: 21px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    pointer-events: none;
  }
  .cd-input { min-width: 0; }
  .cd-send-btn { display: grid; place-items: center; padding: 0; line-height: 1; }
  .cd-bg-heart-1 { left: -12%; }
  .cd-bg-heart-2 { right: -14%; }

  /* Keep the mobile chat header airy even with a balance and a signed-in user. */
  body:has(.chat-app) .header-inner { padding-inline: 10px; gap: 8px; }
  body:has(.chat-app) .logo-text { font-size: clamp(23px, 6.8vw, 27px); }
  body:has(.chat-app) .header-right { min-width: 0; gap: 6px; }
  body:has(.chat-app) #userMenu { gap: 5px !important; }
  body:has(.chat-app) #userGreeting { display: none !important; }
  body:has(.chat-app) .coins-badge { min-height: 38px; padding: 6px 9px; gap: 5px; }
  body:has(.chat-app) .hearts-icon-sm { width: 21px; height: 21px; }
  body:has(.chat-app) #userMenu .btn { min-height: 38px; padding: 8px 11px; }

  .cp-mobile-close {
    position: sticky;
    top: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 54px;
    padding: 0 16px;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(18,10,18,.94);
    backdrop-filter: blur(18px);
    color: #fff;
    font-family: 'Montserrat',sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
  }

  .cp-info { padding: 17px 16px 26px; gap: 12px; }
  .cp-name { font-size: 23px; line-height: 1.2; }
  .cp-stats-row { gap: 12px; margin: 5px 0 8px; }
  .cp-stat-item { font-size: 14px; }
  .cp-section-title { margin-top: 4px; font-size: 13px; }
  .cp-bio { font-size: 14px; line-height: 1.65; }
  .cp-tags { gap: 7px; }
  .cp-tag { padding: 6px 12px; font-size: 12px; }
  .chat-jump-bottom { right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .cp-mobile-close::first-letter { font-size: 28px; font-weight: 300; }
  .cp-photo-wrap {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
  }
  .cp-info { padding: 20px 18px 34px; }
  .cd-auth-banner,
  .cd-closed-banner {
    margin: 8px;
    padding: 13px;
    flex-direction: column;
    align-items: stretch;
    gap: 11px;
    border-radius: 16px;
  }
  .cd-auth-banner > div:first-child,
  .cd-closed-banner > div:first-child { min-width: 0; }
  .cd-auth-banner > div[style],
  .cd-closed-banner > div[style] { width: 100%; display: grid !important; grid-template-columns: 1fr 1.35fr; gap: 8px !important; }
  .cd-auth-banner .btn,
  .cd-closed-banner .btn { width: 100%; min-width: 0; padding-left: 9px; padding-right: 9px; }
  .cd-auth-title { font-size: 13px; }
  .cd-auth-sub { font-size: 11px; line-height: 1.4; }
}

.cd-mobile-back,
.cp-mobile-close { display: none; }

/* ═══════════════════════════════════════════════════════════
   PREMIUM MESSENGER RESTYLE — cohesive with the site (pink/dark)
   ═══════════════════════════════════════════════════════════ */
.message { gap: 10px; max-width: 76%; }
.msg-bubble { padding: 11px 15px; font-size: 13.5px; line-height: 1.55; }

.message.girl .msg-bubble {
  background: linear-gradient(180deg, rgba(60,26,54,0.62), rgba(40,17,36,0.55));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px 20px 20px 20px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.28);
  color: #f4ecf2;
}
.message.user .msg-bubble {
  background: linear-gradient(135deg, #ff4d84 0%, #ff2d6b 55%, #e0245c 100%);
  border-radius: 20px 6px 20px 20px;
  box-shadow: 0 8px 24px rgba(255,45,107,0.40);
  color: #fff;
}
.msg-avatar {
  width: 34px; height: 34px;
  border: 2px solid rgba(255,45,107,0.45);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.25), 0 4px 10px rgba(0,0,0,0.3);
}

/* Header — show girl avatar with online ring, richer bar */
.cd-header {
  height: 66px;
  background: linear-gradient(180deg, rgba(30,10,26,0.96), rgba(22,8,20,0.92));
  border-bottom: 1px solid rgba(255,45,107,0.18);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.cd-hdr-avatar {
  display: block !important;
  width: 40px; height: 40px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 2px rgba(255,45,107,0.18), 0 0 14px var(--accent-glow);
}
.cd-hdr-name { font-size: 15.5px; letter-spacing: -0.2px; }
.cd-hdr-status { font-weight: 600; }

/* Input — pill + glowing gradient send */
.cd-input-area {
  border-radius: 22px;
  border: 1px solid rgba(255,45,107,0.14);
  box-shadow: 0 8px 26px rgba(0,0,0,0.28);
}
.cd-input { border-radius: 22px; background: rgba(0,0,0,0.22); font-size: 13.5px; padding: 11px 18px; }
.cd-input::placeholder { color: rgba(255,255,255,0.32); }
.cd-send-btn {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, #ff4d84, #e0245c);
  box-shadow: 0 6px 18px var(--accent-glow);
}
.cd-send-btn:hover { transform: translateY(-1px) scale(1.06); box-shadow: 0 10px 28px var(--accent-glow); }

/* Conversation list — premium active/hover, avatar rings, glowing unread */
.cl-item { border-radius: 14px; }
.cl-item:hover { background: rgba(255,45,107,0.07); }
.cl-item.active {
  background: linear-gradient(90deg, rgba(255,45,107,0.16), rgba(255,45,107,0.02));
  box-shadow: inset 3px 0 0 var(--accent);
}
.cl-item-img { border: 2px solid rgba(255,255,255,0.10); }
.cl-item.active .cl-item-img { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.cl-item-unread { box-shadow: 0 0 12px var(--accent-glow); }

/* Typing bubble on-brand */
.cd-typing-bubble {
  background: linear-gradient(180deg, rgba(60,26,54,0.6), rgba(40,17,36,0.5));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px 18px 18px 18px;
}

/* ═══════════════════════════════════════════════════════════════
   SIGNATURE CHAT — solid bubbles + romantic aurora background
   (final override block — wins over earlier duplicates)
   ═══════════════════════════════════════════════════════════════ */

/* Bubbles: solid colour, no gradient */
.message.user .msg-bubble {
  background: var(--accent) !important;
  background-image: none !important;
  border-radius: 20px 6px 20px 20px;
  box-shadow: 0 6px 20px rgba(255,45,107,0.30);
  color: #fff;
}
.message.girl .msg-bubble {
  background: rgba(46,22,42,0.80) !important;
  background-image: none !important;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px 20px 20px 20px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.30);
  color: #f4ecf2;
}

/* Romantic aurora mesh — signature dating vibe */
.cd-main {
  background:
    radial-gradient(ellipse 80% 55% at 12% -5%,  rgba(255,45,107,0.20), transparent 55%),
    radial-gradient(ellipse 65% 55% at 92% 12%,   rgba(196,64,168,0.16), transparent 55%),
    radial-gradient(ellipse 75% 60% at 88% 105%,  rgba(255,74,132,0.16), transparent 58%),
    radial-gradient(ellipse 65% 55% at 6% 92%,    rgba(150,40,120,0.14), transparent 58%),
    linear-gradient(160deg, #17101c 0%, #100a13 52%, #1a1020 100%) !important;
}
/* Slow breathing aurora glow behind the messages */
.cd-main::before {
  content: '';
  position: absolute; inset: -12%;
  z-index: -3; pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(255,45,107,0.22), transparent 72%) 22% 26%/46% 46% no-repeat,
    radial-gradient(closest-side, rgba(196,64,190,0.16), transparent 72%) 82% 78%/50% 50% no-repeat;
  filter: blur(34px);
  animation: cdAurora 22s ease-in-out infinite alternate;
}
@keyframes cdAurora {
  0%   { transform: translate(-2%, -1%) scale(1);    }
  50%  { transform: translate(2%,  2%) scale(1.06);  }
  100% { transform: translate(-1%, 3%) scale(1.03);  }
}

/* Floating glowing hearts (soft romantic embers) */
.cd-bg-heart {
  z-index: -2 !important;
  -webkit-text-stroke: 0 !important;
  color: rgba(255,70,125,0.10) !important;
  text-shadow: 0 0 42px rgba(255,45,107,0.22);
  filter: blur(0.4px);
  will-change: transform;
  animation: cdHeartFloat 17s ease-in-out infinite;
}
.cd-bg-heart-1 { top: 6%;   left: 4%;    font-size: 150px; animation-delay: 0s;   }
.cd-bg-heart-2 { top: 30%;  right: -2%;  font-size: 200px; animation-delay: -4s;  color: rgba(196,64,168,0.09) !important; }
.cd-bg-heart-3 { bottom: 2%; left: 12%;  font-size: 175px; animation-delay: -8s;  }
.cd-bg-heart-4 { top: 60%;  right: 26%;  font-size: 100px; animation-delay: -12s; }
@keyframes cdHeartFloat {
  0%,100% { transform: translateY(0)     rotate(-6deg); }
  50%     { transform: translateY(-26px) rotate(4deg);  }
}

/* ═══════════════════════════════════════════════════════════════
   CHAT v2 — static site-style bg, messenger-style active item,
   glassmorphism panels (final override)
   ═══════════════════════════════════════════════════════════════ */

/* Static, site-coloured background */
.cd-main {
  background:
    radial-gradient(ellipse 70% 50% at 15% 0%,   rgba(255,45,107,0.14), transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(255,45,107,0.10), transparent 55%),
    linear-gradient(160deg, #1a0e18 0%, #140a12 55%, #1c0f1a 100%) !important;
}
.cd-main::before { display: none !important; }

.cd-bg-heart {
  z-index: -2 !important;
  color: rgba(255,45,107,0.06) !important;
  -webkit-text-stroke: 0 !important;
  text-shadow: none !important;
  filter: none !important;
  animation: none !important;
}
.cd-bg-heart-2 { color: rgba(255,45,107,0.05) !important; }

/* Active conversation = one solid accent fill, all text white */
.cl-item.active {
  background: var(--accent) !important;
  box-shadow: 0 4px 16px var(--accent-glow) !important;
}
.cl-item.active .cl-item-name,
.cl-item.active .cl-item-preview,
.cl-item.active .cl-item-time,
.cl-item.active .cl-item-time.online,
.cl-item.active .cl-item-time.busy { color: #fff !important; }
.cl-item.active .cl-item-img { border-color: rgba(255,255,255,0.65) !important; box-shadow: none !important; }
.cl-item.active .cl-item-unread { background: #fff !important; color: var(--accent) !important; box-shadow: none !important; }

/* Glassmorphism panels — left, right, header (like site cards) */
.cl-sidebar,
.cp-sidebar {
  background: rgba(22,12,20,0.55) !important;
  backdrop-filter: blur(22px) !important;
  -webkit-backdrop-filter: blur(22px) !important;
  border: 1px solid rgba(255,255,255,0.07) !important;
}
.cd-header {
  background: rgba(22,12,20,0.50) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

/* ═══════════════════════════════════════════════════════════════
   CHAT v3 — bubble height, richer bg, site page backdrop,
   header avatar placeholder + list photo borders (final override)
   ═══════════════════════════════════════════════════════════════ */

/* 1. Bubbles ~15% shorter (tighter vertical padding) */
.msg-bubble { padding-top: 9px !important; padding-bottom: 9px !important; }

/* 2. Chat background — same palette, more contrast/saturation */
.cd-main {
  background:
    radial-gradient(ellipse 70% 50% at 15% 0%,   rgba(255,45,107,0.22), transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(255,45,107,0.17), transparent 55%),
    linear-gradient(160deg, #200f1c 0%, #120810 55%, #241220 100%) !important;
}

/* 3. Page backdrop behind the 3 panels = same nebula as other pages */
.chat-app {
  background:
    radial-gradient(ellipse 70% 50% at 15% 8%,   rgba(180, 8, 55, 0.38) 0%, transparent 60%),
    radial-gradient(ellipse 55% 45% at 78% 18%,  rgba(220, 15, 75, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 8%  55%,  rgba(150, 4, 45, 0.20) 0%, transparent 60%),
    radial-gradient(ellipse 65% 50% at 82% 62%,  rgba(190, 10, 65, 0.22) 0%, transparent 60%),
    radial-gradient(ellipse 80% 45% at 45% 92%,  rgba(130, 0, 40, 0.28) 0%, transparent 65%) !important;
}

/* 4. Header avatar: no broken-image placeholder when no girl is selected */
.cd-hdr-avatar[src=""],
.cd-hdr-avatar:not([src]) { display: none !important; }

/* 5. No border on conversation-list photos (all items, incl. active) */
.cl-item-img,
.cl-item.active .cl-item-img { border: none !important; box-shadow: none !important; }

/* ═══════════════════════════════════════════════════════════════
   CHAT v4 — shorter bubbles, matched input tone, no glow,
   no in-chat balance, static profile, grouped avatars, hearts
   ═══════════════════════════════════════════════════════════════ */

/* 1. Noticeably shorter message bubbles */
.msg-bubble {
  padding-top: 8.4px !important;
  padding-bottom: 8.4px !important;
  line-height: 1.4 !important;
}

/* No scrollbar inside the message input textarea */
.cd-input { scrollbar-width: none !important; -ms-overflow-style: none !important; }
.cd-input::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }

/* iOS Safari zooms the whole page when a focused field is below 16px. */
@media (max-width: 760px) {
  .cd-input,
  .cd-input:focus {
    font-size: 16px !important;
  }
}

/* 2. Input bar uses the same glass tone as header / side panels */
.cd-input-area {
  background: rgba(22,12,20,0.50) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}
/* Only the text field itself is lighter (not the whole bar) */
.cd-input { background: rgba(255,255,255,0.06) !important; }

/* 3. No glow around message bubbles */
.message.user .msg-bubble,
.message.girl .msg-bubble { box-shadow: none !important; }

/* 4. Balance badge lives only in the main navbar, not inside the chat */
#chatCoinsBadge { display: none !important; }

/* 5. Girl profile is static — no scroll, no scrollbar */
.cp-sidebar { overflow: hidden !important; }
.cp-sidebar::-webkit-scrollbar { display: none !important; }

/* 6. Avatar only on the LAST message of a consecutive girl run */
.message.girl:has(+ .message.girl) .msg-avatar { visibility: hidden !important; }

/* Avatar ~6% bigger, bottom edge aligned to the bubble (not the timestamp) */
.msg-avatar {
  width: 36px !important;
  height: 36px !important;
  align-self: flex-end !important;
  margin-bottom: 17px !important;
}

/* Bottom banners (busy / closed / auth / offline / zero-balance) — floating
   glass cards in the site style, consistent with the input bar */
.cd-auth-banner,
.cd-closed-banner {
  margin: 0 12px 12px !important;
  padding: 15px 18px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-top: 1px solid rgba(255,255,255,0.08) !important;
  background: rgba(22,12,20,0.55) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.28) !important;
}
.cd-closed-banner--girl,
.cd-low-balance-banner {
  border-color: var(--border-pink) !important;
  background: rgba(255,45,107,0.09) !important;
}
.cd-closed-banner--girl .cd-auth-title { color: var(--accent) !important; }
.cd-auth-banner .cd-auth-title,
.cd-closed-banner .cd-auth-title { font-weight: 700; letter-spacing: -0.2px; }

/* 7. Deliberate static heart pattern — equal size, tucked in the 4 corners */
.cd-bg-heart {
  position: absolute !important;
  z-index: -2 !important;
  color: rgba(255,45,107,0.05) !important;
  animation: none !important;
  filter: none !important;
  text-shadow: none !important;
  -webkit-text-stroke: 0 !important;
}
.cd-bg-heart-1 { top: 9%;    left: 5%;   right: auto !important; bottom: auto !important; font-size: 120px !important; }
.cd-bg-heart-2 { top: 13%;   right: 6%;  left: auto !important;  bottom: auto !important; font-size: 120px !important; }
.cd-bg-heart-3 { bottom: 10%; left: 7%;  right: auto !important; top: auto !important;    font-size: 120px !important; }
.cd-bg-heart-4 { bottom: 13%; right: 5%; left: auto !important;  top: auto !important;    font-size: 120px !important; }

/* ═══════════════════════════════════════════════════════════════
   CHAT v5 — flat static background (no light/glow) + stylized
   empty-state icons
   ═══════════════════════════════════════════════════════════════ */

/* WhatsApp-style doodle wallpaper in our theme — many faint pink icons,
   tiled and static, that never pull focus from the messages */
.cd-main {
  background:
    url("/img/chat-pattern.svg") repeat 0 0 / 460px 460px,
    linear-gradient(165deg, #1d101b 0%, #170c15 55%, #1a0e18 100%) !important;
}

/* Stylized empty-state icon badges (SVG glyph, not photos) */
.cd-empty-badge {
  width: 64px;
  height: 64px;
  margin: 6px auto 2px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: rgba(255,45,107,0.12);
  border: 1px solid rgba(255,45,107,0.22);
}

/* The doodle wallpaper replaces the old floating corner hearts */
.cd-bg-heart { display: none !important; }

/* Girl bubble = solid colour (no blur / transparency, pattern must not show through) */
.message.girl .msg-bubble {
  background: #2f2029 !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Final button-system bridge: chat.css loads after the shared stylesheet. */
.cl-balance-btn,
.cl-empty-btn,
.cd-close-chat-btn {
  background: linear-gradient(135deg, var(--button-primary-start), var(--button-primary-end));
  border-radius: 999px;
  box-shadow: var(--button-primary-shadow);
  transition: var(--button-transition);
}
.cl-balance-btn:hover,
.cl-empty-btn:hover,
.cd-close-chat-btn:hover {
  background: linear-gradient(135deg, var(--button-primary-hover-start), var(--button-primary-hover-end));
  transform: translateY(-1px);
  box-shadow: var(--button-primary-shadow-hover);
  opacity: 1;
}
.cd-send-btn {
  background: linear-gradient(135deg, var(--button-primary-start), var(--button-primary-end));
  box-shadow: var(--button-primary-shadow);
  transition: var(--button-transition);
}
.cd-send-btn:hover {
  background: linear-gradient(135deg, var(--button-primary-hover-start), var(--button-primary-hover-end));
  transform: translateY(-1px);
  box-shadow: var(--button-primary-shadow-hover);
}
