/* =====================================================
   SAATDURUM — DIRECT CHAT (DM) SYSTEM STYLES (dm-chat.css)
   Full feature-parity with Group Chat & Mobile Fullscreen Mode
===================================================== */

/* ── 1. ANA DM KONTEYNERİ (2-KOLONLU YAPI) ── */
.dm-container {
  display: flex;
  width: 100%;
  height: 660px;
  max-height: calc(100vh - 140px);
  background: var(--grp-card, var(--bg-card, #121217));
  border: 1px solid var(--grp-border, rgba(255, 255, 255, 0.08));
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow, 0 20px 40px rgba(0, 0, 0, 0.3));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.25s ease;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .dm-container {
    height: calc(100vh - 130px);
    max-height: none;
    border-radius: 14px;
    margin: 0;
  }
}

/* ── 2. SOL KOLON / SOHBET LİSTESİ (SIDEBAR) ── */
.dm-sidebar {
  width: 320px;
  min-width: 280px;
  max-width: 360px;
  border-right: 1px solid var(--grp-border, rgba(255, 255, 255, 0.08));
  display: flex;
  flex-direction: column;
  background: rgba(15, 15, 20, 0.45);
  flex-shrink: 0;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
  z-index: 10;
}

.dm-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--grp-border, rgba(255, 255, 255, 0.08));
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(18, 18, 24, 0.4);
}

.dm-sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dm-sidebar-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--grp-text-p, var(--text-p, #ffffff));
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.dm-sidebar-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  background: var(--grp-accent, var(--accent, #3b82f6));
  color: #ffffff;
  border-radius: 12px;
}

/* Arama Kutusu */
.dm-search-wrap {
  position: relative;
  width: 100%;
}

.dm-search-input {
  width: 100%;
  background: var(--grp-card-inner, var(--bg-mid, rgba(255, 255, 255, 0.06)));
  border: 1px solid var(--grp-border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 8px 12px 8px 34px;
  font-size: 12.5px;
  color: var(--grp-text-p, var(--text-p, #ffffff));
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}

.dm-search-input:focus {
  border-color: var(--grp-accent, var(--accent, #3b82f6));
  background: rgba(255, 255, 255, 0.09);
}

.dm-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--grp-text-s, rgba(255, 255, 255, 0.5));
  pointer-events: none;
}

/* Sohbet Akışı & Liste */
.dm-inbox-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dm-inbox-list::-webkit-scrollbar {
  width: 4px;
}
.dm-inbox-list::-webkit-scrollbar-track {
  background: transparent;
}
.dm-inbox-list::-webkit-scrollbar-thumb {
  background: var(--grp-border, rgba(255, 255, 255, 0.15));
  border-radius: 4px;
}

/* ── 3. SABİT GRUP SOHBETİ KARTI (PINNED GROUP CARD) ── */
.dm-group-pinned-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 6px;
  user-select: none;
}

.dm-group-pinned-card:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22) 0%, rgba(99, 102, 241, 0.14) 100%);
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.45);
}

.dm-group-pinned-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.35);
}

.dm-group-pinned-info {
  flex: 1;
  min-width: 0;
}

.dm-group-pinned-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--grp-text-p, var(--text-p, #ffffff));
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-group-pinned-subtitle {
  font-size: 11.5px;
  color: var(--grp-accent, #60a5fa);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 4. SOHBET LİSTESİ ÖĞELERİ (INBOX ITEM) ── */
.dm-inbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  user-select: none;
  position: relative;
}

.dm-inbox-item:hover {
  background: var(--grp-card-inner, rgba(255, 255, 255, 0.05));
}

.dm-inbox-item.active {
  background: var(--accent-dim, rgba(59, 130, 246, 0.14));
  border: 1px solid var(--grp-accent, rgba(59, 130, 246, 0.3));
}

.dm-inbox-avatar-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.dm-inbox-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grp-card-inner, #1c1c24);
  font-size: 20px;
  overflow: hidden;
  border: 1.5px solid var(--grp-border, rgba(255, 255, 255, 0.12));
}

.dm-inbox-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Çevrimiçi / Çalışma Canlı Noktası */
.dm-presence-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-mid, #111116);
  background: #64748b;
}

.dm-presence-dot.dot-working {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
}

.dm-presence-dot.dot-break {
  background: #eab308;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.7);
}

.dm-presence-dot.dot-online {
  background: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.7);
}

.dm-presence-dot.dot-offline {
  background: #64748b;
}

.dm-inbox-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dm-inbox-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.dm-inbox-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--grp-text-p, var(--text-p, #ffffff));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-inbox-time {
  font-size: 11px;
  color: var(--grp-text-s, rgba(255, 255, 255, 0.45));
  flex-shrink: 0;
}

