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

html {
    height: 100%;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    height: 100%;
    margin: 0;
    background: var(--canvas);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    font-feature-settings: "cv11", "ss03", "calt";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

[hidden] {
    display: none !important;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

h1,
h2,
h3,
h4 {
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: -0.011em;
}

a {
    color: var(--accent-text);
    text-decoration: none;
    text-underline-offset: 0.18em;
}

a:hover {
    text-decoration: underline;
}

button,
input,
select,
textarea {
    margin: 0;
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
}

button {
    cursor: pointer;
}

img,
svg {
    display: block;
    max-width: 100%;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

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

::selection {
    background: var(--accent-soft-hover);
    color: var(--text);
}

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

/* Thin, quiet scrollbars that match the surfaces. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.tabular {
    font-variant-numeric: tabular-nums;
}

.mono {
    font-family: var(--font-mono);
}

.muted {
    color: var(--text-muted);
}

.secondary {
    color: var(--text-secondary);
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.noscript {
    padding: var(--space-8);
    text-align: center;
}

/* Layout helpers: enough to compose a screen without a view stylesheet. */
.stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.stack > .btn:not(.btn--block) {
    align-self: flex-start;
}

.stack--sm {
    gap: var(--space-2);
}

.stack--lg {
    gap: var(--space-6);
}

.row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.row--wrap {
    flex-wrap: wrap;
}

.row--between {
    justify-content: space-between;
}

.row--end {
    justify-content: flex-end;
}

.row--top {
    align-items: flex-start;
}

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

.grid {
    display: grid;
    gap: var(--space-4);
}

.grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--auto {
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

@keyframes pop-in {
    from {
        opacity: 0;
        transform: scale(0.97) translateY(4px);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

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