.baray-citation {
    margin: 0 3px;
    padding: 2px 7px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #b9d8d0;
    border-radius: 7px;
    color: #08785f;
    background: #eff8f5;
    font: inherit;
    font-size: .9em;
    line-height: 1.7;
    text-align: right;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .15s;
}
.baray-citation:hover,
.baray-citation:focus {
    border-color: #17a889;
    color: #075f4d;
    background: #e2f4ef;
    outline: none;
    transform: translateY(-1px);
}
.baray-citation i { flex: 0 0 auto; font-size: .9em; }
.baray-modal-open { overflow: hidden !important; }
.baray-source-modal { position: fixed; inset: 0; z-index: 10050; display: none; direction: rtl; font-family: Vazirmatn, Tahoma, sans-serif; }
.baray-source-modal.is-open { display: block; }
.baray-source-backdrop { position: absolute; inset: 0; background: rgba(17,35,47,.66); backdrop-filter: blur(3px); }
.baray-source-dialog {
    position: relative;
    width: min(900px, calc(100% - 34px));
    height: min(78vh, 760px);
    margin: 8vh auto 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 16px;
    color: #304a55;
    background: #fff;
    box-shadow: 0 30px 90px rgba(0,0,0,.28);
}
.baray-source-head { padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid #e1e9ec; background: linear-gradient(135deg,#fff,#f0f8f6); }
.baray-source-heading { min-width: 0; display: flex; align-items: center; gap: 11px; }
.baray-source-icon { width: 41px; height: 41px; flex: 0 0 41px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(135deg,#08785f,#17a889); }
.baray-source-heading h3 { margin: 0 0 3px; color: #233f4a; font-size: 16px; font-weight: 900; }
.baray-source-heading p { max-width: 680px; margin: 0; overflow: hidden; color: #71858d; direction: ltr; text-align: right; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.baray-source-close { width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid #d8e2e5; border-radius: 9px; color: #647881; background: #fff; cursor: pointer; }
.baray-source-close:hover { color: #b3344d; border-color: #e8b9c2; background: #fff4f6; }
.baray-source-meta { min-height: 39px; padding: 8px 19px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #e8eef0; color: #71858d; background: #fafcfc; font-size: 11px; }
.baray-source-meta b { padding: 3px 9px; border-radius: 999px; color: #08785f; background: #e8f6f2; }
.baray-source-body { position: relative; min-height: 0; flex: 1; overflow: auto; padding: 22px 26px; background: #fbfcfc; }
.baray-source-content,
#baraySourceContent { margin: 0; color: #2f4651; direction: rtl; text-align: right; white-space: pre-wrap; word-break: break-word; line-height: 2.25; font-family: Vazirmatn, Tahoma, sans-serif; font-size: 14px; }
.baray-source-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 9px; color: #71858d; font-size: 12px; }
.baray-source-loading:empty { display: none; }
.baray-source-loading span { width: 25px; height: 25px; border: 3px solid #d7ebe6; border-top-color: #17a889; border-radius: 50%; animation: baray-source-spin .8s linear infinite; }
@keyframes baray-source-spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) {
    .baray-source-dialog { width: calc(100% - 18px); height: calc(100vh - 32px); margin-top: 16px; border-radius: 12px; }
    .baray-source-head { padding: 12px; }
    .baray-source-body { padding: 16px; }
    .baray-source-heading p { max-width: 220px; }
}
