/*
 * محدوده‌ی این استایل‌ها:
 *   - سایت: .ss02 (کادر محتوای صفحه)
 *   - پنل ادمین: .wiki-editor-content (ادیتور Tiptap) تا محتوای قدیمی در ویرایش هم همان شکل سایت را داشته باشد
 */
/* =====================================================================
 * Yaghut — نمایش محتوای منتقل‌شده از مدیاویکی
 *   1) جعبه‌ی ناوبری الگوها (table.navbox / table.navbox-inner)
 *   2) نشانگر بزرگ‌نمایی روی تصاویر محتوا (lightbox)
 *
 * رسانه‌ها (تصویر، گالری، ویدیو، صوت، iframe) — قدیمی و جدید — همه در yaghut-media-blocks.css هستند.
 * رنگ‌های inline الگوهای قدیمی (مثلاً سبز #c5e3d4) عمداً با !important خنثی شده‌اند
 * تا همه‌ی جعبه‌ها با رنگ‌بندی یاقوت یکدست شوند.
 * ===================================================================== */

/* ---------------------------------------------------------------------
 * 1) Navbox
 * ------------------------------------------------------------------- */
:is(.ss02, .wiki-editor-content) table.navbox,
:is(.ss02, .wiki-editor-content) table.navbox-inner {
    --nbx-primary: #880f35;
    --nbx-accent: #bc2050;
    --nbx-navy: #344258;
    --nbx-gold: #d9bb8a;
    --nbx-line: rgba(52, 66, 88, .12);
    --nbx-soft: #fbf4f6;

    width: 100% !important;
    margin: 2rem 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    direction: rtl;
    text-align: right;
    background: #fff !important;
    color: #1f2633 !important;
    border: 1px solid var(--nbx-line) !important;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 34px -28px rgba(52, 66, 88, .55);
    font-size: .95rem;
}

/* navbox بیرونی که navbox-inner را در خود دارد: فقط یک قاب */
:is(.ss02, .wiki-editor-content) table.navbox table.navbox-inner {
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none;
}
:is(.ss02, .wiki-editor-content) table.navbox > tbody > tr > td,
:is(.ss02, .wiki-editor-content) table.navbox > tr > td { padding: 0 !important; border: 0 !important; }

:is(.ss02, .wiki-editor-content) table.navbox-inner th,
:is(.ss02, .wiki-editor-content) table.navbox-inner td {
    border: 0 !important;
    vertical-align: middle;
}

