/* Veřejné statistiky — layout, mezery, řádky zemí */

/* Stejná vertikální mezera všude (jako gap mezi bloky Sklad / Komunita) */
.public-stats-page__stack {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Hero na statistikách — mezeru řídí stack, ne mb-10 z partialu */
.public-stats-page .mb-10.text-center.relative.z-20 {
    margin-bottom: 0;
}

#public-stats-body {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.public-stats-built-at {
    margin: 0;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #4c1d95;
    background: #ffffff;
    border: 1px solid #ddd6fe;
    border-radius: 9999px;
    padding: 0.5rem 1.25rem;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 14px rgba(91, 33, 182, 0.12);
}

.public-stats-period-tabs .tile-filter {
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.public-stats-row-grid {
    display: grid;
    /* vlajka | ISO | pruh | počet | % — pevné sloupce vpravo = svislé zarovnání */
    grid-template-columns: 28px 2.5rem minmax(0, 1fr) 4.5rem 3.75rem;
    align-items: center;
    column-gap: 0.5rem;
}

.public-stats-row__flag,
.public-stats-row__iso {
    cursor: help;
}

.public-stats-row__iso {
    font-size: 0.875rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: rgb(76 29 149);
    white-space: nowrap;
}

@media (max-width: 639px) {
    .public-stats-page__stack {
        gap: 1.25rem;
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }

    #public-stats-body {
        gap: 1.25rem;
    }

    .public-stats-row-grid {
        grid-template-columns: 22px 2rem minmax(0, 1fr) 3rem 2.75rem;
        column-gap: 0.3rem;
    }

    .public-stats-row__iso {
        font-size: 0.75rem;
    }

    .public-stats-row__flag {
        width: 22px !important;
        height: 17px !important;
    }

    .public-stats-row__count,
    .public-stats-row__pct {
        font-size: 0.6875rem;
    }

    .public-stats-row__bar-track {
        height: 0.625rem;
    }
}

/* B2B / B2C vedle sebe — užší sloupec, stejné zarovnání čísel */
@media (min-width: 768px) and (max-width: 1279px) {
    .public-stats-community-cols .public-stats-row-grid {
        grid-template-columns: 24px 2.25rem minmax(0, 1fr) 3.75rem 3.25rem;
        column-gap: 0.375rem;
    }
}

.public-stats-row__bar-track {
    height: 0.75rem;
    border-radius: 9999px;
    background-color: rgb(237 233 254);
    overflow: hidden;
    min-width: 0;
}

.public-stats-row__bar-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, rgb(168 85 247), rgb(76 29 149));
    min-width: 0;
    width: 0;
}

.public-stats-row__count,
.public-stats-row__pct {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
    justify-self: stretch;
    line-height: 1.2;
}

.public-stats-row__count {
    font-size: 0.8125rem;
    font-weight: 800;
    color: rgb(17 24 39);
}

.public-stats-row__pct {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgb(107 114 128);
}

.public-stats-block-total {
    font-variant-numeric: tabular-nums;
}

.public-stats-geo-table {
    table-layout: fixed;
    border-collapse: collapse;
    border-spacing: 0;
    min-width: 36rem;
}

.public-stats-geo-col--flag {
    width: 3rem;
}

.public-stats-geo-col--iso {
    width: 3.25rem;
}

.public-stats-geo-col--num {
    width: 4.75rem;
}

.public-stats-geo-col--num-wide {
    width: 5.5rem;
}

.public-stats-geo-table thead th,
.public-stats-geo-table tbody td {
    padding: 0.625rem 0.5rem;
    vertical-align: middle;
}

.public-stats-geo-table thead th {
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgb(109 40 217);
    border-bottom: 2px solid rgb(237 233 254);
}

.public-stats-geo-table tbody td {
    border-bottom: 1px solid rgb(243 244 246);
}

.public-stats-geo-table tbody tr:last-child td {
    border-bottom: none;
}

