/* #36 */

* { margin: 0; padding: 0; box-sizing: border-box; }

/* #37 */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) transparent;
    /* #38 */
    scroll-behavior: smooth;
}
::-webkit-scrollbar {
    width: 0.5rem;
    height: 0.5rem;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 0.25rem;
    border: 0.125rem solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    background-clip: content-box;
    border: 0.125rem solid transparent;
}
::-webkit-scrollbar-corner { background: transparent; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* #39 */
img, video, svg { max-width: 100%; height: auto; }

body {
    font-family: var(--font-sans);
    font-size: clamp(0.875rem, 1vw + 0.5rem, 1rem); /* #40 */ /* #41 */
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

/* #42 */
::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

:invalid:not(:placeholder-shown):not(:focus) {
    border-color: var(--secondary);
}

/* #43 */

/* #44 */
@media (pointer: coarse) {
    .btn, .nav-link { min-height: 3rem; }
    .wizard-btn { min-height: 3.5rem; }
    .site-btn { min-height: 3.25rem; }
}

/* #45 */

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

/* #46 */

@media (display-mode: standalone) {
    .header { padding-top: env(safe-area-inset-top); }
    body {
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    .toast { bottom: calc(var(--space-xl) + env(safe-area-inset-bottom)); }
}

/* #47 */

@media print {
    .header, .nav-toggle, .action-bar, .toast, .auth-banner { display: none !important; }
    .main { padding: 0; max-width: 100%; }
    .table { font-size: 0.625rem; }
    .badge { border-width: 0.0625rem; }
    body { background: #fff; color: #000; }
}
