@font-face {
    font-family: 'Roboto';
    src: url('../Fonts/Roboto-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
}

@font-face {
    font-family: 'Roboto';
    src: url('../Fonts/Roboto-ExtraLight.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
}

@font-face {
    font-family: 'Roboto';
    src: url('../Fonts/Roboto-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Roboto';
    src: url('../Fonts/Roboto-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Roboto';
    src: url('../Fonts/Roboto-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Roboto';
    src: url('../Fonts/Roboto-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Roboto';
    src: url('../Fonts/Roboto-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Roboto';
    src: url('../Fonts/Roboto-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
}


html {
    overflow-x: visible;
}

html,
body {
    font-family: 'Roboto', sans-serif;
    max-width: 100%;
}


*,
*::before,
*::after {
    box-sizing: border-box;
}

button,
input,
textarea,
select {
    font-family: 'Roboto', sans-serif;
    font: inherit;
    /* чтобы формы не сбивали шрифт */
}

:root {
    --bg: #141414;

    --buttons: #0000007a;

    --wh-buttons: #f9f9f9;

    --topic-buttons: #272727;

    --light-blue: #8cceff;

    --muted: #9c9da5;

    --muted-text-description: #d5d5d5;

    --topics-headers: #e0e0e0;

    --card-text-foryou: #e7e7e7;

    --white: #ffffff;

    --text: #ebe7e7;

    --text-topic: #dfdfdf;

    --border: #1c1e27;

    --card-back: #212121;

    --card-back-carousels: #141414;

    --carousel-bg: #0a0a0a;

    --chat-input-bg: #111111;

    --menu-back-bg: #191919;

    --menu-back-muted: #2d2d2d;

    --menu-input-bg: #222222;

    --menu-red: #dc0000;

    --topbar-dock: rgba(18, 18, 18, 0.8);

    --localnav-outline: #282828;

    --outline-auth-box: #414141;

    --border-menu-settings: #373636;

    --topic-hr: #464647;
}

:root {
    --topbar-h: 80px;
    --tabs-dock-h: 56px;
    --bottom-h: 62px;
    --topics-transition: 100px;
}


/* Отключаем переходы на первый кадр */
html.preload main,
html.preload header.topbar {
    transition: none !important;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    letter-spacing: .2px;
    display: flex;
    min-height: 100svh;
    overflow-y: auto;
    overflow-x: hidden;
}

body.orange-purple {
    background: radial-gradient(circle at 25% -45%, #492e1d, transparent 50%),
        radial-gradient(circle at 75% -45%, #3c2449, transparent 50%),
        #000000;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}

body.brown-gold {
    background: radial-gradient(circle at 25% -45%, #2c1f1a, transparent 50%),
        radial-gradient(circle at 75% -45%, #3f4a23, transparent 50%),
        #000000;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}



body.blue-cyan {
    background:
        radial-gradient(circle at 25% -45%, #0f2c3a, transparent 50%),
        radial-gradient(circle at 75% -45%, #123f3a, transparent 50%),
        #000000;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}

body.red-crimson {
    background:
        radial-gradient(circle at 25% -45%, #3a0f14, transparent 50%),
        radial-gradient(circle at 75% -45%, #4a1c2a, transparent 50%),
        #000000;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}

body.green-emerald {
    background:
        radial-gradient(circle at 25% -45%, #102a1c, transparent 50%),
        radial-gradient(circle at 75% -45%, #1f4a33, transparent 50%),
        #000000;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}

body.pink-violet {
    background:
        radial-gradient(circle at 25% -45%, #3a1630, transparent 50%),
        radial-gradient(circle at 75% -45%, #2c1a49, transparent 50%),
        #000000;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}

body.steel-blue {
    background:
        radial-gradient(circle at 25% -45%, #1b2430, transparent 50%),
        radial-gradient(circle at 75% -45%, #2a3a4a, transparent 50%),
        #000000;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}



/* Общий стиль для всех скроллов на сайте */
::-webkit-scrollbar {
    width: 8px;
    /* толщина полосы прокрутки */
}

::-webkit-scrollbar-track {
    background: transparent;
    /* прозрачный фон сектора */
}

::-webkit-scrollbar-thumb {
    background-color: rgba(80, 80, 80, 0.6);
    /* тёмно-серый ползунок */
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(100, 100, 100, 0.8);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(80, 80, 80, 0.6) transparent;
}


/* ───────── Aside ───────── */
/* Стиль бокового меню */
.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 61px;
    height: 100%;
    background-color: var(--topbar-dock);
    color: white;
    transition: width 0.3s ease-in-out;
    z-index: 10;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    background: #00000036;
    border-right: 1px solid #55555540;
}

/* Верхняя часть меню */
.menu-top {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}

/* Элементы меню */
.menu-item,
.profile {
    padding: 10px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
    border-radius: 10px;
}

.menu-item.active {
    background: #ffffff0d;
}

/* Tooltip появляется только когда aside НЕ .open */
.side-menu:not(.open) .menu-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    background: #000000;
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 1);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
}

/* Показ tooltip по hover */
.side-menu:not(.open) .menu-item:hover::after {
    opacity: 1;
}

.side-menu {
    overflow: visible;
}


.profile {
    gap: 8px;
    padding: 8px;
}

.menu-item:hover,
.profile:hover,
.menu-item-complo:hover {
    background-color: #ffffff1a;
}

.profile--guest:hover {
    background: none !important;
}

.profile--guest {
    pointer-events: auto;
}

.side-menu .profile--guest:hover {
    background-color: transparent !important;
}


.menu-item .icon,
.profile .icon {
    width: 20px;
    height: 20px;
    margin-right: 15px;
}

.menu-item svg {
    fill: var(--text);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-right: 10px;
}

.menu-item-complo {
    width: max-content;
    padding: 10px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
    border-radius: 10px;
}

.menu-item-complo .icon {
    width: 20px;
    height: 20px;
    margin-right: 0;
}

/* Текст меню */
.menu-text,
.profile-meta {
    display: inline-block;
    font-size: 14px;
    white-space: nowrap;

    opacity: 0;
    overflow: hidden;
    pointer-events: none;

    transition:
        opacity 0.3s ease-in-out;
}

.profile-meta {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.profile-upgrade-btn {
    margin-left: auto;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    height: max-content;
    border: 1px solid #51515196;

    opacity: 0;
    overflow: hidden;
    pointer-events: none;

    transition:
        opacity 0.3s ease-in-out;
}

.profile-upgrade-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.side-menu.open .menu-text,
.side-menu.open .profile-meta,
.side-menu.open .profile-upgrade-btn {
    opacity: 1;
    pointer-events: auto;
}

/* Нижняя часть меню (профиль) */
.menu-bottom {
    margin-top: auto;
    display: flex;
    justify-content: left;
    align-items: center;
}

.profile-avatar-aside {
    height: 32px;
    width: 32px;
    border-radius: 999px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    object-fit: cover;
}

.profile-avatar-aside .avatar-fallback {
    font-size: 10px !important;
}



.menu-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    cursor: ew-resize;
}

/* Стиль для кнопки переключения */
.toggle-btn {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: none;
    color: white;
    font-size: 24px;
    border: none;
    cursor: pointer;
}

/* Основной контент */
#mainContent {
    margin-left: 61px;
    /* Изначально сдвигаем контент на 5% */
    transition: margin-left 0.3s ease-in-out;
}

.side-menu.open {
    width: 240px;
    overflow-x: hidden;
}

#mainContent.shifted {
    margin-left: 240px;
}

.side-menu .profile {
    margin-bottom: 5px;
    height: 40px;
}

.side-menu.open .profile {
    margin-bottom: 0;
    height: 50px;
}

/* Элементы меню не должны скрываться при их клике */
.menu-item,
.profile {
    pointer-events: auto;
    width: 100%;
}

.menu-separator {
    background: var(--outline-auth-box);
    height: 1px;
    margin: 5px 5px;
}

.profile-info-container {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    white-space: nowrap;
    font-weight: 400;
    gap: 3px;
}

.profile-menu {
    position: fixed;
    left: 12px;
    bottom: 70px;
    width: max-content;
    border-radius: 12px;
    padding: 10px;
    z-index: 1000;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 1);
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #2a2a2a;
    cursor: default;
}

.profile-menu-item {
    background: transparent;
    border-radius: 10px;
    font-size: 14px;
    text-align: left;
    color: var(--text);
    padding: 8px 18px 8px 5px;
    border: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.profile-menu-item svg {
    fill: var(--text);
}

.profile-menu-item:hover {
    background-color: #444;
}

.profile-menu-stats {
    display: flex;
    gap: 20px;
    padding: 6px 8px;
    font-size: 13px;
    color: var(--text);
}

.profile-menu-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-menu-stat svg {
    fill: var(--text);
}


.profile-menu-stat span {
    font-size: 14px;
    font-weight: 400;
    display: flex;
    align-items: center;
}


.profile .aside-auth-btn {
    width: 100%;
    border: 0;
    border-radius: 35px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.profile .aside-auth-btn--primary {
    background: rgb(255 255 255);
    color: #000000;
}

.profile .aside-auth-btn--primary:hover {
    background: rgb(221, 221, 221);
}

.profile .aside-auth-btn--secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-top: 8px;
}

.profile .aside-auth-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}





@media (min-width: 768px) {
    .guest-desktop .topbar {
        display: grid !important;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        column-gap: 16px;
        padding: 12px;
    }

    .guest-desktop .topbar-left {
        grid-column: 1;
    }

    .guest-desktop .topbar-center {
        grid-column: 2;
        justify-self: center;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .guest-desktop .topbar-right {
        grid-column: 3;
        justify-self: end;
    }

    /* чтобы вложенные элементы не ломали ширины */
    .guest-desktop .topbar-left,
    .guest-desktop .topbar-right {
        display: flex;
        align-items: center;
        min-width: 0;
        width: 25vw;
    }


    .guest-topbar-logo img {
        height: 28px;
        width: auto;
        display: block;
    }

    .guest-topbar-nav {
        display: flex;
        gap: 18px;
        position: relative;
    }

    .guest-topbar-tab {
        position: relative;
        background: transparent;
        border: 0;
        color: var(--text);
        padding: 8px 4px 12px;
        /* чуть больше снизу под линию */
        cursor: pointer;
        opacity: 0.75;
    }

    /* hover */
    .guest-topbar-tab:hover {
        opacity: 0.95;
    }

    /* underline */
    .guest-topbar-tab::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 4px;
        height: 2px;
        background: linear-gradient(90deg,
                #6EE7F9 0%,
                #A78BFA 50%,
                #F472B6 100%);
        border-radius: 2px;
        opacity: 0;
        transform: scaleX(0);
        transform-origin: center;
        transition: transform 0.18s ease, opacity 0.18s ease;
    }

    /* active */
    .guest-topbar-tab.is-active {
        opacity: 1;
    }

    /* показываем линию только у активного */
    .guest-topbar-tab.is-active::after {
        opacity: 1;
        transform: scaleX(1);
    }


    .guest-topbar-actions {
        display: flex;
        gap: 10px;
    }

    .guest-btn {
        height: 36px;
        padding: 0 16px;
        border-radius: 40px;
        cursor: pointer;
        border: 1px solid rgba(255, 255, 255, 0.18);
        background: transparent;
        color: var(--text);
        ;
    }

    .guest-btn--primary {
        background: var(--text);
        color: var(--bg);
    }

    /* ВАЖНО: если у вас контент сдвинут под aside — уберите отступ */
    .guest-desktop .app,
    .guest-desktop main,
    .guest-desktop .page,
    .guest-desktop .content {
        margin-left: 0 !important;
    }
}






/* ───────── Main ───────── */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-top: 60px;
    transition: margin-left 0.4s ease;
    width: 100%;
}

@media (max-width: 768px) {
    main {
        margin-left: 0 !important;
    }

    .side-menu {
        display: none;
    }
}

@media (max-width: 640px) {
    main {
        padding-top: 20px;
    }
}

@media (min-width: 768px) {
    .guest-desktop main {
        padding-top: 90px;
    }
}



/* Шапка */
header.topbar {
    position: absolute;
    top: 0;
    left: 0%;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 0 24px;
    background: transparent;
}

/* Контейнер, который раскрывается из-под табов */
header.topbar {
    overflow: visible;
    /* позволяем панели вылезать вниз */
}

.topbar-search {
    width: 70%;
    padding: 12px 0 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}

/* список результатов под строкой */
.topbar-search-results {
    display: grid;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
    text-align: left;

    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 12px;
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    backdrop-filter: blur(14px) saturate(160%);
}

/* элемент результата (минимальный пример) */
.topbar-search-results .search-result {
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
}

.topbar-search-results .search-result:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* когда поиск открыт, чуть ужмём стеклянные табы чтобы дать воздуха */
:root {
    --topbar-h: 80px;
    --glass-w: min(760px, 92vw);
    --glass-gap: 10px;
    /* внутренние отступы tabs */
    --glass-extend-h: 88px;
    /* высота зоны под поиск */
}

/* фиксированный док над контентом, на уровне табов */
#tabsDockWrapper {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    transition: transform 0.3s ease;
    z-index: 1001;
    pointer-events: none;
}

/* внутренний — масштабируем */
#tabsDock {
    display: grid;
    align-content: start;
    justify-items: center;
    width: max-content;
    background: var(--topbar-dock);
    box-shadow: 0 0 0 1px var(--localnav-outline);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 0;

    transform-origin: top center;
}

.topbar-brand {
    display: flex;
    justify-content: center;
    align-items: center;
}

.topbar-brand img {
    height: 60px;
    width: 60px;
}

body.search-open #tabsDock {
    width: var(--glass-w);
    height: calc(var(--topbar-h) + var(--glass-extend-h));
    padding: 10px 16px 14px;
    background: rgba(25, 25, 25, .3);
}

/* сама «пилюля» табов */
#tabsDock .tabs {
    pointer-events: auto;
    position: relative;
    display: flex;
    gap: 10px;
    padding: 12px 36px;
    border-radius: 60px;
    height: var(--tabs-dock-h);
    width: max-content;
    margin: 0 auto;
    background: transparent;
}


/* поисковая коробка под tabs (но тоже в #tabsDock) */
#tabsDock .topbar-search {
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
}

body.search-open #tabsDock .topbar-search {
    opacity: 1;
}

#tabsDock .topbar-search .search.search-large {
    pointer-events: auto;
    margin-top: 6px;
}

#topbarSearchInput,
#tabsDock .search.search-large textarea {
    font-weight: 600;
    color: var(--text);
}

.search.search-large {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    background: #00000099;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 0;
    width: auto;
    border: none;
    outline: none;
    -webkit-appearance: none;
}

#topbarSearchBtn {
    all: unset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

#topbarSearchBtn:hover {
    opacity: 1;
}

#topbarSearchBtn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

#topbarSearchInput {
    all: unset;
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    background: transparent;
    padding-left: 4px;
    border: none;
    outline: none;
    -webkit-appearance: none;
}

#topbarSearchInput:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

/* Placeholder — как у Apple */
#topbarSearchInput::placeholder {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
}

input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    cursor: pointer;
    background: url('../Imgs/CrossIcon.png') no-repeat center center;
    background-size: 12px 12px;
    /* размер самой иконки */
    background-color: rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    border: none;
}

/* при наведении можно слегка осветлить круг */
input[type="search"]::-webkit-search-cancel-button:hover {
    background-color: #eaeaea;
}

.burger-btn,
.topbar-title {
    display: none;
}





/* =========================
   MOBILE DRAWER
   ========================= */

@media (max-width: 1024px) {
    #tabsDockWrapper {
        transform: translateX(-50%) scale(0.8);
    }
}

@media (max-width: 768px) {
    #tabsDockWrapper {
        display: none !important;
    }

    header.topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        padding: 0 14px;
        background: #00000036;
        border-bottom: 1px solid #55555587;
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        z-index: 1200;
    }

    main {
        padding-top: 72px;
    }

    /* делаем "V" кликабельной как кнопка меню */
    .topbar-left h1 {
        margin: 0;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
        user-select: none;
    }

    .topbar-left {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
        flex: 1;
    }

    .topbar-brand {
        display: none;
    }

    .burger-btn,
    .topbar-title {
        display: block;
    }

    .burger-btn {
        all: unset;
        cursor: pointer;
        width: 16px;
        border-radius: 12px;
        display: grid;
        place-items: center;
        margin-right: 10px;
        fill: var(--text);
        margin: 0;
    }

    .burger-btn span {
        display: block;
        width: 16px;
        height: 1px;
        background: var(--muted);
        border-radius: 2px;
        opacity: .9;
    }

    .burger-btn span+span {
        margin-top: 4px;
    }

    .topbar-right-empty {
        width: 20px;
    }

    .topbar-title {
        font-weight: 500;
        font-size: 16px;
        line-height: 1.5;
        color: var(--text);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
        justify-content: center;
        display: flex;
    }
}

/* overlay */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1999;
}


.drawer {
    position: fixed;
    height: 100dvh;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding: 14px 14px 18px;
    padding-bottom: env(safe-area-inset-bottom);

    transform: translateX(-105%);
    transition: transform .25s cubic-bezier(.25, 1, .3, 1);

    background-color: color-mix(in oklab, #212121 90%, transparent);

    inset: 0;
    background: #0d0d0d;
}

.drawer.is-open {
    transform: translateX(0);
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 2px 14px;
}

.drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    width: 100%;
}

.drawer-close-btn {
    background: transparent;
    border: 0;
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
}

.drawer-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.drawer-logo {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
}

.drawer-logo img {
    width: 20px;
    height: 20px;
}

.drawer-name {
    font-weight: 700;
    opacity: 0.9;
}

.drawer-close {
    all: unset;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 4px;
}

.drawer-item {
    all: unset;
    cursor: pointer;
    padding: 10px 10px;
    border-radius: 12px;
    color: var(--text);
    font-weight: 400;
    font-size: 14px;
    background: transparent;
    display: flex;
    gap: 10px;
    fill: var(--text);
    gap: 8px;
    align-items: center;
}

.drawer-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.drawer-item.is-active {
    background: #ffffff1a;
    color: var(--text);
}

.drawer-spacer {
    flex: 1 1 auto;
}

.drawer-bottom {
    display: grid;
    gap: 10px;
    padding-top: 14px;
}

.drawer-primary,
.drawer-secondary {
    all: unset;
    cursor: pointer;
    text-align: center;
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 700;
}

.drawer-primary {
    background: #2fc0c9;
    /* как на скрине */
    color: #0b0b0b;
}

.drawer-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* аккаунтный блок внизу drawer */
#drawerAccountSlot {
    position: relative;
    margin-top: auto;
    padding: 12px 10px 10px;
}

/* floating меню поверх aside */
.drawer-account-floatmenu {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: calc(100% + 10px);
    z-index: 9999;

    padding: 8px;
    border-radius: 14px;
    background: var(--menu-back-bg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);

    display: none;
    width: max-content;
}

.drawer-account-floatmenu.open {
    display: block;
}

.drawer-account-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 14px;
    cursor: pointer;
    background: transparent;
}

.drawer-account-trigger:hover {
    background: var(--card-back);
}

.drawer-account-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.drawer-account-name {
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-account-email {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-account-sheet {
    margin-top: 10px;
    padding: 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: none;
}

.drawer-account-sheet.open {
    display: block;
}

.drawer-account-item {
    all: unset;
    cursor: pointer;
    display: flex;
    padding: 8px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
    align-items: center;
    fill: var(--white);
    gap: 5px;
    width: 100%;
}

.drawer-account-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.drawer-account-item.danger {
    color: #ff5a6b;
}

/* кнопки логина/регистрации снизу */
.drawer-auth-buttons {
    display: grid;
    gap: 10px;
}

.drawer-auth-buttons .drawer-primary,
.drawer-auth-buttons .drawer-secondary {
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 700;
    border: 0;
    cursor: pointer;
}

.drawer-auth-buttons .drawer-primary {
    background: var(--text);
    color: var(--bg);
}

.drawer-auth-buttons .drawer-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.12);
}












/* результаты внутри топбара прячем совсем */
#tabsDock .topbar-search-results {
    display: none !important;
}

:root {
    --search-blur: 10px;
    /* интенсивность размытия */
    --search-dim: .35;
    /* затемнение фона */
}

/* у main будет псевдо-оверлей для затемнения */
main {
    position: relative;
}

/* плавность перехода для всех прямых детей main */
main>* {
    transition: filter .25s ease, opacity .25s ease, transform .25s ease;
}

/* 🔵 режим поиска: блюрим всё, КРОМЕ #tabsDock */
body.search-open main>*:not(#tabsDockWrapper) {
    filter: blur(var(--search-blur));
    opacity: .85;
    /* чуть приглушим; можно убрать */
    pointer-events: none;
    /* блокируем клики по размытому */
}

/* затемняем фон под tabsDock (он будет выше по z-index) */
body.search-open main::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, var(--search-dim));
    z-index: 1000;
    /* ниже #tabsDock */
    pointer-events: none;
}

/* гарантируем, что док выше затемнения */
#tabsDock {
    z-index: 1002;
}

body.search-open {
    overflow: hidden;
    touch-action: none;
    /* отключает свайпы на мобилках */
}

.topbar-left {
    left: 24px;
    right: 24px;
}

.topbar-right {
    right: 24px;
    justify-content: flex-end;
}


.topbar-auth-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    min-width: 0;
    max-width: 100%;
    flex-wrap: nowrap;
}

