* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    font-family: system-ui, sans-serif;
    font-size: 16px;
    line-height: 24px;
    color: #eee;
    background: #000;
    color-scheme: dark;
}

header {
    top: 0;
    position: fixed;
    left: 0;
    right: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(16px, calc((100vw - 1200px) / 2));
    background: #242424;
    z-index: 1000;
    border-bottom: 1px solid #444;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding-top: 48px;
    padding-left: 20px;
    padding-right: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex: 0 0 auto;
    background-color: #000;
    height: 48px;
}

.content {
    max-width: 1200px;
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1 1 auto;
    gap: 20px;
}

.chart-wrapper {
    height: 450px;
    width: 100%;
    overflow-x: auto;
}

.chart-header {
    text-align: center;
    font-size: 1.2rem;
    padding-top: 11px;
    padding-bottom: 7px;
}

.chart-wrapper canvas {
    max-width: 100%;
    height: 100%;
}

.table-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    gap: 10px
}

.table-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    padding: 15px;
    border: 1px solid #444;
    gap: 8px
}

.options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.option,
.last-update {
    white-space: nowrap;
}

.scrollable-table {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: scroll;
    overflow-x: auto;
    display: block;
    max-height: calc(35px * 12);
    scroll-snap-type: y mandatory;
}

@media (max-width: 1200px) {
    .scrollable-table {
        max-height: calc(35px * 21);
    }
}

table {
    font-size: 12px;
    width: 100%;
    border-collapse: collapse;
    background: #242424;
    table-layout: fixed;
}

th,
td {
    height: 35px;
    padding: 0 8px;
    white-space: nowrap;
}

td {
    color: #ddd;
}

caption {
    text-align: center;
}

th {
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #000;
}

tr {
    scroll-snap-align: start;
}

tr>th:first-child,
tr>td:first-child {
    text-align: center;
}

tr:nth-of-type(2n) {
    background: hsl(0 0% 0% / 0.3);
}

.cell-align-right {
    text-align: right;
}

h1 {
    margin: 0;
    font-size: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#data-table {
    table-layout: fixed;
    width: 100%;
}

#data-table th,
#data-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-bold {
    font-weight: 500 !important;
    color: #fff !important;
}

.cell-accent {
    color: #54db9a !important;
}

.empty-state {
    text-align: center;
    font-size: 1.2rem;
    color: #aaa;
    margin-top: 2rem;
}

.chart-container,
.table-container {
    display: none;
}

.hidden {
    display: none !important;
}

.popup {
    width: fit-content;
    text-align: center;
}

.popup::backdrop {
    background-color: rgba(0, 0, 0, 0.6);
}


.popup-title {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    color: #eee;
}

.popup-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    overflow-x: auto;
    display: block;
}

table.popup-table {
    width: auto;
}

.popup-table th,
.popup-table td {
    border: none;
    padding: 8px;
    text-align: center;
    color: #eee;
}

.popup-table th {
    font-weight: bold;
}

.popup-close {
    display: block;
    margin: 0 auto;
    padding: 8px 16px;
    background: #ff4f81;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.dashed-link {
    text-decoration: underline dashed;
    cursor: pointer;
    color: #00e1ff;
}

.dashed-link:hover {
    color: #ff4f81;
}

@media (max-width: 900px) {
    .chart-wrapper {
        height: 250px;
    }
}

@media (max-width: 500px) {
    .chart-wrapper {
        height: 200px;
    }
}