/* ===========================
   Traffic Source Breakdown (TSB)
   Уникальные классы: tsb-*
   =========================== */

.tsb-wrapper {
    width: 592px;
    height: 551px;
    background: #1a1d25;
    border-radius: 20px;
    padding: 25px;
    position: relative;
    color: white;
    box-sizing: border-box;
    overflow: visible;
    margin: 0 auto;
}

.tsb-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.tsb-subtitle {
    font-size: 13px;
    opacity: 0.7;
    margin-bottom: 20px;
}

/* Карточки */
.tsb-card {
    padding: 18px 22px;
    border-radius: 14px;
    width: 170px;
    box-sizing: border-box;
    position: relative;
}

/* Левая карточка */
.tsb-left-card {
    left: -110px;
    top: -40%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

/* Контейнер правых карточек */
.tsb-right-cards {
    position: absolute;
    right: -60px;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 20px; /* ← строго 20px */
    align-items: flex-end;
}

/* Правая карточка */
.tsb-right-card {
    width: 170px;
    padding: 14px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #000000 0%, #061630 100%);
}

/* Текст в карточках */
.tsb-card-title {
    font-size: 13px;
    opacity: 0.85;
    color: #dfe8ff;
}

.tsb-card-value {
    font-size: 28px;
    font-weight: 700;
    margin: 8px 0;
    color: #ffffff;
}

.tsb-card-small {
    font-size: 12px;
    opacity: 0.8;
    color: #c6d5ff;
}

/* График */
#tsb-chart {
    display: block;
    margin-top: 10px;
}


/* ===========================
   MOBILE VERSION (370px–768px)
   =========================== */
@media (max-width: 768px) {
    .tsb-wrapper {
        width: 100%;
        height: auto; /* → контент сам растёт */
        padding: 20px;
        border-radius: 16px;
    }

    .tsb-title {
        font-size: 18px;
    }

    .tsb-subtitle {
        font-size: 12px;
        margin-bottom: 16px;
    }

    /* График */
    #tsb-chart {
        width: 100% !important;
        height: 260px !important;
        margin: 0 auto 20px auto;
    }

    /* Сбрасываем абсолютно позиционированные карточки */
    .tsb-left-card,
    .tsb-right-cards {
        position: static;
        transform: none;
        left: auto;
        top: auto;
        right: auto;
    }

    /* Контейнер правых карточек */
    .tsb-right-cards {
        width: 100%;
        margin-top: 15px;
        gap: 14px;
        align-items: stretch;
    }

    /* Левая карточка → становится первой */
    .tsb-left-card {
        width: 100%;
        margin-bottom: 14px;
        padding: 16px 18px;
    }

    /* Правая карточка */
    .tsb-right-card {
        width: 100%;
        padding: 16px 18px;
    }

    /* Текст внутри карт */
    .tsb-card-title {
        font-size: 12px;
    }

    .tsb-card-value {
        font-size: 22px;
        margin: 6px 0;
    }

    .tsb-card-small {
        font-size: 11px;
    }
}



/* ===========================
   MOBILE VERSION (370px–768px)
   =========================== */
@media (max-width: 768px) {
    .tsb-wrapper {
        width: 100%;
        height: auto; /* → контент сам растёт */
        padding: 20px;
        border-radius: 16px;
    }

    .tsb-title {
        font-size: 18px;
    }

    .tsb-subtitle {
        font-size: 12px;
        margin-bottom: 16px;
    }

    /* График */
    #tsb-chart {
        width: 100% !important;
        height: 260px !important;
        margin: 0 auto 20px auto;
    }

    /* Сбрасываем абсолютно позиционированные карточки */
    .tsb-left-card,
    .tsb-right-cards {
        position: static;
        transform: none;
        left: auto;
        top: auto;
        right: auto;
    }

    /* Контейнер правых карточек */
    .tsb-right-cards {
        width: 100%;
        margin-top: 15px;
        gap: 14px;
        align-items: stretch;
    }

    /* Левая карточка → становится первой */
    .tsb-left-card {
        width: 100%;
        margin-bottom: 14px;
        padding: 16px 18px;
    }

    /* Правая карточка */
    .tsb-right-card {
        width: 100%;
        padding: 16px 18px;
    }

    /* Текст внутри карт */
    .tsb-card-title {
        font-size: 12px;
    }

    .tsb-card-value {
        font-size: 22px;
        margin: 6px 0;
    }

    .tsb-card-small {
        font-size: 11px;
    }
}

/* Версия для совсем маленьких телефонов 370–420px */
@media (max-width: 420px) {
    #tsb-chart {
        height: 220px !important;
    }

    .tsb-card-value {
        font-size: 20px;
    }
}



