/* ============================================================================
   MAXLINE — mobile.css
   Мобильные стили. Desktop-first: правила накладываются через max-width.
   Брейкпоинты: 1100 / 900 / 640 / 480
   ============================================================================ */

/* ============================================================================
   CSS-переменные для мобильных
   ============================================================================ */
:root {
    --font-base: 15px;
    --pad:       20px;
    --gap:       20px;
    --sidebar-w: 220px;
    --touch-min: 44px;
}

/* ============================================================================
   4. Планшеты в ландшафте и маленькие ноутбуки (≤1100px)
      3 колонки → 2 колонки, правый сайдбар скрыт
   ============================================================================ */
@media (max-width: 1100px) {
    :root {
        --font-base: 14px;
        --pad:       16px;
        --gap:       16px;
    }

    body { font-size: var(--font-base); }

    /* Основной layout: 2 колонки — левый сайдбар + центр */
    .layout-3col {
        grid-template-columns: var(--sidebar-w) 1fr;
        gap: var(--gap);
        padding: var(--pad) 12px;
        max-width: 100%;
    }

    /* Правый сайдбар (реклама, премиум-блок) — скрыт */
    .col-right { display: none; }

    /* Header */
    .header-main {
        width: 100%;
        max-width: 100%;
        padding: 0;
		gap: 0px;
    }

    /* Уменьшаем панель профиля Premium */
    .premium-plans {
        grid-template-columns: 1fr 1fr;
    }

    /* Модалка подарков — чуть меньше */
    .gift-modal { max-width: 620px; }

    /* Карточки подарков в модалке: 3 → 3 (пока влезает) */
    .gift-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        padding: 16px 18px;
    }
}

/* ============================================================================
   3. Планшеты в портрете и узкие ландшафты (≤900px)
	  3 колонки → 1 колонка, сайдбары уходят вниз / скрываются
   ============================================================================ */
