:root {
    color-scheme: light dark;
    --surface: #fff;
    --text: #212529;
    --link: #0d6efd;
    --link-hover: #0a58ca;
    --code: #d63384;
    --pax: #198754;
    --gnu: #ffc107;
    --table-text: #000;
    --table-border: #dee2e6;
    --table-stripe: #f2f2f2;
    --unclassified-border: transparent;
    --unclassified-hover: #f2f2f2;
}

* {
    box-sizing: border-box;
}

body {
    margin: 15px 0;
    background: var(--surface);
    color: var(--text);
    font: 1rem/1.5 system-ui, sans-serif;
}

h1, h2 {
    margin: 0 0 .5rem;
    font-weight: 500;
    line-height: 1.2;
}

h1 {
    font-size: min(1.375rem + 1.5vw, 2.5rem);
}

h2 {
    font-size: min(1.325rem + .9vw, 2rem);
}

h1, footer {
    text-align: center;
}

p, ul {
    margin: 0 0 1rem;
}

ul {
    padding-inline-start: 2rem;
}

code {
    color: var(--code);
    font-family: ui-monospace, monospace;
    font-size: .875em;
}

a {
    color: var(--link);
}

a:hover {
    color: var(--link-hover);
}

.container {
    width: 100%;
    margin-inline: auto;
    padding-inline: .75rem;
}

.overview {
    display: grid;
    gap: 0 1.5rem;
    grid-template-columns: minmax(0, 1fr);
}

.wheel {
    display: block;
    margin-inline: auto;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
}

.status-text.success {
    color: var(--pax);
}

.status-text.warning {
    color: var(--gnu);
}

.status-text.default {
    color: #777;
}

.package-list {
    margin-bottom: 15px;
}

.package-link {
    display: block;
    padding: .375rem .75rem;
    border: 1px solid transparent;
    border-bottom: 0;
    color: var(--text);
    text-align: center;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.package-link:first-child {
    border-radius: 5px 5px 0 0;
}

.package-link:last-child {
    border-bottom-width: 1px;
    border-end-start-radius: 5px;
    border-end-end-radius: 5px;
}

.package-link.default {
    border-color: var(--unclassified-border);
}

.package-link.default:hover {
    background: var(--unclassified-hover);
    color: var(--text);
}

:is(.package-link, .format-chip).success {
    background: var(--pax);
    color: #fff;
}

:is(.package-link, .format-chip).warning {
    background: var(--gnu);
    color: #000;
}

.package-link.success:hover {
    background: #157347;
}

.package-link.warning:hover {
    background: #ffca2c;
}

.results-page {
    scrollbar-gutter: stable;
}

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

.results-table {
    width: 100%;
    min-width: 36rem;
    margin-bottom: 1rem;
    table-layout: fixed;
    border-spacing: 0;
    color: var(--table-text);
    text-align: start;
}

.results-table thead th:first-child {
    width: 4rem;
}

.results-table thead th:nth-child(3) {
    width: 11rem;
}

.results-table thead th:nth-child(4) {
    width: 18%;
}

.results-table thead th:last-child {
    width: 21%;
}

.stats-table {
    min-width: 44rem;
}

.stats-table thead th:nth-child(5) {
    width: 7rem;
}

.stats-table thead th:last-child {
    width: 6rem;
}

.results-table :is(th, td) {
    padding: .25rem;
    border-bottom: 1px solid var(--table-border);
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.results-table tr > :is(:first-child, :last-child) {
    text-align: end;
}

.results-table th[scope="row"] {
    font-weight: normal;
}

.results-table tbody tr:nth-child(odd) {
    background: var(--table-stripe);
}

.format-chip {
    display: inline-block;
    padding: .35em .65em;
    border-radius: .375rem;
    color: #fff;
    font-size: .75em;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.format-chip.missing {
    background: #6c757d;
}

.format-chip.zip {
    background: #dc3545;
}

@media (min-width: 576px) {
    .container { max-width: 540px; }
    .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .container { max-width: 720px; }
}

@media (min-width: 992px) {
    .container { max-width: 960px; }
}

@media (min-width: 1200px) {
    .container { max-width: 1140px; }
}

@media (min-width: 1400px) {
    .container { max-width: 1320px; }
}

@media (max-width: 500px) {
    .github-icon { width: 52px; height: 52px; }
}

@media (prefers-color-scheme: dark) {
    :root {
        --surface: #000;
        --text: #ccc;
        --link: #5bf;
        --link-hover: #000;
        --code: #ccc;
        --table-text: #ccc;
        --table-border: #333;
        --table-stripe: #111;
        --unclassified-border: #222;
        --unclassified-hover: #222;
    }

    code {
        background: #222;
    }

    a:not(.package-link):hover {
        background: var(--link);
        outline: .05em solid var(--link);
    }

    .package-link.default:hover {
        border-color: #333;
    }
}
