/* Class-safe application foundations. Document and canvas contents are not
   targeted by these rules. */
html {
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.5;
}

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

button,
[role="button"] {
    -webkit-tap-highlight-color: transparent;
}

:where(button, a[href], input, select, textarea, [role="button"], [role="tab"]):focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

:where(button, input, select, textarea):disabled,
[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.5;
}

::selection {
    background: var(--primary-soft);
    color: var(--foreground);
}

::-webkit-scrollbar {
    width: 0.5rem;
    height: 0.5rem;
}

::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--muted-foreground); }

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

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