.dm-inbox-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dm-inbox-snippet {
  font-size: 12px;
  color: var(--grp-text-s, rgba(255, 255, 255, 0.6));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.dm-inbox-item.has-unread .dm-inbox-snippet {
  color: var(--grp-text-p, var(--text-p, #ffffff));
  font-weight: 600;
}

.dm-unread-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grp-accent, #3b82f6);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.8);
}

.dm-unread-badge-num {
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  background: var(--grp-accent, #3b82f6);
  color: #ffffff;
  border-radius: 10px;
  flex-shrink: 0;
}

/* ── 5. SAĞ KOLON / AKTİF MESAJLAŞMA PENCERESİ ── */
.dm-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 15, 0.6);
  position: relative;
  min-width: 0;
  height: 100%;
}

.dm-chat-main .grp-chat-wrap {
  height: 100%;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

/* Masaüstü DM Üst Barı */
.dm-desktop-only-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--grp-border, rgba(255, 255, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 18, 24, 0.6);
  backdrop-filter: blur(10px);
  z-index: 5;
  flex-shrink: 0;
}

.dm-chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dm-chat-header-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.dm-chat-header-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grp-card-inner, #1c1c24);
  font-size: 18px;
  overflow: hidden;
  border: 1.5px solid var(--grp-border, rgba(255, 255, 255, 0.15));
}