.google-custom-btn {
    background-color: var(--card-back);
    color: white;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 56px;
    padding: 15px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: background-color 0.3s;
    box-shadow: 0 0 0 1px var(--outline-auth-box);
}

.google-custom-btn:hover {
    background-color: var(--localnav-outline);
}

.google-custom-btn:focus {
    outline: none;
}

.google-custom-btn .google-logo {
    margin-right: 10px;
}

.google-custom-btn:before {
    content: "";
    display: inline-block;
    background-image: url('/Imgs/google.svg');
    /* Путь к вашему SVG логотипу */
    background-size: contain;
    width: 20px;
    height: 20px;
    margin-right: 10px;
}




.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 0;
    background: rgba(0, 0, 0, 0.06);
    cursor: pointer;
}

.topbar-user:hover {
    opacity: 0.8;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    color: #fff;
}



/* выпадающее меню */
.user-menu {
    position: absolute;
    right: 0;
    margin-top: 8px;
    min-width: 220px;
    padding: 10px 0;
    border-radius: 12px;
    background: var(--menu-back-bg);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    z-index: 1000;
}

.user-menu-header {
    display: flex;
    align-items: center;
    padding: 5px 14px 10px;
    gap: 10px;
}

.user-menu-avatar-wrapper {
    display: flex;
    align-items: center;
}

.user-menu-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    object-fit: cover;
}

.user-menu-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
}

.user-menu-email {
    font-size: 12px;
    opacity: 0.8;
    color: var(--muted);
    font-weight: 500;
}

.user-menu hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 4px 5% 6px;
    width: 90%;
}

.user-menu-item {
    width: 100%;
    padding: 8px 14px;
    text-align: left;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 5px;
}

.settings-menu-icon {
    fill: var(--text);
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
}



/* фон + блюр */
.logout-modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    /* включаем через JS */
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.75);
    /* тёмный полупрозрачный фон */
    backdrop-filter: blur(10px);
    /* сам блюр */
    -webkit-backdrop-filter: blur(10px);

    z-index: 2000;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

.logout-modal-overlay.shown {
    opacity: 1;
}

/* само окно */
.logout-modal {
    max-width: 400px;
    width: 100%;
    padding: 36px;
    border-radius: 16px;
    background: var(--menu-back-bg);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.logout-modal h2 {
    margin: 0 0 15px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
}

.logout-modal p {
    margin: 0 0 30px;
    font-size: 18px;
    color: var(--muted);
    text-align: center;
}

/* кнопки */
.logout-modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-direction: column;
    width: 100%;
}

.logout-modal .btn-primary,
.logout-modal .btn-secondary {
    border-radius: 999px;
    padding: 10px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.logout-modal .btn-secondary {
    background: transparent;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.18);
    width: 100%;
    background: #232323;
}

.logout-modal .btn-secondary:hover {
    background: #2a2a2a;
}

.logout-modal .btn-primary {
    background: var(--text);
    color: var(--menu-back-bg);
}

.logout-modal .btn-primary:hover {
    background: #dddde2;
}






/* SETTINGS */
body.modal-open {
    overflow: hidden;
}

.user-menu[hidden] {
    display: none;
}

.user-menu.open {
    display: block;
}

.settings-modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
    z-index: 2100;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

.settings-modal-overlay.shown {
    opacity: 1;
}

