@charset "UTF-8";

/* ============================================================
   ЛОКАЛЬНЫЙ ШРИФТ INTER (только Inter для всех пользователей)
   ============================================================ */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: block; src: url('../fonts/Inter_18pt-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: block; src: url('../fonts/Inter_18pt-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: block; src: url('../fonts/Inter_18pt-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: block; src: url('../fonts/Inter_18pt-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: block; src: url('../fonts/Inter_18pt-ExtraBold.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 400; font-display: block; src: url('../fonts/Inter_18pt-Italic.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 500; font-display: block; src: url('../fonts/Inter_18pt-MediumItalic.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 600; font-display: block; src: url('../fonts/Inter_18pt-SemiBoldItalic.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 700; font-display: block; src: url('../fonts/Inter_18pt-BoldItalic.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 800; font-display: block; src: url('../fonts/Inter_18pt-ExtraBoldItalic.ttf') format('truetype'); }

/*<ОБНУЛЕНИЕ, ОБЩИЕ ПАРАМЕТРЫ>===============================================================================================*/
* {
	padding: 0px;
	margin: 0px;
	border: 0px;
}

*,
*:before,
*:after {
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
}

:focus,
:active {
	outline: none;
}

a:focus,
a:active {
	outline: none;
}

aside,
nav,
footer,
header,
section {
	display: block;
}

html,
body {
	min-height: 100%;
	min-width: 320px;
}

body {
	line-height: 1;
	font-family: "";
	-ms-text-size-adjust: 100%;
	-moz-text-size-adjust: 100%;
	-webkit-text-size-adjust: 100%;
}

input,
button,
textarea {
	font-family: "";
}

input::-ms-clear {
	display: none;
}

button {
	cursor: pointer;
}

button::-moz-focus-inner {
	padding: 0;
	border: 0;
}

a,
a:visited {
	text-decoration: none;
}

a:hover {
	text-decoration: none;
}

ul li {
	list-style: none;
}

img {
	vertical-align: top;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: inherit;
	font-size: inherit;
}

* {
	-webkit-tap-highlight-color: transparent;
}

/* ============================================================
   ПЕРЕМЕННЫЕ (единый стиль для всех страниц)
   ============================================================ */
:root {

            --bg-canvas: #f2f2f2;
            --bg-base: #ffffff;
            --bg-surface: #f2f2f2;
            --bg-sidebar: #f2f2f2;
            --text-primary: #070F2B;
            --text-secondary: #1B1A55;
            --line-constructor: #4A4E69;
            --text-tertiary: #828e9a;
            --border-light: #e3e3e3;
            --border-focus: #9290C3;
            --border-success: #7f8f93;
            --border-danger: #a46464;
            --accent-success: #8CA1A5;
            --accent-danger: #c3909a;
            --accent-favorite: #9290C3;
            --accent-no-active: #d8d8d8;
            --accent-chart: #9290C3;
            --btn-primary-bg: #535C91;
            --btn-primary-hover: #4d5586;
            --btn-primary-text: #ffffff;

            --bg-progress: linear-gradient(90deg, #B3B1D5, #9290C3, #666589);
--accent-red: #E53935;      /* Яркий красный, как школьная ручка */
--accent-orange: #1B1A55;   /* Сочный оранжевый */
--accent-green: #43A047;    /* Жизнерадостный зеленый */
--hint-bg: rgb(227, 227, 227, 0.8);
--text-green: #FFFFFF;
        }

        body.theme-minimal {
            /* === ФОНЫ === */
            --bg-canvas: #F7F7F7;
            --bg-base: #FFFFFF;
            --bg-surface: #F5F5F5;    
            --bg-sidebar: #F7F7F7;
            
            /* === ТЕКСТ === */
            --text-primary: #2D2D2D;
            --text-secondary: #625757;
            --line-constructor: #6E5B57;
            --text-tertiary: #BCBAB8;
            
            /* === БОРДЕРЫ === */
            --border-light: #E8E6E4;
            --border-focus: #998a8a;
            --border-success: #8AAA8A;
            --border-danger: #C48A8A;
            
            /* === АКЦЕНТЫ === */
            --accent-success: #8AAA8A;
            --accent-danger: #C48A8A;
            --accent-favorite: #9D8F8F;
            --accent-no-active: #BCBAB8;
            --accent-chart: #625757;
            
            /* === КНОПКИ === */
            --btn-primary-bg: #625757;
            --btn-primary-hover: #4F4545;
            --btn-primary-text: #F9F9F9;

             /* === ПРОГРЕСС И АКЦЕНТЫ === */
    --bg-progress: linear-gradient(90deg, #918989, #625757, #453D3D);
    --accent-red: #D94A4A;      /* Классический красный */
    --accent-orange: #625757;   /* Теплый янтарный */
    --accent-green: #6B9A6B;    /* Приглушенный зеленый */
    --text-green: #FFFFFF;
    --hint-bg: rgba(180, 180, 180, 0.8);
        }
        body.theme-slate {
            /* === Фоны === */
            --bg-base: #3a3a3a;   
            --bg-surface: #323232; 
            --bg-canvas: #222222;  
            
            /* === Текст === */
            --text-primary: #e1e3e6;  
            --text-secondary: #939393;
            --line-constructor: #939393;
            --text-tertiary: #6a6a6a; 
            
            /* === Бордеры === */
        --border-light: #424242;
        --border-focus: #D4A373;     
        --border-success: #8aaa8a;    
        --border-danger: #e06c75;  
        /* === Акценты === */
        --accent-success: #8aaa8a;  
        --accent-danger: #e06c75;    
        --accent-favorite: #D4A373;   
        --accent-no-active: #4a4a4a;  
        --accent-chart: #D4A373;      

        /* === Кнопки (скорректированные ховеры) === */
        --btn-primary-bg: #4a4a4a;
        --btn-primary-hover: #4e4c4c; 
        --btn-primary-text: #b0b0b0;

        /* === ПРОГРЕСС И АКЦЕНТЫ === */
    --bg-progress: linear-gradient(90deg, #E1BF9D, #D4A373, #947250);
    --accent-red: #E05A5A;      /* Классический красный для темной темы */
    --accent-orange: #939393;   /* Теплый янтарный для темной темы */
    --accent-green: #5B9A5B;    /* Приглушенный зеленый для темной темы */
    --text-green: #FFFFFF;
    --hint-bg: rgba(100, 100, 100, 0.8);
        }


        body.theme-one-dark {
            --bg-base: #31363f;
            --bg-surface: #282c34;
            --bg-canvas: #1e2127;
            --text-primary: #d5dae3;
            --text-secondary: #8b94a5;
            --line-constructor: #98A2B3;
            --text-tertiary: #5a6472;
            --border-light: #3a3f4b;
            --border-focus: #c47f6a;
            --border-success: #8aaa8a;
            --border-danger: #e06c75;
            --accent-success: #8aaa8a;
            --accent-danger: #e06c75;
            --accent-favorite: #c47f6a;
            --accent-no-active: #3e4451;
            --accent-chart: #c47f6a;
            --btn-primary-bg: #3e4451;
            --btn-primary-hover: #464c5a;
            --btn-primary-text: #c6c9cf;
            --bg-progress: linear-gradient(90deg, #D6A597, #C47F6A, #89594A);
            --accent-red: #E05A5A;
            --accent-orange: #5c6370;
            --accent-green: #8aaa8a;
            --text-green: #FFFFFF;
            --hint-bg: rgba(100, 100, 100, 0.8);
        }


/* ============================================================
   ГЛОБАЛЬНЫЕ СТИЛИ
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
}

body {
    background: var(--bg-canvas);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   ШАПКА
   ============================================================ */
.header {
    background: var(--bg-base);
    padding: 0 32px;
    height: 68px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
}

.header-content {
    max-width: 1090px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.logo {
    text-decoration: none;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.logo:hover {
    color: var(--text-secondary);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}
.main-nav > a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 4px 0;
}
.main-nav > a:hover {
    color: var(--text-primary);
}

/* Выпадающее меню «Стереометрия» */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-trigger {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    padding: 4px 0;
}
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger:focus-visible {
    color: var(--text-primary);
}
.nav-dropdown-trigger i {
    font-size: 10px;
    transition: transform 0.2s ease;
}
.nav-dropdown.open .nav-dropdown-trigger i {
    transform: rotate(180deg);
}
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: -8px;
    min-width: 250px;
    background: var(--bg-base);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: 8px 0;
    display: none;
    z-index: 1001;
    animation: slideDown 0.2s ease;
}
.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-menu a {
    display: block;
    padding: 9px 17px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}
.nav-dropdown-menu a:hover {
    color: var(--text-primary);
    background: var(--bg-surface);
    border-radius: 6px;
}
.nav-dropdown-menu a:first-child {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}
.nav-dropdown-menu a:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ============================================================
   ПЕРЕКЛЮЧАТЕЛЬ ТЕМ
   ============================================================ */
.theme-switcher {
    position: relative;
    display: inline-block;
}

.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.3s ease, color 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.theme-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-base);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px 8px;
    min-width: 200px;
    max-height: 360px;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 1000;
}
.theme-dropdown.show {
    display: block;
}

.theme-dropdown-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0 10px 10px 10px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 8px;
}

.theme-dropdown-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: none;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    text-align: left;
}
.theme-option:hover {
    background: var(--bg-canvas);
    color: var(--text-primary);
}
.theme-option.active {
    background: var(--bg-canvas);
    color: var(--text-primary);
    font-weight: 500;
}
.theme-option.active::after {
    content: '✓';
    margin-left: auto;
    font-size: 14px;
    color: var(--accent-success);
}

.theme-dropdown::-webkit-scrollbar {
    width: 4px;
}
.theme-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.theme-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}
.theme-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}
.theme-dropdown {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

/* ============================================================
   МОБИЛЬНОЕ МЕНЮ
   ============================================================ */
.mobile-nav {
    display: none;
    align-items: center;
}

.mobile-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}
.mobile-menu-toggle:hover {
    background: var(--bg-surface);
}

.menu-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
}
.menu-icon span {
    display: block;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    width: 100%;
}

.mobile-menu-toggle.active .menu-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.active .menu-icon span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.active .menu-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav-menu {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 24px;
    display: none;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    animation: slideDown 0.3s ease;
    z-index: 999;
}
.mobile-nav-menu.open {
    display: flex;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-nav-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    transition: color 0.2s;
}
.mobile-nav-menu a:last-child {
    border-bottom: none;
}
.mobile-nav-menu a:hover {
    color: var(--text-primary);
}
.mobile-nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mobile-nav-group-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding-bottom: 2px;
}
.mobile-nav-group a {
    padding-left: 12px;
}

@media (max-width: 820px) {
    .main-nav {
        display: none;
    }
    .mobile-nav {
        display: flex;
    }
    .header {
        padding: 0 20px;
        height: 60px;
    }
    .logo {
        font-size: 18px;
    }
    .header-content {
        gap: 16px;
    }
    .theme-dropdown {
        right: -40px;
        min-width: 180px;
    }
}

@media (min-width: 821px) {
    .mobile-nav {
        display: none;
    }
    .mobile-nav-menu {
        display: none !important;
    }
}

/* ============================================================
   ПОДВАЛ
   ============================================================ */
footer {
    background: var(--bg-surface);
    padding: 32px 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-light);
    margin-top: 40px;
}

