*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
    min-height: 100%;
    background-color: var(--color-background);
    color-scheme: light dark;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--color-background) !important;
    color: var(--color-text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif !important;
    font-size: 16px;
    line-height: 1.45;
    overflow-x: clip;
    overscroll-behavior-y: none;
    animation: none !important;
    -webkit-font-smoothing: antialiased;
}

body.is-modal-open {
    overflow: hidden;
    touch-action: none;
}

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
img { max-width: 100%; }

input, select, textarea {
    min-height: var(--control-height);
    width: 100%;
    border: 1px solid var(--color-separator);
    border-radius: var(--radius-medium);
    background: var(--color-background-elevated);
    color: var(--color-text-primary);
    padding: 11px 14px;
    font-size: 16px !important;
    line-height: 1.25;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

select {
    background-image: linear-gradient(45deg, transparent 50%, var(--color-text-tertiary) 50%), linear-gradient(135deg, var(--color-text-tertiary) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 36px;
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px var(--color-accent-soft);
}

button:focus-visible, a:focus-visible, [role="button"]:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

label {
    display: inline-block;
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

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

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