/*
 * The listings grid (listings-grid.js): a dense table of listings beside
 * the cards, with the Cards | Grid toggle. The table scrolls sideways in
 * its own frame (never the page) with the sat column pinned; colours are
 * app.css's tokens, so light and dark follow.
 */

.coll-bar-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.lgrid-toggle button {
    height: 30px;
    padding: 0 12px;
}

.coll-scroll > .lgrid-x {
    margin: 0 16px 16px;
    padding: 0;
}

.lgrid-x {
    max-width: 100%;
    overscroll-behavior-x: contain;
}

.lgrid-x:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.lgrid-x.is-loading {
    opacity: 0.55;
    transition: opacity 0.15s;
}

.data-table.lgrid {
    font-size: 12.5px;
}

.data-table.lgrid th,
.data-table.lgrid td {
    padding: 6px 10px;
    vertical-align: middle;
}

.data-table.lgrid tbody tr:hover > * {
    background: var(--hover, var(--surface));
}

/* The sat stays in view while the rest scrolls sideways. */
.data-table.lgrid .lgrid-c-sat {
    position: sticky;
    left: 0;
    z-index: 1;
    font-weight: 400;
    box-shadow: inset -1px 0 0 var(--grid);
}

.data-table.lgrid thead .lgrid-c-sat {
    z-index: 2;
}

/* Buy now stays in view too on a wide screen, whatever the columns'
   width; a phone scrolls to it (the sat column already takes its room). */
@media (min-width: 720px) {
    .data-table.lgrid .lgrid-c-actions {
        position: sticky;
        right: 0;
        z-index: 1;
        background: var(--surface);
        box-shadow: inset 1px 0 0 var(--grid);
    }

    .data-table.lgrid thead .lgrid-c-actions {
        z-index: 2;
    }
}

.lgrid-more,
.lgrid-unit,
.lgrid-muted {
    color: var(--muted);
}

.lgrid-badges {
    display: inline-flex;
    align-items: center;
}

.lgrid-utxo {
    font-variant-numeric: tabular-nums;
}

.lgrid-seller {
    display: inline-block;
    max-width: 16ch;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

.lgrid-flag {
    display: inline-block;
    margin-right: 4px;
    padding: 0 6px;
    border-radius: 9px;
    background: var(--chip, var(--grid));
    color: var(--ink-2);
    font-size: 11.5px;
    line-height: 18px;
}

.lgrid-flag--own {
    color: var(--ink);
    font-weight: 600;
}

.lgrid-row--pending > td,
.lgrid-row--pending > th {
    color: var(--ink-2);
}

/* The card actions, one line in a cell. */
.lcard-actions.lgrid-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    justify-content: flex-start;
}

.lgrid-actions .lcard-status {
    white-space: nowrap;
}

@media (max-width: 719.98px) {
    .coll-scroll > .lgrid-x {
        margin: 0 0 12px;
    }

    .data-table.lgrid th,
    .data-table.lgrid td {
        padding: 6px 8px;
    }

    .data-table.lgrid .lgrid-c-sat {
        max-width: 42vw;
        white-space: normal;
    }
}

.data-table.lgrid .unit-price {
    flex-wrap: nowrap;
}

/* The birthday page's "Listed here" heading, with the toggle beside it. */
.bday-listings-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 16px;
}

.bday-listings-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 650;
}

.bday-section > .lgrid-x {
    margin: 0 16px;
}

@media (max-width: 719.98px) {
    .bday-listings-head {
        padding: 0 12px;
    }

    .bday-section > .lgrid-x {
        margin: 0;
        padding: 0;
    }
}
