.jlb-crypto{

    width:100%;
    direction:rtl;

    /* برای Container Query: واکنش به عرض واقعی خودِ ویجت، نه عرض صفحه (سازگار با سایدبار) */
    container-type:inline-size;
    container-name:jlb-crypto;

}

.jlb-crypto-card{

    background:var(--jlb-cp-card-bg);
    border:1px solid var(--jlb-cp-border-color);
    border-radius:12px;
    overflow:hidden;

    max-width:100%;

}

.jlb-crypto-header{

    background:var(--jlb-cp-header-bg);
    color:var(--jlb-cp-header-color);

    padding:14px 18px;

    text-align:center;

    font-size:clamp(15px, calc(12.35px + .735vw), 18px);
    font-weight:700;

}

.jlb-crypto-content{

    padding:16px;

}

.jlb-crypto-list{

    display:flex;
    flex-direction:column;

    gap:10px;

}

.jlb-crypto-empty{

    padding:24px;
    text-align:center;
    color:#6b7280;

}

/* ===================================
   Row
=================================== */

.jlb-crypto-row{

    border:1px solid var(--jlb-cp-border-color);
    border-radius:12px;

    overflow:hidden;

    transition:.2s ease;

}

.jlb-crypto-row:nth-child(odd){
    background:var(--jlb-cp-row-odd);
}

.jlb-crypto-row:nth-child(even){
    background:var(--jlb-cp-row-even);
}

.jlb-crypto-row:hover{

    background:var(--jlb-cp-hover-color);
    box-shadow:0 6px 16px rgba(0,0,0,.06);

}

.jlb-crypto-row-head{

    width:100%;

    display:flex;

    align-items:center;

    gap:12px;

    padding:12px 14px;

    background:transparent;
    border:none;

    cursor:pointer;

    text-align:right;

    font-family:inherit;
    font-size:inherit;
    color:inherit;

    min-width:0;
    overflow:hidden;

}

/* ---------- نماد + آیکون ---------- */

.jlb-crypto-symbol{

    flex:0 0 auto;

    display:flex;
    align-items:center;

    gap:8px;

}

.jlb-crypto-symbol-icon{

    flex:none;

    width:26px;
    height:26px;

    border-radius:50%;

    display:flex;
    align-items:center;
    justify-content:center;

    color:#ffffff;

    font-size:13px;
    font-weight:700;
    line-height:1;

}

.jlb-crypto-symbol-name{

    font-size:clamp(12px, calc(9.9px + .55vw), 14px);
    font-weight:800;

    color:var(--jlb-cp-title-color);

    direction:ltr;
    unicode-bidi:isolate;
    white-space:nowrap;

}

/* ---------- دو خط بازار (USDT / TMN) ---------- */

.jlb-crypto-markets{

    flex:1 1 auto;

    min-width:0;

    display:flex;
    flex-direction:column;

    gap:4px;

}

.jlb-crypto-market-line{

    display:flex;
    align-items:center;

    gap:8px;

    min-width:0;

}

.jlb-crypto-market-tag{

    flex:0 0 auto;

    width:38px;

    font-size:10px;
    font-weight:700;

    color:var(--jlb-cp-title-color);
    opacity:.55;

    white-space:nowrap;
    unicode-bidi:isolate;

}

.jlb-crypto-market-price{

    flex:1 1 auto;

    min-width:0;

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;

    font-size:clamp(12px, calc(10px + .5vw), 14px);
    font-weight:700;

    color:var(--jlb-cp-title-color);

    direction:ltr;
    unicode-bidi:isolate;

}

.jlb-crypto-price-compact{
    display:none;
}

/* ---------- تغییر قیمت ---------- */

.jlb-crypto-market-change{

    flex:0 0 auto;

    display:flex;
    align-items:center;
    gap:3px;

    padding:2px 7px;

    border-radius:999px;

    font-size:clamp(9px, calc(8px + .3vw), 11px);
    font-weight:700;

    white-space:nowrap;

    direction:ltr;
    unicode-bidi:isolate;

}

.jlb-crypto-market-change--up{
    color:var(--jlb-cp-up-color);
    background:#dcfce7;
    background:color-mix(in srgb, var(--jlb-cp-up-color) 12%, transparent);
}

.jlb-crypto-market-change--down{
    color:var(--jlb-cp-down-color);
    background:#fee2e2;
    background:color-mix(in srgb, var(--jlb-cp-down-color) 12%, transparent);
}

.jlb-crypto-market-change--flat{
    color:#6b7280;
    background:#f3f4f6;
}

/* ---------- Toggle ---------- */

