:root {
    color-scheme: light;
    --background: #f5f6f7;
    --surface: #fff;
    --text: #192328;
    --secondary: #4a5963;
    --line: #cdd5da;
    --accent: #185951;
    --accent-text: #fff;
    --hover: #e7eeed;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --background: #11191d;
    --surface: #1b252a;
    --text: #edf2f5;
    --secondary: #b7c6ce;
    --line: #46575f;
    --accent: #a9ddd1;
    --accent-text: #142721;
    --hover: #263b40;
}

* { box-sizing: border-box; }

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

a { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-nav, main { width: min(100% - 2rem, 67rem); margin-inline: auto; }
.site-nav, .heading, .document-bar, .document-actions, .languages {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.site-nav, .heading, .document-bar { justify-content: space-between; }
.site-nav { min-height: 3.25rem; }
.site-menu { position: relative; }
.site-menu summary { font-weight: 650; cursor: pointer; }
.site-menu ul {
    position: absolute;
    z-index: 1;
    min-width: 10rem;
    padding: .3rem;
    margin: .35rem 0 0;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: .35rem;
}
.site-menu a { display: block; padding: .3rem .6rem; }
.theme-switch {
    width: 2.2rem;
    min-height: 2.2rem;
    border: 1px solid var(--line);
    border-radius: .35rem;
    background: var(--surface);
    color: var(--text);
    font-size: 1.15rem;
    cursor: pointer;
}

main { padding-block: 1.35rem; }
.heading { align-items: end; flex-wrap: wrap; margin-bottom: .85rem; }
h1 { margin: 0; font-size: clamp(1.7rem, 5vw, 2.55rem); line-height: 1.15; }
.heading p { color: var(--secondary); margin: .35rem 0 0; }
.languages { gap: .2rem; }
.languages a, .document-actions a {
    padding: .35rem .65rem;
    border: 1px solid transparent;
    border-radius: .3rem;
    text-decoration: none;
}
.languages [aria-current] { color: var(--text); background: var(--hover); border-color: var(--line); }
.site-menu a:hover, .languages a:hover, .theme-switch:hover, .document-actions a:hover { background: var(--hover); }
.document { background: var(--surface); border: 1px solid var(--line); border-radius: .4rem; overflow: hidden; }
.document-bar { padding: .45rem .7rem; border-bottom: 1px solid var(--line); }
.document-bar > span { color: var(--secondary); font-size: .9rem; }
.document-actions .download { background: var(--accent); color: var(--accent-text); }
.document-actions .download:hover { filter: brightness(.9); }
.document iframe { display: block; width: 100%; height: max(30rem, calc(100dvh - 13rem)); border: 0; }
.mobile-preview { display: none; }

@media (max-width: 42rem), (pointer: coarse) {
    .document iframe { display: none; }
    .mobile-preview { display: block; padding: .65rem; }
    .mobile-preview img { display: block; width: min(100%, 30rem); height: auto; margin: auto; border: 1px solid var(--line); }
}

@media (max-width: 24rem) {
    .site-nav, main { width: calc(100% - 1rem); }
    .document-actions { gap: .15rem; }
    .document-actions a { padding-inline: .35rem; }
}