.dm-chat-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dm-chat-header-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dm-chat-header-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--grp-text-p, var(--text-p, #ffffff));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dm-chat-header-status {
  font-size: 11.5px;
  color: var(--grp-text-s, rgba(255, 255, 255, 0.6));
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.dm-header-action-btn {
  background: transparent;
  border: 1px solid var(--grp-border, rgba(255, 255, 255, 0.1));
  color: var(--grp-text-s, rgba(255, 255, 255, 0.7));
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.dm-header-action-btn:hover {
  background: var(--grp-card-inner, rgba(255, 255, 255, 0.08));
  color: var(--grp-text-p, #ffffff);
  border-color: var(--grp-border-hv, rgba(255, 255, 255, 0.25));
}

/* ── 6. BOŞ DURUM (EMPTY STATES) ── */
.dm-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  gap: 14px;
  user-select: none;
}

.dm-empty-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px dashed var(--grp-border, rgba(255, 255, 255, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grp-accent, #3b82f6);
  animation: dmFloat 3s ease-in-out infinite;
}

@keyframes dmFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.dm-empty-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--grp-text-p, #ffffff);
  margin: 0;
}

.dm-empty-desc {
  font-size: 13px;
  color: var(--grp-text-s, rgba(255, 255, 255, 0.6));
  max-width: 280px;
  line-height: 1.5;
  margin: 0;
}

/* ── 7. MOBİL VE RESPONSIVE TAM EKRAN (FULLSCREEN PARITY) ── */
@media (min-width: 769px) {
  .grp-chat-mobile-header {
    display: none !important;
  }
  .dm-desktop-only-header {
    display: flex !important;
  }
}

@media (max-width: 768px) {
  .dm-container {
    flex-direction: column;
    height: calc(100vh - 130px);
    max-height: none;
    border-radius: 14px;
    margin: 0;
  }

  .dm-sidebar {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    height: 100%;
    border-right: none;
  }

  .dm-chat-main {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .dm-desktop-only-header {
    display: none !important;
  }

  .grp-chat-mobile-header {
    display: flex !important;
  }

  /* ── TAM EKRAN SOHBET MODU (Grup Sohbeti İle %100 Birebir) ── */
  body.chat-fullscreen-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
  }

  body.chat-fullscreen-open #app,
  body.chat-fullscreen-open #panel-online,
  body.chat-fullscreen-open .online-platform-layout,
  body.chat-fullscreen-open #sd-chat-view-wrap,
  body.chat-fullscreen-open .dm-container,
  body.chat-fullscreen-open .dm-chat-main {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    transform: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    position: static !important;
  }

  body.chat-fullscreen-open #site-header,
  body.chat-fullscreen-open .mobile-bottom-nav,
  body.chat-fullscreen-open .online-top-tabs-nav,
  body.chat-fullscreen-open .online-subtabs-nav,
  body.chat-fullscreen-open #online-mobile-popup,
  body.chat-fullscreen-open .nav-dropdown,
  body.chat-fullscreen-open .dm-sidebar,
  body.chat-fullscreen-open .grp-room-header,
  body.chat-fullscreen-open .grp-room-tabs,
  body.chat-fullscreen-open .grp-room-title-box {
    display: none !important;
  }

  body.chat-fullscreen-open .grp-chat-wrap {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    inset: 0 !important;
    z-index: 10000 !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    width: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    background: var(--grp-card, var(--bg-card, #121217)) !important;
    overflow: hidden !important;
  }

  body.chat-fullscreen-open .grp-chat-mobile-header {
    display: flex !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    padding-top: max(10px, env(safe-area-inset-top, 10px)) !important;
    background: var(--grp-card, var(--bg-card, #121217)) !important;
    border-bottom: 1px solid var(--grp-border, rgba(255, 255, 255, 0.08)) !important;
    z-index: 10 !important;
  }

  body.chat-fullscreen-open .grp-chat-feed {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    padding: 12px 10px 8px 10px !important;
    margin: 0 !important;
  }

  body.chat-fullscreen-open .grp-chat-replying-bar {
    flex-shrink: 0 !important;
  }

  body.chat-fullscreen-open .grp-chat-input-row {
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 8px)) !important;
    background: var(--grp-card, var(--bg-card, #121217)) !important;
    border-top: 1px solid var(--grp-border, rgba(255, 255, 255, 0.08)) !important;
    z-index: 10 !important;
  }
}

/* ── Light & Litewhite Theme Overrides for DM Chat ── */
body.light-theme .dm-sidebar,
body.theme-light .dm-sidebar,
[data-theme="light"] .dm-sidebar,
body.litewhite-theme .dm-sidebar,
body.theme-litewhite .dm-sidebar,
[data-theme="litewhite"] .dm-sidebar {
  background: #f8fafc;
  border-right-color: rgba(15, 23, 42, 0.12);
}

body.light-theme .dm-sidebar-header,
body.theme-light .dm-sidebar-header,
[data-theme="light"] .dm-sidebar-header,
body.litewhite-theme .dm-sidebar-header,
body.theme-litewhite .dm-sidebar-header,
[data-theme="litewhite"] .dm-sidebar-header {
  background: #ffffff;
  border-bottom-color: rgba(15, 23, 42, 0.12);
}

body.light-theme .dm-search-input,
body.theme-light .dm-search-input,
[data-theme="light"] .dm-search-input,
body.litewhite-theme .dm-search-input,
body.theme-litewhite .dm-search-input,
[data-theme="litewhite"] .dm-search-input {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.15);
  color: #0f172a;
}

/* ════════════════════════════════════════════════════════════════════════════
   BİRLİKTE ÇALIŞ (STUDY TOGETHER / CO-OP) ENGINE STYLES
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Header Together Button ── */
.dm-header-together-btn {
  background: var(--accent-dim, rgba(11, 214, 168, 0.12)) !important;
  color: var(--accent, #0bd6a8) !important;
  border: 1px solid var(--accent-glow, rgba(11, 214, 168, 0.3)) !important;
  font-weight: 600 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dm-header-together-btn:hover {
  background: var(--accent, #0bd6a8) !important;
  color: #08080a !important;
  transform: translateY(-1px);
}

/* ── Send Request Modal ── */
.together-modal-dialog {
  border: 1px solid var(--border);
  background: var(--bg-card, #121217);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px var(--accent-glow, rgba(11, 214, 168, 0.1));
}

.together-title-icon {
  font-size: 18px;
}

.together-target-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-mid, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
}

.together-target-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card, #18181f);
  border: 2px solid var(--accent, #0bd6a8);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.together-target-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.together-target-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.together-target-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-p, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.together-target-username {
  font-size: 12px;
  color: var(--text-s, #94a3b8);
  font-family: var(--font-mono, monospace);
}

/* ── Duration Presets Grid ── */
.together-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.together-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  background: var(--bg-mid, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  color: var(--text-p, #f8fafc);
  min-height: 52px;
}

.together-preset-btn:hover {
  background: var(--bg-card, rgba(255, 255, 255, 0.08));
  border-color: var(--accent-glow, rgba(11, 214, 168, 0.4));
  transform: translateY(-1px);
}

.together-preset-btn.active {
  background: var(--accent-dim, rgba(11, 214, 168, 0.15));
  border-color: var(--accent, #0bd6a8);
  box-shadow: 0 0 14px var(--accent-glow, rgba(11, 214, 168, 0.25));
}

.together-preset-btn .preset-time {
  font-size: 13.5px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--text-p, #f8fafc);
}

.together-preset-btn.active .preset-time {
  color: var(--accent, #0bd6a8);
}

.together-preset-btn .preset-lbl {
  font-size: 10.5px;
  color: var(--text-s, #94a3b8);
  margin-top: 2px;
}

/* ── Custom Duration Row ── */
.together-custom-duration-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-mid, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  padding: 8px 12px;
}

.together-custom-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.together-custom-col label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-s, #94a3b8);
  letter-spacing: 0.5px;
}

.together-custom-col input {
  width: 70px !important;
  text-align: center !important;
  font-family: var(--font-mono, monospace) !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  padding: 6px 4px !important;
}

.together-custom-sep {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-s, #94a3b8);
  margin-top: 14px;
}

.together-duration-summary {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent, #0bd6a8);
  text-align: center;
  background: var(--accent-dim, rgba(11, 214, 168, 0.08));
  padding: 6px 10px;
  border-radius: 8px;
}

.together-info-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--bg-mid, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-s, #94a3b8);
  line-height: 1.45;
}

/* ── In-Chat Specialized Invite Card ── */
.dm-together-invite-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-card, rgba(18, 18, 23, 0.95));
  border: 1px solid var(--accent-glow, rgba(11, 214, 168, 0.3));
  border-radius: 14px;
  min-width: 230px;
  max-width: 280px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.dm-together-icon-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dm-together-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.dm-together-title-wrap {
  display: flex;
  flex-direction: column;
}

.dm-together-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent, #0bd6a8);
}

.dm-together-sub {
  font-size: 11.5px;
  color: var(--text-s, #94a3b8);
  margin-top: 1px;
}

.dm-together-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.dm-together-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-align: center;
}

.dm-together-btn.accept {
  background: var(--accent, #0bd6a8);
  color: #08080a;
}

.dm-together-btn.accept:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.dm-together-btn.reject {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.dm-together-btn.reject:hover {
  background: rgba(239, 68, 68, 0.2);
}

.dm-together-btn.join {
  background: var(--accent, #0bd6a8);
  color: #08080a;
  border: none;
}

.dm-together-status-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.dm-together-status-pill.pending {
  background: var(--bg-mid, rgba(255, 255, 255, 0.06));
  color: var(--text-s, #94a3b8);
  justify-content: center;
}

.dm-together-status-pill.accepted {
  background: var(--accent-dim, rgba(11, 214, 168, 0.12));
  color: var(--accent, #0bd6a8);
}

.dm-together-status-pill.rejected {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  justify-content: center;
}

.dm-together-status-pill.expired {
  background: var(--bg-mid, rgba(255, 255, 255, 0.05));
  color: var(--text-s, #94a3b8);
  justify-content: center;
}

/* ── Live Co-op Card (Shown in Timer View) ── */
.together-live-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card, #121217);
  border: 1px solid var(--accent, #0bd6a8);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 24px var(--accent-glow, rgba(11, 214, 168, 0.2));
  margin-bottom: 2px;
  position: relative;
  overflow: hidden;
  animation: togetherGlowPulse 4s ease-in-out infinite;
}

@keyframes togetherGlowPulse {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow, rgba(11, 214, 168, 0.15));
  }
  50% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 32px var(--accent-glow, rgba(11, 214, 168, 0.35));
  }
}

.together-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.together-avatars-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.together-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--accent, #0bd6a8);
  background: var(--bg-mid, #1e1e24);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.together-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.together-connection-beam {
  width: 18px;
  height: 2px;
  background: var(--accent, #0bd6a8);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.together-beam-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px var(--accent, #0bd6a8);
  animation: togetherBeamAnim 1.6s infinite ease-in-out;
}

@keyframes togetherBeamAnim {
  0% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  100% { transform: translateX(-6px); }
}

.together-header-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.together-partner-title {
  font-size: 13.5px;
  color: var(--text-p, #f8fafc);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.together-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: liveDotPulse 1.8s infinite;
  flex-shrink: 0;
}

@keyframes liveDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.together-subject-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--accent, #0bd6a8);
  font-weight: 600;
}

.together-stop-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.together-stop-btn:hover {
  background: #ef4444;
  color: #ffffff;
  transform: translateY(-1px);
}

.together-timer-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 2px 0;
}

.together-countdown-digits {
  font-size: 38px;
  font-weight: 800;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  color: var(--text-p, #f8fafc);
  letter-spacing: 1px;
  text-shadow: 0 0 16px var(--accent-glow, rgba(11, 214, 168, 0.3));
}

.together-duration-total {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-s, #94a3b8);
  font-family: var(--font-mono, monospace);
}

.together-progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-mid, rgba(255, 255, 255, 0.08));
  border-radius: 4px;
  overflow: hidden;
}

.together-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent, #0bd6a8), #3b82f6);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ── Mobile Tweaks ── */
@media (max-width: 480px) {
  .together-presets-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .together-preset-btn {
    padding: 8px 4px;
    min-height: 48px;
  }

  .together-countdown-digits {
    font-size: 30px;
  }

  .together-card-header {
    flex-wrap: wrap;
  }

  .together-stop-btn {
    margin-left: auto;
  }
}

