/* --- Hard CSS Reset --- */

/* Use a more-intuitive box-sizing model */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Remove default margin, padding, and borders for all elements */
* {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    line-height: 1;
    vertical-align: baseline;
    -webkit-tap-highlight-color: transparent;
}

/* Allow percentage-based heights in the application */
html, body {
    height: 100%;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
    overscroll-behavior-x: none;
    touch-action: pan-y;
}

/* UI Protection */
.no-select, .rail, .panel, .mobile-topbar, .active-indicator {
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

/* Base Body settings */
body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: var(--font-3);
    color: var(--text-color);
    background-color: var(--bg-1);
}

html {
    background-color: var(--bg-1);
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;
}

summary::-webkit-details-marker {
    display: none;
}

ol, ul {
    list-style: none;
}

blockquote, q {
    quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}

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

/* Improve media defaults */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

/* Inherit typography for form elements */
input, button, textarea, select {
    font: inherit;
    color: inherit;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    border-radius: var(--radius-2);
}

/* Custom Scrollbar (macOS Style) */
* {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--text-color), transparent 50%) transparent;
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: color-mix(in srgb, var(--text-color), transparent 50%);
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: color-mix(in srgb, var(--text-color), transparent 40%);
}

/* Rail and specific narrow areas might need even thinner scrollbars or hidden ones */
.rail::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
