@font-face { font-family: 'IRANYekanX'; src: url('../fonts/IRANYekanX-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IRANYekanX'; src: url('../fonts/IRANYekanX-Bold.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IRANYekanX'; src: url('../fonts/IRANYekanX-Black.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Noto'; src: url('../fonts/noto-sans-v42-latin-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Noto'; src: url('../fonts/noto-sans-v42-latin-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Noto'; src: url('../fonts/noto-sans-v42-latin-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

body { font-family: 'Noto', -apple-system, sans-serif; }

.fa-body, .fa-body * { font-family: 'IRANYekanX', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important; }


.fa-body .info-note, .fa-body .status-pill, .fa-body .form-type-badge,
.fa-body .header-brand-name, .fa-body .header-brand-byline, .fa-body footer,
.fa-body .accordion-content, .fa-body .stream-item-text, .fa-body .analysis-item p,
.fa-body .progress-item, .fa-body table, .fa-body select, .fa-body button,
.fa-body input, .fa-body h1, .fa-body h2, .fa-body h3, .fa-body label, .lang-fa {
    font-family: 'IRANYekanX', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.fr-body, .fr-body * { font-family: 'Noto', sans-serif; }


.floating-back-btn {
    position: fixed; top: 50% !important; z-index: 9999; width: 56px; height: 56px;
    background: white; border: 1px solid #e2e8f0; border-radius: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #195cfb; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease; cursor: pointer; text-decoration: none;
    left: 25px; right: auto;
}
.floating-back-btn:hover { background: #195cfb; color: white; transform: scale(1.05); box-shadow: 0 6px 16px rgba(25, 92, 251, 0.2); }
[dir="rtl"] .floating-back-btn { left: auto; right: 25px; }
[dir="rtl"] .floating-back-btn svg { transform: rotate(180deg); }
@media (max-width: 768px) {
    .floating-back-btn { width: 40px; height: 40px; left: 16px; }
    [dir="rtl"] .floating-back-btn { right: 16px; left: auto; }
}


.global-fab {
    position: fixed; bottom: 30px; width: 60px; height: 60px;
    background: #195cfb; color: white; border-radius: 50%;
    box-shadow: 0 8px 24px rgba(25, 92, 251, 0.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; cursor: pointer; z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    right: 30px; left: auto;
}
html[lang="fa"] .global-fab { left: 30px; right: auto; }
.global-fab:hover { transform: scale(1.1) rotate(5deg); background: #1142c4; }

.fab-menu {
    position: absolute; bottom: 80px; display: flex; flex-direction: column; gap: 12px;
    opacity: 0; pointer-events: none; transform: translateY(20px); transition: all 0.3s ease;
    align-items: flex-end; right: 0;
}
.global-fab.open .fab-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
html[lang="fa"] .fab-menu { align-items: flex-start; left: 0; right: auto; }

.fab-item {
    background: white; padding: 12px 20px; border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); color: #1e293b;
    text-decoration: none; font-size: 14px; font-weight: 700;
    white-space: nowrap; display: flex; align-items: center; gap: 8px; transition: 0.2s;
}
.fab-item:hover { background: #f8fafc; transform: translateX(-5px); color: #195cfb; }
html[lang="fa"] .fab-item:hover { transform: translateX(5px); }


#error-toast {
    position: fixed; top: 25px; left: 50%; transform: translateX(-50%) translateY(-100px);
    background: #ef4444; color: white; padding: 14px 28px; border-radius: 12px;
    font-weight: 700; box-shadow: 0 10px 25px rgba(239, 68, 68, 0.35); z-index: 10000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#error-toast.show { transform: translateX(-50%) translateY(0); }


#ai-result-box, #ai-markdown-content {
    max-height: none !important;
    overflow-y: visible !important;
    overflow: visible !important;
}

#ai-result-box {
    background: white !important; border-radius: 32px !important;
    border: 1px solid #e2e8f0;
}

.ai-markdown-typography {
    color: #334155;
    font-size: 1.05rem;
    line-height: 1.8;
}
.ai-markdown-typography h2 {
    color: #111827;
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}
.ai-markdown-typography h3 {
    color: #195cfb;
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.ai-markdown-typography p { margin-bottom: 1.2rem; }
.ai-markdown-typography ul, .ai-markdown-typography ol {
    margin-bottom: 1.5rem;
    padding-inline-start: 1.5rem;
}
.ai-markdown-typography li { margin-bottom: 0.5rem; }
.ai-markdown-typography strong { color: #0f172a; font-weight: 800; }