/* ===== Connect English — Design System 2026 ===== */

:root {
    --brand: #4f46e5;
    --brand-ink: #4f46e5;
    --brand-2: #7c74f2;
    --warm: #d97706;

    --bg: #f2f3f8;
    --card: #ffffff;
    --soft: #e9ebf3;
    --border: #d9dce8;
    --text: #14192b;
    --muted: #4c5468;
    --btn-solid-bg: #14192b;
    --btn-solid-ink: #ffffff;
    --hero-wash-a: rgba(79, 70, 229, .2);
    --hero-wash-b: rgba(6, 182, 212, .16);
    --shadow: 0 18px 40px rgba(20, 25, 43, .1);

    --footer-bg: #0f1e35;
    --footer-ink: rgba(255, 255, 255, .78);
    --footer-head: #ffffff;
    --footer-border: rgba(255, 255, 255, .12);
}

[data-theme="dark"] {
    --bg: #0c1022;
    --card: #131832;
    --soft: #171d3a;
    --border: #262d52;
    --text: #e9ecf6;
    --muted: #a3abc4;
    --btn-solid-bg: #ffffff;
    --btn-solid-ink: #0c1022;
    --hero-wash-a: rgba(124, 116, 242, .28);
    --hero-wash-b: rgba(6, 182, 212, .16);
    --shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Vazirmatn", Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.9;
    transition: background .25s, color .25s;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.wrap {
    max-width: 1120px;
    margin: auto;
    padding: 0 22px;
}

.full {
    width: 100%;
}

section[id] {
    scroll-margin-top: 86px;
}

:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---- دکمه‌ها ---- */

.btn-solid,
.btn-brand,
.btn-outline,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: transform .2s, box-shadow .2s, background .2s;
}

.btn-solid {
    background: var(--btn-solid-bg);
    color: var(--btn-solid-ink);
}

.btn-brand {
    background: var(--brand);
    color: #ffffff;
}

.btn-brand:hover,
.btn-solid:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    color: var(--brand-ink);
    border: 2px solid var(--brand);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--soft);
}

.btn-sm {
    padding: 9px 18px;
    font-size: 14px;
}

/* ---- هدر ---- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    gap: 22px;
    padding-block: 11px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 16px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
}

.nav-links a:hover {
    color: var(--brand-ink);
}

.nav-actions {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: .2s;
}

.icon-btn:hover {
    border-color: var(--brand);
    color: var(--brand-ink);
}

.i-moon {
    display: none;
}

[data-theme="dark"] .i-sun {
    display: none;
}

[data-theme="dark"] .i-moon {
    display: block;
}

/* ---- هیرو ---- */

.hero {
    background:
        radial-gradient(900px 460px at 88% -12%, var(--hero-wash-a), transparent 70%),
        radial-gradient(760px 420px at 6% 112%, var(--hero-wash-b), transparent 70%),
        var(--bg);
    padding-block: 84px 96px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    align-items: center;
    gap: 40px;
}

.badge {
    display: inline-block;
    background: var(--soft);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: clamp(30px, 4.6vw, 50px);
    line-height: 1.45;
    font-weight: 900;
    letter-spacing: -.5px;
}

.hero-sub {
    color: var(--muted);
    font-size: clamp(15px, 2vw, 18px);
    margin: 18px 0 30px;
    max-width: 520px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---- ماکت گوشی ---- */

.hero-visual {
    display: flex;
    justify-content: center;
}

.phone {
    width: 250px;
    border-radius: 38px;
    border: 10px solid var(--text);
    background: var(--text);
    box-shadow: var(--shadow);
}

.phone-screen {
    border-radius: 28px;
    background: var(--card);
    padding: 22px 16px 24px;
    text-align: center;
}

.p-emoji {
    font-size: 44px;
    margin-bottom: 8px;
}

.p-q {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 14px;
}

.p-chips {
    display: flex;
    flex-direction: column;
    gap: 8px;
    direction: ltr;
    margin-bottom: 16px;
}

.p-chips span {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 700;
    background: var(--soft);
}

.p-chips span:first-child {
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 12%, var(--card));
}

.p-btn {
    background: var(--brand);
    color: #fff;
    border-radius: 12px;
    padding: 10px;
    font-size: 13px;
    font-weight: 800;
}

@media (prefers-reduced-motion: no-preference) {
    .phone {
        animation: float 4.5s ease-in-out infinite alternate;
    }

    @keyframes float {
        from {
            transform: translateY(0);
        }

        to {
            transform: translateY(-12px);
        }
    }
}

/* ---- نوار آمار ---- */

.stats {
    border-block: 1px solid var(--border);
    background: var(--card);
}