/* окно настроек */
.settings-modal {
    width: min(720px, 96vw);
    max-height: 80vh;
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.settings-close {
    align-self: flex-start;
    margin-bottom: 12px;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 14px;
}

/* тело: слева нав, справа контент */
.settings-modal-body {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 0;
    min-height: 260px;
    height: 65vh;
}

/* навигация */
.settings-nav {
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-color: var(--bg);
}

.settings-tab {
    border: none;
    background: transparent;
    text-align: left;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    fill: var(--text);
    gap: 5px;
    align-items: center;
}

.settings-tab:hover {
    background: #3f3f3f;
}

.settings-tab.is-active {
    background: var(--menu-back-muted);
}

/* контент */
.settings-content {
    padding: 16px;
    overflow-y: auto;
    background-color: var(--menu-back-bg);
    color: var(--text);
}

.settings-panel {
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* блок с инфой аккаунта */
.settings-account-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

/* Карточка профиля */
.settings-account-card {
    max-width: 420px;
    margin: 0 auto;
    padding: 24px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Аватар по центру */
.settings-account-avatar-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.settings-avatar-btn {
    position: relative;
    border: none;
    padding: 0;
    background: none;
    cursor: pointer;
}

/* Круглый аватар (для buildAvatarElement добавлен .settings-avatar) */
.settings-avatar-btn .avatar-wrapper,
.settings-avatar-placeholder,
.settings-avatar {
    width: 140px;
    height: 140px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 600;
}

/* если используется fallback с инициалами */
.settings-avatar-btn .avatar-fallback,
.settings-avatar-placeholder {
    background: #f97316;
    color: #fff;
}

/* картинка-аватар */
.settings-avatar-btn .avatar-img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

/* иконка камеры */
.settings-avatar-camera {
    position: absolute;
    right: 4px;
    bottom: 8px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #191919;
    border: 1px solid var(--border-menu-settings);
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-avatar-camera::before {
    content: "";
    display: block;
    width: 16px;
    height: 16px;
    background-image: url('Imgs/Avatar.svg');
    background-size: cover;
    background-position: center;
}

/* поля ввода */
.settings-account-card .settings-field label {
    font-size: 13px;
    margin-bottom: 4px;
    display: block;
    color: #9ca3af;
}

/* подсказка текстовая снизу */
.settings-account-hint {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

/* кнопки "Отменить / Сохранить" */
.settings-account-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.settings-btn.primary {
    background: #2563eb;
    color: #fff;
    border-radius: 15px;
    border: 0;
    padding: 8px 10px;
    line-height: 1;
    cursor: pointer;
}

.settings-btn.secondary {
    background: transparent;
    color: #e5e7eb;
    border: 1px solid var(--border-menu-settings);
    border-radius: 20px;
    padding: 8px 10px;
    line-height: 1;
    cursor: pointer;
    font-size: 14px;
}

.settings-btn.secondary:hover {
    background: var(--border-menu-settings);
}

.settings-btn.danger.small.delete-account-btn:hover {
    background: var(--border-menu-settings);
}

.settings-btn.danger {
    border: 0;
    border-radius: 20px;
    padding: 0px 12px;
    cursor: pointer;
    font-size: 14px;
}

.settings-sub {
    line-height: 1.3;
}

/* поля */
.settings-header {
    margin-bottom: 14px;
}

.settings-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 6px 0;
}

.settings-field {}

.settings-field label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: 0.7;
    margin-bottom: 4px;
}

.settings-input {
    width: 100%;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: var(--menu-input-bg);
    color: inherit;
    outline: none;
}

/* кнопки выбора темы */
.settings-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.settings-theme-btn {
    border-radius: 999px;
    padding: 6px 12px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
}

.settings-theme-btn:hover {
    background: rgba(148, 163, 184, 0.12);
}

.settings-mobile-top {
    display: none;
}

/* адаптив */
@media (max-width: 768px) {
    .settings-modal-body {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .settings-nav {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    }

    .settings-tab {
        flex: 1;
        text-align: center;
        padding: 10px 12px;
        border-radius: 12px;
    }


    .settings-close {
        align-self: center;
        margin-bottom: 0;
    }

    .settings-content {
        height: 100%;
    }

    .settings-modal {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    /* 1) верхняя строка: заголовок + крестик */
    .settings-mobile-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        background-color: var(--menu-back-bg);
    }

    .settings-mobile-title {
        font-size: 16px;
        font-weight: 600;
    }

    /* чтобы крестик был аккуратный и кликабельный */
    .settings-close--mobile {
        width: 36px;
        height: 36px;
        display: grid;
        place-items: center;
    }

    /* 2) делаем nav НЕ боковым, а строкой вкладок */
    .settings-nav {
        width: 100%;
        padding: 8px 8px;
        display: flex;
        flex-direction: row;
        gap: 8px;
        overflow-x: scroll;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* крестик внутри aside на мобилке прячем (чтобы не было второго рядом с вкладками) */
    .settings-nav .settings-close:not(.settings-close--mobile) {
        display: none;
    }

    /* вкладки в одну строку */
    .settings-tab {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    /* старый десктопный заголовок внутри контента можно скрыть, чтобы не было 2 заголовков */
    .settings-header {
        display: none;
    }

    /* контент пусть занимает остаток и скроллится */
    .settings-content {
        flex: 1;
        overflow: auto;
    }
}

/* CATEGORIES INSIDE */
.settings-interests-chips button {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-menu-settings);
    border-radius: 40px;
    padding: 4px 9px;
    cursor: pointer;
    transition: border 0.2s ease;
    margin-bottom: 8px;
}

.settings-interests-chips button:hover {
    border: 1px solid #ffffff;
}


.settings-interests-chips button.is-active {
    background: var(--border-menu-settings);
}

.settings-textarea.more-about-you {
    width: 100%;
    background: var(--menu-back-muted);
    border: 1px solid var(--border-menu-settings);
    border-radius: 8px;
    height: 120px;
    resize: none;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    color: var(--text);
    font-size: 14px;
    padding: 7px;
}

.settings-field.settings-field-toggle {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-track {
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: #555;
    /* фон "выкл" */
    display: inline-flex;
    align-items: center;
    padding: 2px;
    box-sizing: border-box;
    transition: background 0.2s ease;
}

.toggle-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transform: translateX(0);
    transition: transform 0.2s ease;
}

/* включено */
.toggle input:checked+.toggle-track {
    background: #22c55e;
    /* зелёный фон "вкл" */
}

.toggle input:checked+.toggle-track .toggle-thumb {
    transform: translateX(18px);
}

.settings-content {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* у тебя уже, но на всякий случай */
}


.settings-snackbar-wrap {
    position: sticky;
    bottom: 0;
    z-index: 50;
    pointer-events: none;
    width: 100%;
    /* Растягиваем на всю ширину */
    margin-top: auto;
    /* Выравнивание снизу */
}

.settings-snackbar {
    position: relative;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    background: #222;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.settings-snackbar button {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--muted);
    border-radius: 40px;
    padding: 4px 9px;
    cursor: pointer;
}

.settings-snackbar button:hover {
    border: 1px solid #ffffff;
}

.settings-snackbar.shown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* скрыто по умолчанию */
.settings-snackbar--hidden {
    display: none;
}

.settings-snackbar__actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.settings-select.settings-lang-select {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 5px;
    border-radius: 40px;
    cursor: pointer;
    user-select: none;
    color: var(--text);
    background-color: var(--menu-back-bg);
    margin-top: 5px;
}




/* DELETE ACCOUNT */
.settings-confirm-overlay {
    position: absolute;
    /* внутри settings-modal */
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
    z-index: 50;
}

.settings-confirm-dialog {
    background: #1f1f1f;
    border-radius: 12px;
    padding: 20px 24px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .6);
}

.settings-confirm-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.settings-confirm-text {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 16px;
}

.settings-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}




/* PROFILE */
.settings-card-sub {
    color: var(--muted);
    margin-top: 2px;
}

.settings-custom-select {
    position: relative;
}

.settings-custom-select__btn {
    width: 100%;
    background: transparent;
    color: var(--text);
    border: 0;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.settings-custom-select__btn:hover {
    background: var(--border-menu-settings);
}

.settings-custom-select__label {
    opacity: .7;
}

.settings-custom-select__value {
    margin-left: auto;
}

.settings-custom-select__chev {
    margin-left: 6px;
    opacity: .7;
}

.settings-custom-select__menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 50;

    background: rgba(20, 20, 20, 0.95);
    /* можно заменить на var(--card-bg) если есть */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    /* <-- закругление меню */
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);

    display: none;
}

.settings-custom-select.is-open .settings-custom-select__menu {
    display: block;
}

.settings-custom-select__opt[aria-selected="true"] {
    background: transparent;
}

.settings-custom-select__opt {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: var(--text);
    padding: 10px 10px;
    border-radius: 10px;
    /* <-- закругление элементов */
    cursor: pointer;
    font-size: 14px;
}

.settings-custom-select__opt .checkmark {
    display: none;
    position: absolute;
    right: 10px;
    fill: white;
}

/* Показываем галочку у выбранной опции */
.settings-custom-select__opt[aria-selected="true"] .checkmark {
    display: inline-block;
}

.settings-custom-select__opt:hover {
    background: rgba(255, 255, 255, 0.08);
}



.settings-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-plan-list {
    margin: 6px 0 0px;
    list-style-type: none;
}

.settings-plan-list li {
    margin-bottom: 4px;
    /* Увеличиваем расстояние между пунктами */
}


.settings-btn.secondary.small {
    background: var(--menu-back-muted);
    padding: 10px 15px;
    border: 1px solid var(--muted);
    border-radius: 40px;
    color: var(--text);
    font-weight: 600;
}

.settings-btn.secondary.small:hover {
    background: var(--border-menu-settings);
}

.settings-btn.danger.small.delete-account-btn {
    background: var(--menu-back-muted);
    padding: 10px 15px;
    border: 1px solid var(--menu-red);
    border-radius: 40px;
    color: var(--menu-red);
    font-weight: 600;
    cursor: pointer;
}

.avatar-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-wrapper .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 0.04em;
}

.settings-account-avatar-wrap .avatar-fallback {
    font-size: 44px;
}










/* сами кнопки с иконками */
.topbar-btn {
    all: unset;
    cursor: pointer;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: background 0.15s ease, transform 0.15s ease;
}

/* иконки остаются круглыми */
.topbar-btn.icon-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    padding: 0;
}

/* текстовые кнопки нормальной ширины */
.topbar-btn.text-btn {
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.topbar-btn.login-btn,
.topbar-btn.signup-btn {
    height: 38px;
    padding: 0px 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-weight: 700;
    font-size: 14px;
}

.topbar-btn.login-btn {
    background-color: var(--text);
    color: var(--bg);
    border: 1px solid var(--bg);
}

.topbar-btn.login-btn:hover {
    background-color: var(--text);
    opacity: 0.9;
}


.topbar-btn.signup-btn {
    /* подстрой под свой дизайн */
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--localnav-outline);
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
}

.topbar-btn.signup-btn:hover {
    background-color: var(--localnav-outline);
}



.topbar-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.topbar-btn:active {
    transform: scale(0.95);
}

.topbar-btn img {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1);
}

/* Стеклянная панель вкладок (ширина — по содержимому) */
.topbar .tabs {
    position: relative;
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 60px;
    width: max-content;
    /* ширина по содержимому */
    margin: 0 auto;
    /* центр внутри topbar */
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    backdrop-filter: blur(14px) saturate(160%);

    transform: scale(1);
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.tab-indicator {
    position: absolute;
    top: calc(var(--tabs-dock-h) - 0px);
    bottom: 0px;
    left: 0;
    width: 0;
    opacity: 1;
    border-radius: 2px;
    background: var(--buttons);
    border: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateX(0);
    transition: transform .5s cubic-bezier(.25, 1, .3, 1), width .5s cubic-bezier(.25, 1, .3, 1);
    pointer-events: none;
    z-index: 0;
}

html.preload .tab-indicator {
    opacity: 0;
    transition: none !important;
}

/* по умолчанию индикатор НЕ виден и без анимации */
.tab-indicator {
    opacity: 0;
    transition: none;
}

/* когда JS скажет "всё готово" */
.tabs-initialized .tab-indicator {
    opacity: 1;
    transition: transform 0.25s ease, width 0.25s ease;
}


header.topbar.shrink .tabs {
    transform: scale(0.8);
    opacity: 0.85;
}

/* Кнопки-вкладки */
#tabsDock .tab {
    all: unset;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 45px;
    font-weight: 600;
    letter-spacing: .2px;
    color: var(--text);
    line-height: 1;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
    position: relative;
    z-index: 1;

    display: flex;
    justify-content: center;
    align-items: center;
}

#tabsDock .tab[disabled] {
    opacity: .5;
    pointer-events: none;
}

/* Активная вкладка — более выразительное «матовое стекло» */
#tabsDock .tab.is-active {
    background: transparent;
    color: var(--buttons);
    box-shadow: none;
}

/* Фокус клавиатуры */
#tabsDock .tab:focus-visible {
    outline: 2px solid var(--buttons);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(46, 144, 250, .25);
}

.search-tab {
    height: 14px;
    width: 14px;
}




/* ───────── Анимации переходов ───────── */
:root {
    --slide-dur: .6s;
    --fade-tail: .12s;
    --overshoot: 120%;
    --gap-x: 32px;
}

.sections-stage {
    display: flex;
    position: relative;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.sections-stage>.main-section {
    grid-area: 1 / 1;
    /* все в одной «строке» */
}

/* Едет только transform */
.main-section {
    will-change: transform, opacity;
    transition:
        transform var(--slide-dur) cubic-bezier(.25, 1, .3, 1),
        opacity var(--fade-tail) linear;
    width: 100%;
}

.main-section.clip-bleed {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--abs-top, 0px);
    /* вместо inset:0 */
    width: 100%;
    will-change: transform, opacity;
}

/* ВПРАВО (новая заезжает справа → старая уходит влево) */
.section-enter-right {
    transform: translateX(calc(var(--overshoot) - var(--gap-x)));
    opacity: 0;
}

.section-exit-left {
    transform: translateX(calc(-1 * var(--overshoot) - var(--gap-x)));
    opacity: 0;
}

/* ВЛЕВО (новая заезжает слева → старая уходит вправо) */
.section-enter-left {
    transform: translateX(calc(-1 * var(--overshoot) + var(--gap-x)));
    opacity: 0;
}

.section-exit-right {
    transform: translateX(calc(var(--overshoot) + var(--gap-x)));
    opacity: 0;
}

/* Конечное «покойное» состояние */
.section-active {
    transform: translateX(0);
    opacity: 1;
}

/* 🔸 Анимации прозрачности — не через transition */
@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes fadeOut {
    from {
        opacity: 1
    }

    to {
        opacity: 0
    }
}

/* входящие: проявляемся сразу в начале движения */
.section-enter-left.section-active,
.section-enter-right.section-active {
    animation: fadeIn var(--fade-tail) linear both;
    /* без delay — начинается сразу */
}

/* уходящие: гаснем в самом конце движения */
.section-exit-left,
.section-exit-right {
    animation: fadeOut var(--fade-tail) linear both;
    animation-delay: calc(var(--slide-dur) - var(--fade-tail));
}

/* (опционально) чтобы не ловить клики во время перелёта */
.main-section.anim-lock {
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .main-section {
        transition: none
    }

    .section-enter-left,
    .section-enter-right,
    .section-exit-left,
    .section-exit-right {
        animation: none
    }
}







