* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, sans-serif;
    font-size: 1.2em;
    line-height: 1.62em;
    margin: 1em;
    padding: 0.5em 1em;
    background: white;
    color: black;
    max-width: 70em;
}

h1, h2, h3 {
    line-height: 1.2;
    max-width: 45em !important;
}

/* Narrow text content like rvid.se, same left margin as tables/charts */
p, blockquote {
    max-width: 45em;
}

figure {
    margin: 1em 0;
    max-width: 100%;
}

figure img {
    max-width: 100%;
}

@media (prefers-color-scheme: dark) {
    body {
        background: #000;
        color: #fff;
    }

    a {
        color: #cdf;
    }

    a:visited {
        color: #dcf;
    }

    a:hover, a:visited:hover {
        color: #def;
    }
}

.table-container {
    margin: 1em 0;
    padding: 1em;
    overflow-x: auto;
}

@media (prefers-color-scheme: dark) {
    .table-container {
        background: #111;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

th, td {
    padding: 0.5em 0.75em;
    text-align: right;
    border-bottom: 1px solid #eee;
}

th {
    font-weight: 600;
    text-align: right;
}

th:first-child, td:first-child {
    text-align: left;
}

tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

@media (prefers-color-scheme: dark) {
    th, td {
        border-bottom: 1px solid #333;
    }

    tr:hover {
        background: rgba(255, 255, 255, 0.05);
    }
}

.best {
    color: #27ae60;
    font-weight: 600;
}

.worst {
    color: #c0392b;
}

/* Callout styling for blockquote */
blockquote {
    margin: 1em 0;
    padding: 0.5em 1em;
    font-style: italic;
}

@media (prefers-color-scheme: dark) {
    blockquote {
        border-left: 0.25em solid #cdf;
    }
}

@media (prefers-color-scheme: light) {
    blockquote {
        border-left: 0.25em solid #333;
    }
}

img {
    max-width: 100%;
}

abbr[title] {
    text-decoration: underline dotted;
}

@media print {
    body, p, h1, h2, h3 {
        max-width: none;
    }
}