@media (max-width: 900px) {
    :root {
        --font-base: 14px;
        --pad:       14px;
        --gap:       14px;
    }

    /* На /feed и /my скрываем заголовок страницы на мобильных */
    body.is-feed .page-title,
    body.is-my   .page-title {
        display: none;
    }

	.btn-ed {height: 37px !important;}
	.pagination {margin: 20px 0px 6px 0px;}
	.page-link-2 {min-width: 36px; min-height: 36px; font-size: 13px;}
	.btn-sub {height: 28px;}
	.empty-state {font-size: 14px;}
	.categories-page-subtitle {font-size: 13px;}
	.categories-page-title {font-size: 18px;}
	.vhod {max-height: 37px !important;}
	.profile-gift-badge:hover img.gift-icon {transform: none; z-index: 1; position: relative;}
	#profileGifts.is-expanded .profile-gift-badge.gift-hidden {margin: 0;}
	img.gift-icon {width: auto; height: 140px;}
	.profile-stats {margin-top: 1px;}
	
	.editor-video-popup {
        width: calc(100vw - 32px);
        max-width: 340px;
        left: 0;
        right: auto;
    }
	
    .editor-icons-popup {
		grid-template-columns: repeat(5, 26px);
    }
	
	.sub-req-item {
        flex-wrap: wrap;
    }
    .sub-req-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 6px;
    }
    .sub-req-btn {
        flex: 0 1 auto;
        padding: 6px 10px;
        font-size: 12px;
        height: 28px;
    }
	
    .feed-period {
        width: 150px;
        margin-bottom: 12px;
    }
	
	/* На мобильных показываем только 3 подарка (4-й — в спойлере) */
    #profileGifts:not(.is-expanded) .profile-gift-badge:nth-child(n+4) {
        display: none;
    }

    /* Фон — на всю ширину, растягивается */
    .profile-top::before {
        inset: 0;
        background-position: center;
        background-repeat: no-repeat;
    }

    /* Контент поверх баннера — с отступами */
    .profile-top > .profile-avatar,
    .profile-top > .profile-info {
        position: relative;
        z-index: 2;
        padding: 0;
    }
	
	/* Аватар — слева, не сжимается */
    .profile-top .profile-avatar {
        padding: 3px;
    }

    /* Инфо — справа, по левому краю */
    .profile-top .profile-info {
        flex: 1;
        min-width: 0;
        width: auto;
        text-align: left;
    }

    /* Имя — по левому краю */
    .profile-top .profile-name {
        text-align: left;
        margin: 0;
    }

    /* ID, онлайн, статистика — по левому краю */
    .profile-top .profile-meta-row {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .profile-top .profile-bio {
        text-align: left;
        font-size: 13px;
    }

    .profile-top .profile-stats {
        text-align: left;
        line-height: 1.6;
    }
	
	.categories-page-head-icon {
		width: 48px;
		height: 48px;
		font-size: 20px;
	}
	
	.categories-page-head {
		text-align: center;
		margin-top: 10px;
		margin-bottom: 15px;
	}

	.exclusive-gifts-head {
		text-align: center;
		margin-top: 10px;
		margin-bottom: 15px;
	}
	
	.exclusive-gifts-head-icon {
		width: 48px;
		height: 48px;
		font-size: 20px;
	}

	.dialog-thread {
		flex: 1;
		min-height: 0;
		padding: 20px 20px 14px;
		overflow-y: auto;
		display: flex;
		flex-direction: column;
		gap: 12px;
		scrollbar-width: thin;
		scrollbar-color: #cbd5e1 transparent;
	}

    .dialog-item {
		border-bottom: 0px solid #e5e7eb;
    }
	
	.dialog-item:hover {
		border-bottom: 0px solid #e5e7eb;
    }

    /* Панель реакций: на мобильных — 5 в ряд */
    .reactions-panel {
        max-width: 100%;
    }

    .reactions-panel-list {
        display: grid;
        grid-template-columns: repeat(5, 30px);
        gap: 4px;
        justify-content: start;
    }

    .reactions-panel-premium {
        padding-top: 4px;
    }

    /* Дропдаун меню пользователя — прокрутка */
    .user-menu-dropdown {
        max-height: calc(100vh - var(--header-h) - 100px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    body { font-size: var(--font-base); }

    /* На мобильных сайдбар показываем только на главной, /feed, /my */
    body:not(.is-home):not(.is-feed):not(.is-my) .col-left {
        display: none !important;
    }

    .post-card .js-report,
    .comment .js-report {
        display: none !important;
    }

    /* ============================================================
       На главной (мобильные) скрываем категории и статические ссылки
       ============================================================ */
    body.is-home #categoriesBlock,
    body.is-home .side-line,
    body.is-home .side-block:not(#categoriesBlock),
    body.is-feed #categoriesBlock,
    body.is-feed .side-line,
    body.is-feed .side-block:not(#categoriesBlock),
    body.is-my   #categoriesBlock,
    body.is-my   .side-line,
    body.is-my   .side-block:not(#categoriesBlock) {
        display: none !important;
    }

    /* ============================================================
       Side-nav на главной, /feed, /my (мобильные) — горизонтальный
       ============================================================ */
    body.is-home .side-nav ul,
    body.is-feed .side-nav ul,
    body.is-my   .side-nav ul {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        margin: 0 0 8px 0;
        padding: 0;
        list-style: none;
    }

    /* Если кнопка одна — прижимаем влево */
    body.is-home .side-nav ul:has(> li:only-child),
    body.is-feed .side-nav ul:has(> li:only-child),
    body.is-my   .side-nav ul:has(> li:only-child) {
        justify-content: flex-start;
    }

    body.is-home .side-nav li,
    body.is-feed .side-nav li,
    body.is-my   .side-nav li {
        margin: 0;
    }

    body.is-home .side-nav a,
    body.is-feed .side-nav a,
    body.is-my   .side-nav a {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin: 0;
        padding: 8px;
        background: #fff;
        border: 1px solid #d6dbe5;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 600;
        color: var(--fg);
        white-space: nowrap;
        height: 40px;
        transition: all 0.5s;
    }

    body.is-home .side-nav a:hover,
    body.is-home .side-nav a:active,
    body.is-feed .side-nav a:hover,
    body.is-feed .side-nav a:active,
    body.is-my   .side-nav a:hover,
    body.is-my   .side-nav a:active {
        background: #f4f7ff;
        border-color: #b9c4ff;
        color: #3a6bff;
    }

    body.is-home .side-nav a.is-active,
    body.is-feed .side-nav a.is-active,
    body.is-my   .side-nav a.is-active {
        background: #3a6bff;
        border-color: #3a6bff;
        color: #fff;
        text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    }

    body.is-home .side-nav a .icon-info-3,
    body.is-feed .side-nav a .icon-info-3,
    body.is-my   .side-nav a .icon-info-3 {
        width: 24px;
        height: 24px;
        border: none;
        background: transparent;
        font-size: 14px;
    }

    body.is-home .side-nav a.is-active .icon-info-3,
    body.is-feed .side-nav a.is-active .icon-info-3,
    body.is-my   .side-nav a.is-active .icon-info-3 {
        color: #fff;
    }

	.is-active-2 {height: 28px;}

    .support-layout {
        grid-template-columns: 1fr;
    }
    .support-list {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .support-list-body {
        max-height: 260px;
    }
    .support-thread {
        max-height: none;
    }

    /* В дропдауне меню показываем мобильные пункты + разделители */
    .user-menu-item-mobile-only {
        display: block;
    }
    .user-menu-item-mobile-only.user-menu-separator {
        display: block;
        height: 1px;
        background: var(--border);
        margin: 6px 0;
    }
    .user-menu-item-mobile-only.user-menu-separator:hover {
        background: var(--border);
    }

    /* Layout: одна колонка */
    .layout-3col {
        grid-template-columns: 1fr;
        padding: var(--pad) 8px;
    }
	
	.exclusive-gifts-title {
		margin: 0 0 6px;
		font-size: 18px;
		font-weight: 700;
		color: var(--fg);
	}
	
	.exclusive-gifts-subtitle {
		margin: 0;
		font-size: 13px;
		color: var(--muted);
	}
	
	.page-title {
		font-size: 17px;
		margin-bottom: 12px;
	}

    /* Левый сайдбар — только на главной (см. body:not(.is-home)) */
    .col-left {
        position: static;
        max-height: none;
        overflow: visible;
        margin-top: 8px;
    }

    /* Центр — первым */
    .col-center { order: 1; }

    /* Правый сайдбар — скрыт */
    .col-right { display: none; }

    /* Header — упрощаем */
    .header-main {padding: 0;}
    .site-header {padding: 0 10px;}

    /* Логотип меньше */
    .site-header .logo { font-size: 16px; letter-spacing: 0.5px; }

    /* Поиск в шапке: на мобиле форма не раскрывается, только лупа → /search */
    .header-search.is-open { max-width: 40px; }
    .header-search.is-open input,
    .header-search.is-open .header-search-submit {
        display: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    .header-search.is-open .header-search-toggle {
        display: inline-flex !important;                /* вернуть лупу */
    }

    /* Меню пользователя: ограничиваем высоту, включаем прокрутку */
    .user-menu-dropdown {
        right: 0;
        min-width: 220px;
        max-height: calc(100vh - var(--header-h) - 20px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #cbd5e1 transparent;
        overscroll-behavior: contain;
    }

    .user-menu-dropdown::-webkit-scrollbar {
        width: 6px;
    }
    .user-menu-dropdown::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 3px;
    }
    .user-menu-dropdown::-webkit-scrollbar-track {
        background: transparent;
    }

    /* Уведомления — прижимаем к правому краю */
    .notif-dropdown {
        right: 0;
        width: calc(100vw - 24px);
        max-width: 340px;
    }

    /* Посты — во всю ширину */
    .post-card { padding: 12px; }
    .post-full { padding: 14px; }

    .profile-actions .btn,
    .profile-actions .btn-user {
        width: auto;
        flex: 1 1 auto;
        min-width: 130px;
        max-width: 180px;
    }

    .profile-actions .icon-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
	
    .profile-gifts {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        justify-content: stretch;
        margin-bottom: 16px;
    }
	
    #profileGifts:not(.is-expanded) .profile-gift-badge.gift-hidden {
        display: none;
    }
	
    .profile-gifts.has-toggle:not(.is-expanded),
    .profile-gifts.is-expanded {
        margin-bottom: 20px;
    }

    /* Кнопка «Показать все / Свернуть» — вплотную к сетке */
    .gifts-more-wrap {
        margin-top: 0px;
    }

    .profile-gift-badge {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        min-width: 0;
        min-height: 150px;
        width: 100%;
		margin: 0;
    }

    .profile-gift-badge-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 160px;
    }

    .profile-gift-badge-name {
        font-size: 11px;
        max-width: 100%;
        margin-top: 4px;
    }

    .profile-gift-badge-price {
        font-size: 11px;
        margin-top: 2px;
    }

    .profile-gift-badge-rarity {
        font-size: 9px;
        padding: 1px 6px;
        margin: 8px 0 0 0;
    }

    .profile-gift-exclusive-mark {
        font-size: 8px;
        padding: 1px 6px;
        top: -6px;
    }

    .messages-layout {
        grid-template-columns: 1fr;
        min-height: auto;
        max-height: none;
    }
    .dialogs-list {
        max-height: 320px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .dialog-content {
        min-height: 400px;
        max-height: none;
        height: auto;
        display: flex;
        flex-direction: column;
    }
    .dialog-thread {
        height: auto;
        max-height: 60vh;
        min-height: 300px;
    }

    /* Донаты / подарки — карточки компактнее */
    .donations-summary {
        grid-template-columns: 1fr 1fr;
    }
    .donation-card,
    .gift-card-row {
        grid-template-columns: 40px 1fr auto;
        column-gap: 10px;
        padding: 10px 12px;
    }
    .gift-card-row-icon { width: 44px; height: 44px; }
    .gift-card-row-icon img.gift-row-icon,
    .gift-card-row-icon span.gift-row-icon {
        width: 44px;
        height: 44px;
        font-size: 26px;
    }

    /* Редактор: тулбар переносится, кнопки крупнее */
    .editor-toolbar { flex-wrap: wrap; }
    .editor-btn { width: 36px; height: 36px; }
    .editor-content { min-height: 260px; font-size: 14px; }

    /* Табы ЛК — горизонтальный скролл */
    .account-tabs {
        overflow-x: auto;
        padding: 8px;
        -webkit-overflow-scrolling: touch;
    }
    .account-tabs ul { flex-wrap: nowrap; }

    /* Подписки */
    .subs-item {
        flex-wrap: wrap;
        gap: 10px;
    }
    .subs-actions {
        width: 100%;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    /* Кошелёк: таблица → горизонтальный скролл */
    .wallet-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    /* Модалки — почти на всю ширину */
    .modal {
        max-width: calc(100vw - 24px);
        margin: 0 auto;
        padding: 16px;
    }
    .gift-modal { max-width: calc(100vw - 20px); }
    .gift-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 14px 16px;
        gap: 8px;
    }
    .gift-icon-big { font-size: 60px; }

    /* Premium-заглушка */
    .premium-locked { padding: 20px 16px; }

    /* Посты в профиле — плашки премиум-статистики */
    .my-post-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px 0;
    }
    .my-post-stat {
        padding: 6px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .my-post-stat:nth-last-child(-n+2) { border-bottom: none; }
    .my-post-stat:nth-child(odd) { border-right: 1px solid var(--border); }

    /* Сайдбар: скрываем «О проекте», оставляем самое важное */
    .sidebar-cta-list { font-size: 12px; }
}

/* ============================================================================
   2. Большие смартфоны и планшеты в портрете (≤640px)
   Одна колонка, увеличенные отступы для пальцев
   ============================================================================ */
@media (max-width: 640px) {
    :root {
        --font-base: 14px;
        --pad:       12px;
        --gap:       12px;
    }
	
	body { font-size: var(--font-base); }

	.btn-sub {height: 28px;}
	.account-tabs {justify-content: center;}
	.exclusive-gifts-head {text-align: center; margin-top: 10px; margin-bottom: 15px;}
	.site-main {min-height: calc(100vh - var(--header-h) - 53px);}
	.my-vote-meta > span {background: transparent; border: 0px solid #e5e7eb; padding: 0;}
	.support-layout {min-height: auto;}
	.support-closed-note {bottom: -14px; height: 37px;}
	.drafts-but {flex-direction: column;}
	.exclusive-gift-card:hover img.exclusive-gift-icon,
	.exclusive-gift-card:active img.exclusive-gift-icon {z-index: 1;}
	.my-votes-limit {height: 28px;}
	.my-votes-limit-2 {height: 37px !important;}
	.exclusive-gifts-head-icon {width: 48px; height: 48px; font-size: 20px;}
	.vhod {max-height: 37px !important;}
	.btn-user {max-height: 37px !important;}
	.bnotif {top: -6px !important;}
	.pagination {margin: 20px 0px 10px 0px;}
    .premium-plans {grid-template-columns: 1fr;}
	.profile-stats {margin-top: 4px;}
	.account-tabs ul {display: grid; gap: 6px;}
	.deposit-item-code {font-size: 12px;}
	.set-otstup-2 {font-size: 12px;}
	.form-act-mar { margin-bottom: 11px; }
	.form-act-mar-2 { margin-bottom: 10px; }
	.lenta {padding: 0px 6px;}
	
	.editor-wrap.is-fullscreen .editor-content {
		margin: 0px auto;
		border: none;
		border-radius: 0px;
		background: transparent;
		box-shadow: none;
	}
	
    .editor-tablebar {
        flex-wrap: wrap;
        padding: 6px;
    }

    .editor-tablebar .editor-btn {
        min-width: 36px;
        height: 30px;
        padding: 0 6px;
        font-size: 11px;
    }

    .editor-tablebar .editor-sep {
        display: none;
    }
	
	.html-edit-modal {
        max-width: calc(100vw - 20px);
    }

    #htmlEditTextarea {
        min-height: 240px;
        font-size: 12px;
    }
	
    .img-zoom-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }
	
	.post-full-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
	
	.avatar-upload-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .avatar-upload-actions .btn,
    .avatar-upload-actions .avatar-upload-btn {
        width: 100%;
        justify-content: center;
    }
	
	.profile-actions {
        gap: 6px;
    }

    .profile-actions .btn.btn-user {
        width: 35px;
        height: 35px;
        min-width: 35px;
        max-width: 35px;
        padding: 0;
        flex: 0 0 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .profile-actions .btn.btn-user .js-profile-action-text {
        display: none;
    }

    .profile-actions .btn.btn-user .js-profile-action-icon {
        display: inline-block;
        font-size: 15px;
        margin: 0;
    }
	
    .bio-modal {
        max-width: calc(100vw - 20px);
        border-radius: 10px;
    }
    .bio-modal-head {
        padding: 14px 14px 12px;
		border-radius: 6px;
		border: 1px solid var(--border);
    }
    .bio-modal-title {
        font-size: 16px;
        padding: 0 40px;
    }
    .bio-modal-body {
        padding: 16px 16px 18px;
        max-height: 75vh;
    }
    .bio-modal-text {
        font-size: 14px;
    }
	
	.sub-req-actions {
        flex-wrap: wrap;
    }
    .sub-req-btn {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: center;
    }
    .sub-req-badge {
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        font-size: 10px;
        margin-left: 4px;
    }
	
    .real-donate-modal {
        max-width: calc(100vw - 20px);
        border-radius: 10px;
    }
    .real-donate-head {
        padding: 14px 14px 12px;
    }
    .real-donate-title {
        font-size: 16px;
        padding: 0 40px;
    }
    .real-donate-body {
        padding: 16px 16px 18px;
    }
    .real-donate-row {
        padding: 10px 12px;
    }
    .real-donate-label {
        font-size: 12px;
    }
    .real-donate-value {
        font-size: 14px;
    }
    .real-donate-card {
        font-size: 12px;
    }
	
    .feed-period {
        width: 100%;
        margin-bottom: 12px;
    }
    .feed-period-toggle {
        padding: 9px 12px;
        font-size: 14px;
    }
    .feed-period-option {
        padding: 10px 12px;
        font-size: 14px;
    }
	
	.subs-modal {
        max-width: calc(100vw - 20px);
        border-radius: 10px;
    }
    .subs-modal-head {
        padding: 14px 14px 12px;
		border-radius: 6px;
		border: 1px solid var(--border);
    }
    .subs-modal-title {
        font-size: 16px;
    }
    .subs-modal-tabs {
        padding: 8px 10px 0;
    }
    .subs-modal-tab {
        padding: 7px 10px 9px;
        font-size: 13px;
    }
    .subs-modal-item {
        padding: 9px 14px;
    }
    .subs-modal-body {
        max-height: 65vh;
    }
	
	.profile-gift-badge-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
	
	.notif-dropdown {
		right: 0;
		width: calc(100vw - 20px);
		top: calc(100% + 9px);
		max-width: 340px;
	}
	
	.categories-page-head {
		text-align: center;
		margin-top: 10px;
		margin-bottom: 15px;
	}
	
    .categories-page-head-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .categories-page-title { font-size: 18px; }
    .categories-page-subtitle { font-size: 13px; }

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .category-card {
        padding: 12px 14px;
        gap: 12px;
    }

    .category-card-icon {
        width: 42px;
        height: 42px;
    }

    .category-card-icon img {
        width: 26px;
        height: 26px;
    }

    .category-card-name { font-size: 14px; }
    .category-card-count { font-size: 11px; }
	
    .modal-overlay {
        align-items: flex-start;
        justify-content: center;
        padding: 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .donate-modal {
        max-width: 100%;
        max-height: none;
        margin: auto;
    }

    .donate-modal .donate-sums {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .donate-modal .donate-sum-btn {
        padding: 8px 2px 6px;
    }

    .donate-modal .donate-sum-value {
        font-size: 14px;
    }

    .donate-modal .donate-sum-cur {
        font-size: 10px;
    }

    .donate-modal .modal-body {
        padding: 14px 14px 0px 14px;
    }

    .donate-actions {
        padding: 14px;
        flex-direction: row;
        gap: 8px;
    }

    .donate-actions .btn {
        flex: 1;
        padding: 11px 12px;
        font-size: 14px;
    }

    .donate-head {
        padding: 18px 16px 14px;
    }

    .donate-head-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .donate-head .modal-title {
        font-size: 18px;
    }

    /* Превью — на всю ширину, пропорции 4:1 */
    .cover-preview {
        width: 100%;
        max-width: 100%;
        height: auto;
        border-radius: 8px;
    }

    .cover-preview-wrap {
        margin-bottom: 12px;
    }

    /* Пресеты — 3 в ряд, крупнее, квадратные */
    .cover-presets-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .cover-preset {
        width: 100%;
        aspect-ratio: 4 / 1;
        border-width: 2px;
    }

    .cover-presets {
        margin-bottom: 14px;
    }

    .cover-presets-label {
        display: block;
        font-size: 13px;
        margin-bottom: 8px;
    }

    /* Кнопки — в столбик, каждая на всю ширину */
    .cover-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .cover-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .cover-actions label.btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Отступы и заголовок */
    .cover-row {
        margin-bottom: 16px;
    }

    .cover-row > label:first-child {
        display: block;
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 10px;
    }

    .form-hint {
        font-size: 12px;
        line-height: 1.5;
        margin-top: 8px;
		text-align: justify;
    }

    .exclusive-gifts-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    .exclusive-gift-card {
        padding: 18px 10px 12px;
        border-radius: 12px;
    }
    .exclusive-gift-card-media {
        width: 110px;
        height: 110px;
    }
    img.exclusive-gift-icon,
    span.exclusive-gift-icon {
        width: 100px;
        height: 100px;
        font-size: 80px;
    }
	
	.exclusive-gift-card:hover img.exclusive-gift-icon,
	.exclusive-gift-card:active img.exclusive-gift-icon {
		transform: none;
	}
	
    .exclusive-gift-card-name { font-size: 14px; }
    .exclusive-gift-card-price { font-size: 13px; padding: 3px 10px; }
    .exclusive-gifts-title { font-size: 18px; }
    .exclusive-gifts-subtitle { font-size: 13px; }

/* ============================================================
   Страница опроса /vote/{id}-{slug}
   ============================================================ */

	.vote-full {
		background: #fff;
		border: 1px solid var(--border);
		border-radius: var(--radius);
		padding: 24px 26px 22px;
		margin-bottom: 20px;
		box-shadow: 0 3px 5px rgba(0, 0, 0, 0.03);
	}

	/* Заголовок (вопрос) */
	.vote-full .post-full-title {
		font-size: 18px;
		line-height: 1.3;
		margin: 0 0 14px;
		color: var(--fg);
		font-weight: 700;
	}

	/* Строка статуса: метка «Опрос», «Закрыт», «Можно выбрать несколько» */
	.vote-status-line {
		display: flex;
		align-items: center;
		gap: 10px;
		margin-bottom: 20px;
		padding-bottom: 16px;
		border-bottom: 1px solid var(--border);
		flex-wrap: wrap;
	}

	.vote-status-line .post-mark--vote {
		color: #fff;
		background: #3a6bff;
		text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
		margin-left: 0;
		padding: 2px 10px;
		border-radius: 10px;
		font-size: 11px;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.4px;
		line-height: 1.6;
	}

	.vote-closed {
		display: inline-block;
		font-size: 11px;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.4px;
		padding: 2px 10px;
		border-radius: 10px;
		background: #eef2f7;
		color: #4b5563;
		border: 1px solid #ced6e1;
	}

	.vote-mode {
		font-size: 13px;
		color: #2747a9;
		background: #eef3ff;
		border: 1px solid #d6e0ff;
		padding: 2px 10px;
		border-radius: 10px;
	}

	/* Форма голосования */
	.vote-full-body {
		margin-top: 4px;
	}

	.vote-full .vote-options {
		list-style: none;
		margin: 0 0 16px;
		padding: 0;
		display: flex;
		flex-direction: column;
		gap: 8px;
	}

	.vote-full .vote-option label {
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 14px 18px;
		border: 1px solid var(--border);
		border-radius: var(--radius);
		cursor: pointer;
		transition: all 0.2s;
		font-size: 15px;
		background: #fff;
	}

	.vote-full .vote-option label:hover {
		border-color: #3a6bff;
		background: #f4f7ff;
	}

	.vote-full .vote-option input[type="radio"],
	.vote-full .vote-option input[type="checkbox"] {
		margin: 0;
		cursor: pointer;
		accent-color: #3a6bff;
		width: 18px;
		height: 18px;
		flex-shrink: 0;
	}

	.vote-full .vote-option label:has(input:checked) {
		border-color: #3a6bff;
		background: #eef3ff;
		box-shadow: 0 0 0 3px rgba(58, 107, 255, 0.1);
	}

	.vote-full .vote-actions {
		display: flex;
		align-items: center;
		gap: 14px;
		padding-top: 4px;
		flex-wrap: wrap;
	}

	.vote-full .vote-actions .btn {
		padding: 11px 28px;
		font-size: 15px;
		font-weight: 600;
		border-radius: var(--radius);
		height: auto;
	}

	.vote-full .vote-meta {
		color: var(--muted);
		font-size: 13px;
	}

	/* Результаты */
	.vote-full .vote-results {
		display: flex;
		flex-direction: column;
		gap: 16px;
		margin-bottom: 20px;
	}

	.vote-full .vote-result {
		display: flex;
		flex-direction: column;
		gap: 6px;
	}

	.vote-full .vote-result-head {
		display: flex;
		justify-content: space-between;
		align-items: baseline;
		gap: 12px;
		font-size: 15px;
	}

	.vote-full .vote-result-title {
		color: var(--fg);
		font-weight: 600;
	}

	.vote-full .vote-result-percent {
		color: #3a6bff;
		font-weight: 700;
		white-space: nowrap;
		font-size: 16px;
	}

	.vote-full .vote-result-bar {
		height: 12px;
		background: #eef3ff;
		border-radius: 6px;
		overflow: hidden;
	}

	.vote-full .vote-result-fill {
		height: 100%;
		background: linear-gradient(90deg, #3a6bff, #5e86ff);
		border-radius: 6px;
		transition: width 0.4s ease;
	}

	.vote-full .vote-result-count {
		font-size: 12px;
		color: var(--muted);
	}

	/* Итоговая строка */
	.vote-full .vote-meta-full {
		padding-top: 16px;
		border-top: 1px solid var(--border);
		font-size: 14px;
		color: var(--muted);
		text-align: center;
	}

	.vote-full .vote-meta-full b {
		color: #2747a9;
		font-size: 16px;
		font-weight: 700;
	}

	/* Футер для автора */
	.vote-full-footer {
		margin-top: 20px;
		padding-top: 16px;
		border-top: 1px solid var(--border);
		display: flex;
		justify-content: flex-end;
		gap: 10px;
	}

	.vote-full-footer .btn {
		padding: 9px 20px;
		font-size: 14px;
		height: auto;
	}

    .vote-full {
        padding: 12px;
    }
    .vote-full .post-full-title {
        font-size: 18px;
    }
    .vote-full .vote-option label {
        padding: 12px 14px;
        font-size: 14px;
    }
    .vote-full .vote-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .vote-full .vote-actions .btn {
        width: 100%;
    }
    .vote-full .vote-actions .vote-meta {
        text-align: center;
    }
    .vote-full-footer {
        flex-direction: column;
    }
    .vote-full-footer .btn {
        width: 100%;
    }

    .vote-create-dialog {
        max-width: calc(100vw - 20px);
        margin: 20px auto;
    }
    .vote-create-head {
        padding: 18px 18px 14px;
    }
    .vote-create-head-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    .vote-create-dialog .modal-title {
        font-size: 18px;
    }
    .vote-create-dialog .js-vote-create-form {
        padding: 16px 18px 16px;
    }
    .vote-create-dialog .modal-actions {
        flex-direction: column;
    }

    .my-vote-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .my-vote-actions {
        justify-content: flex-end;
    }
    .my-votes-top {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .my-votes-top .btn {
        justify-content: center;
        width: 100%;
    }

    .messages-layout {
        grid-template-columns: 1fr;
        max-height: none;
        min-height: auto;
    }
    .dialogs-list {
        max-height: 320px;
        border-right: none;
    }
    .dialog-content {
        min-height: 400px;
    }
    .msg { max-width: 85%; }
    .msg-actions { top: -8px; }

    .layout-3col { padding: var(--pad) 8px; }

    /* Header: компактнее */
    .site-header {
        height: 60px;
        padding: 0 10px;
    }
    :root { --header-h: 54px; }

    .site-header .logo { font-size: 15px; }
	
	.header-main {padding: 0;}

    /* Иконки-кнопки в шапке — не меньше 44×44 */
    .header-icon {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .user-menu-toggle {
        width: 44px;
        height: 44px;
    }

    /* Поиск в шапке — только иконка, форма не раскрывается */
    .header-search.is-open { width: auto; max-width: 40px; }
    .header-search.is-open input,
    .header-search.is-open .header-search-submit {
        display: none !important;
    }
    .header-search.is-open .header-search-toggle {
        display: inline-flex !important;
    }

    /* Карточка поста */
    .post-card {
        padding: 12px;
        max-height: none;
    }
    .post-title { font-size: 18px; }
    .post-excerpt {
        font-size: 15px;
        height: auto;
        max-height: 64px;
        overflow: hidden;
    }

    /* Полный пост */
    .post-full { padding: 12px; }
    .post-full-title { font-size: 18px; }
    .post-full-content { font-size: 15px; }

    /* Футер поста: кнопки в столбик */
    .post-full-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .post-actions-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    /* Кнопки-иконки в футере поста — touch-friendly */
	
    .post-actions-row .icon-btn,
    .post-actions-row .btn-small {
        min-width: 30px;
        min-height: 30px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

	.notif-icon-kolokol {margin-top: -6px;}
	
	.hl {display: flex; align-items: center;}

    /* Реакции */
    .reaction-btn {
        padding: 2px 8px;
        font-size: 13px;
    }

    /* Комментарии */
    .comment-children {
        margin-left: 10px;
        padding-left: 8px;
    }
    .comment-head {
        flex-wrap: wrap;
    }
    .comment-actions {
        flex-shrink: 0;
    }
    .comment-actions .icon-btn {
        min-width: 30px;
        min-height: 30px;
		padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
	
	.comment-date {margin-bottom: -4px;}

    /* Форма комментария */
    .comment-form-actions,
    .comment-reply-actions,
    .comment-edit-actions {
        justify-content: right;
    }
    .comment-form-actions .btn,
    .comment-reply-actions .btn,
    .comment-edit-actions .btn {
        width: 100px;
    }

    /* Сообщения */
    .dialog-item {
        padding: 10px;
        min-height: var(--touch-min);
    }
    .dialog-content { min-height: 360px; }

    /* Аватар в профиле */
    .avatar-big { width: 72px; height: 72px; font-size: 26px; }
    .profile-name { font-size: 18px; }

    /* Профиль: кнопки — каждая на всю ширину */
    .profile-actions {
        width: 188px;
    }
    .profile-actions .btn,
    .profile-actions .btn-user,
    .profile-actions .icon-btn {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        justify-content: center;
    }
    .profile-actions .icon-btn {
        width: 30px;
    }
	
    .profile-gifts {
        grid-template-columns: repeat(3, 1fr);
		padding: 0px 20px 20px 20px;
    }

    /* На мобильных показываем только 3 подарка (4-й — в спойлере) */
    #profileGifts:not(.is-expanded) .profile-gift-badge:nth-child(n+4) {
        display: none;
    }

    /* Донаты */
    .donations-tab {
        width: auto;
        min-width: 130px;
		height: 30px;
        flex-shrink: 0;
    }
    .donation-card {
        grid-template-columns: 1fr;
        row-gap: 8px;
        text-align: left;
    }
    .donation-card-avatar {
        justify-content: flex-start;
    }
    .donation-card-sum {
        justify-content: flex-start;
    }

    /* Формы */
    .auth-block, .auth-form {
        padding: 20px;
    }

    /* Профиль-формы: две кнопки подряд — на мобиле в столбик */
    .avatar-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Модалки */
    .modal {
        padding: 14px;
        margin: 0;
        border-radius: 10px;
    }
    .modal-actions .btn,
    .modal-actions .admin-btn {
        width: 100%;
    }

    /* Модалка подарков */
    .gift-modal-head { padding: 16px 16px 12px; }
    .gift-modal-head-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    .gift-modal .modal-title { font-size: 17px; }
    .gift-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 12px 14px;
        gap: 8px;
        max-height: 45vh;
    }
    .gift-icon-big { font-size: 48px; }
    .gift-name { font-size: 12px; }
    .gift-price { font-size: 12px; padding: 2px 8px; }
    .gift-selected { margin: 0 14px 4px; padding: 12px; }
    .js-gift-form { padding: 12px 14px 16px; }
    .js-gift-form input[type="text"] { font-size: 14px; }

    /* Пагинация */
    .page-link, .page-current {
        min-width: 36px;
        min-height: 36px;
        font-size: 13px;
    }

    /* Сайдбар */
    .sidebar-cta { padding: 14px 12px; }
    .sidebar-cta-icon { width: 40px; height: 40px; font-size: 18px; }
    .sidebar-cta-title { font-size: 15px; }

    /* Спойлер категорий */
    .side-more-toggle {
        min-height: var(--touch-min);
        padding: 10px;
    }

    /* Фильтры-селекты */
    .select-custom {
        min-height: 40px;
    }

    /* Таблицы (кошелёк, донаты) — горизонтальный скролл */
    .wallet-table th,
    .wallet-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
	
	.select-custom-toggle {
        padding: 9px 12px;
        font-size: 14px;
    }
    .select-custom-option {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* ============================================================================
   1. Большие телефоны и смартфоны в портрете (≤480px)
      Всё в одну колонку, минимальные отступы, минимум украшательств
   ============================================================================ */
@media (max-width: 480px) {
    :root {
        --font-base: 13px;
        --pad:       10px;
        --gap:       10px;
    }

    body {font-size: 14px;}

	.premium-status-until {font-size: 13px;}
	.reactions-panel-list {gap: 4px;}
	.preview-actions {gap: 8px; display: grid; justify-content: normal;}
	.premium-status-limits {text-align: center;}
	.pagination {margin: 20px 0px 10px 0px;}
	.modal-actions {flex-direction: column;}
    .donations-summary {grid-template-columns: 1fr;}
	img.gift-icon {height: 60px; object-fit: contain; z-index: 1;}
	
    .sub-req-item {
        align-items: stretch;
    }
    .sub-req-actions {
        gap: 4px;
    }
    .sub-req-btn {
        padding: 5px 8px;
        font-size: 11px;
        height: 26px;
        gap: 2px;
    }
    .sub-req-btn i {
        font-size: 10px;
    }
	
	.profile-gift-badge-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 60px;
    }
	
	.donations-tabs {
		overflow-x: auto;
		padding: 8px;
		display: grid;
		align-items: center;
		justify-content: center;
		gap: 6px;
	}

    /* Только в карточках и в шапке поста — не трогаем профиль */
    .post-card .js-follow,
    .post-full .js-follow {
        display: none !important;
    }

	.post-nav-row {
		top: 48px;
		right: 13px;
	}

    .notif-dropdown {
		right: -136px;
		top: calc(100% + 11px);
		width: calc(100vw - 20px);
		max-width: 340px;
    }
	
	.user-menu-dropdown {
		top: calc(100% + 6px);
		right: 3px;
    }

    /* Поиск в шапке — только иконка */
    .header-search.is-open input,
    .header-search.is-open .header-search-submit {
        display: none !important;
    }

    .exclusive-gifts-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    /* Header: упрощаем максимально */
    .site-header {
        height: 60px;
        padding: 0 10px;
    }
    :root { --header-h: 50px; }

    .site-header .logo {
        font-size: 14px;
        letter-spacing: 0.3px;
    }

    /* Кнопка «Написать» — прячем текст, оставляем компактной */
    .header-actions .btn { padding: 6px 10px; font-size: 13px; }

    /* Иконки — 40×40 (достаточно) */
    .header-icon { min-width: 40px; min-height: 40px; }
    .user-menu-toggle { width: 40px; height: 40px; }
    .avatar-mini { width: 30px; height: 30px; font-size: 12px; }

    /* Посты — компактнее */
    .post-card { padding: 12px; }
    .post-title { font-size: 18px; }
    .post-full-title { font-size: 18px; }

    /* Заголовки страниц */
    .page-title { font-size: 17px; margin-bottom: 12px; }

    /* Аватар в профиле */
    .avatar-big { width: 68px; height: 68px; font-size: 24px; }
    .profile-name { font-size: 17px; }

    /* Все кнопки — на всю ширину, если возможно */
    .btn-edit { width: 100%; max-width: 100%; text-align: center; }
    .btn-w { width: 100%; }
	.btn-ed { height: 37px; }
	.btn-ed-2 { max-height: 37px !important; }

    .account-tab i { display: none; } /* иконки не нужны, экономим место */

    /* Реакции — уменьшаем */
    .reaction-emoji { width: 18px; height: 18px; }

    /* Формы — минимум */
    .auth-block, .auth-form {padding: 10px; margin: 10px;}
    .form-row label { font-size: 13px; }

    /* Модалки — полный экран */
    .modal {
        max-width: calc(100vw - 16px);
        width: 100%;
        margin: 0 auto;
        border-radius: 12px;
        padding: 12px;
    }
    .modal-overlay {
        align-items: center;
        justify-content: center;
        padding: 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
	    /* Модалка создания опроса — во всю ширину, со скроллом при переполнении */
    .vote-create-dialog {
        max-width: 100%;
        width: 100%;
        margin: 0;
        border-radius: 12px;
    }

    .vote-create-head {
        padding: 16px 14px 12px;
    }

    .vote-create-head-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .vote-create-dialog .modal-title {
        font-size: 17px;
    }

    .vote-create-subtitle {
        font-size: 12px;
    }

    .vote-create-dialog .js-vote-create-form {
        padding: 14px 14px 16px;
    }

    .vote-create-dialog .form-row {
        margin-bottom: 14px;
    }

    .vote-create-dialog input[type="text"] {
        padding: 10px 12px;
        font-size: 14px;
    }

    .vote-create-options {
        gap: 6px;
    }

    .vote-create-dialog .modal-actions {
        flex-direction: column;
        gap: 8px;
    }

    .vote-create-dialog .modal-actions .btn {
        width: 100%;
    }
    .gift-modal {
        max-width: 100%;
        border-radius: 12px;
    }
    .gift-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 100vh;
        padding: 10px 12px;
    }
	
	.js-gift-form {
		border-top: 0px solid #e8ecf7;
		margin-top: 0px;
		background: transparent;
	}

    /* Подарки в профиле */
    .profile-gift-badge { min-width: 64px; height: 160px; }
    .profile-gift-badge-name { font-size: 11px; max-width: 70px; }

    /* Донаты — карточка в столбик */
    .donation-card-amount { font-size: 15px; }

    /* Кошелёк */
    .wallet-balance-value { font-size: 24px; }

    /* Premium-план — компактнее */
    .premium-plan { padding: 14px; }
    .premium-plan-title { font-size: 16px; }
    .premium-plan-price { font-size: 18px; }
    .premium-plan-features { font-size: 13px; }

    /* Premium-заглушка */
    .premium-locked { padding: 16px 12px; }
    .premium-locked-title { font-size: 15px; }
    .premium-locked-text { font-size: 13px; }

    /* Правый сайдбар точно не показываем */
    .col-right { display: none; }

    /* Сайдбар CTA */
    .sidebar-cta-list { display: none; } /* экономим вертикаль */

    /* Пагинация */
    .page-link, .page-current {
        min-width: 36px;
        min-height: 36px;
        font-size: 13px;
    }

    /* Сообщения */
    .dialog-content { min-height: 300px; }

    /* Редактор */
    .editor-content { min-height: 220px; padding: 10px; }
    .editor-btn { width: 34px; height: 34px; }
    .editor-imgbar { flex-wrap: wrap; }

    /* Футер */
    .site-footer { padding: 16px 8px; font-size: 13px; }
	
	.btn-cancel { max-height: 44px; }
}

/* ============================================================================
   Touch-friendly: hover не работает на тач-устройствах.
   Убираем зависимость важных действий от :hover.
   ============================================================================ */
@media (hover: none) {
    /* Активные состояния, которые раньше жили только в :hover */
    .btn:active     { background: #5e86ff; border-color: #5e86ff; }
    .btn-cancel:active { background: #8c96a9; border-color: #818897; }
    .btn-danger:active { background: #a5281c; border-color: #a5281c; }
    .icon-btn:active   { color: #3a6bff; }
    .header-icon:active { color: #3a6bff; }
    .reaction-btn:active { background: #f2f5ff; border-color: #f2f5ff; color: #3a6bff; }
    .sidebar-cta-btn--primary:active { background: #5e86ff; }
    .sidebar-cta-btn--secondary:active { background: #f4f7ff; }
    .premium-ad-btn:active { background: #ffc30e; }

    /* Убираем transform-scale на мобильных (мешает) */
    .profile-gift-badge:active img.gift-icon { transform: none; }
}

/* ============================================================================
   Горизонтальная ориентация на телефонах — экономим вертикаль
   ============================================================================ */
@media (max-width: 900px) and (orientation: landscape) {
    .site-header {height: 60px; padding: 0 10px;}
    :root { --header-h: 60px; }
    .avatar-big { width: 72px; height: 72px; font-size: 22px; }
    .dialog-content { min-height: 260px; }
    .dialogs-list { max-height: 220px; }
}

/* ============================================================================
   Печать — убираем всё лишнее
   ============================================================================ */
@media print {
    .site-header,
    .site-footer,
    .col-left,
    .col-right,
    .premium-ad,
    .sidebar-widget,
    .post-actions-row,
    .reactions-block,
    .comment-form,
    .modal-overlay { display: none !important; }

    .layout-3col {
        display: block;
        padding: 0;
        max-width: 100%;
    }
    .post-full {
        border: none;
        padding: 0;
    }
}