/* ───────── TOPIC SECTION ───────── */
#topic {
    padding: 0px 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.topic-content-general {
    padding: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.topic-section {
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

#topic-content {
    width: 920px;
}

.badge-viewed {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 5px 9px;
    font-size: 12px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 3;
}

.for-you-hero.reverse .badge-viewed {
    right: unset;
    left: 8px;
}

.badge-viewed .eye {
    display: flex;
    width: 1.2em;
    height: auto;
    background: transparent;
    color: var(--text);
    align-items: center;
}

#topic-content {
    --fg: #e8e8ef;
    --fg-muted: #b7b9c9;
    --fg-dim: #9aa0b5;
    --bg-soft: #1f2024;
    --bg-softer: #17181b;
    --link: #2e90fa;
    --link-hover: #69afff;
    --border: #2a2c35;
    --code-bg: #111216;
    --quote-bar: #6b7280;
    --table-head: #22242a;
    --radius: 12px;

    color: var(--fg);
    line-height: 1.65;
    font-size: 16px;
}

#topic-content h1.topic-title {
    all: unset;
    display: block;

    padding-left: 18px;
    text-align: center;
    font-size: 32px;
    line-height: 1.25;
    font-weight: 700;
    margin-bottom: 60px;
}

.topic-block {
    position: relative;
    margin: 0;
    padding-left: 18px;
    padding-right: 18px;
}

.topic-block--sub::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    border-radius: 3px;
    background: var(--topic-gradient, linear-gradient(to bottom, #3b82f6, #8b5cf6));
    opacity: 0.9;
}


/* (опционально) подчистить внешний вид hr */
.topic-block+hr {
    margin: 22px 0;
    border: 0;
    border-top: 1px solid var(--border, rgba(255, 255, 255, .14));
}


/* Базовая вертикальная ритмика */
#topic-content>*:first-child {
    margin-top: 0;
}

#topic-content>*:last-child {
    margin-bottom: 0;
}




/* LIKE, SHARE, EXPORT*/
.topic-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.topic-export-action-btn {
    background-color: var(--buttons);
    border: 0;
    border-radius: 25px;
    padding: 10px 16px;
    fill: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    cursor: pointer;
}

.export-popover {
    position: absolute;
    z-index: 9999;
    display: none;
}

.export-popover.is-open {
    display: block;
}

.export-popover-inner {
    background: var(--carousel-bg);
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
    padding: 6px;
    min-width: 180px;
}

.export-item {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
}

.export-item:hover {
    background: rgb(58, 58, 58);
}

.export-item svg {
    width: 20px;
    height: 20px;
    fill: var(--text);
    margin-right: 5px;
}

.share-icon {
    background-color: var(--buttons);
    border: 0;
    border-radius: 25px;
    padding: 10px 16px;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    height: 40px;
}

.share-icon span {
    display: flex;
    align-items: center;
    line-height: 1;
}

.share-icon svg {
    display: block;
    fill: var(--text);
}

.like-block {
    background-color: var(--buttons);
    border: 0;
    border-radius: 25px;
    padding: 4px 15px;
    color: var(--text);
    cursor: pointer;

    height: 40px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    gap: 8px;
}

.like-block svg {
    display: block;
    align-items: center;
    stroke: var(--text-color, currentColor);
    fill: none;
    transition: fill 0.3s ease, stroke 0.3s ease;
}

.like-block.liked .heart {
    color: #ff3b60;
    fill: #ff3b60;
}

/* лёгкий пульс при лайке */
.pulse {
    animation: pulseAnim 0.3s ease;
}

@keyframes pulseAnim {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}


#topic-content p,
#topic-content ul,
#topic-content ol,
#topic-content pre,
#topic-content blockquote,
#topic-content table,
#topic-content hr,
#topic-content .callout {
    margin: 0.9em 0;
    line-height: 1.8;
}

/* Заголовки */
#topic-content h1,
#topic-content h2,
#topic-content h3,
#topic-content h4,
#topic-content h5,
#topic-content h6 {
    font-weight: 700;
    line-height: 1.25;
    margin: 4px 0;
    color: var(--fg);
}

#topic-content h1 {
    font-size: 1.65rem;
    margin-bottom: 20px;
}

#topic-content h2 {
    font-size: 1.25rem;
}

#topic-content h3 {
    font-size: 1.125rem;
}

#topic-content h4 {
    font-size: 1.05rem;
}

#topic-content h5 {
    font-size: 1rem;
}

#topic-content h6 {
    font-size: 0.95rem;
    color: var(--fg-muted);
}

/* Акценты */
#topic-content b,
#topic-content strong {
    font-weight: 700;
}

#topic-content i,
#topic-content em {
    font-style: italic;
}

#topic-content s,
#topic-content del {
    text-decoration: line-through;
}

/* Списки */
#topic-content ul,
#topic-content ol {
    padding-left: 1.85em;
}

#topic-content li {
    margin: 0.3em 0;
}

#topic-content ul ul,
#topic-content ol ol,
#topic-content ul ol,
#topic-content ol ul {
    margin: 0.35em 0;
}

/* CODE BLOCK (topic parts) */
#topic-content pre.code-block {
    margin: 14px 0;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
}

/* header: первая строка */
#topic-content pre.code-block .code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 12px 10px 22px;
    background: rgb(255 255 255 / 0%);
}

/* язык слева */
#topic-content pre.code-block .code-lang {
    font-size: 12px;
    opacity: 0.9;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
}

#topic-content pre.code-block .code-copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text);
    border-radius: 10px;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    fill: var(--text);
}

#topic-content pre.code-block .code-copy svg {
    flex-shrink: 0;
    opacity: 0.9;
}

#topic-content pre.code-block .code-copy:active {
    transform: translateY(1px);
}

/* сам код ниже */
#topic-content pre.code-block code {
    display: block;
    padding: 2px 22px 20px;
    overflow: auto;
    white-space: pre;
    line-height: 1.45;
    font-size: 14px;
    color: #e5e7eb;
}

#topic-content pre.code-block code.hljs {
    background: transparent;
}


.source-pills {
    display: inline-flex;
    gap: 6px;
    vertical-align: middle;
    margin-left: 5px;
}

.source-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 999px;
    font-size: 10px;
    text-decoration: none;
    background: rgb(49, 49, 49);
    color: white !important;
    border: 0;
    font-weight: 300;
}

.source-pill:hover {
    background: rgb(230, 230, 230);
    color: var(--bg) !important;
}



.topic-sources h3 {
    margin: 0 0 10px;
}

.source-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.source-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
    color: var(--text);
}

.source-chip:hover {
    background: rgba(255, 255, 255, 0.10);
}



/* LINK PREVIEW */
.link-preview-popover {
    position: fixed;
    z-index: 9999;
    width: 340px;
    max-width: min(90vw, 380px);
    background: rgb(49, 49, 49);
    color: #ffffff;
    border: 1px solid #494949;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .05);
    overflow: hidden;
    transform: translate3d(0, 0, 0);
    cursor: pointer;
}

.link-preview-popover__link {
    cursor: pointer;
}

.link-preview-popover__head {
    display: flex;
    gap: 10px;
    padding: 15px 15px 10px;
    align-items: center;
}

.link-preview-popover__favicon {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, .06);
}

.link-preview-popover__site {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-preview-popover__body {
    padding: 0 15px 12px;
}

.link-preview-popover__title {
    font-size: 14px;
    font-weight: 650;
    line-height: 1.25;
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-popover__desc {
    font-size: 12.5px;
    line-height: 1.35;
    opacity: .85;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-popover__loading {
    padding: 12px;
    font-size: 12.5px;
    opacity: .75;
}




/* SOURCES CAROUSEL */
.sources-carousel {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(275px, 320px);
    gap: 12px;
    overflow-x: auto;
    padding: 8px 2px 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.sources-carousel::-webkit-scrollbar {
    height: 8px;
}

.sources-carousel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .12);
    border-radius: 999px;
}

.source-card {
    scroll-snap-align: start;
    display: block;
    text-decoration: none;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.06);
    padding: 12px;
    color: var(--text);
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.source-card:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.source-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.source-card__favicon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .06);
    flex: 0 0 auto;
}

.source-card__site {
    font-size: 12px;
    opacity: .78;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-card__title {
    font-size: 14px;
    font-weight: 650;
    line-height: 1.25;
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.source-card__desc {
    font-size: 12.5px;
    line-height: 1.35;
    opacity: .85;
    margin: 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.source-card.is-loading .source-card__title,
.source-card.is-loading .source-card__desc,
.source-card.is-loading .source-card__site {
    opacity: .5;
}

.source-card__skeleton {
    height: 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .08);
    margin-top: 8px;
}

.topic-sources {
    margin: 25px 0 55px;
    padding-left: 0;
    padding-right: 30px;
}

.topic-sources h2 {
    text-align: center;
    margin-bottom: 10px !important;
}

@media (max-width: 768px) {
    .sources-carousel {
        margin-right: 20px;
    }
}










/* Цитаты */
#topic-content blockquote {
    margin: 1em 0;
    padding: 0.8em 1em;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-left: 4px solid var(--quote-bar);
    border-radius: var(--radius);
    color: var(--fg);
}

/* Кодовые блоки */
#topic-content pre {
    background: #0c0c0c;
    border-radius: 14px;
    padding: 12px 14px;
    overflow-x: auto;
}

#topic-content pre code {
    font-size: 0.92em;
    display: block;
    white-space: pre;
}

/* Горизонтальная линия */
#topic-content hr {
    border: none;
    height: 1px;
    background: var(--topic-hr);
    margin: 20px 0;
}

/* Таблицы */
#topic-content table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: clip;
    background: var(--bg-softer);
}

#topic-content th,
#topic-content td {
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

#topic-content th {
    background: var(--table-head);
    font-weight: 700;
}

#topic-content tr:nth-child(2n) td {
    background: var(--bg-soft);
}

/* Картинки */
#topic-content img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
    display: block;
    margin: 0;
    border: 1px solid var(--border);
    margin-bottom: 1px;
}

/* Вспомогательные блоки-выделения (callout) */
#topic-content .callout {
    display: grid;
    grid-template-columns: 22px auto;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
}

#topic-content .callout .icon {
    opacity: 0.9;
}

/* Служебный текст */
#topic-content .muted {
    color: var(--fg-dim);
}

/* TOPIC DESIGN */
.query-header {
    margin: 0 0 50px;
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-strong);
    text-align: center;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 20px 0;
    width: 100%;
    padding: 0 70px;
}

.topic-author-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

/* Бейдж пользователя справа */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 500;
}

/* теперь аватар справа от ника */
.user-badge .name {
    order: 1;
}

.user-badge .avatar {
    order: 2;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .25) inset;
}


.back-btn {
    all: unset;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #0071e3;
    margin: 20px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
    margin: 0;
}

.back-btn:hover {
    color: #4ca3ff;
}

.assistant-text,
.assistant-text p,
.assistant-text ul,
.assistant-text ol,
.assistant-text h3 {
    text-align: left;
}

.assistant-text h2,
.assistant-text h3,
.assistant-text h4 {
    font-weight: 700;
    line-height: 1.3;
    margin-top: 0.8em;
    margin-bottom: 0.8em;
}

.assistant-text h2 {
    font-size: 2rem;
}

.assistant-text h3 {
    font-size: 1.5rem;
}

.assistant-text h4 {
    font-size: 1.25rem;
}

.assistant-text p,
.assistant-text ul,
.assistant-text ol {
    text-align: left;
    font-size: 1rem;
    line-height: 1.6;
}

/* Параграфы */
.assistant-text p {
    margin-bottom: 1em;
}

.assistant-text hr {
    margin-top: 25px;
}

.para-bullets {
    margin: 0.6em 0 1em 1.2em;
    padding-left: 1em;
}

.para-bullets li {
    margin: 0.3em 0;
}

.topic-block__content {
    position: relative;
    border-radius: 16px;
    padding: 15px 0 5px 15px;
    background: transparent;
}

.topic-block--sub {
    background: none;
}

.block-cta {
    margin: 4px 0 12px;
    display: flex;
    gap: 12px;
}


.block-cta {
    display: flex;
    justify-content: center;
}

.block-cta button {
    border-radius: 30px;
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 400;
    border: 0;
    text-align: center;
    cursor: pointer;
    line-height: 1;
    color: #ffffff;
    background: #252525;
    box-shadow: 0 0 0 1px var(--topic-hr);
}


@media (max-width: 1200px) {
    #topic {
        padding: 0;
    }

    #topic-content {
        font-size: 17px;
        width: 90%;
    }

    #topic-content h1 {
        font-size: 1.8rem;
    }

    #topic-content h2 {
        font-size: 1.45rem;
    }
}



@media (max-width: 768px) {
    .section-head {
        padding: 0 25px;
    }

    .back-btn {
        font-size: 16px;
    }

    .share-icon span {
        display: none;
    }

    #topic {
        padding: 0;
    }

    .topic-content-general {
        padding: 50px 12px 50px 12px;
    }

    #topic-content h1.topic-title {
        margin-bottom: 20px;
        font-size: 30px;
        padding-left: 0;
    }

    .topic-block {
        padding: 0;
    }

    .topic-block__content {
        padding: 5px;
    }

    .topic-block--sub .topic-block__content {
        margin-left: 12px;
    }
}

@media (max-width: 430px) {
    #topic-content {
        width: 95%;
    }
}




.gate-wrap {
    position: relative;
}

