:root {
    --body-background: #fafaf8;
    --content-color: #777777;
    --heading-color: #4b4b4b;
    --emphasized-bg: #e0e0de;
    --message-failure: #a00000;
    --message-success: #00a000;
    --button-danger-bg: #a00000;
    --button-danger-fg: #ffffff;
    --state-stale: #a00000;
    --state-current: #00a000;
    --tab-fg: #000000;
    --tab-bg: #dddddd;
    --tab-hover: #d0d0d0;
}

@media (prefers-color-scheme: dark) {
    :root {
        --body-background: #050508;
        --content-color: #999999;
        --heading-color: #b4b4b4;
        --emphasized-bg: #1f1f1f;
        --message-failure: #a00000;
        --message-success: #00a000;
        --button-danger-bg: #a00000;
        --button-danger-fg: #ffffff;
        --state-stale: #a00000;
        --state-current: #00a000;
        --tab-fg: #ffffff;
        --tab-bg: #222222;
        --tab-hover: #2f2f2f;
    }

    .pure-menu-selected>.pure-menu-link,
    .pure-menu-selected>.pure-menu-link:visited {
        color: #ffffff;
    }

    .pure-table td,
    .pure-table th {
        border-left: 1px solid #343434;
    }

    .pure-table thead {
        color: var(--heading-color);
    }

    .pure-table-striped tr:nth-child(2n-1) td {
        background-color: #0d0d0d;
    }

    .pure-table thead {
        background-color: #1f1f1f;
    }

    .pure-table {
        border: 1px solid #343434;
    }

    a {
        color: #5050ff;
    }

    a:visited {
        color: #a050ff;
    }

    a.pure-menu-link,
    a.pure-menu-link:visited,
    a.pure-menu-heading,
    a.pure-menu-heading:visited {
        color: var(--content-color);
    }

    .pure-form input[type=color],
    .pure-form input[type=date],
    .pure-form input[type=datetime-local],
    .pure-form input[type=datetime],
    .pure-form input[type=email],
    .pure-form input[type=month],
    .pure-form input[type=number],
    .pure-form input[type=password],
    .pure-form input[type=search],
    .pure-form input[type=tel],
    .pure-form input[type=text],
    .pure-form input[type=time],
    .pure-form input[type=url],
    .pure-form input[type=week],
    .pure-form select,
    .pure-form textarea {
        background-color: var(--emphasized-bg);
        border: 1px solid #333;
        box-shadow: inset 0 1px 3px #222;
        color: #f0f0f0;
    }

    .pure-form input[readonly] {
        color: #666666;
    }
}

html {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

body {
    background-color: var(--body-background);
    flex-grow: 1;
    padding-bottom: 25px;
}

.content {
    margin-left: auto;
    margin-right: auto;
    padding-top: 1em;
    padding-left: 1em;
    padding-right: 1em;
    max-width: 1024px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    color: var(--content-color);
}

.content p {
    font-size: 1.125em;
    line-height: 1.6;
}

ul li {
    line-height: 1.6;
}

.content .small {
    font-size: 0.875em;
}

.headerlink {
    font-weight: normal;
    font-size: 0.625em;
}

.content h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--heading-color);
    margin-top: 1em;
}

.header {
    background-color: var(--emphasized-bg);
}

.icon {
    display: inline-block;
    vertical-align: bottom;
}


ul.messages {
    list-style-type: none;
    padding-left: 0;
    margin-left: 0;
}


.messages .error {
    color: var(--message-failure);
}

.messages .success {
    color: var(--message-success);
}

.pure-button {
    margin-right: 1em;
}

.button {
    color: var(--content-color);
    text-decoration: none;
}

.table-stretch {
    display: table;
}

.danger-button {
    background-color: var(--button-danger-bg);
    color: var(--button-danger-fg);
}

.center {
    text-align: center;
}

.stretch {
    display: inline-block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 500px;
}

.nowrap {
    white-space: nowrap;
}

.stale {
    color: var(--state-stale);
}

.current {
    color: var(--state-current);
}

/* Overrides */

@media screen and (min-width: 64em) {
    .pure-form-aligned .pure-control-group label {
        width: 33%;
    }

    .pure-form-aligned .pure-controls {
        margin-left: calc(33% + 1.5em);
    }
}

@media screen and (max-width: 48em) {
    .pure-form-aligned .pure-control-group label {
        width: auto;
    }

    .pure-form-aligned .pure-controls {
        margin-left: 0;
    }

    .pure-form button[type="submit"] {
        margin: auto;
        margin-right: 1em;
    }
}


/* Accordion styles */
.tabs input {
    position: absolute;
    opacity: 0;
    z-index: -1;
}

.tabs {
    overflow: hidden;
}

.tab {
    width: 100%;
    color: var(--tab-fg);
    overflow: hidden;
}

.tab-label {
    display: flex;
    justify-content: space-between;
    padding: 1em;
    background: var(--tab-bg);
    font-weight: bold;
    cursor: pointer;
    /* Icon */
}

.tab-label:hover {
    background: var(--tab-hover);
}

.tab-label::after {
    content: "❯";
    width: 1em;
    height: 1em;
    text-align: center;
    transition: all 0.35s;
}

.tab-content {
    max-height: 0;
    padding: 0 1em;
    color: var(--content-color);
    background: var(--body-background);
    transition: all 0.35s;
}

input:checked+.tab-label {
    background: var(--tab-hover);
}

input:checked+.tab-label::after {
    transform: rotate(90deg);
}

input:checked~.tab-content {
    max-height: 100vh;
    padding: 1em;
}

/* Footer */

footer {
    position: fixed;
    display: block;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--emphasized-bg);
    color: var(--content-color);
    line-height: 1.5;
    font-size: 12px;
    padding: 5px 10px 5px 10px;
}

/* responsive menu */

nav.header {
    overflow: hidden;
    -webkit-transition: max-height 0.5s;
    -moz-transition: max-height 0.5s;
    -ms-transition: max-height 0.5s;
    transition: max-height 0.5s;
    max-height: 42px;
}

nav.header.open {
    max-height: 400px;
}

.menu-toggle {
    width: 34px;
    height: 34px;
    position: absolute;
    top: 0;
    right: 0;
    display: none;
}

.menu-right {
    text-align: right;
}

@media (max-width: 768px) {

    .menu-right {
        text-align: left;
    }

    .menu-toggle {
        display: block;
    }

}

/* table headings */

@media (max-width: 768px) {

    .pure-table th {
        font-size: 12px;
    }

    .pure-table .column-hide {
        display: none;
    }

}