footer .social {
    display: flex;
    justify-content: center;
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 12px 0 8px;
}
footer .social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-base);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}
footer .social a:hover {
    background: var(--bg-canvas);
    transform: scale(1.05);
}
footer .social a i {
    font-size: 18px;
}

footer .footer-nav {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 12px;
    flex-wrap: wrap;
}
footer .footer-nav a {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}
footer .footer-nav a:hover {
    color: var(--text-primary);
}
/* ============================================================
   ПОДВАЛ — ПОЛИТИКА КОНФИДЕНЦИАЛЬНОСТИ
   ============================================================ */
footer .privacy-link {
    display: inline-block;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
    padding: 4px 0;
}

footer .privacy-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Если политика стоит отдельной строкой с другими элементами */
footer .footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

footer .footer-bottom .privacy-link {
    font-size: 12px;
}

footer .footer-bottom p {
    margin: 0;
}

.auth-block {
    display: flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 12px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.auth-btn:active {
    transform: scale(0.97);
}

.auth-login-btn {
    background: none;
    color: var(--text-secondary);
}
.auth-login-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}
.auth-login-btn i {
    font-size: 0.8rem;
}

.auth-btn-solid {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-weight: 600;
}
.auth-btn-solid:hover {
    background: var(--btn-primary-hover);
}