.stats-row {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    padding-block: 26px;
}

.stat-main {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.stat-number {
    font-size: clamp(34px, 4vw, 46px);
    font-weight: 900;
    color: var(--brand-ink);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.stat-facts {
    margin-inline-start: auto;
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 600;
}

/* ---- بخش‌ها ---- */

section.full:not(.hero):not(.stats) {
    padding-block: 74px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 28px;
}

.section-head h2 {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 900;
}

.section-head a {
    color: var(--brand-ink);
    font-size: 14px;
    font-weight: 800;
}

/* ---- کارت ویژگی ---- */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 28px 22px;
    transition: transform .25s, box-shadow .25s, border-color .25s;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--brand);
    box-shadow: var(--shadow);
}

.f-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--brand) 12%, var(--card));
    color: var(--brand-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

@media (prefers-reduced-motion: no-preference) {
    .feature-card:hover .f-icon svg {
        animation: wiggle .5s ease-in-out;
    }

    @keyframes wiggle {

        0%,
        100% {
            transform: rotate(0) scale(1);
        }

        30% {
            transform: rotate(-8deg) scale(1.12);
        }

        60% {
            transform: rotate(7deg) scale(1.12);
        }
    }
}

.feature-card h3 {
    font-size: 17px;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 13.5px;
    color: var(--muted);
}

/* ---- نصب ---- */

.install {
    background: var(--soft);
}

.install-sub {
    color: var(--muted);
    font-size: 14.5px;
    margin-bottom: 24px;
}

.install-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    max-width: 720px;
}

.install-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 26px 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.install-card h3 {
    font-size: 16px;
    margin-top: 10px;
}

.install-card p {
    font-size: 13.5px;
    color: var(--muted);
    margin-bottom: 14px;
}

.install-card .f-icon {
    margin-bottom: 0;
}

/* ---- درباره ---- */

.about-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 46px 34px;
    text-align: center;
}

.about-card h2 {
    font-size: clamp(20px, 3vw, 26px);
    margin-bottom: 14px;
}

.about-card p {
    max-width: 640px;
    margin: auto;
    color: var(--muted);
    font-size: 15px;
}

/* ---- تماس ---- */

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.contact-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: .2s;
}

.contact-item:hover {
    border-color: var(--brand);
    transform: translateY(-3px);
}

.contact-item b {
    font-size: 14.5px;
}

.contact-item span {
    font-size: 12.5px;
    color: var(--muted);
    direction: ltr;
    text-align: right;
}

[dir="ltr"] .contact-item span {
    text-align: left;
}

/* ---- مقالات ---- */

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.article-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    transition: .2s;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand);
    box-shadow: var(--shadow);
}

.article-card img,
.card-noimg {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.card-noimg {
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 14%, var(--card)), var(--soft));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
}

.card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.card-body h3 {
    font-size: 15.5px;
    line-height: 1.7;
}

.card-body p {
    font-size: 13px;
    color: var(--muted);
    flex: 1;
}

.card-date {
    font-size: 12px;
    color: var(--muted);
}

/* ---- سوالات ---- */

.faq details {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 10px;
}

.faq summary {
    cursor: pointer;
    font-weight: 800;
    font-size: 15px;
}

.faq p {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
}

/* ---- فوتر ---- */

.site-footer {
    background: var(--card);
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    padding-block: 46px;
}

.footer-grid h3,
.footer-grid h4 {
    margin-bottom: 12px;
    font-size: 16px;
}

.footer-grid p {
    color: var(--muted);
    font-size: 13.5px;
}