.jlb-crypto-row-toggle{

    flex:none;

    display:flex;
    align-items:center;
    justify-content:center;

    width:24px;
    height:24px;

    color:var(--jlb-cp-title-color);
    opacity:.55;

    transition:transform .25s ease;

}

.jlb-crypto-row-toggle svg{
    width:18px;
    height:18px;
}

.jlb-crypto-row.is-open .jlb-crypto-row-toggle{

    transform:rotate(180deg);
    opacity:.9;

}

/* ===================================
   جزئیات (اکوردیون کشویی)
=================================== */

.jlb-crypto-row-detail{

    display:grid;

    grid-template-rows:0fr;

    transition:grid-template-rows .3s ease;

}

.jlb-crypto-row-detail-inner{

    overflow:hidden;

}

.jlb-crypto-row.is-open .jlb-crypto-row-detail{

    grid-template-rows:1fr;

}

.jlb-crypto-detail-grid{

    display:grid;

    grid-template-columns:repeat(4, 1fr);

    gap:10px;

    padding:0 16px 14px;

    border-top:1px dashed var(--jlb-cp-border-color);

    margin-top:2px;
    padding-top:12px;

}

.jlb-crypto-detail-item{

    display:flex;
    flex-direction:column;
    gap:4px;

    padding:8px 10px;

    background:rgba(0,0,0,.02);

    border-radius:8px;

}

.jlb-crypto-detail-label{

    font-size:clamp(10px, calc(9.12px + .25vw), 11px);
    color:#6b7280;

}

.jlb-crypto-detail-value{

    font-size:clamp(12px, calc(10.24px + .49vw), 14px);
    font-weight:700;

    color:var(--jlb-cp-title-color);

}

/* ===================================
   Responsive — عرض صفحه (نمای معمول/تمام‌عرض)
=================================== */

@media (max-width:768px){

    .jlb-crypto-content{
        padding:10px;
    }

    .jlb-crypto-detail-grid{
        grid-template-columns:repeat(2, 1fr);
    }

}

/* ===================================
   Container Query — واکنش به عرض واقعی خودِ ویجت
   (سایدبار باریک، ویجت، ستون کنار محتوا و ...)
   مستقل از عرض صفحه، فقط بر اساس عرض ظرفی که جدول واقعاً داخلش رندر شده
=================================== */

@container jlb-crypto (max-width:360px){

    .jlb-crypto-content{
        padding:8px;
    }

    .jlb-crypto-list{
        gap:6px;
    }

    .jlb-crypto-row-head{

        gap:8px;

        padding:9px 10px;

    }

    .jlb-crypto-symbol{
        gap:6px;
    }

    .jlb-crypto-symbol-icon{
        width:22px;
        height:22px;
        font-size:11px;
    }

    .jlb-crypto-symbol-name{
        font-size:11px;
    }

    .jlb-crypto-market-tag{
        width:30px;
        font-size:9px;
    }

    .jlb-crypto-market-price{
        font-size:11px;
    }

    .jlb-crypto-market-change{

        gap:2px;

        padding:2px 5px;

        font-size:9px;

    }

    .jlb-crypto-row-toggle{
        width:16px;
        height:16px;
    }

    .jlb-crypto-row-toggle svg{
        width:14px;
        height:14px;
    }

    .jlb-crypto-detail-grid{
        grid-template-columns:repeat(2, 1fr);
        gap:6px;
        padding:0 10px 10px;
    }

    .jlb-crypto-detail-label{
        font-size:10px;
    }

    .jlb-crypto-detail-value{
        font-size:11px;
    }

}

@container jlb-crypto (max-width:260px){

    .jlb-crypto-row-head{
        gap:6px;
        padding:8px;
    }

    .jlb-crypto-symbol-icon{
        width:20px;
        height:20px;
        font-size:10px;
    }

    .jlb-crypto-symbol-name{
        font-size:10px;
    }

    .jlb-crypto-market-tag{
        width:24px;
        font-size:8px;
    }

    .jlb-crypto-market-price{
        font-size:10px;
    }

    .jlb-crypto-market-change{
        padding:2px 4px;
        font-size:8px;
    }

    .jlb-crypto-price-full{
        display:none;
    }

    .jlb-crypto-price-compact{
        display:inline;
    }

    .jlb-crypto-detail-grid{
        grid-template-columns:repeat(1, 1fr);
    }

}

/*
|--------------------------------------------------------------------------
| Fallback برای مرورگرهای بسیار قدیمی بدون پشتیبانی Container Query:
| چیدمان معمولی حفظ می‌شود و به‌خاطر ellipsis/min-width:0 از قبل
| هیچ Overflow افقی رخ نمی‌دهد، فقط ممکن است در سایدبار خیلی باریک
| متن قیمت با "…" کوتاه شود.
|--------------------------------------------------------------------------
*/