.gate-body {
    position: relative;
    overflow: hidden;
}

.gate-fade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 300px;
    pointer-events: none;
    background: linear-gradient(to bottom, #14141400 0%, #141414d1 45%, #141414f7 65%, var(--bg) 100%);
}

.gate-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 28px;
    display: flex;
    justify-content: center;
    padding: 0 16px;
}

.gate-card {
    width: min(560px, 100%);
    background: #2a2a2a;
    border: 1px solid #55555540;
    border-radius: 16px;
    padding: 16px;
    backdrop-filter: blur(8px);
}

.gate-title {
    font-size: 16px;
    line-height: 1.35;
    margin-bottom: 12px;
    color: var(--text);
    text-align: center;
}

.gate-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.gate-btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-radius: 999px;
    cursor: pointer;
    padding: 5px 16px;
}

.gate-btn--primary {
    background: #ffffff;
    color: #000000;
    font-size: 14px;
    font-weight: 500;
    border-radius: 35px;
    cursor: pointer;
    white-space: nowrap;
    padding: 5px 16px;
}

.gate-btn--primary:hover {
    background: #575757;
    color: #ffffff;
}










/* TOPIC TAGS*/
.topic-tags {
    margin-top: 24px;
    margin-bottom: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--topic-hr);
    margin-right: 20px;
}

.topic-tags-left {
    padding-left: 18px;
    padding-right: 18px;
}

.topic-tags__title {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.topic-tags__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    appearance: none;
    border: 0;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    background: #252525;
    color: inherit;
    transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
}

body.dark-theme .tag-chip {
    background: rgba(49, 49, 49, 1);
}

.tag-chip:hover {
    transform: translateY(-1px);
    background: rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

body.dark-theme .tag-chip:hover {
    background: rgba(255, 255, 255, 0.12);
}



.topic-scrolltop {
    position: fixed;
    z-index: 3000;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 8px;
    border-radius: 999px;
    border: 1px solid #ffffff42;

    background: var(--topic-buttons);
    color: var(--text);

    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);

    cursor: pointer;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.25);
}

.topic-scrolltop-icon {
    fill: var(--text);
    transform: rotate(180deg);
    transform-origin: center;
    height: 20px;
    width: 20px;
}










/* ───────── FOR YOU ───────── */
#section-for-you {
    margin-bottom: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin-top: 50px;
}

@media (max-width: 768px) {
    #section-for-you {
        margin-top: 0;
    }
}

.for-you-head {
    padding: 0 80px;
    width: 1200px;
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 70px;
}

.h1-fyh-container {
    height: 36px;
    display: flex;
    align-items: flex-end;
}

.for-you-head h1 {
    font-size: 50px;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

.for-you-controls {
    display: flex;
    gap: 12px;
}

/* кнопки */
.filter-btn {
    height: 32px;
    padding: 0 14px;
    border-radius: 40px;
    background: #1e1e1e;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background .2s, opacity .2s;
    font-weight: 400;
    line-height: 1;
    font-size: 14px;
}

.filter-btn.active {
    background: var(--buttons);
}

.filter-btn.theme {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.filter-btn.theme .chev {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: var(--text);
    transition: transform .2s ease;
}

/* если селект открыт — повернуть стрелку вверх */
.filter-select.open .filter-btn.theme .chev {
    transform: rotate(180deg);
}



/* селект */
.filter-select {
    position: relative;
    font-weight: 200;
}

.filter-dropdown {
    position: absolute;
    top: 42px;
    right: 0;
    min-width: 185px;
    background: #1c1c1c;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px;
    display: none;
    z-index: 10;
}

.filter-dropdown button {
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: none;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 300;
}

.filter-dropdown button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.filter-select.open .filter-dropdown {
    display: block;
}

/* строка с карточками */
.for-you-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 380px;
    gap: 30px;
}

.for-you-row .foryou-card.big {
    grid-column: 1 / span 2;
    grid-row: 1 / span 2;
    border-radius: 24px;
}

.for-you-row.reverse .foryou-card.big {
    grid-column: 3 / span 2;
}

/* базовая карточка */
.foryou-card {
    position: relative;
    background: var(--card-back);
    border-radius: 18px;
    padding: 0;
    /* обложка будет от края до края */
    display: block;
    /* flex больше не нужен */
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .25) inset;
    transition: transform .2s ease, background .2s ease;
}

.foryou-card.big {
    padding: 0;
}

/* обложка на всю карточку */
.foryou-card .cover {
    position: absolute;
    inset: 0;
    /* top:0; right:0; bottom:0; left:0 */
    border-radius: inherit;
    overflow: hidden;
    background: #0f1117;
    margin-bottom: 0;
}

.cover-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
    z-index: 2;
}

.topic-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

/* затемнение + заголовок */
.foryou-card .cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
}

.foryou-card .cover::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;

    height: 45%;
    z-index: 1;

    background: linear-gradient(to top,
            var(--cover-blur-color, rgba(0, 0, 0, 0.5)) 0%,
            var(--cover-blur-color, rgba(0, 0, 0, 0.5)) 90%,
            rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
}



.foryou-card .title-overlay {
    margin-left: 14px;
    margin-right: 14px;
    margin-bottom: 12px;

    font-size: 22px;
    font-weight: 700;
    color: var(--text-topic);
    line-height: 1.2;

    text-align: left;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


.foryou-card.big .cover .title-overlay {
    font-size: 30px;
    -webkit-line-clamp: 2;
}

.foryou-card .bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;

    display: flex;
    justify-content: space-between;
    align-items: center;

    margin: 0;
    padding: 8px 15px;

    background: rgba(0, 0, 0, 0.45);
    /* полупрозрачная подложка */
    backdrop-filter: blur(8px);
    /* лёгкий блюр фона под ней */
    -webkit-backdrop-filter: blur(8px);

    z-index: 3;
    height: var(--bottom-h);
}

.foryou-card.big .bottom {
    padding: 8px 14px;
}

.bottom-spacer {
    height: var(--bottom-h);
}

.foryou-card .info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.foryou-card .info img.logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.foryou-card .info .meta {
    display: flex;
    flex-direction: column;
}

.foryou-card .info .meta .name {
    font-weight: 600;
    text-align: left;
}

.foryou-card .info .meta .author {
    font-size: 13px;
    color: var(--muted);
    text-align: left;
}

.foryou-card .read-btn {
    all: unset;
    cursor: pointer;
    background: var(--buttons);
    color: white;
    font-weight: 500;
    border-radius: 20px;
    padding: 10px 14px;
    transition: background .2s ease;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex: 0 0 auto;
}


.foryou-card .read-btn:hover {
    background: #4ca3ff;
}

@media (max-width: 900px) {
    .for-you-row {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 220px;
        /* подстрой при желании */
    }

    .for-you-row .foryou-card.big,
    .for-you-row.reverse .foryou-card.big {
        grid-column: 1 / span 2;
        grid-row: 1 / span 1;
        /* можно оставить span 2, если нужна двойная высота */
    }
}

.for-you-controls--mobile {
    display: none;
}

@media (max-width: 768px) {
    .for-you-head {
        width: 100%;
        gap: 0;
        padding: 0 20px;
    }

    .for-you-head .h1-fyh-container {
        display: none;
    }

    .for-you-controls--desktop {
        display: none;
    }

    .for-you-controls--mobile {
        display: flex;
        gap: 10px;

        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;

        padding: 0 16px;

        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scroll-padding-left: 16px;
    }

    .for-you-controls--mobile::-webkit-scrollbar {
        display: none;
        /* прячем скроллбар */
    }

    .for-you-controls--mobile button {
        flex: 0 0 auto;
        /* ❗ не сжиматься */
        scroll-snap-align: start;
    }
}




/* =========================
   FOR YOU — new rows layout
   ========================= */

.for-you-stack {
    display: flex;
    flex-direction: column;
    gap: 26px;
    margin-top: 30px;
    padding: 0 80px;
    width: 1200px;
}

/* HERO row (row #1) */
.for-you-hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 26px;
    align-items: stretch;
    cursor: pointer;
}

.for-you-hero.reverse {
    direction: rtl;
}

.for-you-hero.reverse>* {
    direction: ltr;
}

.hero-left,
.hero-right {
    border-radius: 24px;
    overflow: hidden;
}

/* left column: title + intro */
.hero-left {
    padding: 22px 22px 18px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hero-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.175;
    color: var(--topics-headers);
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-intro {
    font-size: 16px;
    line-height: 1.6rem;
    color: var(--muted-text-description);
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-cover {
    height: 15vw;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.hero-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1);
    transition: transform 0.45s ease;
    border-radius: 24px;
}

.for-you-hero:hover .hero-title {
    color: var(--white);
}

.for-you-hero:hover .hero-cover img {
    transform: scale(1.05);
}

.hero-author {
    display: none
        /*;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;*/
}

.hero-author .hero-author-name {
    font-weight: 600;
    color: var(--text-topic);
    font-size: 14px;
}

.hero-author .hero-author-sub {
    color: var(--muted);
    font-size: 12px;
}

/* GRID rows (row #2/#3): 3 cards */
.for-you-grid3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.for-you-grid3.reverse {
    direction: rtl;
}

.for-you-grid3.reverse>* {
    direction: ltr;
}

/* card style: top image, bottom intro */
.foryou-card.v2 {
    border-radius: 22px;
    overflow: hidden;
    background: var(--card-back);
    cursor: pointer;
    transition: transform .2s ease;
    display: flex;
    flex-direction: column;
    min-height: 360px;
}

.foryou-card.v2 .v2-cover {
    height: 13vw;
    background: #0f1117;
    position: relative;
}

.carousel-track .foryou-card:hover {
    transform: translateY(-3px);
}

.library-grid .lib-card:hover {
    transform: translateY(-3px);
}

#search-results .lib-card:hover {
    transform: translateY(-3px);
}

.foryou-card.v2 .v2-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1);
    transition: transform 0.45s ease;
}

.foryou-card.v2:hover .v2-cover img {
    transform: scale(1.04);
}

.foryou-card.v2 .v2-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;

}

.foryou-card.v2 .v2-title {
    font-weight: 600;
    color: var(--topics-headers);
    font-size: 24px;
    line-height: 1.175;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.foryou-card.v2 .v2-intro {
    color: var(--card-text-foryou);
    font-size: 14px;
    line-height: 1.45rem;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.foryou-card.v2:hover .v2-title {
    color: var(--white);
}

.for-you-divider {
    border: none;
    height: 1px;
    margin: 15px 0;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
}

@media (max-width: 1024px) {
    .for-you-stack {
        padding: 0;
    }

    .for-you-head {
        padding: 0;
    }

    .hero-cover {
        height: 18vw;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-intro {
        font-size: 14px;
    }

    .foryou-card.v2 .v2-title {
        font-size: 22px;
    }

    .foryou-card.v2 .v2-intro {
        font-size: 14px;
    }
}


/* mobile */
@media (max-width: 768px) {
    .for-you-divider {
        margin: 28px 0;
    }

    .for-you-stack {
        padding: 0 25px;
    }

    .for-you-hero {
        grid-template-columns: 1fr;
    }

    .hero-cover {
        height: 240px;
    }

    .for-you-grid3 {
        grid-template-columns: 1fr;
    }

    .foryou-card.v2 {
        min-height: 0;
    }

    .foryou-card.v2 .v2-cover {
        height: 200px;
    }
}



/* =========================
   FOR YOU — mobile stacked
   ========================= */
@media (max-width: 768px) {
    #forYouStack {
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 0 20px;
        width: 100%;
        margin-top: 20px;
    }

    .for-you-row {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .for-you-row.reverse {
        flex-direction: column;
    }

    .foryou-card,
    .foryou-card.big {
        width: 100%;
        max-width: 100%;
        flex: 0 0 auto;
        border-radius: 18px;
    }

    .foryou-card .cover {
        height: 100%;
    }

    .foryou-card .topic-cover-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .foryou-card .bottom {
        padding: 10px 12px;
    }

    .foryou-card .bottom,
    .foryou-card.big .bottom {
        padding: 10px 16px;
        height: auto;
    }

    .avatar-wrapper {
        width: 32px;
        height: 32px;
    }

    .foryou-card .info .meta .name {
        font-size: 12px;
        font-weight: 500;
    }


    .foryou-card .info .meta .author {
        font-size: 10px;
        font-weight: 500;
    }

    .foryou-card .read-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
}













/* ───────── TOPICS AND WORK ───────── */
#section-topics .welcome {
    min-height: calc(90vh - var(--topbar-h) + 50px);
    display: grid;
    align-content: center;
    justify-items: center;
    position: relative;
    background: transparent;
    z-index: 2;
    margin-bottom: 0 !important;

    width: 55vw;
}

/*#section-topics .welcome::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;

    width: 100vw;
    height: var(--topics-transition);

    margin-left: -50vw;
    transform: none;

    background: linear-gradient(to bottom,
            var(--bg) 0%,
            var(--carousel-bg) 100%);

    pointer-events: none;
    z-index: -1;
}*/



#section-topics .welcome .search,
#section-work .welcome .search {
    /* как у search-section: стеклянная пилюля с рамкой */
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 30px;
    padding: 10px 12px;
    gap: 8px;
    background: var(--chat-input-bg);
    display: flex;
    align-items: center;
}

/* левая иконка — делаем её «лупой» и приглушённой */
#section-topics .welcome .search .i.plus,
#section-work .welcome .search .i.plus {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: inline-block;
    opacity: .6;
    /* прячем плюс и ставим картинку лупы */
    font-size: 0;
    line-height: 0;
    background: center / contain no-repeat url("../Imgs/SearchICON.png");
    border: 0;
}