.footer-grid a {
    display: block;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.footer-grid a:hover {
    color: var(--brand-ink);
}

.copyright {
    text-align: center;
    border-top: 1px solid var(--border);
    padding: 18px;
    font-size: 13px;
    color: var(--muted);
}

/* ---- صفحات داخلی مقالات ---- */

.page-hero {
    background: var(--bg);
    padding-block: 56px;
    border-bottom: 1px solid var(--border);
}

.page-hero h1 {
    font-size: clamp(24px, 4vw, 36px);
}

.page-hero p {
    color: var(--muted);
    margin-top: 10px;
    font-size: 14.5px;
}

.empty-note {
    text-align: center;
    color: var(--muted);
    padding: 40px 0;
}

.article-page {
    max-width: 760px;
    margin: auto;
    padding: 40px 22px;
}

.breadcrumb {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 18px;
}

.breadcrumb a {
    color: var(--brand-ink);
}

.article-page h1 {
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1.6;
    margin-bottom: 10px;
}

.article-meta {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 22px;
}

.article-cover {
    border-radius: 22px;
    margin-bottom: 26px;
}

.article-content {
    font-size: 15.5px;
    line-height: 2.1;
}

.article-content h2 {
    font-size: 22px;
    margin: 28px 0 12px;
}

.article-content h3 {
    font-size: 18px;
    margin: 22px 0 10px;
}

.article-content img {
    border-radius: 16px;
    margin: 18px 0;
}

.article-content a {
    color: var(--brand-ink);
    font-weight: 700;
    text-decoration: underline;
}

.article-content ul,
.article-content ol {
    padding-inline-start: 22px;
    margin: 14px 0;
}

.article-content blockquote {
    border-inline-start: 4px solid var(--brand);
    background: var(--soft);
    padding: 14px 18px;
    border-radius: 12px;
    margin: 18px 0;
}

.related {
    max-width: 1120px;
    margin: auto;
    padding: 20px 22px 70px;
}

.related h2 {
    font-size: 20px;
    margin-bottom: 18px;
}

/* ---- موبایل ---- */

@media (max-width: 860px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-sub {
        margin-inline: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-visual {
        margin-top: 10px;
    }

    .hero {
        padding-block: 60px 70px;
    }
}

@media (max-width: 720px) {
    .nav-links {
        display: none;
    }

    section.full:not(.hero):not(.stats) {
        padding-block: 54px;
    }

    .stats-row {
        gap: 14px;
    }

    .stat-facts {
        margin-inline-start: 0;
        gap: 14px;
    }

    .about-card {
        padding: 34px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition: none !important;
        animation: none !important;
    }
}

/* ===== نسخه ۳ — فوتر تم‌محور، آمار مرکزی، نصب ساده، تماس، همکاری ===== */

[data-theme="dark"] {
    --footer-bg: #131832;
    --footer-ink: var(--muted);
    --footer-head: var(--text);
    --footer-border: var(--border);
    --warm: #fbbf24;
}

/* ---- فوتر ---- */

.site-footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--footer-border);
    margin-top: 40px;
}

.footer-grid h3,
.footer-grid h4 {
    color: var(--footer-head);
}

.footer-grid p,
.footer-grid a,
.copyright {
    color: var(--footer-ink);
}

.footer-grid a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-grid a:hover {
    color: var(--footer-head);
}

.footer-grid .f-ic {
    flex: none;
    opacity: .85;
}

.copyright {
    border-top: 1px solid var(--footer-border);
}

/* ---- آمار مرکزی با + رنگی ---- */

.stats-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    padding-block: 30px;
}

.stat-main {
    display: flex;
    align-items: baseline;
    gap: 6px;
    justify-content: center;
}

.stat-plus {
    font-size: clamp(28px, 3.4vw, 40px);
    font-weight: 900;
    color: var(--warm);
}

/* ---- نصب ساده ---- */

.install-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.install-card h3 {
    margin-top: 8px;
}

.btn-outline.is-disabled {
    opacity: .5;
    pointer-events: none;
}

/* ---- تماس ---- */

.contact-item .c-ic {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--brand) 12%, var(--card));
    color: var(--brand-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.copy-btn {
    align-self: flex-start;
    border: 1px solid var(--border);
    background: var(--soft);
    color: var(--text);
    border-radius: 10px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: .2s;
    direction: ltr;
}

.copy-btn:hover {
    border-color: var(--brand);
    color: var(--brand-ink);
}

/* ---- همکاری ---- */

.collab-wrap {
    max-width: 640px;
    padding-block: 60px;
}

.collab-intro {
    color: var(--muted);
    font-size: 14.5px;
    margin-bottom: 26px;
}

.collab-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 28px 24px;
}

.collab-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 13.5px;
    font-weight: 700;
}

.collab-form input,
.collab-form textarea {
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: .2s;
    resize: vertical;
}

.collab-form input:focus,
.collab-form textarea:focus {
    border-color: var(--brand);
    background: var(--card);
}

.collab-form .btn-brand {
    align-self: flex-start;
}

.collab-success {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px 24px;
    font-weight: 700;
    font-size: 14.5px;
}

.collab-alt {
    margin-top: 18px;
    color: var(--muted);
    font-size: 13.5px;
}

.collab-alt a {
    color: var(--brand-ink);
    font-weight: 700;
    direction: ltr;
    unicode-bidi: embed;
}

/* ---- همکاری: نسخه‌ی نهایی و مینیمال ---- */

.collab-wrap {
    max-width: 560px;
    padding-block: 70px 90px;
    text-align: center;
}

.collab-title {
    font-size: clamp(24px, 4vw, 32px);
    margin-bottom: 14px;
}

