.trending-shell {
    padding-top: 1.15rem;
}

.trending-hero {
    align-items: center;
}

.trending-filter-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(10rem, 1fr)) auto;
    gap: 0.35rem;
    align-items: end;
    min-width: min(43rem, 100%);
}

.trending-filter-form label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.trending-filter-form select {
    width: 100%;
    min-height: 2.65rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid #b9c9d9;
    background: #ffffff;
    color: var(--brand-deep);
    font: inherit;
    font-weight: 800;
}

.trending-filter-form label,
.trending-filter-form select {
    grid-row: auto;
}

.trending-filter-form label[for="country-select"] {
    grid-column: 1;
    grid-row: 1;
}

.trending-filter-form #country-select {
    grid-column: 1;
    grid-row: 2;
}

.trending-filter-form label[for="sector-select"] {
    grid-column: 2;
    grid-row: 1;
}

.trending-filter-form #sector-select {
    grid-column: 2;
    grid-row: 2;
}

.trending-filter-form label[for="industry-select"] {
    grid-column: 3;
    grid-row: 1;
}

.trending-filter-form #industry-select {
    grid-column: 3;
    grid-row: 2;
}

.trending-filter-form select:disabled {
    background: #f3f7fa;
    color: #71859a;
}

.trending-export-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    grid-column: 4;
    grid-row: 2;
    min-height: 2.65rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid #9fc0d3;
    background: #edf6f7;
    color: #164b5b;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.trending-export-link:hover,
.trending-export-link:focus {
    border-color: #164b5b;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.trending-summary,
.trending-results {
    margin-top: 0.85rem;
}

.trending-country-stat small {
    display: block;
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 900;
}

.trending-grid {
    display: grid;
    gap: 0.45rem;
}

.trending-row {
    display: grid;
    grid-template-columns:
        minmax(5.5rem, 0.6fr)
        minmax(12rem, 1.35fr)
        minmax(8rem, 0.95fr)
        minmax(8rem, 1fr)
        minmax(4.5rem, 0.45fr)
        minmax(4rem, 0.42fr)
        minmax(5rem, 0.48fr)
        minmax(5rem, 0.55fr)
        minmax(5.25rem, 0.52fr);
    gap: 0.55rem;
    align-items: center;
    min-width: 0;
    padding: 0.65rem;
    border: 1px solid #dce6ef;
    background: #ffffff;
}

.trending-head {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    background: #f8fbfe;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.trending-cell {
    min-width: 0;
    color: var(--brand-deep);
    font-weight: 800;
}

.trending-cell strong,
.trending-cell small {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.trending-cell small {
    margin-top: 0.16rem;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.trending-cell.number {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.trending-taxonomy-link {
    color: var(--brand);
    font-weight: 900;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.trending-taxonomy-link:hover,
.trending-taxonomy-link:focus {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.trending-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    border: 1px solid #9fc0d3;
    background: #edf6f7;
    color: #164b5b;
    font-weight: 900;
}

.trending-move {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 900;
    white-space: nowrap;
}

.trending-move .bi {
    width: 1rem;
    height: 1rem;
}

.trending-move.is-up {
    color: #04713a;
}

.trending-move.is-down {
    color: #b3312a;
}

.trending-move.is-flat {
    color: var(--muted);
}

.trending-empty {
    display: grid;
    gap: 0.2rem;
    padding: 1rem 0;
    color: var(--muted);
}

.trending-empty strong {
    color: var(--brand-deep);
}

@media (max-width: 1250px) {
    .trending-row {
        grid-template-columns:
            minmax(5rem, 0.55fr)
            minmax(10rem, 1.25fr)
            minmax(7.5rem, 0.9fr)
            minmax(7.5rem, 0.95fr)
            minmax(4.25rem, 0.4fr)
            minmax(3.75rem, 0.38fr)
            minmax(4.75rem, 0.45fr)
            minmax(4.75rem, 0.5fr)
            minmax(4.75rem, 0.48fr);
        gap: 0.45rem;
        font-size: 0.88rem;
    }
}

@media (max-width: 980px) {
    .trending-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
    }

    .trending-filter-form label[for="country-select"] {
        grid-column: 1;
        grid-row: 1;
    }

    .trending-filter-form #country-select {
        grid-column: 1;
        grid-row: 2;
    }

    .trending-filter-form label[for="sector-select"] {
        grid-column: 2;
        grid-row: 1;
    }

    .trending-filter-form #sector-select {
        grid-column: 2;
        grid-row: 2;
    }

    .trending-filter-form label[for="industry-select"] {
        grid-column: 1;
        grid-row: 3;
    }

    .trending-filter-form #industry-select {
        grid-column: 1;
        grid-row: 4;
    }

    .trending-export-link {
        grid-column: 2;
        grid-row: 4;
    }

    .trending-grid {
        gap: 0.65rem;
    }

    .trending-head {
        display: none;
    }

    .trending-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem 0.85rem;
        align-items: start;
        padding: 0.85rem;
    }

    .trending-cell {
        display: grid;
        gap: 0.16rem;
    }

    .trending-cell::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 900;
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    .trending-ticker-cell {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .trending-filter-form {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .trending-filter-form label[for="country-select"],
    .trending-filter-form #country-select,
    .trending-filter-form label[for="sector-select"],
    .trending-filter-form #sector-select,
    .trending-filter-form label[for="industry-select"],
    .trending-filter-form #industry-select,
    .trending-export-link {
        grid-column: 1;
        grid-row: auto;
    }

    .trending-row {
        grid-template-columns: 1fr;
    }

    .trending-cell.number {
        white-space: normal;
    }
}