body.auth-logged-in .auth-login-btn {
    display: none;
}

.user-box {
    position: relative;
    display: none;
    align-items: center;
}
body.auth-logged-in .user-box {
    display: flex;
}

.user-avatar-btn {
    background: none;
    border: 1px solid transparent;
    padding: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.user-avatar-btn:hover {
    background: var(--bg-surface);
    border-color: var(--border-light);
}
.user-avatar-btn:active {
    transform: scale(0.96);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    user-select: none;
    flex-shrink: 0;
}
.user-avatar.user-avatar-sm {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-base);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    min-width: 230px;
    padding: 8px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.16);
    display: none;
    z-index: 1100;
    animation: auth-drop 0.18s ease;
}
.user-dropdown.open {
    display: block;
}
@keyframes auth-drop {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 10px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 6px;
}
.user-dropdown-id {
    min-width: 0;
}
.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-email {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    background: none;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    text-align: left;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.user-menu-item:hover {
    background: var(--bg-canvas);
    color: var(--text-primary);
}
.user-menu-item i {
    width: 18px;
    text-align: center;
    color: var(--text-tertiary);
}
.user-menu-item:hover i {
    color: var(--text-secondary);
}
.user-menu-item.user-menu-danger {
    color: var(--accent-danger);
}
.user-menu-item.user-menu-danger i {
    color: var(--accent-danger);
}
.user-menu-item.user-menu-danger:hover {
    background: var(--bg-canvas);
    color: var(--accent-danger);
}

.mobile-login-btn {
    display: flex;
    width: 100%;
    margin: 4px 0 10px;
    padding: 10px 16px;
    border: 1px solid var(--border-light);
}
.mobile-login-btn:hover {
    background: var(--bg-surface);
}

.mobile-user-box {
    display: none;
    flex-direction: column;
    padding: 8px 0 4px;
}
body.auth-logged-in .mobile-user-box {
    display: flex;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0 10px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
}
.mobile-user-info .user-name {
    font-size: 0.95rem;
}

.mobile-nav-menu .mobile-user-action {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 0;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-light);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
}
.mobile-nav-menu .mobile-user-action:hover {
    color: var(--text-primary);
}
.mobile-nav-menu .mobile-user-action:last-child {
    border-bottom: none;
}
.mobile-nav-menu .mobile-user-action i {
    width: 20px;
    text-align: center;
    color: var(--text-tertiary);
}
.mobile-user-action.mobile-user-danger,
.mobile-user-action.mobile-user-danger i {
    color: var(--accent-danger);
}

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 3000;
}
.auth-overlay.open {
    display: flex;
}

