.rich-content {
    color: var(--text-muted, #64748b);
    font-size: .92rem;
    line-height: 2;
    word-wrap: break-word;
}

.rich-content p {
    margin-bottom: .85rem;
}

.rich-content p:last-child {
    margin-bottom: 0;
}

.rich-content h2,
.rich-content h3,
.rich-content h4 {
    color: var(--text, #0f172a);
    font-weight: 800;
    margin: 1.25rem 0 .65rem;
    line-height: 1.5;
}

.rich-content h2 { font-size: 1.15rem; }
.rich-content h3 { font-size: 1.05rem; }
.rich-content h4 { font-size: .98rem; }

.rich-content ul,
.rich-content ol {
    padding-right: 1.25rem;
    margin-bottom: .85rem;
}

.rich-content li {
    margin-bottom: .35rem;
}

.rich-content a {
    color: var(--blue, #2563eb);
    text-decoration: none;
}

.rich-content a:hover {
    text-decoration: underline;
}

.rich-content strong,
.rich-content b {
    color: var(--text, #0f172a);
    font-weight: 700;
}

.rich-content blockquote {
    border-right: 3px solid var(--blue, #2563eb);
    padding: .5rem 1rem;
    margin: 1rem 0;
    background: rgba(37, 99, 235, .04);
    border-radius: 0 8px 8px 0;
}

.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* ── Vam spec tables (SEO structured tables) ── */
.vam-spec-table-block {
    margin: 1rem 0;
}

.vam-spec-table-title {
    font-size: .92rem;
    font-weight: 700;
    color: var(--text, #0f172a);
    margin-bottom: .5rem;
    padding-right: .15rem;
}

.vam-spec-table-scroll,
.rich-table-scroll.vam-spec-table-scroll {
    margin: 0;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, .07);
    box-shadow: none;
    background: #fff;
}

.vam-spec-table,
.rich-content .vam-spec-table {
    min-width: 420px;
    font-size: .86rem;
}

.vam-spec-table thead th,
.rich-content .vam-spec-table thead th {
    background: var(--navy, #1e293b);
    color: #fff;
    font-weight: 600;
    padding: .65rem .85rem;
    text-align: right;
    border: none;
    white-space: nowrap;
}

.vam-spec-table tbody td,
.rich-content .vam-spec-table tbody td {
    padding: .58rem .85rem;
    border-bottom: 1px solid rgba(15, 23, 42, .06);
    vertical-align: top;
    color: var(--text-muted, #475569);
    text-align: right;
}

.vam-spec-table tbody td:first-child,
.rich-content .vam-spec-table tbody td:first-child {
    font-weight: 600;
    color: var(--text, #334155);
    white-space: nowrap;
}

.vam-spec-table tbody tr:nth-child(even) td {
    background: rgba(248, 250, 252, .9);
}

.vam-spec-table tbody tr:hover td {
    background: rgba(16, 185, 129, .05);
}

.vam-spec-table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Legacy rich-content tables ── */
.rich-table-scroll,
.rich-content .rich-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow: 0 4px 18px rgba(15, 23, 42, .05);
    background: #fff;
}

.rich-content table,
.rich-content .loan-data-table {
    width: 100%;
    min-width: 480px;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    font-size: .88rem;
}

.rich-content table caption,
.rich-content .loan-data-table caption {
    caption-side: top;
    text-align: right;
    padding: .65rem .85rem;
    font-weight: 700;
    color: var(--text, #0f172a);
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid rgba(15, 23, 42, .06);
}

.rich-content thead th,
.rich-content .loan-data-table thead th {
    background: linear-gradient(180deg, #1e3a5f, #1e40af);
    color: #fff;
    font-weight: 700;
    padding: .72rem .85rem;
    text-align: right;
    border: none;
    white-space: nowrap;
}

.rich-content thead th:first-child {
    border-radius: 0;
}

.rich-content tbody td,
.rich-content .loan-data-table tbody td {
    padding: .62rem .85rem;
    border-bottom: 1px solid rgba(15, 23, 42, .06);
    vertical-align: top;
    color: var(--text-muted, #475569);
}

.rich-content tbody tr:nth-child(even) td,
.rich-content .loan-data-table tbody tr:nth-child(even) td {
    background: rgba(248, 250, 252, .85);
}

.rich-content tbody tr:hover td,
.rich-content .loan-data-table tbody tr:hover td {
    background: rgba(37, 99, 235, .04);
}

.rich-content tbody tr:last-child td,
.rich-content .loan-data-table tbody tr:last-child td {
    border-bottom: none;
}

.rich-content tfoot td,
.rich-content .loan-data-table tfoot td {
    background: #f1f5f9;
    font-weight: 700;
    padding: .65rem .85rem;
    border-top: 2px solid rgba(37, 99, 235, .15);
}

@media (max-width: 767px) {
    .rich-content table,
    .rich-content .loan-data-table {
        min-width: 520px;
        font-size: .82rem;
    }

    .rich-content thead th,
    .rich-content tbody td {
        padding: .55rem .65rem;
    }

    .rich-table-scroll::after,
    .rich-content .rich-table-scroll::after {
        content: "← اسکرول";
        display: block;
        text-align: center;
        font-size: .68rem;
        color: #94a3b8;
        padding: .25rem;
        background: #f8fafc;
        border-top: 1px solid rgba(0, 0, 0, .04);
    }
}

.rich-content--intro {
    margin-bottom: 1rem;
}
