:root {
    color-scheme: dark;
    --page: #0a0a0a;
    --panel: #141414;
    --text: #f5f5f5;
    --muted: #b7b7b7;
    --accent: #febf00;
    --line: rgba(255, 255, 255, .16);
}

* {
    box-sizing: border-box;
}

html {
    scroll-padding-top: 2rem;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font: 16px/1.7 "Roboto Mono", ui-monospace, monospace;
}

a {
    color: var(--accent);
    overflow-wrap: anywhere;
}

a:hover {
    color: #ffda69;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}

[hidden] {
    display: none !important;
}

.docs-header,
.docs-footer {
    max-width: 1200px;
    margin: auto;
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    justify-content: space-between;
}

.docs-header {
    border-bottom: 1px solid var(--line);
}

.docs-header>a {
    font-weight: 700;
    text-decoration: none;
}

.docs-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.docs-article {
    width: min(1060px, calc(100% - 3rem));
    margin: 2rem auto 4rem;
    overflow-wrap: anywhere;
}

.docs-article h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.2;
    margin: 2rem 0;
}

.docs-article h2 {
    font-size: 1.7rem;
    margin-top: 3rem;
    line-height: 1.35;
}

.docs-article h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
}

.docs-article p,
.docs-article li,
.docs-article td {
    color: var(--muted);
}

.docs-article strong {
    color: var(--text);
}

.docs-article li {
    margin: .4rem 0;
}

.docs-article blockquote {
    margin: 1rem 0;
    border-left: 4px solid var(--accent);
    background: var(--panel);
    padding: .5rem 1.2rem;
}

.docs-article pre {
    overflow-x: auto;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #101010;
    white-space: pre;
    overflow-wrap: normal;
}

.docs-article code {
    color: #f1d78c;
    font-size: .9em;
}

.docs-article .table-wrap {
    overflow-x: auto;
    margin: 1rem 0;
}

.docs-article table {
    border-collapse: collapse;
    width: 100%;
}

.docs-article th,
.docs-article td {
    padding: .75rem;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    min-width: 130px;
}

.docs-article th {
    background: var(--panel);
}

.docs-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.mehs-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 1rem;
    margin: 1.5rem 0;
}

.mehs-controls label {
    display: flex;
    flex: 1 1 180px;
    flex-direction: column;
    gap: .4rem;
    color: var(--muted);
    font-size: .9rem;
}

.mehs-controls input,
.mehs-controls select,
.mehs-action {
    font: inherit;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .75rem;
    min-height: 48px;
    max-width: 100%;
}

.mehs-controls input,
.mehs-controls select {
    width: 100%;
}

.mehs-action {
    cursor: pointer;
    color: var(--accent);
}

.mehs-action:disabled {
    opacity: .6;
    cursor: wait;
}

.mehs-status {
    color: var(--muted);
}

.mehs-status.error {
    color: #ffb6a8;
}

.release-card,
.doc-result {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    margin: 1rem 0;
}

.release-card h3,
.doc-result h3 {
    margin: 0 0 .5rem;
    line-height: 1.4;
}

.release-card h3 {
    overflow-wrap: anywhere;
}

.release-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    color: var(--muted);
    font-size: .9rem;
    margin: .5rem 0 1.25rem;
}

.release-badge {
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 20px;
    padding: .15rem .6rem;
    font-size: .8rem;
}

.release-assets {
    list-style: none;
    padding: 0;
    margin: 0;
}

.release-assets li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: .25rem 1rem;
    padding: .75rem 0;
    border-top: 1px solid var(--line);
}

.release-assets a {
    flex: 1 1 260px;
    overflow-wrap: anywhere;
}

.release-assets small {
    color: var(--muted);
}

.doc-result p {
    margin: .5rem 0 0;
}

.knowledge-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
    gap: 1rem;
}

.knowledge-links a {
    display: block;
    padding: 1rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
}

.knowledge-links strong {
    display: block;
    color: var(--text);
}

.knowledge-links span {
    display: block;
    color: var(--muted);
    font-size: .9rem;
    margin-top: .4rem;
}

@media (max-width: 600px) {

    .docs-header,
    .docs-footer {
        padding: 1rem;
    }

    .docs-article {
        width: calc(100% - 2rem);
    }

    .mehs-controls {
        align-items: stretch;
    }

    .mehs-controls label {
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }
}

.release-changelog {
    margin-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 0.5rem;
}

.release-changelog>summary {
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    padding: 0.25rem 0;
    list-style: none;
}

.release-changelog>summary::-webkit-details-marker {
    display: none;
}

.release-changelog>summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform 0.15s ease;
}

.release-changelog[open]>summary::before {
    transform: rotate(90deg);
}

.release-changelog-body {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: inherit;
    max-height: 24rem;
    overflow: auto;
}

@media (prefers-color-scheme: dark) {
    .release-changelog {
        border-top-color: rgba(255, 255, 255, 0.12);
    }
}

.release-badge.stable-release {
    background-color: #e8f5e9 !important;
    color: #2e7d32 !important;
    border: 1px solid #a5d6a7 !important;
    font-weight: 600;
}

.release-badge.pre-release {
    background-color: #fff3e0 !important;
    color: #e65100 !important;
    border: 1px solid #ffcc80 !important;
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    .release-badge.stable-release {
        background-color: #141414 !important;
        color: #a5d6a7 !important;
        border-color: #4caf50 !important;
    }

    .release-badge.pre-release {
        background-color: #141414 !important;
        color: #ffe0b2 !important;
        border-color: #ff9800 !important;
    }
}

.release-changelog-body {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: inherit;
    max-height: 24rem;
    overflow-y: auto;
}

.release-changelog-body>*:first-child {
    margin-top: 0;
}

.release-changelog-body>*:last-child {
    margin-bottom: 0;
}

.release-changelog-body ul,
.release-changelog-body ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.release-changelog-body p {
    margin: 0.5rem 0;
}

.release-changelog-body a {
    color: #0066cc;
    text-decoration: underline;
}

.release-changelog-body code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.85em;
}

.release-changelog-body pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.75rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.release-changelog-body pre code {
    background: none;
    padding: 0;
}

@media (prefers-color-scheme: dark) {
    .release-changelog-body a {
        color: #66b2ff;
    }

    .release-changelog-body code,
    .release-changelog-body pre {
        background: rgba(255, 255, 255, 0.1);
    }
}