.collab-line {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 8px;
}

.collab-wrap .email-copy {
    margin-top: 22px;
    display: inline-block;
    font-size: 16px;
}

/* ---- تماس: ستونی همیشه + ایمیل قابل‌کلیک ---- */

.contact-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
}

.contact-item span:last-child {
    display: none;
}

.email-copy {
    border: 1px dashed var(--border);
    background: var(--soft);
    color: var(--brand-ink);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 14.5px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    direction: ltr;
    transition: .2s;
}

.email-copy:hover {
    border-color: var(--brand);
    border-style: solid;
}

.email-copy.copied {
    border-color: #16a34a;
    color: #16a34a;
    border-style: solid;
}

.copy-hint {
    font-size: 12px;
    color: var(--muted);
}

/* ---- همکاری ---- */

.collab-title {
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1.5;
    margin-bottom: 16px;
}

.collab-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 30px 26px;
    margin-top: 26px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.collab-cta-label {
    font-weight: 800;
    font-size: 15px;
}

.collab-hint {
    font-size: 12.5px;
    color: var(--muted);
}

.collab-alt {
    margin-top: 18px;
    color: var(--muted);
    font-size: 13.5px;
}

.collab-alt a {
    color: var(--brand-ink);
    font-weight: 700;
}

/* ---- + همیشه قبل از عدد (هر دو زبان) ---- */

.stats-center .stat-main,
.stats-center .stat-number,
.stats-center .stat-plus {
    direction: ltr !important;
}

/* ---- ایمیل: ظاهر متنی، کلیک = کپی ---- */

.email-copy {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    color: var(--brand-ink);
    font-size: 15px;
    font-weight: 800;
    text-decoration: solid;
    text-decoration-style: dashed;
    text-underline-offset: 5px;
    text-decoration-color: color-mix(in srgb, var(--brand-ink) 45%, transparent);
}

.email-copy:hover {
    text-decoration-style: solid;
    text-decoration-color: var(--brand-ink);
}

.email-copy.copied {
    color: #16a34a;
    text-decoration-color: #16a34a;
}

/* ---- تماس: آیکون و متن در یک ردیف ---- */

.contact-item {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    text-align: right;
}

.contact-item .c-ic {
    margin-bottom: 0;
}

.contact-item .email-copy {
    align-self: center;
}

.contact-item .copy-hint {
    flex: 1;
    text-align: left;
}

/* ---- جدول مقاله‌ها ---- */

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 22px 0;
    font-size: 14px;
    background: var(--card);
    border: 1px solid var(--border);
}

.article-content th {
    background: var(--soft);
    color: var(--text);
    font-weight: 800;
    text-align: right;
    padding: 12px 16px;
}

.article-content td {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    color: var(--text);
}

[dir="ltr"] .article-content th,
[dir="ltr"] .article-content td {
    text-align: left;
}

.article-content tr:nth-child(even) td {
    background: color-mix(in srgb, var(--soft) 45%, var(--card));
}

@media (max-width: 640px) {
    .article-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        min-width: 100%;
    }
}

/* ---- جایگاه‌های تبلیغ ---- */

.ad-slot {
    margin: 20px auto;
    text-align: center;
    max-width: 100%;
    position: relative;
}

.ad-slot img,
.ad-slot video {
    max-width: 100%;
    border-radius: 14px;
    display: inline-block;
}

.ad-tag {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 5px;
    letter-spacing: 1px;
}

/* نوار بالای مقاله — مثل بنر مهمان اپ */

.ad-topbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.ad-topbar .ad-tag {
    display: none;
}

.ad-topbar img,
.ad-topbar video {
    border-radius: 10px;
    max-height: 90px;
}

/* ---- تبلیغات: نسخه نهایی ---- */

.ad-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-width: 100%;
}

.ad-slot img,
.ad-slot video {
    max-width: 100%;
    max-height: 180px;
    width: auto;
    border-radius: 14px;
    display: block;
    margin: 0 auto;
}

/* برچسب + ضربدر = دکمه‌ی بستن بدون ظاهر دکمه */

.ad-close {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    padding: 2px 8px;
    color: var(--muted);
    transition: color.2s;
}