.public-stats-geo-table__flag {
    width: 3rem;
    text-align: center;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.public-stats-geo-flag-box {
    display: inline-block;
    width: 28px;
    height: 21px;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    line-height: 0;
    vertical-align: middle;
}

.public-stats-geo-flag-box img {
    display: block;
    width: 28px;
    height: 21px;
    object-fit: cover;
    object-position: center;
}

.public-stats-geo-table__name {
    text-align: left;
    font-weight: 800;
    color: rgb(76 29 149);
}

.public-stats-geo-name-cell {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    max-width: 100%;
}

.public-stats-geo-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.public-stats-geo-table__iso {
    text-align: left;
    font-weight: 700;
    color: rgb(55 65 81);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.public-stats-geo-table__num {
    text-align: right;
    white-space: nowrap;
}

.public-stats-geo-num {
    display: inline-block;
    min-width: 100%;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: rgb(17 24 39);
}

.public-stats-geo-table__totals td {
    border-top: 2px solid rgb(237 233 254);
    background: rgb(250 245 255);
}

.public-stats-geo-table__totals-label {
    font-weight: 900;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgb(76 29 149);
}

.public-stats-geo-table__totals .public-stats-geo-num {
    font-weight: 900;
}

.public-stats-geo-table__us-note {
    flex-shrink: 0;
    font-size: 1.2em;
    font-weight: 900;
    color: rgb(109 40 217);
    cursor: help;
    line-height: 1;
    position: relative;
    top: -0.05em;
}

.public-stats-geo-footnote {
    border-top: 1px solid rgb(237 233 254);
    padding-top: 0.75rem;
}

@media (max-width: 639px) {
    .public-stats-geo-table-wrap {
        overflow-x: visible;
        margin-left: 0;
        margin-right: 0;
        padding: 0;
    }

    .public-stats-geo-table {
        min-width: 0;
        width: 100%;
        display: block;
    }

    .public-stats-geo-table colgroup,
    .public-stats-geo-table thead {
        display: none;
    }

    .public-stats-geo-table tbody {
        display: block;
    }

    .public-stats-geo-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.35rem 0.5rem;
        margin-bottom: 0.625rem;
        padding: 0.625rem 0.75rem;
        border: 1px solid rgb(237 233 254);
        border-radius: 0.875rem;
        background: #ffffff;
    }

    .public-stats-geo-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .public-stats-geo-table tbody td {
        border: none;
        padding: 0;
    }

    .public-stats-geo-table__flag {
        width: auto;
        flex: 0 0 auto;
    }

    .public-stats-geo-table__name {
        flex: 1 1 8rem;
        min-width: 0;
        font-size: 0.875rem;
    }

    .public-stats-geo-table__iso {
        flex: 0 0 auto;
        font-size: 0.75rem;
        color: rgb(107 114 128);
    }

    .public-stats-geo-name-text {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .public-stats-geo-table__num {
        flex: 0 0 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding-top: 0.35rem;
        margin-top: 0.15rem;
        border-top: 1px solid rgb(243 244 246);
    }

    .public-stats-geo-table__num::before {
        content: attr(data-label);
        font-size: 0.6875rem;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: rgb(109 40 217);
        text-align: left;
    }

    .public-stats-geo-table__num .public-stats-geo-num {
        min-width: auto;
        font-size: 0.8125rem;
    }

    .public-stats-geo-table__totals {
        margin-top: 0.25rem;
        border-color: rgb(221 214 254);
        background: rgb(250 245 255);
        padding-top: 0.5rem;
    }

    .public-stats-geo-table__totals td.public-stats-geo-table__totals-label {
        flex: 0 0 100%;
        padding-bottom: 0.25rem;
        border-bottom: 1px solid rgb(237 233 254);
    }

    .public-stats-geo-table__totals .public-stats-geo-table__flag,
    .public-stats-geo-table__totals .public-stats-geo-table__name,
    .public-stats-geo-table__totals .public-stats-geo-table__iso {
        display: none;
    }
}