.welcome-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    /* расстояние между заголовками и search */
    width: 100%;
}

/* вместо height: 100% и центрирования по вертикали */
.welcome-headers {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    /* содержимое прижато к НИЗУ блока */

    height: 100px;
    /* фиксированная «зона заголовков» */
    overflow: hidden;
    /* на всякий случай */
}

#welcomeTitle {
    margin: 0 0 12px 0;
    transition: transform .25s ease;
}

/* предупреждение остаётся обычным потоком, БЕЗ absolute */
#private-theme-warn {
    display: none;
    /* JS уже включает/выключает */
    color: var(--muted);
    font-size: 16px;
    font-weight: 400;
    width: 70%;
    text-align: center;
    margin: 0;
    line-height: 1.3;
    margin: 0 0 6px
}



.search {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-row {
    width: 100%;
}

.search-row textarea {
    width: 100%;
    min-height: 48px;
    max-height: 180px;
    padding: 10px 14px;
    font-size: 16px;
    resize: none;
    border-radius: 14px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-weight: 400;

    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(80, 80, 80, 0.6) transparent;
}


.search-row textarea:focus {
    border: 0 !important;
    outline: none !important;
    box-shadow: none
}

.search-row textarea::-webkit-scrollbar {
    width: 6px;
}

.search-row textarea::-webkit-scrollbar-track {
    background: transparent;
}

.search-row textarea::-webkit-scrollbar-thumb {
    background: rgba(80, 80, 80, 0.6);
    border-radius: 999px;
}


.search-row #input::placeholder {
    font-weight: 400 !important;
    opacity: 1 !important;
}

.search-row #input::-webkit-input-placeholder {
    font-weight: 400 !important;
    opacity: 1 !important;
}

.search-row #input::-moz-placeholder {
    font-weight: 400 !important;
    opacity: 1 !important;
}

.search-row #input:-ms-input-placeholder {
    font-weight: 400 !important;
}

.search-row #input::-ms-input-placeholder {
    font-weight: 400 !important;
}

/* Нижняя панель */
.search-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 2px 8px;
}

.search-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-icon,
.tool-icon-code {
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.tool-caret,
.tool-caret-code {
    display: none;
    border-radius: 40px;
    background: rgb(from var(--light-blue) r g b / 0.5);
    padding: 2px;
}

.tool-caret svg,
.tool-caret-code svg {
    padding: 2px;
}

.tool-icon,
.tool-icon-code {
    margin-right: 3px;
}

/* Tool selector */
.tool-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    border: 0;
    border-radius: 40px;
    cursor: pointer;
    user-select: none;
    color: var(--light-blue);
    fill: var(--light-blue);
    stroke: var(--light-blue);
    font-size: 14px;
    font-weight: 400;
}

.tool-selector:hover {
    background: rgb(from var(--light-blue) r g b / 0.1);
}

.tool-selector.tool-label {
    line-height: 0;
}

.tool-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 8px;
    width: max-content;
    z-index: 30;
    color: var(--text);
    fill: var(--text);
}

.tool-menu .tool-option {
    padding: 10px;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 15px;

    display: flex;
    gap: 8px;
    align-items: center;
}

.tool-menu .tool-option svg {
    fill: var(--text);
}

.code-option svg {
    fill: none !important;
}


.tool-menu .tool-option:hover {
    background: rgba(255, 255, 255, 0.12);
}


.tool-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: left;
    gap: 2px;
}

.tool-title {
    font-size: 14px;
    font-weight: 500;
}

.tool-desc {
    font-size: 12px;
    color: #8b8b8b;
}


/* Приватная кнопка */
.privacy-btn {
    border: none;
    background: transparent;
    border-radius: 40px;
    padding: 8px;
    cursor: pointer;

    display: flex;
    justify-content: center;
    align-items: center;
}

.privacy-btn:hover {
    background: var(--menu-input-bg);
    border-radius: 40px;
}

.privacy-icon {
    color: var(--text);

    display: flex;
    justify-content: center;
    align-items: center;
}

/* когда режим включён — показываем галочку */
.privacy-btn.active .checkmark {
    opacity: 1;
}

/* можно сделать плавное появление */
.privacy-btn .checkmark {
    transition: opacity 0.2s ease;
}



/* SUGGESTION */
.search-row-wrapper {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    /* управляем сами */
    position: relative;
    width: 100%;
}

/* "балансировочная" колонка слева */
.search-row-wrapper::before {
    content: "";
    flex: 0 0 auto;
    width: 41px;
    margin-right: 16px;
}

.search {
    flex: 1 1 auto;
    max-width: 700px;
}

/* кнопка справа */
.privacy-btn {
    flex: 0 0 auto;
    width: 41px;
    margin-left: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

@media (min-width: 768px) {

    .guest-desktop .privacy-btn,
    .guest-desktop .search-row-wrapper::before {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .tool-menu {
        bottom: calc(55% + 20px);
        top: auto;
    }

}





#topicSuggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);

    border-radius: 12px;
    backdrop-filter: blur(12px);
    max-height: 220px;
    overflow-y: auto;
    width: 75%;
    padding: 5px 20px;
    z-index: 20;
    margin-top: 20px;
}


.topic-suggestion-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    text-align: left;
}

.topic-suggestion-text {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-suggestion-arrow {
    flex: 0 0 auto;
    opacity: 0.6;
}

.topic-suggestion-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    opacity: 1;
}

.topic-suggestion-arrow {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    opacity: 0.6;
}

.topic-suggestion-row:hover .topic-suggestion-arrow {
    opacity: 1;
}

.arrow-icon {
    width: 14px;
    height: 14px;
    stroke: var(--text);
}

.topic-suggestion-separator {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 0;
    width: 100%;
}

.highlight {
    color: var(--muted);
}

@media (max-width: 768px) {

    .welcome-headers #topicSuggestions {
        position: fixed;
        transform: none;
        left: auto;
        top: auto;
        width: 100%;
        margin-top: 16px;
    }

}





#section-topics .welcome .search textarea.input.at-max {
    overflow-y: auto;
}




/* плейсхолдер как у поиска */
#section-topics .welcome .search textarea::placeholder,
#section-work .welcome .search textarea::placeholder {
    color: var(--muted);
    font-weight: 500;
    opacity: .9;
}

/* кнопка отправки — прозрачная иконка справа, как #search-btn */
#section-topics .welcome .search #send,
#section-work .welcome .search #send {
    all: unset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .6;
    transition: opacity .2s ease;

    background: #ffffff;
    color: var(--chat-input-bg);
    width: 15px;
    border-radius: 40px;
    padding: 10px;

    pointer-events: none;
}

#section-topics .welcome .search #send img,
#section-work .welcome .search #send img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

#section-topics .welcome .search #send.active,
#section-work .welcome .search #send.active {
    opacity: 1;
    pointer-events: auto;
}

#section-topics,
#section-work {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    min-height: 70vh;
    width: 100vw;
    position: relative;
    --peek: 64px;
}


/* Центрируем именно h1 + поле */
.welcome-hero {
    display: grid;
    gap: 18px;
    justify-items: center;
    width: 100%;
    transform: translateY(-2vw);
}

/* Статус/чат — фиксируем, чтобы центрирование welcome-hero не сдвигалось */
#section-topics .status,
#section-topics #chat,
#section-work .status,
#section-work #chat {
    place-self: center;
    display: flex;
    /*CHAT CHAT CHAT CHAT CHAT CHAT CHAT CHAT CHAT*/
}

#section-topics #chat {
    margin-bottom: 120px;
}

/* Карусели: находятся сразу под welcome, но слегка "заезжают" вверх */
.carousels-slab {
    position: relative;
    margin-top: calc(-1 * var(--peek));
    padding-top: var(--peek);
    z-index: 0;
}

/* если хочешь немного тени на "пикинге" для выразительности */
/*.carousels-slab::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--peek);
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .18), transparent 70%);
}*/





/* === Переход цвета за 100px до начала второго блока === */
#section-topics .welcome.loading::after {
    opacity: 0;
}

#section-topics .carousels-slab {
    background: var(--carousel-bg);
    position: relative;
    z-index: 1;
    margin-top: 0;
    /* если был зазор — убираем */
    padding-top: var(--peek);
    /* «подглядывание» оставляем */
}

.carousels-slab {
    width: 100%;
}







/* Блок приветствия и поле ввода */
.welcome h1 {
    font-size: 28px;
    font-weight: 400;
    opacity: .95;
    margin: 0 0 18px;
}

.search .pill {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pill .icon-btn {
    width: 30px;
    height: 30px;
}

/* Контейнер поиска теперь колонкой: сверху строка ввода, снизу настройки */
#section-topics .welcome .search,
#section-work .welcome .search {
    border: 0;
    border-radius: 25px;
    padding: 10px 12px;
    background: var(--card-back);
    ;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 90%;
    align-items: center;
    box-shadow: 0 0 0 1px var(--localnav-outline);
}

/* Внутренняя строка: иконка + textarea + кнопка отправки */
#section-topics .welcome .search .search-inner,
#section-work .welcome .search .search-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Остальные стили .i.plus, textarea, #send — можно оставить как есть */


/* Контейнер переключателя приватности */
.privacy-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 4px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted);
}

/* Опции (радиокнопки) слева */
.privacy-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    color: var(--muted);
}

/* Скрываем дефолтный кружочек радио, делаем свой */
.privacy-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    display: inline-block;
    position: relative;
}

.privacy-option input[type="radio"]:checked {
    border-color: rgba(255, 255, 255, 0.9);
}

.privacy-option input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: inherit;
    background: #fff;
}

/* Подсветка выбранной опции */
.privacy-option input[type="radio"]:checked+span {
    color: var(--text);
}

.privacy-option:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* Маленькая подпись справа */
.privacy-hint {
    flex: 1;
    text-align: right;
    opacity: 0.75;
    font-size: 11px;
    line-height: 1.3;
}

/* На узких экранах переводим всё в две строки */
@media (max-width: 768px) {
    .empty-state {
        margin-top: 15px;
    }

    #welcomeTitle {
        font-size: 22px;
        line-height: 1.2;
        margin: 0;
    }

    #section-topics .welcome .search {
        width: 100%;
    }

    .search-row-wrapper {
        flex-direction: column;
        align-items: center;
        margin-top: 10px;
    }

    .tool-selector {
        padding: 6px;
        font-size: 14px;
    }

    .tool-icon,
    .tool-icon-code {
        width: 14px;
        height: 14px;
    }

    .tool-caret,
    .tool-icon-code {
        width: 17px;
        height: 17px;
    }

    #section-topics .welcome .search #send {
        padding: 8px;
    }

    #section-topics .welcome .search #send svg {
        width: 14px;
        height: 14px;
    }

    .privacy-btn {
        transform: none !important;
        margin-left: 0;
    }

    .privacy-btn svg {
        width: 22px;
    }

    .privacy-toggle {
        flex-direction: column;
        align-items: flex-start;
    }

    .privacy-hint {
        text-align: left;
        width: 100%;
    }

    .guest-desktop .privacy-btn,
    .guest-desktop .search-row-wrapper::before {
        display: none !important;
    }
}

@media (max-width: 768px) {

    /* секция занимает экран */
    #section-topics,
    #section-work {
        height: 80vh;
    }

    /* welcome растягиваем по высоте и даём позиционирование */
    #section-topics .welcome,
    #section-work .welcome {
        width: 100vw;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    /* убираем сдвиг, который ломает позиционирование */
    .welcome-hero {
        transform: none !important;
        width: 100%;
        flex: 1 1 auto;

        /* делаем раскладку: заголовки по центру, search у низа */
        display: flex;
        flex-direction: column;
    }

    /* заголовки — по центру экрана */
    .welcome-headers {
        height: auto;
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* центр по вертикали */
        align-items: center;
    }

    /* search (вся обвязка) — вниз */
    .search-row-wrapper {
        margin-top: auto;
        padding-bottom: env(safe-area-inset-bottom);
        /* на iPhone чтобы не пряталось */
        width: 100%;
    }

    /* сама "пилюля" */
    #section-topics .welcome .search,
    #section-work .welcome .search {
        width: 100%;
        max-width: 700px;
    }

    /* если чат есть — он не должен расширять центрирование */
    #section-topics #chat,
    #section-work #chat {
        margin-bottom: 0;
    }
}


/* scrollbar */
.chat-list {
    scrollbar-gutter: stable;
}

.chat-list::-webkit-scrollbar {
    width: 10px;
}

.chat-list::-webkit-scrollbar-thumb {
    background: #1b1e29;
    border-radius: 10px;
}

/* Icons */
.i {
    width: 16px;
    height: 16px;
    display: inline-block;
}

.i.more::before {
    content: "⋯";
    font-weight: 700;
}

.i.plus::before {
    content: "＋";
    font-weight: 700;
}

.i.search::before {
    content: "🔍";
}

.i.mic::before {
    content: "🎤";
}

.i.wave::before {
    content: "〰";
    font-weight: 700;
}






/* ───────── Topics Carousels ───────── */
#section-topics-down {
    margin-bottom: 50px;
}

#section-down-topics {
    margin-top: 60px;
    padding-top: 20px;
}

.topics-stack {
    display: grid;
    gap: 50px;
}

/* Ряд: заголовок + строка с лентой и стрелками */
.carousel-row {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding-inline: 0;
}

