/* ==========================================================================
   COLOSIAN MARKETS — TRADE HISTORY
   ========================================================================== */

.trade-page {
    display: grid;

    gap: 0.75rem;

    width: 100%;

    min-width: 0;
    min-height: auto;

    height: auto;

    overflow: visible;
}

/* ==========================================================================
   TRADE STATS
   ========================================================================== */

.trade-stats-grid {
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
}

.stat-card__value {
    margin: 0;

    font-size: 1.6rem;
    line-height: 1.1;

    letter-spacing: -0.03em;

    font-weight: 600;

    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   TRADE TABLE FLOW

   Shared market table classes are locked to the viewport for CM500 / CM100.
   Trade History instead belongs to normal page flow and the application
   content container handles vertical scrolling.
   ========================================================================== */

.trade-page .market-table-card {
    display: block;

    width: 100%;

    min-width: 0;
    min-height: 0;

    height: auto;

    overflow: visible;
}

.trade-page .market-table-card__header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    margin-bottom: 0.65rem;
    padding-bottom: 0;
}

.trade-page .market-table-wrap {
    position: relative;

    width: 100%;

    min-width: 0;
    min-height: 0;

    height: auto;
    max-height: none;

    overflow-x: auto;
    overflow-y: visible;

    overscroll-behavior: auto;

    scrollbar-gutter: auto;
}

/* ==========================================================================
   TABLE ALIGNMENT
   ========================================================================== */

.trade-table th:nth-child(5),
.trade-table th:nth-child(6),
.trade-table th:nth-child(7),
.trade-table td:nth-child(5),
.trade-table td:nth-child(6),
.trade-table td:nth-child(7) {
    text-align: right;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1280px) {
    .trade-stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .trade-page .market-table-card__header {
        flex-direction: column;

        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .trade-stats-grid {
        grid-template-columns: 1fr;
    }
}