:root {
    --bg: #fff;
    --text: #000;
    --accent: #000;
    --subtle: #000;
    --dashed: #000;
    --selection-bg: #000;
    --selection-text: #fff;
}

/* Theme Overrides */
body.dark-theme {
    --bg: #000;
    --text: #fff;
    --accent: #fff;
    --subtle: #fff;
    --dashed: #fff;
    --selection-bg: #fff;
    --selection-text: #000;
}

@media (prefers-color-scheme: dark) {
    body:not(.light-theme) {
        --bg: #000;
        --text: #fff;
        --accent: #fff;
        --subtle: #fff;
        --dashed: #fff;
        --selection-bg: #fff;
        --selection-text: #000;
    }
}

::selection {
    background: var(--selection-bg);
    color: var(--selection-text);
}

body {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    margin: 0;
    padding: 0;
}

.app-wrapper {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 1.5rem 0 0.5rem 0;
}

hr {
    border: none;
    border-top: 1px solid var(--dashed);
    margin: 2rem 0;
}

a {
    color: inherit;
    text-underline-offset: 3px;
    text-decoration-style: solid;
}

.theme-toggle-link {
    opacity: 1;
    font-weight: bold;
    font-size: 0.7rem;
    margin-right: 1rem;
    text-decoration: none;
    cursor: pointer;
}

.filter-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem 0;
    font-size: 0.8rem;
}

select, button, input[type="password"] {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--accent);
    font-family: inherit;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 0;
    outline: none;
    -webkit-appearance: none;
}

button {
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    border: 1px solid var(--accent);
}

button:hover {
    background: var(--text);
    color: var(--bg);
}

.summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px dotted var(--dashed);
    margin: 2rem 0;
}

.summary-item {
    padding: 1.5rem;
    border-right: 1px dotted var(--dashed);
}

.summary-item:nth-child(4n) {
    border-right: none;
}

.summary-label {
    display: block;
    font-size: 0.7rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: bold;
}

.trend-container {
    margin: 2rem 0;
}

.trend {
    display: flex;
    align-items: flex-end;
    height: 100px;
    gap: 2px;
    border-bottom: 1px solid var(--dashed);
    padding-bottom: 2px;
}

.trend-bar {
    background: var(--accent);
    flex: 1;
    min-width: 2px;
}

.trend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    margin-top: 0.8rem;
    font-weight: bold;
}

.timeframe-nav a {
    text-decoration: none;
    padding: 2px 6px;
    border: 1px solid transparent;
    margin: 0 2px;
}

.timeframe-nav a.active {
    border: 1px solid var(--accent);
    background: var(--text);
    color: var(--bg);
    font-weight: bold;
}

.columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.col {
    min-width: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    table-layout: fixed;
}

.live-stream-table {
    table-layout: auto;
}

th, td {
    text-align: left;
    padding: 1rem 0.5rem;
    border-bottom: 1px dotted var(--dashed);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-stream-table td, .live-stream-table th {
    white-space: normal;
    word-break: break-word;
}

th {
    border-bottom: 2px solid var(--accent);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    font-weight: normal;
}

.bar-bg {
    background: transparent;
    height: 8px;
    width: 100%;
    margin-top: 6px;
}

.bar-fill {
    background: var(--accent);
    height: 100%;
}

.integration-guide {
    margin-top: 4rem;
    padding: 2rem;
    border: 1px dotted var(--dashed);
}

pre {
    background: var(--bg);
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.8rem;
    border: 1px solid var(--dashed);
    color: var(--text);
}

footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--dashed);
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

.error-msg {
    border: 1px solid var(--text);
    color: var(--text);
    padding: 0.5rem;
    font-size: 0.7rem;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
}

@media (max-width: 1024px) {
    .columns { grid-template-columns: repeat(2, 1fr); }
    .summary { grid-template-columns: repeat(2, 1fr); }
    .summary-item:nth-child(n) { border-right: 1px dotted var(--dashed); border-bottom: 1px dotted var(--dashed); }
    .summary-item:nth-child(2n) { border-right: none; }
    .summary-item:nth-child(3), .summary-item:nth-child(4) { border-bottom: none; }
}

@media (max-width: 768px) {
    .columns { grid-template-columns: 1fr; }
    .summary { grid-template-columns: 1fr; }
    .summary-item:nth-child(n) { border-right: none; border-bottom: 1px dotted var(--dashed); }
    .summary-item:last-child { border-bottom: none; }
}