.header,
.subheader,
.main {
    width: 100%;
    max-width: var(--max-page-width);
    margin: 0 auto;
    padding-left: var(--page-padding);
    padding-right: var(--page-padding);
    box-sizing: border-box;
}

.header {
    padding-top: var(--header-padding-top);
    padding-bottom: var(--index-gap);
}

    .header a {
        text-decoration: none;
    }

    .header-top {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 16px;
        align-items: center;
        justify-content: space-between;
    }

    .header-logo {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 28px;
        font-weight: bold;
        letter-spacing: -0.02em;
        min-width: 0;
    }

    .header-logo a {
        display: flex;
        align-items: center;
        gap: 0.22em;
        min-width: 0;
        color: inherit;
        white-space: nowrap;
    }

    .header-logo-mark {
        width: 1.15em;
        height: 1.15em;
        flex-shrink: 0;
        display: block;
    }

    .header-logo-title:last-child {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-menu-button {
        display: none;
    }

    .header-actions {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        gap: 12px;
    }

    .header-user {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
        align-items: center;
    }

        .header-action {
            font-size: 100%;
            gap: 8px;
            padding: 3px 14px;
            min-height: 50px;
        }

        .header-action-icon {
            width: 50px;
            min-width: 50px;
            padding: 0;
        }

        .header-user-button {
            max-width: 240px;
        }

        .header-user-name {
            overflow: hidden;
            text-overflow: ellipsis;
            min-width: 0;
        }

        .header-user .avatar {
            width: 40px;
            height: 40px;
        }

        .header-create-guest {
            display: none;
        }

        .header-anon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background-image: none;
            color: var(--text-color);
            font-size: 16px;
        }

@media (min-width: 1200px) {
    .header-create-guest {
        display: inline-flex;
    }
}

.subheader {
    padding-bottom: var(--index-gap);
}

.main {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: var(--index-gap);
}

.content {
    flex: 1;
    min-width: 0;
}

.main:not(:has(.sidebar)) {
    justify-content: center;
}

.main:not(:has(.sidebar)) .content {
    width: 100%;
    max-width: 1100px;
    flex: 0 1 1100px;
}

.doc {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.doc .markdown-text {
    max-width: 66ch;
    font-size: 118%;
    line-height: 1.65;
    overflow-wrap: break-word;
}

.doc .markdown-text p,
.doc .markdown-text ul,
.doc .markdown-text ol,
.doc .markdown-text .doc-rules {
    margin: 0 0 1.05em;
}

.doc .doc-rule {
    display: grid;
    grid-template-columns: 1.7em 1fr;
    column-gap: 0.45em;
    align-items: baseline;
    margin: 0;
    padding: 0.35em 0.45em 0.35em 0.2em;
    border-radius: 10px;
}

.doc .doc-rule:target {
    background: var(--highlight-bg-active);
}

.doc .doc-rule dt {
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: inherit;
    text-align: right;
}

.doc .doc-rule dt a {
    font-weight: 700;
    text-decoration: none;
    color: inherit;
}

.doc .doc-rule dd {
    margin: 0;
}

.doc .markdown-text h1,
.doc .markdown-text h2,
.doc .markdown-text h3,
.doc .markdown-text h4,
.doc .markdown-text h5,
.doc .markdown-text h6 {
    margin-top: 1.75em;
    margin-bottom: 0.5em;
    line-height: 1.25;
}

.doc .markdown-text > :first-child {
    margin-top: 0;
}

.doc .markdown-text li {
    margin: 0.45em 0;
}

.doc .markdown-text ul,
.doc .markdown-text ol {
    padding-left: 1.4em;
}

.sidebar-overlay {
    display: none;
}

.footer {
    margin: 100px auto 200px;
    max-width: 800px;
    padding: 20px;
    opacity: 0.5;
    font-size: 90%;
}

.footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.footer-top:not(:has(.footer-logout)) {
    justify-content: center;
}

.footer-about {
    margin: 0;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.footer-links a,
.footer-links a:visited {
    color: inherit;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
    opacity: 1;
}

.footer-logout {
    flex-shrink: 0;
    margin-left: auto;
}

.footer-logout .button {
    opacity: 1;
}

.banned {
    max-width: 900px;
    text-align: center;
}

.banned-remaining {
    margin: 28px 0 8px;
    font-size: 280%;
    font-weight: 700;
    line-height: 1.2;
}
