/*
 * An address's activity (wallet-activity.js): the tabs over the address
 * page, the totals, the coverage line, the filter chips (filters.css's
 * .flt-* look) and the rows, a grid on a wide screen and stacked cards on a
 * phone. Built on app.css's tokens: light, dark and auto alike.
 */

/* ------------------------------------------------------------- tabs */

.wact-tabs {
    flex: none;
    display: flex;
    gap: 2px;
    padding: 0 12px;
    border-bottom: 1px solid var(--grid);
    overflow-x: auto;
    scrollbar-width: none;
}

/* Another tab in place of the UTXOs (and the market's panel over them, under the tab bar). */
.pane.is-activity > .addr-body,
.pane.is-activity > .trade-addr {
    display: none !important;
}

.wact-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.wact-panel[hidden] {
    display: none;
}

.wact-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: opacity 0.15s;
}

.wact-scroll.is-loading {
    opacity: 0.6;
}

/* ------------------------------------------------------------ totals */

.wact-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    margin: 12px 16px 4px;
    border: 1px solid var(--grid);
    border-radius: var(--radius);
    background: var(--grid);
    overflow: hidden;
}

.wact-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 12px 10px;
    background: var(--surface);
    min-width: 0;
}

.wact-stat-label {
    color: var(--ink-2);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.wact-stat-value {
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.wact-stat-sub {
    color: var(--ink-2);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.wact-note {
    margin: 8px 16px 0;
    padding: 7px 10px;
    border-left: 3px solid var(--warning);
    border-radius: 4px;
    background: var(--sunken);
    color: var(--ink-2);
    font-size: 12.5px;
    line-height: 1.45;
}

/* ----------------------------------------------------------- filters */

.wact-filter-toggle {
    display: none;
}

.wact-filters {
    padding-top: 12px;
}

.wact-chip .sat-badges {
    align-self: center;
}

.wact-chip--more {
    color: var(--ink-2);
}

.wact-dates {
    align-items: center;
}

.wact-date {
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 12.5px;
    color-scheme: light dark;
}

.wact-date:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
}

.wact-dash {
    color: var(--muted);
}

/* -------------------------------------------------------------- rows */

.wact-list {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--grid);
}

.wact-item {
    display: grid;
    grid-template-columns: 116px minmax(0, 1.5fr) minmax(0, 0.9fr) minmax(0, 1.2fr) 168px;
    align-items: center;
    gap: 6px 16px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--grid);
    font-size: 13px;
}

.wact-item:hover {
    background: var(--hover);
}

.wact-type {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.wact-pill {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--chip);
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.wact-item--bought .wact-pill,
.wact-item--transfer_in .wact-pill,
.wact-item--mined .wact-pill {
    background: color-mix(in srgb, var(--good) 16%, var(--surface));
}

.wact-item--sold .wact-pill,
.wact-item--transfer_out .wact-pill,
.wact-item--burn .wact-pill {
    background: color-mix(in srgb, var(--serious) 18%, var(--surface));
}

.wact-item--extraction .wact-pill {
    background: color-mix(in srgb, var(--series-1) 18%, var(--surface));
}

.wact-item--listed .wact-pill,
.wact-item--relisted .wact-pill,
.wact-item--cancelled .wact-pill {
    background: color-mix(in srgb, var(--warning) 20%, var(--surface));
}

.wact-tag {
    padding: 0 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--ink-2);
    font-size: 11px;
    line-height: 16px;
}

.wact-sats {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.wact-badges {
    flex: none;
}

.wact-sat-line {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wact-row {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A sale's other sats, under its row: "+ Black omega". */
.wact-sat-line .sale-with {
    align-self: flex-start;
    margin: 2px 0;
}

.wact-sat {
    font-size: 12px;
    white-space: nowrap;
}

.wact-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.wact-price,
.wact-value {
    font-weight: 600;
    white-space: nowrap;
}

.wact-unit,
.wact-ext {
    color: var(--ink-2);
    font-size: 11.5px;
    white-space: nowrap;
}

.wact-party {
    min-width: 0;
    overflow-wrap: anywhere;
}

.wact-market {
    color: var(--ink-2);
}

.wact-when {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0 8px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.wact-block {
    font-size: 11.5px;
}

/* The date on a line of its own, the block and the link under it. */
.wact-when time {
    flex: 1 0 100%;
}

.wact-tx {
    text-decoration: none;
}

.wact-muted {
    color: var(--ink-2);
}

.wact-more {
    justify-content: center;
}

/* -------------------------------------------- narrower: stacked cards */

@media (max-width: 899.98px) {
    .wact-item {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "type amount"
            "sats sats"
            "party when";
        align-items: start;
        gap: 6px 12px;
        padding: 10px 12px;
    }

    .wact-type {
        grid-area: type;
    }

    .wact-when {
        grid-area: when;
    }

    .wact-sats {
        grid-area: sats;
    }

    .wact-amount {
        grid-area: amount;
    }

    .wact-party {
        grid-area: party;
        align-self: end;
        font-size: 12.5px;
    }

    .wact-when {
        align-self: end;
        font-size: 12.5px;
    }

    .wact-row {
        white-space: normal;
    }
}

@media (max-width: 719.98px) {
    .wact-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 10px 12px 4px;
    }

    .wact-note {
        margin: 8px 12px 0;
    }

    .wact-tabs {
        padding: 0 8px;
    }

    .wact-filter-toggle:not([hidden]) {
        display: inline-flex;
        margin: 10px 12px 0;
    }

    .wact-filters:not(.is-open) {
        display: none;
    }

    .wact-filters {
        padding: 10px 12px 4px;
    }

    .wact-stat:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .wact-stat-value {
        font-size: 14px;
    }

    .wact-filters .flt-row {
        align-items: flex-start;
    }

    .wact-filters .flt-label {
        min-width: 100%;
    }

    .wact-date {
        flex: 1 1 120px;
        min-width: 0;
    }
}

@media (forced-colors: active) {
    .wact-pill {
        border: 1px solid CanvasText;
    }
}

/* A price change: the old price struck before the new one. */
.wact-was {
    color: var(--ink-2);
    font-weight: 400;
}

.wact-reprice {
    white-space: nowrap;
}
