.cpp-wrapper {
    max-width: 1100px;
    margin: 40px auto;
    padding: 21px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.cpp-title {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #111;
    min-height: 31px; /* Prevents font-swap shift */
}

.cpp-subtitle {
    margin-top: 40px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #222;
    min-height: 24px; /* Prevents font-swap shift */
}

/* 🎯 CLS FIX: Reserve height directly on the grid containers */
.cpp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 15px !important;
    margin-top: 20px !important;
    width: 100% !important;
    box-sizing: border-box;
    /* 16 items in ~4 rows desktop = ~290px min-height reserved */
    min-height: 290px; 
}

.cpp-card {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 14px 12px !important;
    height: 62px !important; /* Fixed exact height for desktop cards */
    background: #f7f9fa !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    color: #333 !important;
    transition: all 0.2s ease-in-out !important;
    border: 1px solid #eef2f4 !important;
    box-sizing: border-box !important;
}

.cpp-card:hover {
    background: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08) !important;
    border-color: #d1d9e0 !important;
}

.cpp-card img {
    width: 28px !important;
    height: 20px !important;
    object-fit: cover !important;
    border-radius: 3px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
    flex-shrink: 0 !important;
}

.cpp-card div {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0;
}

.cpp-card strong {
    display: block !important;
    font-size: 14px !important;
    color: #222 !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cpp-card span {
    font-size: 12px !important;
    color: #556575 !important;
    margin-top: 3px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cpp-loading-text {
    grid-column: 1 / -1;
    text-align: center;
    color: #777;
    font-size: 14px;
    padding: 20px;
}

/* 📱 MOBILE OVERRIDES */
@media screen and (max-width: 540px) {
    .cpp-wrapper {
        padding: 21px 7px !important;
        margin: 20px auto;
        width: 100%;
        box-sizing: border-box;
    }

    .cpp-title {
        font-size: 20px;
        margin-bottom: 15px;
        min-height: 24px;
    }

    .cpp-subtitle {
        font-size: 16px;
        margin-top: 25px;
        min-height: 20px;
    }

    .cpp-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important; 
        gap: 12px !important;
        margin-top: 12px !important;
        width: 100% !important;
        /* 16 items in 8 rows mobile (52px card + 12px gap) = ~500px min-height reserved */
        min-height: 500px;
    }

    .cpp-card {
        gap: 8px !important;
        padding: 10px 8px !important;
        height: 52px !important; /* Fixed exact height for mobile cards */
        border-radius: 8px !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .cpp-card img {
        width: 22px !important;
        height: 16px !important;
        border-radius: 2px !important;
    }

    .cpp-card div {
        min-width: 0 !important;
        flex: 1; 
    }

    .cpp-card strong {
        font-size: 14px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block !important;
    }

    .cpp-card span {
        font-size: 12px !important;
        margin-top: 1px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block !important;
    }
}