.ad-close.ad-tag {
    font-size: 11px;
    letter-spacing: 1px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ad-close.ad-x {
    font-size: 12px;
    opacity: .75;
}

.ad-close:hover {
    color: var(--text);
}

/* A: نفس بین تیتر و کاور */

.ad-a {
    margin-block: 12px 28px;
}

.ad-b,
.ad-c {
    margin-block: 26px;
}

/* ---- نوار بالای مقاله (سبک هایتاکی): چسبان، متن + دکمه ---- */

.ad-topbar {
    position: sticky;
    top: 64px;
    z-index: 90;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 48px 10px 16px;
    background: var(--card);
    border-block: 1px solid var(--border);
    box-shadow: 0 6px 18px rgba(20, 25, 43, .07);
}

.ad-topbar.ad-tag {
    display: none;
}

.ad-topbar.ad-close {
    position: absolute;
    inset-inline-end: 14px;
    top: 50%;
    transform: translateY(-50%);
}

.ad-topbar img,
.ad-topbar.ad-topbar-logo {
    max-height: 40px !important;
    width: auto;
    border-radius: 8px !important;
}

.ad-topbar-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.ad-topbar-btn {
    background: var(--brand);
    color: #ffffff;
    border-radius: 10px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    transition: .2s;
}

.ad-topbar-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* ---- قوانین ---- */

.terms-wrap {
    max-width: 720px;
    padding-block: 50px 70px;
}

.terms-wrap h1 {
    font-size: clamp(24px, 4vw, 32px);
    margin-bottom: 8px;
}

.terms-meta {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 20px;
}

.terms-wrap h2 {
    font-size: 19px;
    margin: 26px 0 10px;
}

.terms-wrap p,
.terms-wrap li {
    color: #3c4254;
    font-size: 14.5px;
    line-height: 2.1;
}

.terms-wrap ul {
    padding-inline-start: 22px;
    margin: 10px 0;
}

.terms-back {
    margin-top: 30px;
}

[data-theme="dark"] .terms-wrap p,
[data-theme="dark"] .terms-wrap li {
    color: var(--muted);
}

/* ---- نظرات مقاله ---- */

.comments {
    max-width: 760px;
    margin: 10px auto 40px;
    padding: 0 22px;
}

.comments h2 {
    font-size: 19px;
    margin-bottom: 16px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
}

.comment-form input,
.comment-form textarea {
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 12px;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: .2s;
    resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--brand);
    background: var(--card);
}

.cm-captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cm-captcha {
    background: var(--soft);
    border-radius: 10px;
    padding: 9px 16px;
    font-weight: 900;
    letter-spacing: 2px;
    user-select: none;
}

.cm-captcha-row input {
    width: 120px;
}

.cm-submit {
    align-self: flex-start;
    background: #16a34a;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 11px 26px;
    font-weight: 900;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: .2s;
}

.cm-submit:hover {
    background: #15803d;
    transform: translateY(-1px);
}

.cm-msg {
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 14px;
}

.cm-msg.cm-success {
    background: rgba(22, 163, 74, .12);
    color: #16a34a;
}

.cm-msg.cm-error {
    background: rgba(239, 68, 68, .12);
    color: #dc2626;
}

.cm-count {
    color: var(--muted);
    font-size: 13px;
    margin: 18px 0 10px;
}

.comment {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.cm-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.cm-name {
    color: #4f46e5;
    font-size: 13.5px;
}

.cm-date {
    color: var(--muted);
    font-size: 11.5px;
}

.cm-body {
    font-size: 14px;
    line-height: 2;
    color: var(--text);
}

.cm-reply {
    background: var(--soft);
    border-radius: 12px;
    padding: 10px 14px;
    margin-top: 10px;
}

.cm-reply b {
    font-size: 12.5px;
    color: var(--brand-ink);
}

.cm-reply p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.9;
}

/* ---- مودال و فوتر لاگین (اپ) ---- */

.login-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
    padding: 0 6px;
}

.lf-terms,
.lf-help {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 12px;
    color: #9aa0ae;
    cursor: pointer;
    padding: 4px 0;
}

.lf-terms:hover,
.lf-help:hover {
    color: #4f46e5;
}

.lf-help {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 24, .55);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box {
    background: #ffffff;
    border-radius: 22px;
    padding: 24px 22px;
    max-width: 340px;
    width: 100%;
    text-align: center;
}

.modal-box h3 {
    font-size: 16px;
    font-weight: 900;
    margin-bottom: 10px;
    color: #14192b;
}

.modal-box p {
    font-size: 13.5px;
    color: #6b7280;
    line-height: 2;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.mb-cancel {
    flex: 1;
    background: #f3f4f9;
    border: none;
    border-radius: 12px;
    padding: 11px;
    font-family: inherit;
    font-weight: 800;
    font-size: 13.5px;
    color: #14192b;
    cursor: pointer;
}

.mb-bale {
    flex: 1.4;
    background: #4f46e5;
    color: #ffffff;
    border-radius: 12px;
    padding: 11px;
    font-weight: 800;
    font-size: 13.5px;
}