/* عنوان جعبه */
:is(.ss02, .wiki-editor-content) .navbox-title {
    padding: .8rem 1.1rem !important;
    text-align: center !important;
    color: #fff !important;
    background: linear-gradient(90deg, var(--nbx-primary) 0%, #bb204e 50%, var(--nbx-primary) 100%) !important;
    font-weight: 900 !important;
    font-variation-settings: "wght" 900, "DOTS" 4;
}
:is(.ss02, .wiki-editor-content) .navbox-title > div {
    margin: 0 !important;
    font-size: 1.02rem !important;
    color: inherit !important;
}
:is(.ss02, .wiki-editor-content) .navbox-title a { color: #fff !important; }

/* هر ردیف: عنوان گروه + فهرست پیوندها */
:is(.ss02, .wiki-editor-content) .navbox-group {
    width: 9.5rem !important;
    min-width: 7rem;
    padding: .7rem 1rem !important;
    color: var(--nbx-navy) !important;
    background: var(--nbx-soft) !important;
    font-size: .88rem !important;
    font-weight: 800 !important;
    font-variation-settings: "wght" 800;
    text-align: right !important;
    white-space: normal;
    border-left: 2px solid rgba(217, 187, 138, .55) !important;
}

:is(.ss02, .wiki-editor-content) .navbox-list {
    padding: .55rem .9rem !important;
    font-size: .92rem !important;
    line-height: 2.1;
    text-align: right !important;
    background: #fff !important;
}
:is(.ss02, .wiki-editor-content) .navbox-list > div { padding: 0 !important; }
:is(.ss02, .wiki-editor-content) .navbox-even { background: #fcfcfd !important; }

/* جداکننده‌ی ردیف‌ها */
:is(.ss02, .wiki-editor-content) table.navbox-inner > tbody > tr + tr > th,
:is(.ss02, .wiki-editor-content) table.navbox-inner > tbody > tr + tr > td {
    border-top: 1px dashed var(--nbx-line) !important;
}

/* پیوندها */
:is(.ss02, .wiki-editor-content) .navbox-list a {
    color: var(--nbx-primary);
    text-decoration: none;
    padding: .05rem .2rem;
    border-radius: 6px;
    white-space: nowrap; /* نام هر پیوند در یک خط بماند */
    transition: background-color .15s ease, color .15s ease;
}
:is(.ss02, .wiki-editor-content) .navbox-list a:hover,
:is(.ss02, .wiki-editor-content) .navbox-list a:focus-visible {
    color: #fff;
    background: var(--nbx-accent);
}
/* صفحه‌ی فعلی (پیوند به خود صفحه) */
:is(.ss02, .wiki-editor-content) .navbox-list a.mw-selflink,
:is(.ss02, .wiki-editor-content) .navbox-list a.selflink {
    color: var(--nbx-navy);
    font-weight: 900;
    background: rgba(217, 187, 138, .3);
    cursor: default;
}

/* جدول‌های تودرتوی زیرگروه */
:is(.ss02, .wiki-editor-content) .navbox-list table.navbox-subgroup,
:is(.ss02, .wiki-editor-content) .navbox-list table.navbox-inner {
    margin: 0 !important;
    box-shadow: none;
    border-radius: 10px;
}

/* موبایل: عنوان گروه بالای فهرست */
@media (max-width: 768px) {
    :is(.ss02, .wiki-editor-content) table.navbox-inner,
    :is(.ss02, .wiki-editor-content) table.navbox-inner > tbody,
    :is(.ss02, .wiki-editor-content) table.navbox-inner > tbody > tr,
    :is(.ss02, .wiki-editor-content) table.navbox-inner > tbody > tr > th,
    :is(.ss02, .wiki-editor-content) table.navbox-inner > tbody > tr > td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }
    :is(.ss02, .wiki-editor-content) table.navbox-inner { overflow-wrap: anywhere; }
    :is(.ss02, .wiki-editor-content) .navbox-group {
        border-left: 0 !important;
        padding: .55rem .9rem !important;
    }
    :is(.ss02, .wiki-editor-content) table.navbox-inner > tbody > tr + tr > td { border-top: 0 !important; }
}

/* ---------------------------------------------------------------------
 * 2) تصاویر قابل بزرگ‌نمایی
 * ------------------------------------------------------------------- */
img.yaghut-zoomable { cursor: zoom-in; }
img.yaghut-zoomable:focus-visible { outline: 3px solid rgba(188, 32, 80, .55); outline-offset: 3px; }

/* ---------------------------------------------------------------------
 * 3) زیرنویس lightbox (PhotoSwipe)
 * ------------------------------------------------------------------- */
.pswp__yaghut-caption {
    position: absolute;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    max-width: min(760px, calc(100% - 2rem));
    padding: .6rem 1.1rem;
    color: #fff;
    font-family: 'iransansxv', iransansx, tahoma;
    font-size: .92rem;
    line-height: 1.9;
    text-align: center;
    background: rgba(17, 17, 17, .62);
    border-radius: 12px;
    backdrop-filter: blur(6px);
    pointer-events: none;
}
.pswp__yaghut-caption[hidden] { display: none; }
@media (max-width: 768px) {
    .pswp__yaghut-caption { bottom: .75rem; font-size: .85rem; padding: .5rem .85rem; }
}

/* ---------------------------------------------------------------------
 * 4) نقل‌قول کناری قدیمی (div.quotebox.pullquote)
 *    رنگ‌ها و عرض inline هر نقل‌قول (مثلاً width:25%؛ background:#c4cbfc) یکدست می‌شوند.
 * ------------------------------------------------------------------- */
:is(.ss02, .wiki-editor-content) .quotebox {
    position: relative;
    box-sizing: border-box;
    width: min(330px, 38%) !important;
    float: left;
    clear: left;
    margin: .4rem 1.75rem 1.25rem 0;
    padding: 1.1rem 1.15rem 1rem;
    direction: rtl;
    text-align: right;
    background: linear-gradient(165deg, #ffffff 0%, #fbf4f6 100%) !important;
    border: 1px solid rgba(188, 32, 80, .18);
    border-inline-start: 4px solid #bc2050;
    border-radius: 16px;
    box-shadow: 0 16px 30px -24px rgba(136, 15, 53, .55);
}
:is(.ss02, .wiki-editor-content) .quotebox.floatright {
    float: right;
    clear: right;
    margin: .4rem 0 1.25rem 1.75rem;
}
:is(.ss02, .wiki-editor-content) .quotebox:not(.floatleft):not(.floatright) {
    float: none;
    width: auto !important;
    max-width: 680px;
    margin: 1.75rem auto;
}

/* علامت نقل‌قول */
:is(.ss02, .wiki-editor-content) .quotebox::after {
    content: "\201D";
    position: absolute;
    top: .1rem;
    left: .85rem;
    font-family: Georgia, serif;
    font-size: 3.6rem;
    line-height: 1;
    color: rgba(188, 32, 80, .18);
    pointer-events: none;
}

:is(.ss02, .wiki-editor-content) .quotebox .quotebox-title {
    margin: 0 0 .6rem;
    padding: 0 0 .5rem 2.2rem;
    color: #880f35;
    font-size: .95rem;
    font-weight: 900;
    font-variation-settings: "wght" 900;
    background: none !important;
    border-bottom: 2px solid rgba(217, 187, 138, .55);
}

:is(.ss02, .wiki-editor-content) .quotebox .quotebox-quote {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    color: #374151;
    font-size: .95rem;
    line-height: 2;
}
:is(.ss02, .wiki-editor-content) .quotebox .quotebox-quote p {
    margin: 0;
    padding: 0;
    color: inherit;
    font-weight: 600;
    font-variation-settings: "wght" 600;
}
/* <br> ابتدای نقل‌قول‌های قدیمی فاصله‌ی اضافه می‌ساخت */
:is(.ss02, .wiki-editor-content) .quotebox .quotebox-quote p > br:first-child { display: none; }
:is(.ss02, .wiki-editor-content) .quotebox sup.reference { font-size: .7em; }

/* کنار المان float شده (نقل‌قول کناری، کارت رسانه‌ی کنار متن، پلیر صوتی) کادر بلوک‌ها زیر آن نرود */
:is(.ss02, .wiki-editor-content):has(.quotebox.floatleft, .quotebox.floatright, .music-player, .yaghut-media-w-side) :is(
    blockquote, pre, ul, ol, hr, figure, .box, .yaghut-quote-section, .yaghut-media-block
):not(.quotebox *, .yaghut-ibx *, .yaghut-toc *, .music-player, .music-player *, .yaghut-media-w-side, .yaghut-media-w-side *, .yaghut-media-w-fit, .yaghut-media-w-fit *, .yaghut-media-w-center, .yaghut-media-w-center *, .yaghut-media-editor-card, .yaghut-media-editor-card *, .yaghut-block-editor, .yaghut-block-editor *, ul.sessions, .poetry-wrapper) {
    display: flow-root;
    clear: none;
}
:is(.ss02, .wiki-editor-content):has(.quotebox.floatleft, .quotebox.floatright, .music-player, .yaghut-media-w-side) .yaghut-media-block:not(.quotebox *, .music-player *, .yaghut-media-w-side, .yaghut-media-w-fit, .yaghut-media-w-center, .yaghut-media-editor-card) { width: auto; }
/* تصویر و رسانه‌ی وسط‌چین کنار هیچ متنی نمی‌نشینند: زیر رسانه‌های کناری می‌روند */

@media (max-width: 768px) {
    :is(.ss02, .wiki-editor-content) .quotebox,
    :is(.ss02, .wiki-editor-content) .quotebox.floatright {
        float: none;
        width: auto !important;
        margin: 1.25rem 0;
    }
}

/* ---------------------------------------------------------------------
 * 5) تصاویر محتوا بدون ابعاد مشخص
 *    پیش از JS: هرگز از عرض کادر یا ۷۵٪ ارتفاع پنجره بزرگ‌تر نشوند.
 *    JS تصاویر بزرگ (نه آیکن‌ها) را کلاس yaghut-content-img می‌دهد: بلوک، وسط‌چین،
 *    حداکثر نصف عرض محتوا در دسکتاپ (موبایل: تمام‌عرض). با کلیک در lightbox بزرگ می‌شوند.
 * ------------------------------------------------------------------- */
.yaghut-article__main img:not([width]):not(.yaghut-gallery-item img):not(.yaghut-ibx img):not(.icon-wrapper img) {
    max-width: 100%;
    max-height: 75vh;
    width: auto;
    height: auto;
    object-fit: contain;
}
.yaghut-article__main img.yaghut-content-img {
    display: block;
    width: auto;
    max-width: min(50%, 640px) !important;
    max-height: 70vh;
    height: auto !important;
    margin: 1.25rem auto;
    object-fit: contain !important;
    border-radius: 12px;
    box-shadow: 0 14px 30px -22px rgba(31, 38, 51, .55);
}

@media (max-width: 768px) {
    .yaghut-article__main img.yaghut-content-img { max-width: 100% !important; }
}

/* هر المان float شده (کارت تصویر، نقل‌قول کناری، …) نزدیک انتهای متن از کادر محتوا بیرون نزند */
:is(.yaghut-article__main .ss02, .wiki-editor-content)::after {
    content: "";
    display: table;
    clear: both;
}

/* ---------------------------------------------------------------------
 * 7) جدول‌های ویکی (table.wikitable)
 *    سطر اول که فقط th دارد = سرستون (زرشکی)؛ th ابتدای هر سطر = سرسطر.
 *    JS جدول را داخل .yaghut-table-wrap می‌گذارد: اسکرول افقی/عمودی + سرستون چسبان + مرتب‌سازی.
 * ------------------------------------------------------------------- */
:is(.ss02, .wiki-editor-content) .yaghut-table-wrap {
    position: relative;
    /* جدول کم‌ستون کل عرض را نگیرد و وسط بنشیند */
    width: max-content;
    min-width: min(100%, 560px);
    max-width: 100%;
    max-height: 34rem;
    margin: 1.75rem auto;
    overflow: auto;
    overscroll-behavior: contain;
    background: #fff;
    border: 1px solid rgba(52, 66, 88, .12);
    border-radius: 16px;
    box-shadow: 0 16px 34px -28px rgba(52, 66, 88, .55);
    scrollbar-width: thin;
    scrollbar-color: rgba(188, 32, 80, .3) transparent;
}
:is(.ss02, .wiki-editor-content) .yaghut-table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
:is(.ss02, .wiki-editor-content) .yaghut-table-wrap::-webkit-scrollbar-thumb { background: rgba(188, 32, 80, .3); border-radius: 999px; }

:is(.ss02, .wiki-editor-content) table.wikitable {
    width: 100%;
    margin: 1.75rem auto !important;
    border-collapse: separate;
    border-spacing: 0;
    direction: rtl;
    text-align: right;
    background: #fff;
    color: #1f2633;
    font-size: .93rem;
    line-height: 1.8;
}
/* داخل wrapper، قاب و فاصله را wrapper می‌دهد */
:is(.ss02, .wiki-editor-content) .yaghut-table-wrap > table.wikitable { margin: 0 !important; }
/* بدون JS (یا پیش از اجرای آن) هم قاب داشته باشد */
:is(.ss02, .wiki-editor-content) table.wikitable:not(.yaghut-table-wrap > table) {
    border: 1px solid rgba(52, 66, 88, .12);
    border-radius: 16px;
    overflow: hidden;
}

:is(.ss02, .wiki-editor-content) table.wikitable th,
:is(.ss02, .wiki-editor-content) table.wikitable td {
    padding: .6rem .9rem;
    vertical-align: middle;
    border: 0;
    border-bottom: 1px solid rgba(52, 66, 88, .08);
}
:is(.ss02, .wiki-editor-content) table.wikitable p { margin: 0; padding: 0; color: inherit; }

/* سرستون: thead یا سطر اولی که فقط th دارد */
:is(.ss02, .wiki-editor-content) table.wikitable > thead > tr > th,
:is(.ss02, .wiki-editor-content) table.wikitable > tbody > tr:first-child:not(:has(td)) > th {
    position: sticky;
    top: 0;
    z-index: 2;
    color: #fff;
    background: linear-gradient(180deg, #a3123f 0%, #880f35 100%);
    font-size: .9rem;
    font-weight: 800;
    font-variation-settings: "wght" 800;
    text-align: center;
    white-space: nowrap;
    border-bottom: 0;
}

/* سرسطر (th ابتدای سطرهای داده) */
:is(.ss02, .wiki-editor-content) table.wikitable > tbody > tr:has(td) > th {
    color: #344258;
    background: #fbf4f6;
    font-weight: 800;
    font-variation-settings: "wght" 800;
    text-align: center;
    white-space: nowrap;
    border-left: 2px solid rgba(217, 187, 138, .5);
}

/* راه‌راه + hover */
:is(.ss02, .wiki-editor-content) table.wikitable > tbody > tr:has(td):nth-child(even) > td { background: #fcfcfd; }
:is(.ss02, .wiki-editor-content) table.wikitable > tbody > tr:has(td):hover > td { background: #fdf2f5; }
:is(.ss02, .wiki-editor-content) table.wikitable > tbody > tr:last-child > * { border-bottom: 0; }

:is(.ss02, .wiki-editor-content) table.wikitable a { color: #880f35; text-decoration: none; }
:is(.ss02, .wiki-editor-content) table.wikitable a:hover { color: #bc2050; text-decoration: underline; }

/* مرتب‌سازی (table.sortable) */
:is(.ss02, .wiki-editor-content) table.wikitable th.yaghut-sortable {
    cursor: pointer;
    user-select: none;
    padding-left: 1.6rem;
    position: sticky;
}
:is(.ss02, .wiki-editor-content) table.wikitable th.yaghut-sortable::after {
    content: "\f0dc"; /* fa-sort */
    font-family: FontAwesome;
    position: absolute;
    left: .6rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .8em;
    opacity: .55;
}
:is(.ss02, .wiki-editor-content) table.wikitable th.yaghut-sortable[aria-sort="ascending"]::after { content: "\f0de"; opacity: 1; }  /* fa-sort-asc */
:is(.ss02, .wiki-editor-content) table.wikitable th.yaghut-sortable[aria-sort="descending"]::after { content: "\f0dd"; opacity: 1; } /* fa-sort-desc */
:is(.ss02, .wiki-editor-content) table.wikitable th.yaghut-sortable:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

@media (max-width: 768px) {
    :is(.ss02, .wiki-editor-content) .yaghut-table-wrap { max-height: 70vh; border-radius: 12px; }
    :is(.ss02, .wiki-editor-content) table.wikitable { font-size: .86rem; }
    :is(.ss02, .wiki-editor-content) table.wikitable th,
    :is(.ss02, .wiki-editor-content) table.wikitable td { padding: .5rem .65rem; }
}

/* ---------------------------------------------------------------------
 * 8) «لینک قرمز» مدیاویکی (a.new: صفحه‌ای که وجود ندارد، href="#")
 *    به‌جای لینک مرده، متن ساده نمایش داده می‌شود.
 * ------------------------------------------------------------------- */
:is(.ss02, .wiki-editor-content) a.new {
    color: inherit !important;
    text-decoration: none !important;
    border-bottom: 0 !important;
    background: none !important;
    pointer-events: none;
    cursor: text;
}

/* ---------------------------------------------------------------------
 * 9) شعر (div.poetry-wrapper > .poetry-sdr / .poetry-ajz)
 *    چیدمان سنتی: مصراع اول (صدر) راست، مصراع دوم (عجز) چپ؛
 *    هر دو ستون هم‌عرضِ بلندترین مصراع و هر مصراع وسط ستون خودش.
 *    موبایل: مصراع‌ها زیر هم؛ صدر راست‌چین، عجز چپ‌چین.
 * ------------------------------------------------------------------- */
:is(.ss02, .wiki-editor-content) .poetry-wrapper {
    display: grid;
    /* در اندازه‌ی ذاتی، دو ستون 1fr هر دو برابر بلندترین مصراع می‌شوند */
    grid-template-columns: 1fr 1fr;
    column-gap: clamp(1.5rem, 4vw, 3.5rem);
    row-gap: .35rem;
    width: fit-content !important;
    max-width: 100%;
    margin: 1.75rem auto;
    padding: 1.4rem clamp(1.1rem, 3vw, 2.25rem);
    position: relative;
    direction: rtl;
    color: #2b3445;
    font-size: 1.02rem;
    line-height: 2.3;
    background: linear-gradient(180deg, #fffdf9 0%, #fbf6ef 100%);
    border: 1px solid rgba(217, 187, 138, .45);
    border-radius: 16px;
    box-shadow: 0 16px 34px -30px rgba(52, 66, 88, .6);
    box-sizing: border-box;
}
/* نشان تزئینی بالای کادر */
:is(.ss02, .wiki-editor-content) .poetry-wrapper::before {
    content: "❁";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -55%);
    padding: 0 .55rem;
    color: #bc2050;
    font-size: 1rem;
    line-height: 1;
    background: #fff;
}

:is(.ss02, .wiki-editor-content) .poetry-wrapper > .poetry-sdr,
:is(.ss02, .wiki-editor-content) .poetry-wrapper > .poetry-ajz {
    margin: 0;
    padding: 0;
    /* justify در مصراع‌های کوتاه فاصله‌های بد می‌سازد؛ وسط‌چین در ستون‌های هم‌عرض تمیزتر است */
    text-align: center;
    white-space: nowrap;
}
:is(.ss02, .wiki-editor-content) .poetry-wrapper > .poetry-sdr { grid-column: 1; }
:is(.ss02, .wiki-editor-content) .poetry-wrapper > .poetry-ajz { grid-column: 2; }

/* مصراع تنها یا فرد آخر (مثلاً پایان قطعه) وسط بنشیند */
:is(.ss02, .wiki-editor-content) .poetry-wrapper > .poetry-sdr:last-child {
    grid-column: 1 / -1;
    justify-self: center;
}

/* جداکننده‌ی ظریف بین بیت‌ها */
:is(.ss02, .wiki-editor-content) .poetry-wrapper > .poetry-ajz:not(:last-child) {
    padding-bottom: .35rem;
}
:is(.ss02, .wiki-editor-content) .poetry-wrapper > .poetry-sdr:not(:first-child) {
    padding-top: .35rem;
    border-top: 1px dashed rgba(217, 187, 138, .45);
}
:is(.ss02, .wiki-editor-content) .poetry-wrapper > .poetry-sdr:not(:first-child) + .poetry-ajz {
    padding-top: .35rem;
    border-top: 1px dashed rgba(217, 187, 138, .45);
}

:is(.ss02, .wiki-editor-content) .poetry-wrapper a { color: #880f35; }

@media (max-width: 640px) {
    :is(.ss02, .wiki-editor-content) .poetry-wrapper {
        grid-template-columns: 1fr;
        width: auto !important;
        row-gap: 0;
        padding: 1.2rem 1rem;
        font-size: .98rem;
        line-height: 2.1;
    }
    :is(.ss02, .wiki-editor-content) .poetry-wrapper > .poetry-sdr,
    :is(.ss02, .wiki-editor-content) .poetry-wrapper > .poetry-ajz {
        grid-column: 1;
        white-space: normal;
    }
    :is(.ss02, .wiki-editor-content) .poetry-wrapper > .poetry-sdr { text-align: right; }
    :is(.ss02, .wiki-editor-content) .poetry-wrapper > .poetry-ajz { text-align: left; padding-inline-start: 1.5rem; }
    /* در موبایل خط جداکننده فقط بالای صدر */
    :is(.ss02, .wiki-editor-content) .poetry-wrapper > .poetry-sdr:not(:first-child) + .poetry-ajz {
        padding-top: 0;
        border-top: 0;
    }
}

/* ---------------------------------------------------------------------
 * 10) فهرست‌های چندستونه
 *     <div style="column-count: N"> و div.div-col مدیاویکی که داخلشان ul/ol است.
 *     ستون‌ها با خط جدا می‌شوند، هیچ آیتمی بین دو ستون شکسته نمی‌شود،
 *     در تبلت حداکثر ۲ ستون و در موبایل ۱ ستون (column-count درون‌خطی هم override می‌شود).
 * ------------------------------------------------------------------- */
:is(.ss02, .wiki-editor-content) :is(div[style*="column-count"], div[style*="columns:"], .div-col) {
    column-gap: 2.5rem !important;
    column-rule: 1px dashed rgba(217, 187, 138, .55) !important;
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: #fcfaf7;
    border: 1px solid rgba(52, 66, 88, .08);
    border-radius: 14px;
}

:is(.ss02, .wiki-editor-content) :is(div[style*="column-count"], div[style*="columns:"], .div-col) > :is(ul, ol) {
    margin: 0 !important;
    padding: 0 !important;
}
:is(.ss02, .wiki-editor-content) :is(div[style*="column-count"], div[style*="columns:"], .div-col) > ul { list-style: none !important; }

:is(.ss02, .wiki-editor-content) :is(div[style*="column-count"], div[style*="columns:"], .div-col) li {
    position: relative;
    margin: 0 !important;
    padding: .35rem 1.15rem .35rem 0 !important;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    line-height: 1.9;
    color: #2b3445;
    border-bottom: 1px solid rgba(52, 66, 88, .06);
}
/* نشانه‌ی لوزی زرشکی به‌جای bullet پیش‌فرض */
:is(.ss02, .wiki-editor-content) :is(div[style*="column-count"], div[style*="columns:"], .div-col) > ul > li::before {
    content: "";
    position: absolute;
    right: .2rem;
    top: 1.05em;
    width: .4rem;
    height: .4rem;
    background: #bc2050;
    border-radius: 1px;
    transform: rotate(45deg);
    opacity: .75;
}
/* ol: شماره‌ی بومی حفظ شود */
:is(.ss02, .wiki-editor-content) :is(div[style*="column-count"], div[style*="columns:"], .div-col) > ol { list-style-position: inside !important; }
:is(.ss02, .wiki-editor-content) :is(div[style*="column-count"], div[style*="columns:"], .div-col) > ol > li { padding-right: 0 !important; }
:is(.ss02, .wiki-editor-content) :is(div[style*="column-count"], div[style*="columns:"], .div-col) > ol > li::marker { color: #bc2050; font-weight: 700; }

:is(.ss02, .wiki-editor-content) :is(div[style*="column-count"], div[style*="columns:"], .div-col) li a { color: #880f35; }

@media (max-width: 1023px) {
    :is(.ss02, .wiki-editor-content) :is(div[style*="column-count"], div[style*="columns:"], .div-col) {
        column-count: 2 !important;
        -webkit-column-count: 2 !important;
        -moz-column-count: 2 !important;
    }
}
@media (max-width: 600px) {
    :is(.ss02, .wiki-editor-content) :is(div[style*="column-count"], div[style*="columns:"], .div-col) {
        column-count: 1 !important;
        -webkit-column-count: 1 !important;
        -moz-column-count: 1 !important;
        padding: .75rem 1rem;
    }
}
/* ---------------------------------------------------------------------
 * 14) فهرست‌های ساده‌ی محتوا (ul بدون کلاس، مثل «جوایز و افتخارات»)
 *     نشانه‌ی لوزی زرشکی، فاصله‌ی منظم بین آیتم‌ها و تورفتگی آویزان برای خطوط دوم به بعد.
 *     فهرست‌های داخل اجزای دیگر (ناوباکس، فهرست مطالب، جدول، کارت، چندستونه و …) دست نمی‌خورند.
 * ------------------------------------------------------------------- */
:is(.yaghut-article__main .ss02, .wiki-editor-content) ul:not([class]):not(h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul):not(:is(
    .navbox, .yaghut-toc, table, .quotebox, .card, .yaghut-ibx, .music-player,
    .div-col, [style*="column-count"], [style*="columns:"], .gallery, .yaghut-media-row, nav, .external-link-box
) ul) {
    list-style: none !important;
    margin: 1rem 0 1.25rem !important;
    padding: 0 1.4rem 0 0 !important;
}
:is(.yaghut-article__main .ss02, .wiki-editor-content) ul:not([class]):not(h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul):not(:is(
    .navbox, .yaghut-toc, table, .quotebox, .card, .yaghut-ibx, .music-player,
    .div-col, [style*="column-count"], [style*="columns:"], .gallery, .yaghut-media-row, nav, .external-link-box
) ul) > li {
    position: relative;
    margin: 0 0 .65rem !important;
    padding: 0 !important;
    line-height: 1.85;
    list-style: none !important;
}
:is(.yaghut-article__main .ss02, .wiki-editor-content) ul:not([class]):not(h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul):not(:is(
    .navbox, .yaghut-toc, table, .quotebox, .card, .yaghut-ibx, .music-player,
    .div-col, [style*="column-count"], [style*="columns:"], .gallery, .yaghut-media-row, nav, .external-link-box
) ul) > li::before {
    content: "";
    position: absolute;
    right: -1.05rem;
    top: .78em;
    width: .42rem;
    height: .42rem;
    background: #bc2050;
    border-radius: 1px;
    transform: rotate(45deg);
    opacity: .8;
}
:is(.yaghut-article__main .ss02, .wiki-editor-content) ul:not([class]):not(h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul):not(:is(
    .navbox, .yaghut-toc, table, .quotebox, .card, .yaghut-ibx, .music-player,
    .div-col, [style*="column-count"], [style*="columns:"], .gallery, .yaghut-media-row, nav, .external-link-box
) ul) > li:last-child { margin-bottom: 0 !important; }

/* فهرست تودرتو: نشانه‌ی توخالی و کوچک‌تر */
:is(.yaghut-article__main .ss02, .wiki-editor-content) ul:not([class]) ul:not([class]) {
    margin: .4rem 0 0 !important;
}
:is(.yaghut-article__main .ss02, .wiki-editor-content) ul:not([class]) ul:not([class]) > li::before {
    width: .34rem;
    height: .34rem;
    background: transparent;
    border: 1.5px solid #bc2050;
}

/* ---------------------------------------------------------------------
 * 15) خط زمانی قدیمی (ul.sessions > li.list-time > .time + .text-time)
 *     مثل فیلم‌شناسی سال‌به‌سال: سال در برچسب زرشکی، نقطه و خط عمودی در سمت راست.
 *     دسکتاپ پهن: دو ستون (هر ستون خط خودش را دارد)؛ موبایل: یک ستون.
 * ------------------------------------------------------------------- */
:is(.ss02, .wiki-editor-content) ul.sessions {
    list-style: none !important;
    margin: 1.5rem 0 !important;
    padding: 1.1rem 1.25rem .6rem !important;
    column-gap: 2.5rem;
    background: #fcfaf7;
    border: 1px solid rgba(52, 66, 88, .08);
    border-radius: 16px;
    box-shadow: 0 16px 34px -30px rgba(52, 66, 88, .55);
}
@media (min-width: 900px) {
    /* قدیمی بدون تنظیم: ۸ ردیف به بالا دو ستونی — جدید: طبق انتخاب ادیتور */
    :is(.ss02, .wiki-editor-content) ul.sessions:not([data-columns]):has(> li.list-time:nth-child(8)),
    :is(.ss02, .wiki-editor-content) ul.sessions[data-columns="2"] { column-count: 2; }
}

:is(.ss02, .wiki-editor-content) ul.sessions > li.list-time {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: .75rem;
    margin: 0 !important;
    padding: 0 1.6rem .85rem 0 !important;
    list-style: none !important;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    line-height: 1.9;
}
/* نقطه */
:is(.ss02, .wiki-editor-content) ul.sessions > li.list-time::before {
    content: "";
    position: absolute;
    right: .28rem;
    top: .55em;
    z-index: 1;
    width: .7rem;
    height: .7rem;
    background: #fff;
    border: 2.5px solid #bc2050;
    border-radius: 50%;
    box-sizing: border-box;
}
/* خط تا آیتم بعد */
:is(.ss02, .wiki-editor-content) ul.sessions > li.list-time::after {
    content: "";
    position: absolute;
    right: calc(.28rem + .35rem - 1px);
    top: calc(.55em + .7rem);
    bottom: -.55em; /* تا نقطه‌ی آیتم بعد برسد */
    width: 2px;
    background: linear-gradient(180deg, rgba(188, 32, 80, .45), rgba(217, 187, 138, .45));
    border-radius: 2px;
}
:is(.ss02, .wiki-editor-content) ul.sessions > li.list-time:last-child::after { display: none; }
:is(.ss02, .wiki-editor-content) ul.sessions > li.list-time:hover::before { background: #bc2050; }

/* سال */
:is(.ss02, .wiki-editor-content) ul.sessions .time {
    flex: 0 0 auto;
    min-width: 3.4rem;
    padding: .05rem .55rem;
    color: #fff;
    background: linear-gradient(145deg, #a3123f 0%, #880f35 100%);
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
    font-variation-settings: "wght" 800;
    line-height: 1.8;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
/* عنوان */
:is(.ss02, .wiki-editor-content) ul.sessions .text-time {
    flex: 1 1 auto;
    min-width: 0;
    color: #2b3445;
    font-size: .95rem;
    font-weight: 600;
    font-variation-settings: "wght" 600;
}
:is(.ss02, .wiki-editor-content) ul.sessions .text-time p { margin: 0; padding: 0; }
:is(.ss02, .wiki-editor-content) ul.sessions .text-time a:not(.new) {
    color: #880f35;
    text-decoration: none;
    border-bottom: 1px dashed rgba(136, 15, 53, .35);
}
:is(.ss02, .wiki-editor-content) ul.sessions .text-time a:not(.new):hover { color: #bc2050; border-bottom-color: #bc2050; }

@media (max-width: 600px) {
    :is(.ss02, .wiki-editor-content) ul.sessions { padding: .9rem .85rem .4rem !important; }
    :is(.ss02, .wiki-editor-content) ul.sessions .text-time { font-size: .9rem; }
}

/* ---------------------------------------------------------------------
 * 16) گالری با زیرنویس زیر هر تصویر (تبدیل‌شده از div.posts-grid قدیمی)
 * ------------------------------------------------------------------- */
:is(.ss02, .wiki-editor-content) .yaghut-gallery--captioned .yaghut-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .85rem;
}
:is(.ss02, .wiki-editor-content) .yaghut-gallery--captioned .yaghut-gallery-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid rgba(52, 66, 88, .1);
    border-radius: 14px;
    box-shadow: 0 14px 28px -24px rgba(31, 38, 51, .6);
    text-decoration: none;
    transition: box-shadow .2s ease, transform .2s ease;
}
:is(.ss02, .wiki-editor-content) .yaghut-gallery--captioned .yaghut-gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px -22px rgba(136, 15, 53, .55);
}
:is(.ss02, .wiki-editor-content) .yaghut-gallery--captioned .yaghut-gallery-item img {
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
:is(.ss02, .wiki-editor-content) .yaghut-gallery--captioned .yaghut-gallery-item__caption {
    display: block;
    flex: 1 1 auto;
    padding: .55rem .7rem .65rem;
    color: #344258;
    font-size: .84rem;
    line-height: 1.8;
    font-weight: 600;
    font-variation-settings: "wght" 600;
    text-align: center;
    background: linear-gradient(180deg, #fff 0%, #fbf4f6 100%);
    border-top: 2px solid rgba(188, 32, 80, .25);
}
@media (max-width: 600px) {
    :is(.ss02, .wiki-editor-content) .yaghut-gallery--captioned .yaghut-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    :is(.ss02, .wiki-editor-content) .yaghut-gallery--captioned .yaghut-gallery-item__caption { font-size: .78rem; padding: .45rem .5rem .5rem; }
}

/* ---------------------------------------------------------------------
 * 17) شعر یک‌ستونی (شعر نو / مصراع‌های تکی) — بلوک «شعر» ادیتور با چیدمان single
 * ------------------------------------------------------------------- */
:is(.ss02, .wiki-editor-content) .poetry-wrapper.poetry-single,
:is(.ss02, .wiki-editor-content) .poetry-wrapper[data-layout="single"] {
    grid-template-columns: minmax(0, 1fr);
}
:is(.ss02, .wiki-editor-content) .poetry-wrapper > .poetry-line {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0;
    text-align: center;
}

/* ---------------------------------------------------------------------
 * 18) رنگ پس‌زمینه‌ی متن (Highlight چندرنگ ادیتور)
 * ------------------------------------------------------------------- */
:is(.ss02, .wiki-editor-content) mark[data-color] {
    padding: .05em .2em;
    border-radius: .25em;
    color: inherit;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* =====================================================================
 * 19) فقط ادیتور: بلوک‌های گاهشمار و شعر
 * ===================================================================== */
.wiki-editor-content .yaghut-block-editor {
    position: relative;
    margin: 1.75rem 0;
    padding: 1.4rem .5rem .25rem;
    border: 1px dashed rgba(136, 15, 53, .25);
    border-radius: 18px;
}
.wiki-editor-content .yaghut-block-editor::before {
    content: attr(data-label);
    position: absolute;
    top: -.75rem;
    right: 1rem;
    padding: 0 .6rem;
    color: #880f35;
    background: #fff;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.5rem;
    border-radius: 999px;
}
.wiki-editor-content .yaghut-block-editor:focus-within {
    border-color: rgba(136, 15, 53, .55);
}
.wiki-editor-content .yaghut-block-editor > ul.sessions,
.wiki-editor-content .yaghut-block-editor > .poetry-wrapper {
    margin-top: 0 !important;
    margin-bottom: .5rem !important;
}
.wiki-editor-content .yaghut-block-editor-delete {
    position: absolute;
    top: -.8rem;
    left: 1rem;
    z-index: 2;
    padding: .1rem .6rem;
    color: #a3123f;
    background: #fff;
    border: 1px solid rgba(163, 18, 63, .3);
    border-radius: 999px;
    font-size: .75rem;
    line-height: 1.4rem;
    cursor: pointer;
    opacity: .75;
}
.wiki-editor-content .yaghut-block-editor-delete:hover { opacity: 1; background: #fdf0f3; }


/* فیلد سال = همان برچسب زرشکی */
.wiki-editor-content ul.sessions input.yaghut-timeline-time {
    width: 4.6rem;
    min-width: 4.6rem;
    border: 0;
    outline: 0;
    font-family: inherit;
    direction: rtl;
    cursor: text;
}
.wiki-editor-content ul.sessions input.yaghut-timeline-time::placeholder { color: rgba(255, 255, 255, .7); }
.wiki-editor-content ul.sessions input.yaghut-timeline-time:focus { box-shadow: 0 0 0 3px rgba(188, 32, 80, .25); }

/* راهنمای ردیف/مصراع خالی */
.wiki-editor-content ul.sessions .text-time:has(> br.ProseMirror-trailingBreak:only-child)::before,
.wiki-editor-content .poetry-wrapper > [data-poem-line]:has(> br.ProseMirror-trailingBreak:only-child)::before {
    float: right;
    height: 0;
    color: #a0a7b4;
    font-weight: 400;
    pointer-events: none;
}
.wiki-editor-content ul.sessions .text-time:has(> br.ProseMirror-trailingBreak:only-child)::before { content: "عنوان رویداد…"; }
.wiki-editor-content .poetry-wrapper > [data-poem-line]:has(> br.ProseMirror-trailingBreak:only-child)::before { content: "مصراع…"; }

/* شعر در ادیتور: مصراع فرد = صدر (راست)، زوج = عجز (چپ) — مثل خروجی */
.wiki-editor-content .poetry-wrapper[data-yaghut-poem] > [data-poem-line] {
    min-width: 9rem;
    margin: 0;
    padding: 0;
    text-align: center;
    white-space: normal;
}
.wiki-editor-content .poetry-wrapper[data-layout="couplet"] > [data-poem-line]:nth-child(odd) { grid-column: 1; }
.wiki-editor-content .poetry-wrapper[data-layout="couplet"] > [data-poem-line]:nth-child(even) { grid-column: 2; }
.wiki-editor-content .poetry-wrapper[data-layout="couplet"] > [data-poem-line]:nth-child(odd):not(:first-child),
.wiki-editor-content .poetry-wrapper[data-layout="couplet"] > [data-poem-line]:nth-child(odd):not(:first-child) + [data-poem-line] {
    padding-top: .35rem;
    border-top: 1px dashed rgba(217, 187, 138, .45);
}
.wiki-editor-content .poetry-wrapper[data-layout="single"] > [data-poem-line] { grid-column: 1 / -1; }

/* =====================================================================
 * 20) گاهشمار و شعر: متن کنارشان نمی‌نشیند، ولی کنار رسانه‌ی شناور (چپ/راست) بالا می‌آیند
 *     و تمام عرضِ باقی‌مانده تا رسانه را می‌گیرند (flow-root = کادر مستقل کنار float)
 * ===================================================================== */
:is(.ss02, .wiki-editor-content) ul.sessions,
:is(.ss02, .wiki-editor-content) .yaghut-timeline-title,
.wiki-editor-content .yaghut-block-editor {
    display: flow-root !important;
    clear: none !important;
    float: none !important;
    width: auto !important;
}
:is(.ss02, .wiki-editor-content) .poetry-wrapper {
    clear: none !important;
    float: none !important;
}
:is(.ss02, .wiki-editor-content) ul.sessions[data-columns="1"] { column-count: 1; }

/* ظرف شناور قدیمی گاهشمار (div.wrapper > div.title-time + ul.sessions) → تمام‌عرض */
:is(.ss02, .wiki-editor-content) div:has(> ul.sessions):not(.mw-parser-output, .ss02, .wiki-editor-content, .yaghut-block-editor) {
    display: flow-root !important;
    float: none !important;
    clear: none !important;
    width: auto !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
:is(.ss02, .wiki-editor-content) .yaghut-timeline-title,
:is(.ss02, .wiki-editor-content) div:has(> ul.sessions) > .title-time {
    margin: 1.75rem 0 -.6rem !important;
    padding: 0 !important;
    color: #880f35;
    background: none !important;
    font-size: 1.05rem;
    font-weight: 800;
    font-variation-settings: "wght" 800;
    text-align: center;
}

/* ادیتور: نوار تنظیمات بلوک (عنوان، یک/دو ستونی، حذف) */
.wiki-editor-content .yaghut-block-editor {
    padding-top: 2.6rem;
}
.wiki-editor-content .yaghut-block-editor-bar {
    position: absolute;
    top: .55rem;
    right: .75rem;
    left: .75rem;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: .4rem;
    direction: rtl;
}
.wiki-editor-content .yaghut-block-editor-bar .yaghut-block-editor-delete {
    position: static;
    margin-inline-start: auto;
}
.wiki-editor-content .yaghut-block-editor-title {
    flex: 0 1 22rem;
    min-width: 0;
    padding: .15rem .65rem;
    color: #880f35;
    background: #fff;
    border: 1px solid rgba(136, 15, 53, .2);
    border-radius: 999px;
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    outline: 0;
}
.wiki-editor-content .yaghut-block-editor-title:focus { border-color: rgba(136, 15, 53, .55); }
.wiki-editor-content .yaghut-block-editor-toggle {
    padding: .1rem .65rem;
    color: #2b3445;
    background: #f4f1ec;
    border: 1px solid rgba(43, 52, 69, .12);
    border-radius: 999px;
    font-size: .76rem;
    line-height: 1.4rem;
    cursor: pointer;
    white-space: nowrap;
}
.wiki-editor-content .yaghut-block-editor-toggle:hover { background: #ebe5dc; }

/* =====================================================================
 * 21) متن پررنگ در فرانت
 *     .deysg-black-box p متن عادی را «wght 700» می‌کند و strong/b همان تنظیم را به ارث می‌برند،
 *     پس بولد با متن عادی یکی می‌شد. اینجا بولد صریحاً پررنگ‌تر از متن اطرافش است.
 * ===================================================================== */
.page-content :is(strong, b):not(:is(h1, h2, h3, h4, h5, h6, th, .time) *) {
    font-weight: 900;
    font-variation-settings: "wght" 900, "DOTS" 4;
}
.page-content :is(ol, ul) > li :is(strong, b):not(:is(h1, h2, h3, h4, h5, h6) *) {
    font-weight: 1000;
    font-variation-settings: "wght" 1000, "DOTS" 4;
}

/* رنگ متن (span style="color") روی بولد/ایتالیک/زیرخط هم اعمال شود؛
   قالب پنل ادمین به strong رنگ ثابت می‌دهد و رنگ انتخابی را می‌پوشاند */
:is(.ss02, .wiki-editor-content) span[style*="color"] :is(strong, b, em, i, u, s, code),
:is(.ss02, .wiki-editor-content) :is(strong, b, em, i, u, s) > span[style*="color"] :is(strong, b, em, i, u, s) {
    color: inherit !important;
}

/* =====================================================================
 * 22) پانویس‌ها — قدیمی (مدیاویکی) و جدید (ادیتور) با یک ظاهر
 *   قدیمی: div.scroller > div.reflist > div.mw-references-wrap > ol.references > li#cite_note-N
 *            > p > span.mw-cite-backlink > a(↑)  +  span.reference-text > cite
 *   جدید:  section.yaghut-footnotes > h2 + hr + ol.yaghut-footnotes-list > li.yaghut-footnote-item#footnote-ID
 *            > a.yaghut-footnote-back(↑)  +  div.yaghut-footnote-text
 *   کارت کرم با اسکرول ظریف، شماره‌ی فارسی در دایره، پیوند منبع زرشکی، تاریخ‌ها کم‌رنگ.
 * ===================================================================== */

/* --- ارجاع داخل متن ([۱]) --- */
:is(.ss02, .wiki-editor-content) :is(sup.reference, sup[data-yaghut-footnote]) {
    scroll-margin-top: 100px;
}
:is(.ss02, .wiki-editor-content) :is(sup.reference, sup[data-yaghut-footnote]) a {
    padding: 0 .08em;
    color: #880f35 !important;
    font-weight: 700;
    font-variation-settings: "wght" 700;
    text-decoration: none !important;
    border: 0 !important;
}
:is(.ss02, .wiki-editor-content) :is(sup.reference, sup[data-yaghut-footnote]) a:hover { color: #bc2050 !important; }

/* --- بخش پانویس جدید: خود بخش (تیتر + آیکن + فهرست) کارت است؛ فقط فهرست اسکرول می‌خورد --- */
:is(.ss02, .wiki-editor-content) section.yaghut-footnotes {
    max-height: none !important;
    overflow: visible !important;
    margin: 2rem 0 1.5rem !important;
    padding: 1.35rem .6rem .35rem !important;
    background: #fcfaf7 !important;
    border: 1px solid rgba(52, 66, 88, .08) !important;
    border-radius: 16px !important;
    box-shadow: 0 16px 34px -30px rgba(52, 66, 88, .55) !important;
}
/* تیتر و آیکن با رنگ دوم سایت (#344258) */
:is(.ss02, .wiki-editor-content) section.yaghut-footnotes > h2 {
    margin: 0 .9rem .9rem !important;
    padding: 0 !important;
    color: #344258 !important;
}
:is(.ss02, .wiki-editor-content) section.yaghut-footnotes > h2 .fa { color: #344258; }
:is(.ss02, .wiki-editor-content) section.yaghut-footnotes > hr {
    margin: 0 .6rem .5rem !important;
    height: 0;
    background: none !important;
    border: 0 !important;
    border-top: 1px solid rgba(52, 66, 88, .18) !important;
}

/* --- کارت (قدیمی: اسکرولرِ مستقیم فهرست منابع / جدید: خود فهرست) ---
 *     فقط اسکرولری که «مستقیماً» فهرست منابع است؛ نه ظرف بزرگ‌تری که (به‌خاطر HTML ناقص) کل بخش‌ها را در خود دارد */
:is(.ss02, .wiki-editor-content) .scroller:has(> .reflist, > .mw-references-wrap, > ol.references):not(:has(> :is(h1, h2, h3, h4, h5, h6, table, .yt-table-scroll))),
:is(.ss02, .wiki-editor-content) ol.yaghut-footnotes-list {
    max-height: 26rem !important;
    overflow-y: auto !important;
    margin: 1rem 0 1.5rem !important;
    padding: .35rem .25rem !important;
    background: #fcfaf7 !important;
    border: 1px solid rgba(52, 66, 88, .08);
    border-radius: 16px !important;
    box-shadow: 0 16px 34px -30px rgba(52, 66, 88, .55);
    line-height: 1.9 !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(136, 15, 53, .35) transparent;
}
:is(.ss02, .wiki-editor-content) :is(.scroller:has(> .reflist, > .mw-references-wrap, > ol.references):not(:has(> :is(h1, h2, h3, h4, h5, h6, table, .yt-table-scroll))), ol.yaghut-footnotes-list)::-webkit-scrollbar { width: 6px; }
:is(.ss02, .wiki-editor-content) :is(.scroller:has(> .reflist, > .mw-references-wrap, > ol.references):not(:has(> :is(h1, h2, h3, h4, h5, h6, table, .yt-table-scroll))), ol.yaghut-footnotes-list)::-webkit-scrollbar-thumb { background: rgba(136, 15, 53, .3); border-radius: 6px; }

/* فهرست جدید داخل کارتِ بخش: بدون کادر دوم */
:is(.ss02, .wiki-editor-content) section.yaghut-footnotes > ol.yaghut-footnotes-list {
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* --- فهرست --- */
:is(.ss02, .wiki-editor-content) :is(ol.references, ol.yaghut-footnotes-list) {
    counter-reset: yaghut-ref;
    list-style: none !important;
    font-size: .88rem;
    color: #4a5263;
}
:is(.ss02, .wiki-editor-content) ol.references {
    margin: 0 !important;
    padding: 0 !important;
}
:is(.ss02, .wiki-editor-content) :is(ol.references, ol.yaghut-footnotes-list) > li {
    /* .deysg-black-box ol li (custom.css) ردیف‌ها را 1.14rem و wght 800 می‌کرد */
    font-size: .9rem !important;
    font-weight: 500 !important;
    font-variation-settings: "wght" 500 !important;
    color: #4a5263 !important;
    counter-increment: yaghut-ref;
    position: relative;
    margin: 0 !important;
    padding: .55rem 2.9rem .55rem 1rem !important;
    list-style: none !important;
    border-bottom: 1px dashed rgba(217, 187, 138, .45);
    overflow-wrap: anywhere;
    scroll-margin-top: 100px;
}
:is(.ss02, .wiki-editor-content) :is(ol.references, ol.yaghut-footnotes-list) > li:last-child { border-bottom: 0; }

/* شماره در دایره */
:is(.ss02, .wiki-editor-content) :is(ol.references, ol.yaghut-footnotes-list) > li::before {
    content: counter(yaghut-ref, persian);
    position: absolute;
    right: .8rem;
    top: .7rem;
    width: 1.55rem;
    height: 1.55rem;
    color: #880f35;
    background: #fff;
    border: 1.5px solid rgba(136, 15, 53, .35);
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 800;
    font-variation-settings: "wght" 800;
    line-height: 1.4rem;
    text-align: center;
}
/* hover: ردیف زیر نشانگر مشخص شود */
:is(.ss02, .wiki-editor-content) :is(ol.references, ol.yaghut-footnotes-list) > li {
    border-radius: 10px;
    transition: background-color .15s ease;
}
:is(.ss02, .wiki-editor-content) :is(ol.references, ol.yaghut-footnotes-list) > li:hover {
    background: rgba(52, 66, 88, .06);
}
:is(.ss02, .wiki-editor-content) :is(ol.references, ol.yaghut-footnotes-list) > li:hover::before {
    color: #fff;
    background: #880f35;
    border-color: #880f35;
}

/* با کلیک روی شماره‌ی پانویس در متن، ردیف هدف برجسته شود */
:is(.ss02, .wiki-editor-content) :is(ol.references, ol.yaghut-footnotes-list) > li:target {
    background: rgba(188, 32, 80, .07);
    border-radius: 10px;
}
:is(.ss02, .wiki-editor-content) :is(ol.references, ol.yaghut-footnotes-list) > li:target::before { color: #fff; background: #bc2050; border-color: #bc2050; }

:is(.ss02, .wiki-editor-content) :is(ol.references > li > p, .yaghut-footnote-text, .yaghut-footnote-text p) {
    margin: 0 !important;
    padding: 0 !important;
    font-size: inherit !important;
    font-weight: 500 !important;
    font-variation-settings: "wght" 500 !important;
    color: inherit !important;
    text-align: right !important;
}
:is(.ss02, .wiki-editor-content) :is(.yaghut-footnote-text, .yaghut-footnote-text p) { display: inline; }

/* ↑ بازگشت به محل ارجاع */
:is(.ss02, .wiki-editor-content) :is(ol.references .mw-cite-backlink a, ol.yaghut-footnotes-list a.yaghut-footnote-back) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    margin: 0 0 0 .3rem;
    color: #8a93a3 !important;
    background: rgba(52, 66, 88, .06);
    border: 0 !important;
    border-radius: 6px;
    font-size: .75rem;
    text-decoration: none !important;
    vertical-align: middle;
}
:is(.ss02, .wiki-editor-content) :is(ol.references .mw-cite-backlink a, ol.yaghut-footnotes-list a.yaghut-footnote-back):hover { color: #fff !important; background: #bc2050; }

/* منبع / پیوندها */
:is(.ss02, .wiki-editor-content) ol.references cite { font-style: normal; }
:is(.ss02, .wiki-editor-content) :is(ol.references .reference-text, .yaghut-footnote-text) a {
    color: #880f35 !important;
    font-weight: 700;
    font-variation-settings: "wght" 700;
    text-decoration: none;
    border-bottom: 1px dashed rgba(136, 15, 53, .3);
    overflow-wrap: anywhere;
}
:is(.ss02, .wiki-editor-content) :is(ol.references .reference-text, .yaghut-footnote-text) a:hover { color: #bc2050 !important; border-bottom-color: #bc2050; }
:is(.ss02, .wiki-editor-content) ol.references .reference-text em { font-style: normal; color: #2b3445; }
:is(.ss02, .wiki-editor-content) ol.references bdi,
:is(.ss02, .wiki-editor-content) ol.references .reference-accessdate { color: #8a93a3; font-size: .82rem; }
/* داده‌ی COinS (اسپن خالی) */
:is(.ss02, .wiki-editor-content) ol.references .Z3988 { display: none; }

@media (max-width: 600px) {
    :is(.ss02, .wiki-editor-content) :is(.scroller:has(> .reflist, > .mw-references-wrap, > ol.references):not(:has(> :is(h1, h2, h3, h4, h5, h6, table, .yt-table-scroll))), ol.yaghut-footnotes-list) { max-height: 20rem !important; }
    :is(.ss02, .wiki-editor-content) :is(ol.references, ol.yaghut-footnotes-list) > li { padding: .5rem 2.5rem .5rem .6rem !important; }
    :is(.ss02, .wiki-editor-content) :is(ol.references, ol.yaghut-footnotes-list) > li::before { right: .55rem; }
}

/* =====================================================================
 * 23) پیوند به بیرون — قدیمی و جدید با یک ظاهر (هم‌خانواده‌ی پانویس‌ها)
 *   قدیمی: h2#پیوند_به_بیرون + ul > li > p > a.external
 *          (JS صفحه به این ul کلاس yaghut-external-links-list می‌دهد؛ selector دوم پشتیبان است)
 *   جدید:  div#external-links.external-link-box > h2 + hr + ul > li > a + i.fa-external-link
 *   کارت کرم، هر پیوند یک ردیف با نشان ↗ در دایره‌ی سرمه‌ای (رنگ دوم)، hover مثل پانویس‌ها.
 * ===================================================================== */

/* کارت جدید: تیتر داخل کارت */
.yaghut-article .external-link-box {
    max-height: none !important;
    overflow: visible !important;
    margin: 1.5rem 0 !important;
    padding: 1.35rem .6rem .35rem !important;
    background: #fcfaf7 !important;
    border: 1px solid rgba(52, 66, 88, .08) !important;
    border-radius: 16px !important;
    box-shadow: 0 16px 34px -30px rgba(52, 66, 88, .55) !important;
}
.yaghut-article .external-link-box > h2 {
    margin: 0 .9rem .9rem !important;
    padding: 0 !important;
    color: #344258 !important;
}
.yaghut-article .external-link-box > h2 .fa { color: #344258; }
.yaghut-article .external-link-box > hr {
    margin: 0 .6rem .5rem !important;
    height: 0;
    background: none !important;
    border: 0 !important;
    border-top: 1px solid rgba(52, 66, 88, .18) !important;
}

/* فهرست پیوندها (قدیمی: خود ul کارت است / جدید: داخل کارت) */
:is(.ss02, .wiki-editor-content) :is(ul.yaghut-external-links-list, h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul),
.yaghut-article .external-link-box > ul {
    max-height: 26rem;
    overflow-y: auto;
    margin: 1rem 0 1.5rem !important;
    padding: .35rem .25rem !important;
    list-style: none !important;
    background: #fcfaf7;
    border: 1px solid rgba(52, 66, 88, .08);
    border-radius: 16px;
    box-shadow: 0 16px 34px -30px rgba(52, 66, 88, .55);
    font-size: .92rem;
    line-height: 1.9;
    scrollbar-width: thin;
    scrollbar-color: rgba(52, 66, 88, .3) transparent;
}
.yaghut-article .external-link-box > ul {
    margin: 0 !important;
    padding: 0 !important;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

:is(:is(.ss02, .wiki-editor-content) :is(ul.yaghut-external-links-list, h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul), .yaghut-article .external-link-box > ul) > li {
    position: relative;
    margin: 0 !important;
    padding: .55rem 2.9rem .55rem 1rem !important;
    list-style: none !important;
    border-bottom: 1px dashed rgba(52, 66, 88, .14);
    border-radius: 10px;
    overflow-wrap: anywhere;
    transition: background-color .15s ease;
}
:is(:is(.ss02, .wiki-editor-content) :is(ul.yaghut-external-links-list, h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul), .yaghut-article .external-link-box > ul) > li:last-child { border-bottom: 0; }
:is(:is(.ss02, .wiki-editor-content) :is(ul.yaghut-external-links-list, h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul), .yaghut-article .external-link-box > ul) > li:hover {
    background: rgba(52, 66, 88, .06);
}

/* نشان ↗ در دایره (رنگ دوم) */
:is(:is(.ss02, .wiki-editor-content) :is(ul.yaghut-external-links-list, h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul), .yaghut-article .external-link-box > ul) > li::before {
    content: "↗";
    position: absolute;
    right: .8rem;
    top: .7rem;
    width: 1.55rem;
    height: 1.55rem;
    color: #344258;
    background: #fff;
    border: 1.5px solid rgba(52, 66, 88, .3);
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.35rem;
    text-align: center;
}
:is(:is(.ss02, .wiki-editor-content) :is(ul.yaghut-external-links-list, h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul), .yaghut-article .external-link-box > ul) > li:hover::before {
    color: #fff;
    background: #344258;
    border-color: #344258;
}

:is(:is(.ss02, .wiki-editor-content) :is(ul.yaghut-external-links-list, h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul), .yaghut-article .external-link-box > ul) > li > p {
    margin: 0 !important;
    padding: 0 !important;
    font-size: inherit !important;
    text-align: right !important;
}
:is(:is(.ss02, .wiki-editor-content) :is(ul.yaghut-external-links-list, h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul), .yaghut-article .external-link-box > ul) > li a {
    color: #344258 !important;
    font-weight: 700;
    font-variation-settings: "wght" 700;
    text-decoration: none !important;
    border-bottom: 1px dashed rgba(52, 66, 88, .3);
}
:is(:is(.ss02, .wiki-editor-content) :is(ul.yaghut-external-links-list, h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul), .yaghut-article .external-link-box > ul) > li a:hover {
    color: #bc2050 !important;
    border-bottom-color: #bc2050;
}
/* آیکن انتهای پیوندهای جدید: نشان دایره‌ای جایش را گرفته */
.yaghut-article .external-link-box > ul > li .fa-external-link { display: none; }

@media (max-width: 600px) {
    :is(:is(.ss02, .wiki-editor-content) :is(ul.yaghut-external-links-list, h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul), .yaghut-article .external-link-box > ul) > li { padding: .5rem 2.5rem .5rem .6rem !important; }
    :is(:is(.ss02, .wiki-editor-content) :is(ul.yaghut-external-links-list, h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul), .yaghut-article .external-link-box > ul) > li::before { right: .55rem; }
}

/* اندازه‌ی متن پانویس‌ها و پیوند به بیرون یکسان (قواعد دیگر صفحه برای p / li غالب نشوند) */
:is(.ss02, .wiki-editor-content) :is(ol.references, ol.yaghut-footnotes-list, ul.yaghut-external-links-list, h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul),
.yaghut-article .external-link-box > ul {
    font-size: .88rem !important;
}
:is(.ss02, .wiki-editor-content) :is(ol.references, ol.yaghut-footnotes-list, ul.yaghut-external-links-list, h2:is([id^="پیوند_به_بیرون"], [id^="پیوند-به-بیرون"], :has(> [id^="پیوند_به_بیرون"])) + ul) :is(li, p, cite, .reference-text, .yaghut-footnote-text, a:not(.yaghut-footnote-back, .mw-cite-backlink a)),
.yaghut-article .external-link-box > ul :is(li, p, a) {
    font-size: inherit !important;
}
:is(.ss02, .wiki-editor-content) ol.references :is(bdi, .reference-accessdate) { font-size: .8rem !important; }

/* =====================================================================
 * 24) نقل‌قول (blockquote) — قدیمی (blockquote ساده‌ی مدیاویکی) و جدید (blockquote.yaghut-blockquote) یکسان
 *     کارت کرم با نوار زرشکی سمت راست و نشان « بزرگ و کم‌رنگ؛ هم در فرانت و هم در ادیتور.
 *     مستثنا: نقل‌قول کناری قالب قدیمی (.quotebox) و blockquoteی که فقط ظرف شعر است.
 * ===================================================================== */
:is(.ss02, .wiki-editor-content) blockquote:not(.quotebox-quote, .quotebox *, :has(.poetry-wrapper)) {
    position: relative;
    margin: 1.5rem 0 !important;
    padding: 1.1rem 3.1rem 1.1rem 1.4rem !important;
    color: #2b3445 !important;
    background: #fcfaf7 !important;
    border: 1px solid rgba(52, 66, 88, .08) !important;
    border-right: 4px solid #bc2050 !important;
    border-radius: 14px !important;
    box-shadow: 0 16px 34px -30px rgba(52, 66, 88, .55);
    font-size: 1rem;
    line-height: 2.05;
    quotes: none;
}
/* نشان نقل‌قول */
:is(.ss02, .wiki-editor-content) blockquote:not(.quotebox-quote, .quotebox *, :has(.poetry-wrapper))::before {
    /* نماد نقل‌قول (همان آیکن دکمه‌ی نقل‌قول)؛ SVG با mask تا رنگش از CSS بیاید و به فونت آیکن وابسته نباشد */
    content: "";
    position: absolute;
    top: .95rem;
    right: .8rem;
    width: 1.6rem;
    height: 1.6rem;
    background: rgba(188, 32, 80, .45);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z'/%3E%3C/svg%3E") center / contain no-repeat;
    pointer-events: none;
}
:is(.ss02, .wiki-editor-content) blockquote:not(.quotebox-quote, .quotebox *, :has(.poetry-wrapper)) > p {
    margin: 0 0 .6rem !important;
    padding: 0 !important;
    color: inherit !important;
    font-size: inherit !important;
}
:is(.ss02, .wiki-editor-content) blockquote:not(.quotebox-quote, .quotebox *, :has(.poetry-wrapper)) > p:last-child { margin-bottom: 0 !important; }
:is(.ss02, .wiki-editor-content) blockquote:not(.quotebox-quote, .quotebox *, :has(.poetry-wrapper)) a { color: #880f35; }

/* blockquoteی که ظرف شعر است: بدون کادر دوم دور شعر */
:is(.ss02, .wiki-editor-content) blockquote:has(.poetry-wrapper) {
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
}

@media (max-width: 600px) {
    :is(.ss02, .wiki-editor-content) blockquote:not(.quotebox-quote, .quotebox *, :has(.poetry-wrapper)) {
        padding: .9rem 2.5rem .9rem 1rem !important;
        font-size: .95rem;
    }
    :is(.ss02, .wiki-editor-content) blockquote:not(.quotebox-quote, .quotebox *, :has(.poetry-wrapper))::before { right: .55rem; top: .8rem; width: 1.35rem; height: 1.35rem; }
}

/* =====================================================================
 * 25) جدول‌های پهن در موبایل: هر ردیف یک کارت
 *     JS صفحه (single.blade.php) به جدول مناسب کلاس yt-stack و به هر خانه data-label (عنوان ستون) می‌دهد.
 *     ردیف سرستون پنهان، ردیف عنوان جدول نوار زرشکی، بقیه کارت «عنوان: مقدار».
 *     :not(#…) دوبار: قواعد yaghut-tables.css در :not(#data-table) شناسه دارند؛ این‌جا باید غالب شود.
 * ===================================================================== */
@media (max-width: 640px) {
    /* ظرف اسکرول: کارت‌ها داخل یک کادر با ارتفاع محدود اسکرول می‌خورند تا صفحه خیلی طولانی نشود؛
       عنوان جدول (نوار زرشکی) بالای کادر ثابت می‌ماند */
    .page-content .yt-table-scroll:has(> table.yt-stack, > .yaghut-table-wrap > table.yt-stack) {
        width: auto !important;
        max-height: min(75vh, 620px) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        padding: 0 0 .2rem !important;
        background: #f7f4f1 !important;
        border: 1px solid #ecdde2 !important;
        border-radius: 14px !important;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: rgba(136, 15, 53, .35) transparent;
    }

    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2),
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) > :is(tbody, thead, tfoot),
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr {
        display: block !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        background: none !important;
        border: 0 !important;
        box-shadow: none !important;
    }
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) colgroup,
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr.yt-stack-labels { display: none !important; }

    /* عنوان جدول (مثل «کتاب‌شناسی»): بالای کادر اسکرول ثابت */
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr.yt-stack-title:first-child {
        position: sticky !important;
        top: 0;
        z-index: 3;
        margin: 0 0 .1rem !important;
    }
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr.yt-stack-title:first-child > :is(th, td) {
        border-radius: 0 !important;
    }
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr.yt-stack-title > :is(th, td) {
        display: block !important;
        position: static !important;
        padding: .6rem 1rem !important;
        color: #fff !important;
        background: linear-gradient(145deg, #c0265a 0%, #a3123f 100%) !important;
        border: 0 !important;
        border-radius: 12px !important;
        text-align: center !important;
        font-weight: 800;
    }
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr.yt-stack-title > :is(th, td) a { color: #fff !important; }

    /* هر ردیف = کارت */
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr:not(.yt-stack-labels, .yt-stack-title) {
        width: auto !important;
        margin: .75rem .6rem !important;
        padding: .3rem 0 !important; /* فاصله‌ی افقی روی خود خانه‌هاست تا رنگ یک‌در‌میان تا لبه‌ی کارت برسد */
        overflow: hidden !important;
        /* همان پترن پس‌زمینه‌ی جدول در دسکتاپ (متغیرهای yaghut-tables.css) */
        background-color: #fff !important;
        background-image: var(--yt-tbl-bg-image, url("https://dl.yaghut.ir/media/mediawiki/2/2f/18c06d17-4010-4e9a-9cca-16667db867d1.png")) !important;
        background-size: var(--yt-tbl-bg-size, 240px) auto !important;
        background-repeat: repeat !important;
        background-position: top right !important;
        border: 1px solid #ecdde2 !important;
        border-right: 4px solid #bc2050 !important;
        border-radius: 12px !important;
        box-shadow: 0 12px 26px -22px rgba(52, 66, 88, .55) !important;
    }

    /* خانه = «عنوان ستون : مقدار» */
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr:not(.yt-stack-labels, .yt-stack-title) > :is(td, th) {
        /* نه grid: در grid هر تکه‌ی متن و هر لینکِ داخل خانه یک ستون/ردیف جدا می‌شد و متن می‌شکست.
           عنوان ستون با position:absolute در ستون راست، خود متن جریان عادی در بقیه‌ی عرض */
        display: block !important;
        position: relative !important;
        padding-right: calc(32% + .9rem) !important;
        width: auto !important;
        min-width: 0 !important;
        padding-top: .55rem !important;
        padding-bottom: .55rem !important;
        padding-left: .9rem !important;
        text-align: right !important;
        vertical-align: top !important;
        background: none !important;
        border: 0 !important;
        border-bottom: 1px dashed rgba(52, 66, 88, .14) !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr:not(.yt-stack-labels, .yt-stack-title) > :is(td, th):last-child { border-bottom: 0 !important; }
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr:not(.yt-stack-labels, .yt-stack-title) > :is(td, th)::before {
        content: attr(data-label);
        position: absolute;
        top: .55rem;
        right: .9rem;
        width: calc(32% - .6rem);
        color: #344258;
        font-size: .8rem;
        font-weight: 800;
        font-variation-settings: "wght" 800;
        line-height: 1.7;
    }
    /* متن بلند: عنوان بالای متن، متن تمام‌عرض */
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr:not(.yt-stack-labels, .yt-stack-title) > :is(td, th).yt-stack-long {
        padding-right: .9rem !important;
        line-height: 1.95;
    }
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr:not(.yt-stack-labels, .yt-stack-title) > :is(td, th).yt-stack-long::before {
        position: static;
        display: block;
        width: auto;
        margin-bottom: .15rem;
    }
    /* خانه‌ی بی‌عنوان یا خالی */
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr:not(.yt-stack-labels, .yt-stack-title) > :is(td, th):not([data-label]) { padding-right: .9rem !important; }
    /* ستون‌های جدول (= ردیف‌های کارت) یک‌در‌میان رنگی؛ نیمه‌شفاف تا تصویر پس‌زمینه دیده شود */
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr:not(.yt-stack-labels, .yt-stack-title) > :is(td, th).yt-stack-alt {
        background: linear-gradient(90deg, rgba(255, 241, 244, .55) 0%, rgba(252, 228, 235, .8) 100%) !important;
    }
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr:not(.yt-stack-labels, .yt-stack-title) > :is(td, th):not([data-label])::before { content: none; }
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr:not(.yt-stack-labels, .yt-stack-title) > :is(td, th):empty,
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr:not(.yt-stack-labels, .yt-stack-title) > :is(td, th):has(> p:only-child:empty) { display: none !important; }
    /* اولین خانه (معمولاً نام) پررنگ‌تر */
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) tr:not(.yt-stack-labels, .yt-stack-title) > :is(td, th):first-child { font-weight: 800; color: #2b3445; }
    .page-content table.yt-stack:not(#yt-x1):not(#yt-x2) td p { margin: 0 !important; }
}

/* =====================================================================
 * 26) ردیف عنوان ستون‌ها در جدول‌های قدیمی (td رنگی به‌جای th) → همان ظاهر سرستون
 *     JS صفحه به این ردیف کلاس yt-label-row می‌دهد. رنگ‌ها از متغیرهای yaghut-tables.css.
 * ===================================================================== */
.page-content table:not(#yt-x1):not(#yt-x2) tr.yt-label-row > td {
    background: var(--yt-tbl-head-bg, #bc2050) !important;
    color: var(--yt-tbl-head-color, #fff) !important;
    border-color: var(--yt-tbl-head-border, rgba(255, 255, 255, .25)) !important;
    border-bottom-color: rgba(0, 0, 0, .15) !important;
    font-weight: 700;
    font-variation-settings: "wght" 700;
    text-align: center !important;
}
.page-content table:not(#yt-x1):not(#yt-x2) tr.yt-label-row > td * {
    color: inherit !important;
    font-weight: 700 !important;
    font-variation-settings: "wght" 700 !important;
}

/* ردیف عنوان ستون‌ها هنگام اسکرول جدول بالای کادر ثابت می‌ماند (زیر ردیف عنوان جدول، اگر باشد).
   فاصله از بالا (--yt-label-top) را JS از ارتفاع ردیف‌های قبلی حساب می‌کند. */
.page-content table:not(#yt-x1):not(#yt-x2) tr.yt-label-row > td {
    position: sticky !important;
    top: var(--yt-label-top, 0px);
    z-index: 2;
}

/* =====================================================================
 * 27) موبایل: کادرهای اسکرول‌دار داخل متن (جدول، کارت‌های جدول، پانویس، پیوند به بیرون،
 *     گفتاورد، scroller قدیمی و …) وقتی به ته/سرشان رسیدند، اسکرول بعدی کل صفحه را ببرد
 *     تا کاربر فکر نکند صفحه تمام شده است.
 *     فقط محور عمودی؛ محور افقی contain می‌ماند تا کشیدن جدول به پهلو «برگشت» مرورگر را نزند.
 * ===================================================================== */
@media (max-width: 1215px) {
    .page-content,
    .page-content *,
    nav.yaghut-toc[data-yaghut-toc] .yaghut-toc__scroll {
        overscroll-behavior-y: auto !important;
    }
}
