/* نامهٔ جدید — تم شب */
html[data-theme="dark"] .ln-card,
html[data-theme="dark"] .ln-note,
html[data-theme="dark"] .ln-toolbar{
  background:#171A2E !important;
  border:1px solid rgba(255,255,255,.10) !important;
  color:#EEF0F8 !important;
}
html[data-theme="dark"] .ln-card-title{ color:#FFFFFF !important; }
html[data-theme="dark"] .ln-card-title small,
html[data-theme="dark"] .ln-tip,
html[data-theme="dark"] .ln-count{ color:#A7AECB !important; }
html[data-theme="dark"] .ln-side label,
html[data-theme="dark"] .ln-card label{ color:#C9CFE6 !important; }

html[data-theme="dark"] .ln-card input,
html[data-theme="dark"] .ln-card select,
html[data-theme="dark"] .ln-card textarea,
html[data-theme="dark"] .ln-side input,
html[data-theme="dark"] .ln-side select,
html[data-theme="dark"] .ln-side textarea{
  background:#0F1222 !important;
  border:1px solid rgba(255,255,255,.16) !important;
  color:#F3F5FC !important;
}
html[data-theme="dark"] .ln-card input::placeholder,
html[data-theme="dark"] .ln-card textarea::placeholder{ color:#8890AE !important; opacity:1 !important; }
html[data-theme="dark"] .ln-card select option{ background:#0F1222 !important; color:#F3F5FC !important; }

html[data-theme="dark"] .ln-tpls button,
html[data-theme="dark"] .ln-pour button,
html[data-theme="dark"] .ln-toolbar button,
html[data-theme="dark"] .ln-actions .btn-ghost{
  background:#1E2238 !important;
  border:1px solid rgba(255,255,255,.14) !important;
  color:#EEF0F8 !important;
}
html[data-theme="dark"] .ln-tpls button:hover,
html[data-theme="dark"] .ln-pour button:hover,
html[data-theme="dark"] .ln-toolbar button:hover,
html[data-theme="dark"] .ln-actions .btn-ghost:hover{ background:#272C48 !important; }
html[data-theme="dark"] .ln-note{ color:#CBD2EA !important; }
html[data-theme="dark"] .ln-card input[type="file"]{ color:#C9CFE6 !important; }
html[data-theme="dark"] .ln-card input[type="file"]::file-selector-button{
  background:#1E2238 !important; border:1px solid rgba(255,255,255,.14) !important;
  color:#EEF0F8 !important; border-radius:8px; padding:6px 10px; margin-inline-end:8px;
}

/* سربرگ نامه کاغذ سفید می‌ماند — مرکب تیره و خوانا */
html[data-theme="dark"] .ln-sheet{
  background:#FFFFFF !important;
  color:#16182C !important;
  border:1px solid rgba(0,0,0,.10) !important;
}
html[data-theme="dark"] .ln-sheet .ln-label,
html[data-theme="dark"] .ln-sheet .ln-edit,
html[data-theme="dark"] .ln-sheet .ln-strong,
html[data-theme="dark"] .ln-sheet .ln-body,
html[data-theme="dark"] .ln-sheet .ln-org-name,
html[data-theme="dark"] .ln-sheet .ln-signer,
html[data-theme="dark"] .ln-sheet .ln-subject,
html[data-theme="dark"] .ln-sheet b{ color:#16182C !important; }
html[data-theme="dark"] .ln-sheet .ln-org-sub,
html[data-theme="dark"] .ln-sheet .ln-meta,
html[data-theme="dark"] .ln-sheet .ln-foot,
html[data-theme="dark"] .ln-sheet .ln-sign-rule{ color:#4A5068 !important; }
html[data-theme="dark"] .ln-sheet .ln-subject{
  background:#FFFFFF !important; border-bottom:1px solid rgba(0,0,0,.18) !important;
}
html[data-theme="dark"] .ln-sheet .ln-subject::placeholder,
html[data-theme="dark"] .ln-sheet .ln-edit:empty::before{ color:#8A90A8 !important; opacity:1 !important; }
html[data-theme="dark"] .ln-sheet .ln-edit:focus{ outline:2px solid #3C01AF; outline-offset:2px; }

/* مرکب برگهٔ نامه در تم شب — شامل همهٔ فرزندان */
html[data-theme="dark"] body .ln-sheet,
html[data-theme="dark"] body .ln-sheet *{
  color:#16182C !important;
  -webkit-text-fill-color:#16182C !important;
  text-shadow:none !important;
}
html[data-theme="dark"] body .ln-sheet .ln-org-sub,
html[data-theme="dark"] body .ln-sheet .ln-meta,
html[data-theme="dark"] body .ln-sheet .ln-meta *,
html[data-theme="dark"] body .ln-sheet .ln-foot,
html[data-theme="dark"] body .ln-sheet .ln-foot *,
html[data-theme="dark"] body .ln-sheet .ln-sign-rule{
  color:#4A5068 !important; -webkit-text-fill-color:#4A5068 !important;
}
html[data-theme="dark"] body .ln-sheet .ln-label{
  color:#16182C !important; -webkit-text-fill-color:#16182C !important; font-weight:800 !important;
}
html[data-theme="dark"] body .ln-sheet .ln-body,
html[data-theme="dark"] body .ln-sheet .ln-body p{
  color:#16182C !important; -webkit-text-fill-color:#16182C !important;
  opacity:1 !important; font-size:14.5px !important; line-height:2 !important;
}
html[data-theme="dark"] body .ln-sheet input,
html[data-theme="dark"] body .ln-sheet textarea{
  background:#FFFFFF !important;
  color:#16182C !important; -webkit-text-fill-color:#16182C !important;
}
html[data-theme="dark"] body .ln-sheet input::placeholder{
  color:#9AA0B8 !important; -webkit-text-fill-color:#9AA0B8 !important; opacity:1 !important;
}
html[data-theme="dark"] body .ln-sheet .ln-body,
html[data-theme="dark"] body .ln-sheet .ln-edit{ background:#FFFFFF !important; }
html[data-theme="dark"] body .ln-sheet .ln-body{ border:1px solid rgba(0,0,0,.10) !important; }

/* پیوست‌ها — جلوگیری از زدن بیرون کارت */
.ln-card{ overflow:hidden; }
.ln-card input[type="file"]{
  display:block !important;
  width:100% !important; max-width:100% !important; min-width:0 !important;
  box-sizing:border-box !important;
  padding:10px 12px !important; border-radius:10px !important;
  font-size:12.5px !important;
  background:rgba(19,21,44,.04); border:1px solid rgba(19,21,44,.12);
}
.ln-card input[type="file"]::file-selector-button{
  max-width:60% !important; margin-inline-end:10px !important;
  padding:6px 10px !important; border-radius:8px !important; cursor:pointer;
  border:1px solid rgba(19,21,44,.16); background:#fff; font-family:inherit; font-size:12px;
}
html[data-theme="dark"] .ln-card input[type="file"]{
  background:#0F1222 !important; border:1px solid rgba(255,255,255,.16) !important;
}

/* ================= دیدن نامه (lv) — تم شب ================= */
/* برگه کاغذ سفید با مرکب تیره، شامل همهٔ فرزندان */
html[data-theme="dark"] body .lv-sheet{
  background:#FFFFFF !important; border:1px solid rgba(0,0,0,.10) !important;
}
html[data-theme="dark"] body .lv-sheet,
html[data-theme="dark"] body .lv-sheet *{
  color:#16182C !important; -webkit-text-fill-color:#16182C !important;
  opacity:1 !important; text-shadow:none !important;
}
html[data-theme="dark"] body .lv-sheet .lv-org-sub,
html[data-theme="dark"] body .lv-sheet .lv-meta,
html[data-theme="dark"] body .lv-sheet .lv-meta *,
html[data-theme="dark"] body .lv-sheet .lv-foot,
html[data-theme="dark"] body .lv-sheet .lv-foot *,
html[data-theme="dark"] body .lv-sheet .lv-sign-rule,
html[data-theme="dark"] body .lv-sheet .muted{
  color:#4A5068 !important; -webkit-text-fill-color:#4A5068 !important;
}
html[data-theme="dark"] body .lv-sheet .lv-body,
html[data-theme="dark"] body .lv-sheet .lv-body p{
  font-size:14.5px !important; line-height:2 !important;
}

/* کارت‌های ستون کنار */
html[data-theme="dark"] .lv-card,
html[data-theme="dark"] .lv-bar{
  background:#171A2E !important; border:1px solid rgba(255,255,255,.10) !important; color:#EEF0F8 !important;
}
html[data-theme="dark"] .lv-card-title{ color:#FFFFFF !important; }
html[data-theme="dark"] .lv-card-title small,
html[data-theme="dark"] .lv-tip,
html[data-theme="dark"] .lv-bar-meta{ color:#A7AECB !important; }

/* پیوست‌ها و پاسخ‌ها */
html[data-theme="dark"] .lv-card .ledger-row{
  background:#0F1222 !important; border:1px solid rgba(255,255,255,.10) !important;
}
html[data-theme="dark"] .lv-card .ledger-title{
  color:#F3F5FC !important; -webkit-text-fill-color:#F3F5FC !important;
  opacity:1 !important; overflow-wrap:anywhere;
}
html[data-theme="dark"] .lv-card .ledger-meta,
html[data-theme="dark"] .lv-card .muted,
html[data-theme="dark"] .lv-card .empty-row{ color:#A7AECB !important; -webkit-text-fill-color:#A7AECB !important; }
html[data-theme="dark"] .lv-card .btn-ghost{
  background:#1E2238 !important; border:1px solid rgba(255,255,255,.14) !important; color:#EEF0F8 !important;
}
html[data-theme="dark"] .lv-card .btn-ghost:hover{ background:#272C48 !important; }

/* شناسنامه */
html[data-theme="dark"] .lv-rows > div{ border-color:rgba(255,255,255,.08) !important; }
html[data-theme="dark"] .lv-rows span{ color:#A7AECB !important; }
html[data-theme="dark"] .lv-rows b{ color:#F3F5FC !important; }

/* کادر پاسخ */
html[data-theme="dark"] .lv-reply textarea{
  background:#0F1222 !important; border:1px solid rgba(255,255,255,.16) !important;
  color:#F3F5FC !important; -webkit-text-fill-color:#F3F5FC !important;
}
html[data-theme="dark"] .lv-reply textarea::placeholder{ color:#8890AE !important; opacity:1 !important; }

/* کادر فایل — بدون زدن بیرون کارت */
.lv-card{ overflow:hidden; }
.lv-attach{ display:flex !important; flex-wrap:wrap !important; gap:8px !important; align-items:center !important; }
.lv-attach input[type="file"]{
  flex:1 1 100% !important; width:100% !important; max-width:100% !important; min-width:0 !important;
  box-sizing:border-box !important; padding:10px 12px !important; border-radius:10px !important;
  font-size:12.5px !important;
  background:rgba(19,21,44,.04); border:1px solid rgba(19,21,44,.12);
}
.lv-attach input[type="file"]::file-selector-button{
  max-width:60% !important; margin-inline-end:10px !important; padding:6px 10px !important;
  border-radius:8px !important; cursor:pointer; border:1px solid rgba(19,21,44,.16);
  background:#fff; font-family:inherit; font-size:12px;
}
html[data-theme="dark"] .lv-attach input[type="file"]{
  background:#0F1222 !important; border:1px solid rgba(255,255,255,.16) !important; color:#C9CFE6 !important;
}
html[data-theme="dark"] .lv-attach input[type="file"]::file-selector-button{
  background:#1E2238 !important; border:1px solid rgba(255,255,255,.14) !important; color:#EEF0F8 !important;
}
