* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    background: #202428;
    color: #f0f4f8;

    font-family: sans-serif;

    color-scheme: dark;
}

body {
    display: grid;
    grid-template-columns: [sidebar] 320px [content] 1fr;
}

#content {
    grid-column: content;

    padding: 2vh 2vw;

    height: fit-content;
    width: 100%;
}

#content h1 {
    font-size: 2vw;
    font-weight: 700;
}

td,
th {
    border-bottom: 1px solid #808488;
}

td {
    border-left: 1px solid #808488;
}

tr:last-child > * {
    border-bottom: none;
}

th {
    vertical-align: bottom;
    text-align: center;
}

th a {
    color: inherit;
    text-decoration: none;
    width: 100%;
    display: inline-block;
}

table {
    border: 1px solid #808488;
    border-collapse: separate;
    border-spacing: 0;

    width: 100%;
}

table th {
    font-family: monospace;
    font-size: 14px;
    font-weight: 500;
    padding: 8px;

    vertical-align: middle;
    text-align: left;
    width: 25%;

    word-break: break-all;
}

thead > :last-child > th {
    padding: 0;
    font-family: inherit;
}

thead > :first-child > th {
    font-weight: 600;
    text-align: center;
    font-size: 18px;
    padding: 6px;
}

th.sub {
    border-left-width: 8px;
}

#content > .stats {
    width: 100%;
}

.stats {
    display: flex;
    position: relative;
    align-items: center;
    width: 100%;
    height: 22px;

    background: #303438;
}

table .stats {
    width: calc((100vw - 320px - 4vw) * 0.75 - 12px - 2px);
    margin: 6px;
}

thead .stats {
    margin: 0;
    width: calc(100vw - 320px - 4vw - 19px);
}

.stats > div {
    height: 100%;
    font-size: 14px;
    line-height: 22px;

    overflow: hidden;
    white-space: nowrap;

    cursor: default;
    transition: all 0.2s;
}

.stats > div > b {
    margin-left: 4px;
}

.stat-v8 {
    background: #498af4;
}

.stat-sm {
    background: #ffd681;
    color: #000408;
}

.stat-jsc {
    background: #003550;
}

.stat-hermes {
    background: #2bb673;
}

.stat-chakra {
    background: #1d6acf;
}

.stat-kiesel {
    background: #f0dc4e;
    color: #000408;
}

.stat-libjs {
    background: #ef4946;
}

.stat-engine262 {
    background: #22b2da;
}

.stat-qjs {
    background: #c0c4c8;
    color: #000408;
}

.stat-qjs_ng {
    background: rgb(44, 44, 41);
}

.stat-xs {
    background: #08306e;
}

.stat-graaljs {
    background: #f29111;
    color: #000408;
}

.stat-graaljs_exp {
    background: #f88c96;
    color: #000408;
}

.stat-babel {
    background: #f8c10d;
    color: #000408;
}

.stat-swc {
    background: #fd9b77;
    color: #000408;
}

.stat-rhino {
    background: #d0d0d0;
    color: #000408;
}

.stat-boa {
    background: #ffff00;
    color: #000408;
}

.stat-sucrase {
    background: #f6f6f6;
    color: #000408;
}

.stat-v8_exp {
    background: #296ad1;
}

.stat-sm_exp {
    background: #d4ab59;
    color: #000408;
}

.stat-jsc_exp {
    background: #002540;
}

.stat-porffor {
    background: #9c60e0;
}

.stat-nova {
    background: #FF810A;
    color: #000408;
}

.stat-njs {
    background: #009900;
    color: #000408;
}

.stat-kingfisher {
    background: #006491;
}

.no-stat-v8 #content .stat-v8,
.no-stat-sm #content .stat-sm,
.no-stat-jsc #content .stat-jsc,
.no-stat-chakra #content .stat-chakra,
.no-stat-graaljs #content .stat-graaljs,
.no-stat-graaljs_exp #content .stat-graaljs_exp,
.no-stat-hermes #content .stat-hermes,
.no-stat-kiesel #content .stat-kiesel,
.no-stat-libjs #content .stat-libjs,
.no-stat-engine262 #content .stat-engine262,
.no-stat-qjs #content .stat-qjs,
.no-stat-qjs_ng #content .stat-qjs_ng,
.no-stat-xs #content .stat-xs,
.no-stat-babel #content .stat-babel,
.no-stat-swc #content .stat-swc,
.no-stat-rhino #content .stat-rhino,
.no-stat-boa #content .stat-boa,
.no-stat-sucrase #content .stat-sucrase,
.no-stat-v8_exp #content .stat-v8_exp,
.no-stat-jsc_exp #content .stat-jsc_exp,
.no-stat-sm_exp #content .stat-sm_exp,
.no-stat-porffor #content .stat-porffor,
.no-stat-nova #content .stat-nova,
.no-stat-njs #content .stat-njs {
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.stats > div[style="width: 0%;"] {
    color: #f0f4f8 !important;
}

