*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    background: var(--color-bg);
}

body {
    min-width: 320px;
    min-height: 100vh;
    background: transparent;
    color: var(--color-text);
    font-family: Arial, sans-serif;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image: var(--pattern-image);
    background-size: var(--pattern-size) var(--pattern-size);
    background-repeat: repeat;
    opacity: var(--pattern-opacity);
    pointer-events: none;
    z-index: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

input,
select,
textarea {
    color: var(--color-text);
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

body.menu-open {
    overflow: hidden;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.site-main {
    position: relative;
    flex: 1;
    display: flex;
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    z-index: 1;
}

.site-content {
    flex: 1;
    min-width: 0;
    padding: 32px;
    position: relative;
    z-index: 1;
}

.site-content > * {
    position: relative;
    z-index: 1;
}

.page-card,
.profile-section-card,
.profile-info-card,
.profile-photo-card,
.home-card,
.auth-card {
    position: relative;
    z-index: 1;
}

/* Глобальный аккуратный скроллбар */
body,
.site-main,
.site-content {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.site-main::-webkit-scrollbar,
.site-content::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.site-main::-webkit-scrollbar-track,
.site-content::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 999px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.site-main::-webkit-scrollbar-thumb,
.site-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
    border: 2px solid var(--scrollbar-track);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.site-main::-webkit-scrollbar-thumb:hover,
.site-content::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

html::-webkit-scrollbar-thumb:active,
body::-webkit-scrollbar-thumb:active,
.site-main::-webkit-scrollbar-thumb:active,
.site-content::-webkit-scrollbar-thumb:active {
    background: var(--scrollbar-thumb-active);
}

@media (max-width: 980px) {
    .site-main {
        display: block;
    }

    .site-content {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .site-content {
        padding: 16px;
    }
}