/* сама лента */
.carousel-wrapper {
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 20px;
}

/* Заголовок выравниваем по «якорю», который ты задаёшь из JS через --row-left */
.carousel-row .carousel-title {
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 8px;
    padding-left: var(--row-left, 0px);
    text-align: left;
}

.carousel-line {
    display: flex;
    flex-direction: column;
    /* <— ВАЖНО: карточки сверху, стрелки снизу */
    gap: 10px;
    width: 100%;
}

/* Вьюпорт остаётся как был */
.carousel-viewport {
    position: relative;
    overflow: visible;
    border-radius: 16px;
    overflow-x: clip;
}

/* Лента карточек */
.carousel-track {
    display: inline-flex;
    gap: 12px;
    padding: 0 20px;
    transform: translateX(var(--shift, 0px));
    will-change: transform;
    transition: transform .45s cubic-bezier(.25, 1, .3, 1);
}

/* Блок стрелок: горизонтально, прижат вправо */
.carousel-controls {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-right: 40px;
    transform: translateY(20px);
    width: 100vw;
}


/* Кнопки-стрелки в кружках */
.carousel-nav {
    width: 700px;
    align-self: center;
    display: flex;
    justify-content: right;
    gap: 15px;
}

/* кнопки */
.carousel-btn {
    all: unset;
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, .12);
}

.carousel-btn:active {
    transform: scale(.95);
}

.carousel-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Иконки внутри кнопок */
.carousel-btn img {
    width: 12px;
    height: 12px;
    display: block;
    filter: brightness(0) invert(1);
}


@media (max-width: 768px) {
    .carousels-slab {
        display: none;
    }

    .carousel-row {
        left: 0;
        right: 0;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }

    .carousel-wrapper {
        overflow: hidden;
        border-radius: 16px;
    }

    .carousel-viewport {
        overflow: hidden;
    }

    .carousel-track {
        padding: 0 14px;
        gap: 12px;
    }

    .topic-card {
        flex: 0 0 calc(100vw - 28px);
        /* 2*14px = 28 */
        max-width: calc(100vw - 28px);
    }

    .carousel-controls {
        padding-right: 14px;
        /* вместо 40 */
        transform: none;
        /* убираем translateY(20px), если мешает */
    }

    /* навигация НЕ 700px, а по ширине экрана */
    .carousel-nav {
        width: 100%;
        max-width: 100%;
        justify-content: flex-end;
        /* стрелки справа */
        padding: 0 14px;
        /* чтобы не липли к краю */
        box-sizing: border-box;
    }
}


[hidden] {
    display: none !important;
}

/* Карточка */
.topic-card {
    flex: 0 0 480px;
    background: var(--card-back-carousels);
    border-radius: 18px;
    padding: 0;
    display: grid;
    gap: 0;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .25) inset;
}

.topic-card .subject {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #f3b07c;
}

.topic-card .subject .dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    border: 1px solid #f3b07c;
    font-size: 12px;
}

.topic-card .title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    margin-top: -2px;
}

.topic-card .cover {
    width: 100%;
    aspect-ratio: 12 / 10;
    border-radius: 14px;
    background: #0f1117;
    overflow: hidden;
    position: relative;
}

.topic-card .cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.topic-card .cover .placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 42px;
    color: #97a0c6;
    opacity: .6;
}

/* Адаптив */
@media (max-width: 1200px) {
    .search-row-wrapper {
        width: 92%;
    }

    .search-tools {
        padding: 0px 8px;
    }

    .topic-card {
        flex-basis: 40vw;
    }

    #section-topics .welcome {
        width: 80vw;
    }
}

@media (max-width: 768px) {
    .topic-card {
        flex-basis: 90vw;
    }

    .carousel-controls {
        margin-right: 4px;
    }

    #section-topics .welcome {
        width: 95%;
        height: 100%;
    }

    #section-topics .welcome::after {
        display: none;
    }
}













/* ───────── LIBRARY grid ───────── */
#section-library {
    display: flex;
    justify-content: center;
    flex-direction: column;
    width: 1500px;
}

.h1-library-container {
    display: flex;
    justify-content: center;
}

.h1-library-container h1 {
    margin: 0;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 50px 80px;
    width: 1500px;
}

/* CARD (две части) */
.lib-card {
    border-radius: 20px;
    overflow: hidden;
    background: var(--card-back);
    border: 1px solid var(--border);
    box-shadow: 0 10px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}

/* ВЕРХ: изображение */
.lib-top {
    position: relative;
    width: 100%;
    aspect-ratio: 16/16;
    /* можно 16/9 */
    background: #0f1117;
}

.lib-top img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
}

/* Оверлей заголовка */
.lib-title-over {
    position: absolute;
    left: 16px;
    bottom: 12px;
    right: 16px;
    color: #fff;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.15;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .55);
    z-index: 3;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* количество строк */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: left;
}

.lib-top::after {
    /* лёгкий градиент снизу для читабельности */
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 42%;
    background: linear-gradient(to top, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0));
    z-index: 2;
}

/* НИЗ: мета + кнопка */
.lib-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    gap: 12px;
}

/* слева: лого + название + автор */
.lib-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 5px 0px;
}

.lib-logo {
    border-radius: 12px;
    background: transparent;
    display: grid;
    place-items: center;
    width: 36px;
}

.lib-logo img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    display: block;
}

.lib-logo.fallback {
    background: #2e90fa;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

/* тексты */
.lib-texts {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lib-name {
    color: #fff;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lib-author {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* кнопка справа */
.lib-read {
    all: unset;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--buttons);
    border: 1px solid rgba(255, 255, 255, .22);
    color: #fff;
    font-weight: 500;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
    transition: transform .12s ease, background .12s ease;
    flex: 0 0 auto;
    text-align: center;
    line-height: 1;
}

.lib-read:active {
    transform: translateY(1px) scale(.98);
}

@media (max-width: 1024px) {
    .library-grid {
        width: 80%;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    #section-library {
        width: 80%;
    }
}

@media (max-width: 768px) {
    .library-grid {
        width: 100%;
        padding: 20px;
    }

    #section-library {
        width: 100%;
    }
}





/* Стили для сообщения, если топиков нет */
.no-topics-message {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    color: #fff;
    font-size: 1.2rem;
    max-width: 600px;
    width: 100%;
    /* Сделать его адаптивным */
    margin: 0 auto;
    /* Центрирование по горизонтали */
}

/* Кнопка-ссылка на вкладку Topics */
.go-to-topics-btn {
    background-color: var(--buttons);
    color: white;
    padding: 12px 20px;
    /* border: none; */
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid #424242;
    font-size: 16px;
}

.go-to-topics-btn:hover {
    background: #242424;
    border: 1px solid #616161;
}









/* SEARCH секция */
#section-search .search-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 16px;
    width: 75vw;
    margin: 0 auto;
    min-height: auto;
    /* убираем принудительную высоту */
    overflow: visible;
}

/* убираем fixed/absolute у контейнера и поля внутри секции */
#section-search .search-wrapper {
    position: static !important;
    inset: auto !important;
    pointer-events: auto;
    z-index: auto;
    width: 100%;
    display: flex;
    justify-content: center;
}

@media (max-width: 768px) {
    #section-search .search-section {
        gap: 10px;
        padding: 10px 0 20px 0px;
        width: 100vw;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #section-search .search-wrapper {
        margin: 0 13%;
        width: 74%;
    }
}

#search-section-search {
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 30px;
    padding: 10px;
    width: 60%;
}

#search-btn {
    all: unset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    padding-left: 8px;
}

#search-btn img {
    width: 20px;
    height: 20px;
}

#section-search #search-results {
    margin: 0 !important;
    width: 100%;
    opacity: 1 !important;
    transition: none !important;
}

.search-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    padding: 50px 20px;
}

.search-section.is-active #search-results {
    /* когда поле наверху — можно уменьшить верхний отступ при желании */
    margin-top: calc(var(--topbar-h) + 120px);
    opacity: 1;
}

/* Поле В СЕКЦИИ поиска (input или textarea) */
#section-search .search-section .search.search-large>input,
#section-search .search-section .search.search-large>textarea {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    background: transparent;
    color: var(--text);
    border: 0;
    outline: 0;
    font-weight: 700;
    /* жирный — как у макета */
    font-size: 18px;
    line-height: 1.3;
    padding: 10px 8px;
}

/* на всякий случай убираем любые «подчёркивания» и тени */
#section-search .search-section .search.search-large>input,
#section-search .search-section .search.search-large>textarea {
    border-bottom: 0 !important;
    box-shadow: none !important;
    background-image: none !important;
    -webkit-appearance: none;
    appearance: none;
}

@media (max-width: 1024px) {

    #section-search .search-section .search.search-large>input,
    #section-search .search-section .search.search-large>textarea {
        padding: 5px 8px;
    }

    .search-result-grid {
        padding: 50px 30px;
    }

    #search-btn img {
        width: 17px;
        height: 17px;
    }
}

@media (max-width: 768px) {

    #section-search .search-section .search.search-large>input,
    #section-search .search-section .search.search-large>textarea {
        padding: 4px;
        font-weight: 500;
    }

    .search-result-grid {
        padding: 20px;
        width: 85% !important;
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    }

    #search-btn img {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 768px) {
    .search-result-grid {
        width: 100% !important;
    }
}






/* LOADING */
#section-topics .welcome:has(.loading-ui) {
    align-content: start;
    /* вместо center */
    padding-top: 40px;
    /* чтобы не липло к верху */
}

.loading-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading-ui {
    margin-top: 18px;
    width: 100%;
}

.stages-card {
    border: 0;
    border-radius: 14px;
    padding: 14px 14px 10px;
    width: 100%;
}

.stages-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, .9);
}

.stages-title {
    font-weight: 400;
    letter-spacing: .2px;
    font-size: 18px;
}

.stages-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, .55);
}

.stages-list {
    position: relative;
}


.stage-row {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .4s ease, transform .4s ease;
    margin-bottom: 8px;
}

/* скрытый этап: чуть выше */
.stage-row.is-hidden {
    opacity: 0;
    transform: translateY(-10px);
    /* было +8px */
    pointer-events: none;
}

.stage-row.is-revealed {
    opacity: 1;
    transform: translateY(0);
}



/* вертикальная линия */
.stage-row::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 16px;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, .15);
}

/* маркер */
.stage-marker {
    width: 14px;
    height: 14px;
    margin-top: 4px;
    position: relative;
    flex-shrink: 0;
}

/* кружок */
.stage-marker::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .25);
}

/* SVG по умолчанию скрыта */
.stage-marker .checkmark {
    position: absolute;
    inset: 0;
    width: 14px;
    height: 14px;
    fill: #ababab;
    opacity: 0;
    transform: scale(.6);
    transition: opacity .3s ease, transform .3s ease;
}

.stage-row.is-active .stage-marker::before {
    background: #fff;
    box-shadow:
        0 0 0 0 rgba(255, 255, 255, .6),
        0 0 0 0 rgba(255, 255, 255, .35);
    animation: stage-pulse 1.4s ease-out infinite;
}

/* анимация пульса */
@keyframes stage-pulse {
    0% {
        box-shadow:
            0 0 0 0 rgba(255, 255, 255, .6),
            0 0 0 0 rgba(255, 255, 255, .35);
    }

    70% {
        box-shadow:
            0 0 0 6px rgba(255, 255, 255, 0),
            0 0 0 12px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow:
            0 0 0 0 rgba(255, 255, 255, 0),
            0 0 0 0 rgba(255, 255, 255, 0);
    }
}


/* DONE — показываем SVG, убираем кружок */
.stage-row.is-done .stage-marker::before {
    background: transparent;
    animation: none;
    box-shadow: none;
}

.stage-row.is-done .stage-marker .checkmark {
    opacity: 1;
    transform: scale(1);
}

/* контент */
.stage-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    margin-left: 20px;
}

.stage-title {
    font-size: 16px;
    margin: 5px 0;
    font-weight: 500;
}

.stage-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, .55);
    line-height: 1.4;

    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    overflow: hidden;

    transition:
        opacity .28s ease,
        transform .28s ease,
        max-height .32s ease;
}

.stage-desc.is-visible {
    opacity: 1;
    transform: translateY(0);
    max-height: 35px;
}


.stage-row.is-done .stage-title {
    color: var(--muted);
}