.stats + table {
    margin-top: 20px;
}

.hidden {
    display: none;
}

.stats.vertical {
    flex-direction: column;
    height: unset;
    align-items: unset;
}

.stats.vertical > div {
    height: 22px;
    overflow: visible;
}

/* .stat:has(+ .stat:hover), .stat:hover + .stat
.stats:not(.vertical):has(div:hover) > div {
  width: 0;
} */

/* .stats:not(.vertical):has(> :hover) > div {
  width: 0 !important;
  padding: 0;
}

.stats:not(.vertical) > div:hover {
  padding-left: 4px;
  position: absolute;
  left: 0;
} */

#sidebar {
    grid-column: sidebar;

    position: sticky;
    top: 0;
    overflow-y: auto;
    height: 100vh;

    background: #101418;
}

#sidebar h1 {
    font-weight: 800;
    font-size: 2em;
    margin: 0;
    cursor: pointer;
}

#sidebar h2 {
    font-weight: 500;
    font-size: 0.9em;
    margin: 0;
    margin-top: 6px;
}

#sidebar-contents {
    position: relative;

    min-height: 100vh;

    padding: 24px 12px;
    padding-bottom: calc(24px + 5rem);
}

#sidebar footer {
    position: absolute;
    bottom: 24px;
    left: 12px;
    width: calc(100% - 24px);

    color: #a0a4a8;
    font-size: 0.7em;

    line-height: 1.4em;
}

#sidebar hr {
    border-color: #808488;
    margin: 1em 0;
}

#engines > div {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

#engines > div:not(:last-child) {
    margin-bottom: 4px;
}

#engines input {
    margin-right: 4px;
    vertical-align: baseline;
}

#engines label {
    font-weight: 600;
    font-size: 1em;
    vertical-align: text-top;
}

#engines span {
    font-family: monospace;
    font-weight: 300;
    font-size: 0.9em;
    white-space: pre-wrap;

    margin-left: 6px;
    user-select: all;
}

a {
    color: #b0b4b8;
    /* text-decoration: underline dashed #b0b4b8; */
}

#content details {
    margin-top: 16px;
}

#content table + details {
    margin-top: 36px;
}

#content details summary {
    margin-bottom: 12px;
}

#test262_rev {
    font-family: monospace;
    font-size: 1.2em;
}

#proposals, #editions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 48px;
}

#editions {
    margin-top: 12px;
}

#proposals > div, #editions > div {
    width: calc((100vw - 320px - 4vw) / 2 - 24px);
}

#proposals > div > :first-child {

}

#proposals > div > :first-child > a, #editions > div > :first-child > span {
    color: #f0f4f8;
    font-size: 1.2em;
    font-weight: 600;
    text-decoration: none;

    margin-bottom: 2px;
    display: inline-block;
}

#editions > div > :first-child > span {
    margin-bottom: 4px;
}

#proposals > div > :first-child > a > span, #editions > div > :first-child > span > span {
    font-size: 0.7em;
    font-weight: 500;
    margin-left: 6px;
}

#editions > div > :first-child > span > span {
    color: #a0a4a8;
}

#proposals > div > :first-child > :nth-child(2) {
    color: #a0a4a8;
    font-size: 0.8em;
    margin-bottom: 8px;

    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    white-space: pre-wrap;
}

.stage-1 {
    color: #f02c00;
}

.stage-2 {
    color: #f08800;
}

.stage-3 {
    color: #f0c400;
}

.stage-4 {
    color: #bcf000;
}

@media (max-width: 1000px) {
    #proposals, #editions {
        grid-template-columns: 1fr;
    }

    #proposals > div, #editions > div {
        width: 100%;
    }
}

#table-options {
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
}

#sidebar h3 {
    vertical-align: baseline;
}

summary > * {
    display: inline;
}

summary h2 {
    vertical-align: middle;
}

#sidebar details {
    margin-bottom: 16px;
}

#sidebar summary {
    margin-bottom: 6px;
    cursor: pointer;
}

summary input {
    vertical-align: middle;
}

#sidebar details > div {
    margin-left: 8px;
}

#sidebar summary {
    list-style: none;
}

#sidebar summary::pointer, #sidebar summary::-webkit-details-marker {
    display: none;
    content: "";
}

#sidebar summary::after {
    content: '◄';
    float: right;
}

#sidebar details[open] summary:after {
    content: " ▼";
}
