/*
 * Data tables fit the page: header and cell text wraps (the page wrapper sets nowrap, which made tables wider than
 * the screen). If a table still doesn't fit, grid.js adds .grid-scrolls and it scrolls sideways inside its own box
 * with the Symbol column pinned, instead of the whole page scrolling. Plus the Columns menu (columnchooser).
 */

.grid td,
.grid th {
    white-space: normal;
}

.grid .premium-info li:not(.bidask),
.grid td.col-Symbol {
    white-space: nowrap;
}

/* the sort arrow took ~20px of every sortable header */
.grid.grid-sortable thead th[data-sort]:after {
    margin-left: 2px;
    font-size: 11px;
}

.grid-container.grid-scrolls {
    overflow-x: auto;
    overflow-y: hidden;
}

/* inside a scrolling box, sticky offsets count from the box, not the page */
.grid-container.grid-scrolls .th-sticky {
    top: 0;
}

.grid-container.grid-scrolls .col-Symbol {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
}

/* ---------- Columns menu ---------- */

.grid-tools {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 8px 10px;
    white-space: normal;
}

.grid-scroll-hint {
    color: #767676;
    font-size: 0.9em;
}

.grid-columns-btn {
    font: inherit;
    font-size: 13px;
    padding: 6px 12px;
    cursor: pointer;
    color: #333;
    background: #f3f3f3;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.grid-columns-btn:hover {
    border-color: #bbb;
}

.grid-columns-menu {
    position: absolute;
    top: calc(100% - 2px);
    right: 10px;
    z-index: 20;
    width: 240px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 6px 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.grid-columns-head {
    display: flex;
    justify-content: space-between;
    padding: 6px 14px 8px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    margin-bottom: 4px;
}

.grid-columns-head a {
    font-weight: normal;
    margin-left: 10px;
}

.grid-columns-fit {
    margin-left: auto;
    color: #767676;
}

.grid-columns-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    cursor: pointer;
}

.grid-columns-menu label:hover {
    background: #f4f4f4;
}

.grid-columns-menu input[type="checkbox"] {
    top: 0;
    margin: 0;
}

@media (max-width: 600px) {
    .grid-scroll-hint {
        display: none;
    }
}
