.sub-tabs { display: inline-flex; background: var(--bg-surface); padding: 4px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); }
.sub-tab-btn { background: transparent; border: none; color: var(--text-muted); padding: 8px 16px; border-radius: 6px; font-weight: 600; cursor: pointer; }
.sub-tab-btn.active { background: var(--primary); color: #ffffff; }

.discover-layout {
  display: grid;
  grid-template-columns: 270px minmax(340px, 430px) 270px;
  gap: 20px;
  justify-content: center;
  align-items: start;
}
.side-widget-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
}
.side-widget-title { font-size: 0.92rem; font-weight: 700; color: var(--text-main); border-bottom: 1px solid var(--border-subtle); padding-bottom: 8px; }

.swipe-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); width: 100%; overflow: hidden; box-shadow: var(--shadow-card); }
.swipe-photo-box { position: relative; height: 340px; background: #e2e8f0; }
.swipe-photo-box img { width: 100%; height: 100%; object-fit: cover; display: block; }

.match-pill { position: absolute; top: 14px; right: 14px; background: rgba(255, 255, 255, 0.92); border: 1px solid var(--primary); color: var(--primary); padding: 5px 11px; border-radius: 99px; font-weight: 700; font-size: 0.82rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.swipe-level-overlay { position: absolute; bottom: 12px; left: 14px; display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.92); color: var(--text-main); padding: 6px 12px 6px 6px; border-radius: 99px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.swipe-card-body { padding: 18px; }
.swipe-name-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.tags-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.interest-tag { background: var(--bg-card); border: 1px solid var(--border-subtle); padding: 4px 10px; border-radius: 99px; font-size: 0.79rem; color: #334155; }
.interest-tag.matched { background: rgba(124, 92, 255, 0.14); border-color: var(--primary); color: var(--primary); font-weight: 700; }

.swipe-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.btn-dislike { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.btn-like { background: linear-gradient(135deg, #22c55e, #16a34a); color: #ffffff; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-bar input, .filter-bar select { max-width: 220px; }
.profiles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.profile-mini-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-card); }
.mini-card-cover { position: relative; height: 210px; }
.mini-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.ai-badge { position: absolute; top: 10px; left: 10px; background: #0284c7; color: #ffffff; font-weight: 800; font-size: 0.74rem; padding: 3px 9px; border-radius: 6px; }
.mini-card-content { padding: 14px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.mini-card-actions { margin-top: auto; display: flex; gap: 6px; }

.chat-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  height: calc(100vh - 116px);
  min-height: 480px;
  max-height: 780px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.chat-list-pane { border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f8fafc; }
.pane-title { padding: 14px 16px; font-weight: 700; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.dialogs-list { overflow-y: auto; flex: 1; min-height: 0; }
.dialog-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--border-subtle); }
.dialog-item:hover, .dialog-item.active { background: #ffffff; }
.dialog-meta { flex: 1; min-width: 0; }
.dialog-name { font-weight: 600; font-size: 0.92rem; display: flex; align-items: center; gap: 6px; }
.dialog-preview { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-close-dialog { background: transparent; border: none; color: var(--text-muted); font-size: 0.85rem; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.btn-close-dialog:hover { background: #fee2e2; color: #dc2626; }
.chat-window-pane { display: flex; flex-direction: column; height: 100%; min-width: 0; min-height: 0; overflow: hidden; }
.empty-state { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-muted); padding: 20px; text-align: center; }
.active-chat { display: flex; flex-direction: column; height: 100%; min-width: 0; min-height: 0; overflow: hidden; }
.chat-header { padding: 10px 16px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f8fafc; flex-shrink: 0; flex-wrap: wrap; }
.chat-peer-info { display: flex; align-items: center; gap: 10px; }
.msg-counter-badge { background: #fef3c7; border: 1px solid #fde68a; padding: 4px 10px; border-radius: 99px; font-size: 0.8rem; font-weight: 700; color: #b45309; }
.icebreakers-bar { padding: 8px 14px; background: rgba(124, 92, 255, 0.08); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; flex-shrink: 0; }
.icebreaker-chip { background: #ffffff; border: 1px solid rgba(124, 92, 255, 0.35); color: var(--primary); padding: 5px 11px; border-radius: 99px; font-size: 0.79rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.icebreaker-chip:hover { background: var(--primary); color: #ffffff; }
.chat-messages { flex: 1; min-height: 0; padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: #ffffff; }
.msg-bubble { max-width: 78%; padding: 9px 13px; border-radius: 14px; font-size: 0.92rem; line-height: 1.4; word-break: break-word; }
.msg-bubble.me { align-self: flex-end; background: var(--primary); color: #ffffff; border-bottom-right-radius: 4px; }
.msg-bubble.peer { align-self: flex-start; background: #f1f5f9; color: var(--text-main); border: 1px solid var(--border-subtle); border-bottom-left-radius: 4px; }
.msg-bubble.system { align-self: center; background: #dcfce7; border: 1px solid #bbf7d0; color: #15803d; font-size: 0.82rem; text-align: center; }
.antispam-banner { background: #fee2e2; border-top: 1px solid #fecaca; color: #b91c1c; padding: 8px 14px; font-size: 0.83rem; font-weight: 600; flex-shrink: 0; }
.chat-input-bar { padding: 10px 14px; border-top: 1px solid var(--border-subtle); display: flex; gap: 10px; background: #f8fafc; flex-shrink: 0; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.shop-item-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 18px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; box-shadow: var(--shadow-card); }

.profile-dashboard { display: grid; grid-template-columns: 330px 1fr; gap: 20px; }
.profile-preview-card, .profile-edit-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-card); }
.profile-preview-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.profile-perks { width: 100%; margin-top: 8px; border-top: 1px solid var(--border-subtle); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.perk-row { display: flex; justify-content: space-between; font-size: 0.86rem; }

.gifts-showcase { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.gift-badge { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 6px 10px; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 6px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 1500; }
.modal-box { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 24px; width: 100%; max-width: 440px; text-align: center; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-card); }
.modal-box.modal-lg { max-width: 660px; text-align: left; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.btn-icon-close { background: transparent; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; }
.roulette-wheel-wrap { position: relative; width: 230px; height: 230px; margin: 16px auto; }
.roulette-pointer { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: 1.5rem; color: #f59e0b; z-index: 5; }
.roulette-wheel {
  width: 100%; height: 100%; border-radius: 50%; border: 6px solid var(--primary);
  background: conic-gradient(#4338ca 0deg 60deg, #312e81 60deg 120deg, #6d28d9 120deg 180deg, #be185d 180deg 240deg, #047857 240deg 300deg, #b45309 300deg 360deg);
  position: relative; transition: transform 3.2s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}
.wheel-sector { position: absolute; top: 50%; left: 50%; width: 50%; transform-origin: 0% 50%; transform: rotate(calc(var(--i) * 60deg - 60deg)) translateX(18px); font-size: 0.78rem; font-weight: 700; color: #ffffff; }
.roulette-result-text { min-height: 24px; font-weight: 700; color: var(--primary); margin-bottom: 10px; }

.private-album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.private-photo-slot { height: 115px; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-card); border: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; color: var(--text-muted); text-align: center; padding: 8px; }
.private-photo-slot img { width: 100%; height: 100%; object-fit: cover; }

.mobile-chat-back { display: none; }
.blind-label-short { display: none; }
.likes-toggle-arrow { display: none; }

@media (max-width: 1080px) {
  .discover-layout { grid-template-columns: 1fr; width: 100%; gap: 10px; }
  .side-widget-card { width: 100%; }
  .blind-label-full { display: none; }
  .blind-label-short { display: inline; }
  .panel-header { gap: 6px; margin-bottom: 10px; flex-wrap: nowrap; }
  .sub-tab-btn { padding: 7px 10px; font-size: 0.82rem; }
  #btn-quick-blind-top { padding: 7px 11px; font-size: 0.82rem; white-space: nowrap; }
  #widget-likes-card { padding: 10px 14px; gap: 0; }
  #widget-likes-card .side-widget-title {
    border-bottom: none; padding-bottom: 0; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
  }
  .likes-toggle-arrow { display: inline-block; font-size: 0.85rem; color: var(--text-muted); }
  #widget-likes-card.collapsed #widget-likes-list { display: none !important; }
  #widget-likes-card:not(.collapsed) .side-widget-title {
    border-bottom: 1px solid var(--border-subtle); padding-bottom: 8px; margin-bottom: 10px;
  }
}

@media (max-width: 860px) {
  .mobile-chat-back { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; font-size: 0.82rem; flex-shrink: 0; }
  .swipe-card { width: 100%; max-width: 100%; }
  .swipe-photo-box { height: 280px; }
  .swipe-actions { gap: 6px; }
  .swipe-actions .btn { padding: 10px 6px; font-size: 0.84rem; }
  .filter-bar input, .filter-bar select { max-width: 100%; width: 100%; }
  .profiles-grid { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 135px); min-height: 440px; max-height: none; width: 100%; }
  .chat-layout .chat-list-pane { display: none; max-height: none; height: 100%; border-right: none; border-bottom: none; }
  .chat-layout.show-list .chat-list-pane { display: flex; }
  .chat-layout.show-list .chat-window-pane { display: none; }
  .chat-input-bar { padding: 8px; gap: 6px; }
  .chat-input-bar .btn { padding: 10px 12px; }
  .profile-dashboard { grid-template-columns: 1fr; width: 100%; }
  .modal-backdrop { padding: 10px; }
  .modal-box { padding: 16px 14px; max-width: 100%; }
  .private-album-grid { grid-template-columns: repeat(2, 1fr); }
}
/* Чёткие пропорции фото без обрезки головы в Поиске и Свайпах */
.mini-card-cover {
  height: auto !important;
  aspect-ratio: 4 / 5;
  max-height: 310px;
}
.mini-card-cover img,
.swipe-photo-box img {
  object-fit: cover;
  object-position: center 18%;
}
.private-photo-slot {
  height: auto !important;
  aspect-ratio: 1 / 1;
}
.private-photo-slot img {
  object-position: center 18%;
}

/* Яркие карточки подарков и задвинутая горизонтальная витрина */
.gift-drawer-bar {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.gift-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.gift-horizontal-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 2px 4px;
  scrollbar-width: thin;
}
.gift-card-bright {
  flex: 0 0 104px;
  background: linear-gradient(145deg, #ffffff, #f3e8ff);
  border: 1.5px solid rgba(124, 92, 255, 0.28);
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.12);
  transition: transform 0.15s, box-shadow 0.15s;
}
.gift-card-bright:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(124, 92, 255, 0.24);
}
.gift-card-emoji {
  font-size: 2rem;
  line-height: 1.1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
}
.gift-card-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
.gift-card-price {
  font-size: 0.75rem;
  font-weight: 800;
  color: #7c3aed;
  background: rgba(124, 92, 255, 0.12);
  padding: 2px 8px;
  border-radius: 99px;
}

@media (max-width: 860px) {
  .mini-card-cover {
    aspect-ratio: 1 / 1;
    max-height: 340px;
  }
  .peer-modal-top {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
  }
  .peer-modal-top .tags-row {
    justify-content: center;
  }
}