/* TAKS RENDERING */
.gen-overlay {
    position: fixed;
    top: 4%;
    right: 2%;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--carousel-bg);
    color: #fff;
    /* box-shadow: 0 8px 24px var(--border); */
    max-width: min(360px, 80vw);
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.loading-image-container {
    width: 20vw;
    height: 20vw;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.css-arc-loader {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-sizing: border-box;

    /* “кольцо”, из которого мы делаем дугу */
    border: 3px solid var(--text);
    border-top-color: var(--text);
    border-right-color: var(--text);
    border-bottom-color: transparent;
    border-left-color: transparent;

    animation: arc-spin 0.8s linear infinite;
}

/* анимация вращения дуги */
@keyframes arc-spin {
    to {
        transform: rotate(360deg);
    }
}


.gen-overlay .gen-left {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 28px;
}

.gen-overlay .gen-left img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gen-overlay .gen-content {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.gen-overlay .gen-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.gen-overlay .gen-sub {
    margin-top: 2px;
    font-size: 12px;
    opacity: 0.85;
}

.gen-overlay .gen-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-left: 6px;
    vertical-align: -2px;
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.gen-overlay.clickable {
    cursor: pointer;
}





/* SHARE TOPIC */
.share-popover {
    z-index: 2000;
    display: none;
}

.share-popover.is-open {
    display: block;
}

.share-popover-inner {
    min-width: 220px;
    max-width: 400px;
    padding: 12px 14px;
    border-radius: 12px;
    backdrop-filter: blur(14px);
    background: var(--carousel-bg);
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.share-link-row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.share-link-input {
    flex: 1;
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, .5);
    background: var(--carousel-bg);
    color: inherit;
}

.share-copy-btn {
    white-space: nowrap;
    background-color: var(--topic-buttons);
    border: 0;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    padding: 5px 10px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.share-guests-block {
    margin-top: 10px;
}

.share-guests-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
}

.share-guest-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.share-guest-avatar {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    object-fit: cover;
}

.share-guest-name {
    font-size: 13px;
}

.share-guest-email {
    font-size: 11px;
    opacity: 0.7;
}






/* LAST READ */
.topic-divider {
    position: relative;
    display: flex;
    align-items: center;
}

.topic-divider>hr {
    flex: 1;
}

/* небольшой контейнер справа */
.divider-right {
    position: relative;
    flex: 0 0 auto;
    width: 22px;
    /* контролируешь зону клика */
    height: 22px;
    margin-left: 8px;
}

/* и кнопка, и маркер — по центру этого контейнера */
.bookmark-btn,
.bookmark-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 5px;
    box-sizing: border-box;
}

/* кнопка (по hover), чуть больше, чтобы было удобно кликать */
.bookmark-btn {
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    background: transparent;

    opacity: 0.7;
    pointer-events: none;
    transition: opacity .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    fill: var(--text);
    cursor: pointer;
}

/* показываем кнопку только при наведении на divider */
.topic-divider:hover .bookmark-btn {
    opacity: 1;
    pointer-events: auto;
}

/* маркер-иконка: базово скрыт */
.bookmark-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    pointer-events: none;

    opacity: 0;
    transition: opacity .2s ease;
    fill: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* чтобы svg занимал контейнер */
.bookmark-marker svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* активная метка — показываем иконку */
.topic-divider.has-bookmark .bookmark-marker {
    opacity: 1;
    color.profile-menu-stats: #3b82f6;
}


/* если есть сохранённая метка — кнопку не показываем даже при hover */
.topic-divider.has-bookmark:hover .bookmark-btn {
    opacity: 0;
}







/* SUBSCRIPTION */
.sub-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 32px 28px 40px;
    overflow: auto;
}

.sub-topbar {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    width: 100%;
    justify-content: flex-end;
}

.sub-title {
    font-size: 32px;
    font-weight: 650;
    letter-spacing: .2px;
    text-align: center;
    line-height: 1;
    margin-bottom: 20px;
}

.sub-time {
    font-size: 20px;
    font-weight: 500;
    color: var(--muted);
    text-align: center;
    margin-bottom: 30px;
}

.sub-close {
    justify-self: end;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 0;
    background: var(--bg);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sub-close:hover {
    background: rgba(255, 255, 255, .10);
}

.sub-grid {
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 25px;
}

/* 4 видимые карточки */
.sub-grid:has(> .plan-card:not([hidden]) ~ .plan-card:not([hidden]) ~ .plan-card:not([hidden]) ~ .plan-card:not([hidden])) {
    max-width: 1600px;
}

/* ровно 3 видимые карточки */
.sub-grid:has(> .plan-card:not([hidden]) ~ .plan-card:not([hidden]) ~ .plan-card:not([hidden])):not(:has(> .plan-card:not([hidden]) ~ .plan-card:not([hidden]) ~ .plan-card:not([hidden]) ~ .plan-card:not([hidden]))) {
    max-width: 1200px;
}

/* чтобы hidden реально скрывал */
.plan-card[hidden] {
    display: none;
}


.plan-card {
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    background: rgba(255, 255, 255, .09);
    padding: 22px 22px 18px;
    backdrop-filter: blur(10px);
}

.plan-card--active {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .18);
}

.plan-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.plan-name {
    font-size: 22px;
    font-weight: 700;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.plan-currency {
    opacity: .8;
    font-size: 18px;
}

.plan-amount {
    font-size: 46px;
    font-weight: 750;
    letter-spacing: -.5px;
}

.plan-period {
    opacity: .75;
    font-size: 13px;
    white-space: nowrap;
}

.plan-desc {
    opacity: .9;
    font-size: 16px;
    line-height: 1.35;
    margin-top: 2px;
}

.plan-cta {
    width: 100%;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-weight: 650;
    cursor: pointer;
    margin: 10px 0 20px;
}

.plan-list-limit {
    font-weight: 500;
    opacity: 1;
}

.plan-cta:hover {
    background: rgba(255, 255, 255, .12);
}

.plan-cta--disabled {
    background: rgba(255, 255, 255, .06);
    opacity: .6;
    cursor: not-allowed;
}

.plan-cta:disabled:hover,
.plan-cta:disabled:active,
.plan-cta:disabled:focus {
    background: rgba(255, 255, 255, .06);
    opacity: .6;
}

.plan-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.plan-list li {
    position: relative;
    padding-left: 22px;
    opacity: .8;
    font-size: 16px;
    line-height: 1.35;
}

.plan-list li::before {
    content: "✦";
    position: absolute;
    left: 0;
    top: 0;
    opacity: .9;
}

@media (max-width: 980px) {
    .sub-overlay {
        padding: 22px 16px 28px;
    }

    .sub-grid {
        grid-template-columns: 1fr;
    }

    .plan-amount {
        font-size: 42px;
    }
}





/* Auth */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 9999;
    opacity: 0;
    transition: opacity .15s ease;
}

.auth-modal-overlay.shown {
    opacity: 1;
}

.auth-modal {
    width: min(460px, 90%);
    background: var(--card-back-carousels);
    border-radius: 24px;
    padding: 26px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
    transform: translateY(8px) scale(.98);
    transition: transform .15s ease;
}

.auth-close-block {
    display: flex;
    width: 100%;
    justify-content: flex-end;
}

.auth-modal-overlay.shown .auth-modal {
    transform: translateY(0) scale(1);
}

.auth-modal-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-direction: column;
    text-align: center;
}

.auth-modal-close {
    border: 0;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text);
}

.auth-modal-close:hover {
    background: rgba(0, 0, 0, .06);
}

.auth-modal h2 {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-modal p.sub {
    margin: 10px 0 18px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
}

.auth-modal p.sub a {
    color: var(--text);
}

.auth-stack {
    display: flex;
    gap: 12px;
    justify-content: center;
}

#googleBtnWrap {
    width: 100%;
}

.nsm7Bb-HzV7m-LgbsSe.JGcpL-RbRzK {
    background: var(--card-back);
    border: 0;
    color: var(--text);
    box-shadow: 0 0 0 1px var(--outline-auth-box);
    padding: 25px 16px;
    border-radius: 48px !important;
    font-size: 15px;
}

.auth-divider {
    position: relative;
    margin: 24px 0;
    height: 1px;
    background: var(--muted);
}

.auth-divider span {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-back-carousels);
    padding: 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
}

.auth-field {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 38px;
    padding: 12px 12px;
    background: var(--card-back);
    box-shadow: 0 0 0 1px var(--outline-auth-box);
}

.auth-field .auth-icon {
    color: #666;
    font-size: 14px;
    min-width: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-field input {
    border: 0;
    outline: 0;
    font-size: 16px;
    width: 100%;
    background: transparent;
    color: var(--text);
    padding: 4px 8px;
}

.auth-err {
    margin-top: 8px;
    padding: 0 12px;
    border-radius: 12px;
    background: var(--card-back-carousels);
    border: 0;
    color: #b00020;
    font-size: 13px;
}

.auth-submit {
    margin-top: 24px;
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    background: var(--wh-buttons);
    color: var(--carousel-bg);
}

.auth-submit:disabled {
    opacity: .6;
    cursor: default;
}

.auth-switch {
    margin-top: 12px;
    font-size: 13px;
    color: #444;
    text-align: center;
}

.auth-switch a {
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
}

.auth-foot {
    margin-top: 16px;
    font-size: 12px;
    color: #777;
    text-align: center;
}

.auth-foot a {
    color: inherit;
}

.topbar-auth-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}






/* PLAN LIMIT BANNER */
.plan-limit-host {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 30px;
    z-index: 20000;

    display: flex;
    justify-content: center;
    pointer-events: none;
    /* чтобы клики проходили мимо, кроме баннера */
}

.plan-limit-banner {
    width: 60%;
    max-width: 720px;
    min-width: 420px;
    pointer-events: auto;
    background: #2a2a2a;
    border: 1px solid #55555540;
    border-radius: 20px;
    box-shadow: 0 5px 12px rgba(0, 0, 0, .75);
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    transform: translateY(120%);
    opacity: 0;
    transition: transform .3s ease, opacity .3s ease;
}

.plan-limit-host.is-open .plan-limit-banner {
    transform: translateY(0);
    opacity: 1;
}

.plan-limit-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.plan-limit-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}

.plan-limit-subtitle {
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

.plan-limit-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.plan-limit-btn {
    border: 0;
    background: #ffffff;
    color: #000000;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 35px;
    cursor: pointer;
    white-space: nowrap;
}

.plan-limit-btn:hover {
    background: #575757;
    color: #ffffff;
}

.plan-limit-close {
    border: 0;
    background: transparent;
    color: #ffffff;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.plan-limit-close:hover {
    background: rgba(255, 255, 255, .10);
}

@media (max-width: 900px) {
    .plan-limit-banner {
        width: calc(100% - 32px);
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .plan-limit-banner {
        align-items: flex-start;
    }

    .plan-limit-right {
        flex-direction: column;
        align-items: stretch;
    }

    .plan-limit-close {
        align-self: flex-end;
    }
}







/* SERVER ERROR BLOCK */
.load-limit-host {
    position: fixed;
    left: 0;
    right: 0;
    top: 18px;
    /* сверху */
    z-index: 2000;

    display: flex;
    justify-content: center;
    pointer-events: none;
}

.load-limit-banner {
    width: 60%;
    max-width: 720px;
    min-width: 420px;
    pointer-events: auto;

    background: #2a2a2a;
    border: 1px solid #55555540;
    border-radius: 20px;
    box-shadow: 0 5px 12px rgba(0, 0, 0, .75);
    padding: 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    transform: translateY(-120%);
    /* старт: выше экрана */
    opacity: 0;
    transition: transform .3s ease, opacity .3s ease;
}

.load-limit-host.is-open .load-limit-banner {
    transform: translateY(0);
    opacity: 1;
}

.load-limit-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.load-limit-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}

.load-limit-subtitle {
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

.load-limit-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.load-limit-close {
    border: 0;
    background: transparent;
    color: #ffffff;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.load-limit-close:hover {
    background: rgba(255, 255, 255, .10);
}

@media (max-width: 900px) {
    .load-limit-banner {
        width: calc(100% - 32px);
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .load-limit-banner {
        align-items: flex-start;
    }

    .load-limit-right {
        align-items: stretch;
    }

    .load-limit-close {
        align-self: flex-end;
    }
}







/* CONFIRMATION */
.confirm-overlay[hidden] {
    display: none;
}

.confirm-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(1px);
}

.confirm-modal {
    position: relative;
    width: max-content;
    margin: 0 auto;
    background: var(--menu-back-bg);
    border: 1px solid #55555540;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
    color: #fff;
    overflow: hidden;
    text-align: center;
    padding: 2px 10px;
}

.confirm-body {
    padding: 22px;
    font-size: 14px;
    padding-bottom: 14px;
}

.confirm-question {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 18px;
}

.confirm-warn {
    margin-bottom: 4px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 5px 14px 16px;
}

.confirm-btn {
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: #232323;
}

.confirm-btn.primary {
    background: var(--text);
    color: var(--menu-back-bg);
}


.confirm-dont-show {
    margin-top: 20px;
}

.confirm-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 300;
}

/* Скрываем нативный чекбокс */
.confirm-checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Визуальный квадрат */
.checkbox-box {
    width: 16px;
    height: 16px;
    border: 1px solid #999;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* SVG по умолчанию скрыта */
.checkmark {
    width: 12px;
    height: 12px;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.2s ease;
    fill: white;
}

/* Состояние checked */
.confirm-checkbox input:checked+.checkbox-box {
    background-color: rgb(0, 119, 255);
    border-color: rgb(0, 119, 255);
}

/* Показываем SVG */
.confirm-checkbox input:checked+.checkbox-box .checkmark {
    opacity: 1;
    transform: scale(1);
}









/* 2K */
@media (min-width: 1921px) {
    .for-you-head {
        width: 60%;
    }

    .for-you-stack {
        width: 60%;
    }

    .section-head,
    .topic-content-general {
        width: 75%;
    }
}

/* @media (min-width: 1921px) {
    .for-you-head h1{
        font-size: 60px;
    }

    .for-you-controls{
        gap: 20px;
    }

    .filter-btn{
        height: 40px;
        padding: 0 18px;
        font-size: 18px;
    }

    .hero-title{
        font-size: 38px;
    }

    .hero-intro,
    .foryou-card.v2 .v2-intro{
        font-size: 18px;
    }

    .foryou-card.v2 .v2-title{
        font-size: 28px;
    }

    .badge-viewed{
        font-size: 15px;
    }

    .welcome h1{
        font-size: 32px;
    }
}*/