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

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;

    display: flex;
    flex-direction: column;

    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading);
    color: var(--c-text);
    background-color: var(--c-bg);

    /* diagonal wedges: part of the brand look, keep */
    background-image:
        linear-gradient(145deg, var(--pattern-tint) 25%, transparent 25%),
        linear-gradient(225deg, var(--pattern-tint) 25%, transparent 25%),
        linear-gradient(55deg,  var(--pattern-tint) 25%, transparent 25%),
        linear-gradient(315deg, var(--pattern-tint) 25%, transparent 25%);
    background-position: 10px 0, 10px 0, 0 0, 0 0;
}

/* auth.js removes .preload on the first frame; until then, don't animate the initial layout */
.preload *,
.preload *::before,
.preload *::after {
    transition: none !important;
}

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

mark {
    color: var(--c-accent);
    background-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* --- page heading, shared by the catalog / templates / assignments views --- */

.page-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-xxl);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--c-text);
    text-wrap: balance;
}

.page-sub {
    margin: 4px 0 0;
    min-height: 1.5em;
    font-size: var(--text-sm);
    color: var(--c-text-muted);
    font-variant-numeric: tabular-nums;
}

/* --- filter chip, shared by the catalog type filter and the graph filter bar --- */

.chip-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-full);
    background: transparent;
    color: var(--c-text-muted);
    font-family: var(--font-display);
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}

.chip:hover {
    color: var(--c-text);
    background: var(--c-surface-hover);
}

.chip[aria-pressed="true"] {
    background: var(--c-text);
    border-color: var(--c-text);
    color: var(--c-bg);
}

.chip-count {
    opacity: 0.7;
}
