/* پیام‌های خصوصی — اصلاح اندازه در موبایل */
@media (max-width: 900px) {
  .chat-wrap ~ *, .card:has(> #conversationList) { min-width: 0; }
  .card:has(#conversationList){
    flex-direction: column !important;
    height: calc(100dvh - 168px) !important;
    max-height: none !important;
  }
  #conversationList{
    width: 100% !important; flex: 0 0 auto !important;
    max-height: 34% !important; overflow-y: auto !important;
    border-inline-start: 0 !important;
    border-block-end: 1px solid var(--paper-line) !important;
  }
  .chat-wrap{
    flex: 1 1 auto !important; min-height: 0 !important;
    display: flex !important; flex-direction: column !important;
    padding: 10px !important;
  }
  .chat-log{
    flex: 1 1 auto !important; min-height: 0 !important;
    overflow-y: auto !important; overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }
  .chat-log > *{ max-width: 88% !important; }
  .chat-msg, .chat-log p, .chat-log div{ overflow-wrap: anywhere; word-break: break-word; }
  .chat-log, .chat-log *{ font-size: 14.5px !important; line-height: 1.85 !important; }
  .chat-input-row{
    flex: 0 0 auto !important; display: flex !important; gap: 8px !important;
    align-items: flex-end !important; padding-top: 8px !important;
  }
  #dmInput{
    flex: 1 1 auto !important; min-width: 0 !important;
    min-height: 48px !important; max-height: 130px !important;
    font-size: 16px !important; padding: 12px !important; border-radius: 12px !important;
    resize: none !important; box-sizing: border-box !important;
  }
  .chat-input-row .btn{
    flex: 0 0 auto !important; min-width: 76px !important;
    height: 48px !important; padding: 0 14px !important; white-space: nowrap !important;
  }
}
/* نشانگر «تازه» روی نامه */
.lt-new{ position: relative; }
.lt-new::before{
  content: 'تازه';
  position: absolute; inset-inline-end: 10px; inset-block-start: 10px;
  background: #dc2626; color: #fff; font-size: 10.5px; font-weight: 800;
  padding: 3px 8px; border-radius: 999px; line-height: 1; z-index: 3;
  box-shadow: 0 1px 4px rgba(220,38,38,.35);
}
.lt-new{ box-shadow: inset 3px 0 0 #dc2626; }

/* نامهٔ تازه — نشان «جدید» */
#letterLanes .lt-new{ position: relative; box-shadow: inset 3px 0 0 #dc2626; }
#letterLanes .lt-new::before{
  content: 'جدید';
  position: absolute; inset-inline-end: 8px; inset-block-start: 6px;
  background: #dc2626; color: #fff; font-size: 10px; font-weight: 800;
  padding: 2px 7px; border-radius: 999px; line-height: 1.5; z-index: 3;
}
#letterLanes [style*="cursor:pointer"]:hover,
#letterLanes .lt-new:hover{ background: rgba(60,1,175,.04); }

/* ستون‌های جمع‌شوندهٔ نامه */
#letterLanes .lt-lane-head{
  cursor:pointer; user-select:none; position:relative;
  padding-inline-start:26px !important;
}
#letterLanes .lt-lane-head::after{
  content:'⌄'; position:absolute; inset-inline-start:8px; inset-block-start:50%;
  transform:translateY(-58%); font-size:15px; line-height:1; opacity:.65;
  transition:transform .18s ease;
}
#letterLanes .lt-collapsed > .lt-lane-head::after{ transform:translateY(-50%) rotate(-90deg); }
#letterLanes .lt-lane-head:hover{ background:rgba(60,1,175,.06); border-radius:10px; }
#letterLanes .lt-collapsed > *:not(.lt-lane-head){ display:none !important; }
#letterLanes .lt-collapsed{ align-self:start; }

/* دکمهٔ جمع/باز کردن ستون */
#letterLanes .lt-toggle{
  margin-inline-start:10px; width:24px; height:24px; flex:0 0 24px;
  display:inline-grid; place-items:center; vertical-align:middle;
  border-radius:8px; cursor:pointer; font:inherit; font-size:15px; font-weight:800; line-height:1;
  background:rgba(60,1,175,.10); border:1px solid rgba(60,1,175,.28); color:#3C01AF;
}
#letterLanes .lt-toggle:hover{ background:rgba(60,1,175,.20); }
html[data-theme="dark"] #letterLanes .lt-toggle{
  background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.18); color:#EEF0F8;
}
#letterLanes .lt-lane-head:hover{ background:rgba(60,1,175,.05); border-radius:10px; }
#letterLanes .lt-collapsed{ align-self:start; }
