/* Pools component - live pools under the saturation point at k = 1000.
   Reuses the votes modal (.modal-votes, .votes-header); only the table is new. */

.modal-pools {
    max-width: 900px;
}

.pools-body {
    color: #333;
    line-height: 1.6;
    font-size: 0.95rem;
}

.pools-body p {
    margin: 0 0 12px 0;
}

.pools-body h3 {
    font-size: 1.05rem;
    color: #28a745;
    margin: 20px 0 8px 0;
}

.pools-body code {
    font-size: 0.9em;
    background: #f0f0f0;
    padding: 1px 4px;
    border-radius: 3px;
}

.pools-meta {
    color: #777;
}

.pools-rules {
    margin: 0 0 12px 22px;
}

.pools-tools {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
}

.pools-tools input {
    flex: 1 1 220px;
    padding: 8px 10px;
    font: inherit;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.pools-csv {
    color: #28a745;
    font-weight: 700;
    text-decoration: none;
}

.pools-csv:hover {
    text-decoration: underline;
}

.pools-scroll {
    overflow-x: auto;
}

.pools-table {
    width: 100%;
    border-collapse: collapse;
    line-height: 1.4;
}

.pools-table th {
    text-align: left;
    cursor: pointer;
    border-bottom: 2px solid #FFD700;
    padding: 6px 8px;
    white-space: nowrap;
    user-select: none;
}

.pools-table td {
    border-bottom: 1px solid #eee;
    padding: 5px 8px;
}

.pools-table .num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.pools-ticker {
    font-weight: 700;
    color: #28a745;
    text-decoration: none;
}

.pools-table th.pools-nosort {
    cursor: default;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.pools-link {
    color: #333;
    text-decoration: none;
}

.pools-link:hover {
    color: #28a745;
    text-decoration: underline;
}

.pools-ticker:hover {
    text-decoration: underline;
}

.pools-note {
    color: #777;
    font-size: 0.9rem;
}

/* The Delegate button, at the end of the row */
.pools-buttons {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* On a phone each pool is a card: ticker and name, the figures with their
   label, then the Delegate button. The headings stay as a row to sort by. */
@media (max-width: 600px) {
    .pools-table {
        font-size: 0.85rem;
    }

    .pools-table,
    .pools-table thead,
    .pools-table tbody {
        display: block;
    }

    .pools-table thead tr {
        display: flex;
        flex-wrap: wrap;
        gap: 2px 14px;
        border-bottom: 2px solid #FFD700;
        padding-bottom: 4px;
    }

    .pools-table th {
        border-bottom: none;
        padding: 4px 0;
    }

    .pools-table th.pools-nosort {
        display: none;
    }

    .pools-table tbody tr {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 10px;
        padding: 8px 0;
        border-bottom: 1px solid #eee;
    }

    .pools-table td {
        border-bottom: none;
        padding: 1px 0;
    }

    .pools-table td.num {
        grid-column: 1 / -1;
        text-align: left;
    }

    .pools-table td.num::before {
        content: attr(data-label) ": ";
        color: #777;
    }

    .pools-table td.pools-actions {
        grid-column: 1 / -1;
        padding-top: 6px;
    }

    .pools-buttons {
        justify-content: flex-start;
    }

    .pools-delegate {
        font-size: 0.9rem;
        padding: 6px 14px;
    }
}