.auth-modal {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--bg-base);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 28px 28px 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: auth-pop 0.22s ease;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}
@keyframes auth-pop {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: 50%;
    color: var(--text-tertiary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.auth-modal-close:hover {
    background: var(--bg-canvas);
    color: var(--text-primary);
}

.auth-modal h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.auth-subtitle {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

.auth-field {
    margin-bottom: 14px;
}
.auth-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.auth-field input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-canvas);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}
.auth-field input::placeholder {
    color: var(--text-tertiary);
}
.auth-field input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.auth-error {
    font-size: 0.85rem;
    color: var(--accent-danger);
    margin-bottom: 10px;
}

.auth-submit {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    margin-top: 2px;
}

.auth-forgot-row {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 14px;
}
.auth-forgot-row a,
.auth-switch a {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}
.auth-forgot-row a:hover,
.auth-switch a:hover {
    color: var(--text-primary);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    line-height: 1;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.auth-social {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}
.social-btn:active {
    transform: scale(0.97);
}
.social-btn i {
    font-size: 1.05rem;
    line-height: 1;
}
.social-vk {
    background: #4c75a3;
}
.social-vk:hover {
    background: #3e648d;
}
.social-ya {
    background: #fc3f1d;
}
.social-ya:hover {
    background: #d93517;
}
.social-ya-letter {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
}

.auth-switch {
    margin-top: 16px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}
.auth-switch a {
    font-weight: 600;
}

.auth-note {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-light);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
}

.auth-btn:focus-visible,
.user-avatar-btn:focus-visible,
.user-menu-item:focus-visible,
.auth-modal-close:focus-visible,
.mobile-user-action:focus-visible,
.social-btn:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

@media (max-width: 820px) {
    .header .auth-block {
        display: none;
    }
}

/* ===== ВРЕМЕННО СКРЫТА АВТОРИЗАЦИЯ =====
   Скрывает кнопку «Войти» и личный кабинет в шапке (десктоп и мобильное меню).
   Разметка сохранена в includes/header.php — для возврата удалить это правило. */
.header .auth-block,
.header .mobile-auth {
    display: none !important;
}

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
.breadcrumbs {
    font-size: 0.85rem;
    margin: 0 0 12px;
    line-height: 1.5;
    overflow: hidden;
}
.breadcrumbs ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.breadcrumbs li {
    display: inline-flex;
    align-items: center;
    color: var(--text-tertiary);
}
.breadcrumbs li + li::before {
    content: '›';
    margin-right: 6px;
    color: var(--border-light);
}
.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}
.breadcrumbs a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}
.breadcrumbs-current {
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55vw;
}

@media (max-width: 768px) {
    .breadcrumbs li:not(:first-child):not(:last-child) {
        display: none;
    }
    .breadcrumbs li + li::before {
        margin-right: 4px;
    }
}