*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

code,
kbd,
pre,
.mono {
    font-family: var(--font-mono);
    font-size: 0.93em;
}

kbd {
    display: inline-block;
    padding: 0 5px;
    border: 1px solid var(--rule-strong);
    border-bottom-width: 2px;
    border-radius: var(--radius);
    background: var(--sheet);
    font-size: 12px;
    line-height: 18px;
}

a {
    color: var(--repo);
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

::selection {
    background: var(--repo-soft);
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* scrollbars that recede */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--rule-strong) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--rule-strong);
    border: 3px solid var(--panel);
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---- labels: small caps section titles with a numeral, like callouts in a manual ---- */
.label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.label .num {
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ink-3);
}

/* ---- buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 11px;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    background: var(--sheet);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.12s, border-color 0.12s;
}

.btn:hover {
    border-color: var(--ink-3);
    background: var(--panel);
}

.btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.btn.primary {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--ink-inverse);
}

.btn.primary:hover {
    background: var(--ink-2);
}

.btn.quiet {
    border-color: transparent;
    background: transparent;
    color: var(--ink-2);
    font-weight: 500;
}

.btn.quiet:hover {
    color: var(--ink);
    background: var(--shade);
}

.btn.danger {
    color: var(--danger);
}

.btn svg,
.icon {
    width: 16px;
    height: 16px;
    flex: none;
    stroke: currentColor;
    stroke-width: 1.6;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-btn {
    width: 30px;
    padding: 0;
    justify-content: center;
}
