/* ============ Theme tokens ============ */

:root {
    color-scheme: light;
    --bg: #ffffff;
    --bg-elev: #ffffff;
    --surface: #fafafa;
    --surface-2: #f1f3f5;
    --text: #111827;
    --text-muted: #6b7280;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.14);
    --link: #d62976;
    --link-hover: #962fbf;
    --accent: #d62976;
    --accent-2: #962fbf;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.12);
    --navbar-bg: rgba(255, 255, 255, 0.78);
    --navbar-border: rgba(0, 0, 0, 0.06);
    --gradient-brand: linear-gradient(135deg, #feda75 0%, #fa7e1e 22%, #d62976 50%, #962fbf 75%, #4f5bd5 100%);
    --gradient-pill: linear-gradient(135deg, #d62976 0%, #962fbf 100%);
    --gradient-warm: linear-gradient(135deg, #feda75, #fa7e1e, #d62976);
    --gradient-cool: linear-gradient(135deg, #4f5bd5, #962fbf);
    --reaction-bg: rgba(0, 0, 0, 0.04);
    --reaction-bg-hover: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #000000;
    --bg-elev: #0a0a0a;
    --surface: #0f0f0f;
    --surface-2: #161616;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --link: #ec4f8d;
    --link-hover: #f06ba1;
    --accent: #ec4f8d;
    --accent-2: #b146d4;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.6);
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.8);
    --navbar-bg: rgba(10, 10, 10, 0.78);
    --navbar-border: rgba(255, 255, 255, 0.06);
    --reaction-bg: rgba(255, 255, 255, 0.06);
    --reaction-bg-hover: rgba(255, 255, 255, 0.12);
}

/* ============ Base ============ */

html {
    font-size: 14px;
    min-height: 100%;
    position: relative;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    html { font-size: 16px; }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

hr { border-color: var(--border); }

.text-muted { color: var(--text-muted) !important; }

.card {
    background-color: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 14px;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(214, 41, 118, 0.18);
}

.form-control {
    background-color: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus {
    background-color: var(--surface);
    color: var(--text);
    border-color: var(--accent);
}

/* ============ Navigation ============ */

.app-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1030;
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--navbar-border);
    transition: transform 0.3s ease;
}

.app-navbar.is-hidden { transform: translateY(-100%); }

.app-navbar > .container,
.app-navbar > .container-fluid {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    letter-spacing: -0.01em;
    text-decoration: none;
}

.brand:hover { color: var(--text); text-decoration: none; }

.brand-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center; justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
}

.brand-mark__img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-left: 6px;
}

.nav-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.15s ease, color 0.15s ease;
    text-decoration: none;
}

.nav-link-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

.nav-link-btn.is-active {
    background: var(--gradient-pill);
    color: #fff;
}

.nav-link-btn.is-active:hover { color: #fff; }

.nav-search {
    flex: 1 1 220px;
    max-width: 360px;
    margin-left: auto;
    margin-bottom: 0;
}

.theme-toggle {
    width: 38px; height: 38px;
    flex: 0 0 auto;
    border-radius: 999px;
    display: inline-flex;
    align-items: center; justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s ease;
}

.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle .bi { font-size: 1.05rem; }

.menu-toggle {
    display: none;
    border: 1px solid var(--border);
    background: var(--surface);
    width: 38px; height: 38px;
    flex: 0 0 auto;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
}

/* responsive nav rules live in BEM additions section below */

/* ============ Page container ============ */

.page-shell {
    padding-top: 88px;
    padding-bottom: 60px;
    min-height: calc(100vh - 60px);
}

@media (max-width: 767.98px) {
    .page-shell { padding-top: 76px; }
}

/* ============ Cards / grids ============ */

.shadow-soft { box-shadow: var(--shadow-sm); }

.grid-item img { width: 100%; height: auto; display: block; }

.tile-card {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    margin: 6px;
    position: relative;
    transition: border-color 0.15s ease;
}

.tile-card:hover { border-color: var(--border-strong); }

.tile-card img { width: 100%; height: auto; display: block; border-radius: 13px; background: var(--surface-2); }

.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--gradient-pill);
    border-radius: 2px;
}

/* ============ Buttons ============ */

.btn-gradient {
    background: var(--gradient-pill);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 999px;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.btn-gradient:hover {
    color: #fff;
    filter: brightness(1.05);
    box-shadow: 0 8px 24px rgba(214, 41, 118, 0.3);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 999px;
    transition: background-color 0.15s ease;
}

.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* ============ Store buttons ============ */

.store-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.1;
}

.store-btn:hover { text-decoration: none; box-shadow: var(--shadow); }

.store-btn .store-icon { font-size: 1.5rem; line-height: 1; }

.store-btn .store-label {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.15;
}

.store-btn .store-label small {
    font-size: 0.65rem;
    opacity: 0.8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.store-btn .store-label span { font-size: 0.95rem; font-weight: 700; }

.store-btn--filled {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.store-btn--filled:hover { background: var(--text); color: var(--bg); }

.store-btn--outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}

.store-btn--outline:hover { background: var(--surface-2); color: var(--text); }

[data-theme="dark"] .store-btn--outline:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }

.store-btn--apple {
    background: linear-gradient(135deg, #1c1c1c 0%, #2d2d2d 100%);
    color: #fff;
    border-color: #1c1c1c;
}

.store-btn--apple:hover { color: #fff; }

[data-theme="dark"] .store-btn--apple {
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    color: #1c1c1c;
    border-color: #f5f5f7;
}

[data-theme="dark"] .store-btn--apple:hover { color: #1c1c1c; }

.store-btn--google {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.store-btn--google:hover { background: var(--text); color: var(--bg); }

@media (max-width: 575.98px) {
    .store-btn { flex: 1 1 calc(50% - 10px); justify-content: center; }
}

/* ============ App Store Modal ============ */

.app-store-modal .modal-content {
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
}

.app-store-modal .modal-header { border-bottom: none; padding: 16px 16px 0; }
.app-store-modal .modal-body { padding: 28px 28px 24px; }
.app-store-modal .modal-footer { border-top: 1px solid var(--border); padding: 16px 24px; }

.app-store-modal__hero {
    background: var(--gradient-brand);
    color: #fff;
    padding: 48px 24px 32px;
    margin: 0;
    text-align: center;
}

.app-store-modal__hero .bi { font-size: 3.2rem; }
.app-store-modal__hero h5 { font-weight: 700; margin: 14px 0 6px; font-size: 1.25rem; color: #fff; }
.app-store-modal__hero p { margin: 0; opacity: 0.95; color: #fff; }

.app-store-modal h6 { color: var(--text); }
.app-store-modal p { color: var(--text-muted); }

.btn-close-custom {
    background: var(--surface-2);
    border: none;
    color: var(--text);
    width: 36px; height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center; justify-content: center;
    margin-left: auto;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-close-custom:hover { background: var(--border-strong); }

/* ============ Reactions ============ */

.reactions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 8px;
    background: var(--reaction-bg);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.reaction-pill:hover { background: var(--reaction-bg-hover); }

.reaction-pill--mine {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(214, 41, 118, 0.1), rgba(150, 47, 191, 0.1));
}

.reaction-pill img {
    width: 24px;
    height: 24px;
    display: block;
}

.reactions-empty {
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* ============ Profile Header ============ */

.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 36px;
    padding: 16px 0 8px;
}

.profile-header__avatar { flex: 0 0 auto; }

.profile-avatar-wrap {
    width: 168px;
    height: 168px;
    border-radius: 50%;
    padding: 4px;
    background: var(--gradient-brand);
}

.profile-avatar {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--bg);
    background: var(--surface);
    display: block;
}

.profile-header__info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-name-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.profile-login-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.profile-qr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.profile-qr-btn:hover { background: var(--surface-2); }
.profile-qr-btn:focus { outline: none; box-shadow: 0 0 0 0.18rem rgba(214, 41, 118, 0.18); }
.profile-qr-btn .bi { font-size: 1.15rem; line-height: 1; }

.profile-display-name {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--text);
    word-break: break-word;
}

.profile-login {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    word-break: break-all;
}

.profile-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
}

.profile-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    color: var(--text);
    text-decoration: none;
}

.profile-stat:hover { color: var(--link); text-decoration: none; }

.profile-stat-num { font-size: 1.05rem; font-weight: 700; }
.profile-stat-label { color: var(--text-muted); font-size: 0.95rem; }

a.profile-stat:hover .profile-stat-label { color: var(--link); }

.profile-profession {
    font-weight: 600;
    color: var(--text);
}

.profile-description {
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.55;
    max-width: 720px;
}

@media (max-width: 767.98px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 18px;
        padding-left: 6px;
        padding-right: 6px;
    }

    .profile-avatar-wrap { width: 128px; height: 128px; }

    .profile-header__info { align-items: center; width: 100%; }

    .profile-name-row { align-items: center; }

    .profile-stats { justify-content: center; gap: 22px; }

    .profile-description { text-align: left; align-self: stretch; }

    .posts-heading { padding-left: 6px; padding-right: 6px; }
}

@media (max-width: 360px) {
    .profile-stats { gap: 14px; }
    .profile-stat { flex-direction: column; align-items: center; gap: 0; }
    .profile-stat-num { font-size: 1.1rem; }
    .profile-stat-label { font-size: 0.85rem; }
}

/* ============ Clickable links in description ============ */

.link-mention {
    color: var(--link);
    font-weight: 500;
    text-decoration: none;
    word-break: break-word;
}

.link-mention:hover { color: var(--link-hover); text-decoration: underline; }

/* ============ Post page ============ */

.post-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
}

.post-card__media {
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-card__media img {
    display: block;
    max-width: 100%;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.post-card__media--progressive {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
    display: block;
}

.post-card__media--progressive .post-card__media-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 1s ease;
}

.post-card__media--progressive .post-card__media-img.is-loaded { opacity: 1; }
.post-card__media--progressive .post-card__media-img--fallback { position: static; opacity: 1; }

/* ---- Video post player ---- */
.post-card__media--video { cursor: default; }
.post-card__media--video.is-video-ready { cursor: pointer; }

.post-card__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.4s ease;
}
.post-card__media--video.is-video-ready .post-card__video { opacity: 1; }
/* Прячем превью, когда видео готово */
.post-card__media--video.is-video-ready .post-card__media-img { opacity: 0; }

/* Центральная иконка — видна только на паузе */
.post-video-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    z-index: 3;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 2.4rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.post-card__media--video.is-video-paused .post-video-center {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Кнопка справа снизу: прогресс загрузки → переключатель звука */
.post-video-ctl {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 4;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.post-card__media--video.is-video-ready .post-video-ctl { cursor: pointer; }
.post-video-ctl:disabled { cursor: default; }

.post-video-ring { width: 30px; height: 30px; display: block; }
.post-video-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.post-video-ring__track { fill: none; stroke: rgba(255, 255, 255, 0.3); stroke-width: 3; }
.post-video-ring__bar {
    fill: none;
    stroke: #fff;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.2s ease;
}
.post-video-ctl__sound { display: none; font-size: 1.15rem; }
.is-video-ready .post-video-ring { display: none; }
.is-video-ready .post-video-ctl__sound { display: block; }
.is-video-failed .post-video-ctl { display: none; }

.post-card__body { padding: 22px 24px; }

.post-card__author {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.post-card__author:hover { text-decoration: none; }

.post-author__avatar-wrap {
    display: inline-block;
    border-radius: 50%;
    padding: 2px;
    background: var(--gradient-brand);
    flex: 0 0 auto;
}

.post-author__avatar {
    width: 46px; height: 46px;
    border-radius: 50%;
    border: 2px solid var(--bg);
    background: var(--surface-2);
    object-fit: cover;
    display: block;
}

.post-author__name {
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin: 0;
}

.post-author__time {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.post-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.post-card__description {
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
    margin: 16px 0;
}

.comments-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    /* Чтобы переход по #comments (из ленты) не прятал заголовок под навбар. */
    scroll-margin-top: 88px;
}

.comments-card__header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
}

.comment-item {
    padding: 16px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 14px;
}

.comment-item:first-of-type { border-top: none; }

.comment-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: var(--surface-2);
    object-fit: cover;
}

.comment-content { flex: 1; min-width: 0; }

.comment-author-link { color: var(--text); font-weight: 600; text-decoration: none; }
.comment-author-link:hover { color: var(--link); }

.comment-time { color: var(--text-muted); font-size: 0.82rem; margin-left: 8px; }

.comment-text {
    margin-top: 6px;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

.comments-empty {
    padding: 40px 22px;
    text-align: center;
    color: var(--text-muted);
}

.post-cta {
    margin-top: 28px;
    padding: 26px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.post-cta__title {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    font-size: 1.05rem;
}

.post-cta__text {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

/* ============ Footer ============ */

.app-footer {
    background: var(--surface);
    color: var(--text);
    padding: 44px 0 20px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.app-footer .footer-brand h4 {
    color: var(--text);
    font-weight: 700;
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.app-footer .footer-description { color: var(--text-muted); font-size: 0.95rem; max-width: 320px; }

.footer-title {
    color: var(--text);
    font-weight: 700;
    position: relative;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.footer-title::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    height: 3px; width: 36px;
    background: var(--gradient-pill);
    border-radius: 2px;
}

.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { margin-bottom: 10px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.footer-list a { color: var(--text-muted); transition: color 0.15s ease; text-decoration: none; }
.footer-list a:hover { color: var(--link); }

.social-icon {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text);
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: none;
}

.social-icon:hover { background: var(--gradient-pill); color: #fff; }

.footer-bottom {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    margin-top: 24px;
}

/* ============ Cookie banner ============ */

.cookie-banner {
    position: fixed;
    bottom: 16px; left: 16px; right: 16px;
    z-index: 1050;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 18px 22px;
    transform: translateY(140%);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
    max-width: 980px;
    margin: 0 auto;
}

.cookie-banner.is-visible { transform: translateY(0); opacity: 1; }

.cookie-banner__content {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.cookie-banner__icon {
    width: 44px; height: 44px;
    border-radius: 14px;
    background: var(--gradient-warm);
    display: inline-flex;
    align-items: center; justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    flex: 0 0 auto;
}

.cookie-banner__text {
    flex: 1 1 280px;
    font-size: 0.95rem;
    color: var(--text);
}

.cookie-banner__text strong { display: block; margin-bottom: 4px; font-size: 1rem; }
.cookie-banner__text p { margin: 0; color: var(--text-muted); }
.cookie-banner__text a { color: var(--link); }

.cookie-banner__actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 575.98px) {
    .cookie-banner { padding: 14px 16px; bottom: 8px; left: 8px; right: 8px; }
}

/* ============ App promo banner ============ */

.app-promo {
    position: fixed;
    z-index: 1045;
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    background:
        linear-gradient(135deg, rgba(250, 126, 30, 0.10) 0%, rgba(214, 41, 118, 0.10) 50%, rgba(79, 91, 213, 0.12) 100%),
        var(--bg-elev);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 16px 18px;
    overflow: hidden;
    transform: translateY(180%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    pointer-events: none;
}

/* Цветной акцент-полоска сверху, как у модалки магазина приложений */
.app-promo::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-brand);
}

[data-theme="dark"] .app-promo {
    background:
        linear-gradient(135deg, rgba(250, 126, 30, 0.16) 0%, rgba(214, 41, 118, 0.18) 50%, rgba(79, 91, 213, 0.22) 100%),
        #16161c;
    border-color: rgba(255, 255, 255, 0.12);
}

.app-promo.is-visible { transform: translateY(0); opacity: 1; pointer-events: auto; }

.app-promo__inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-promo__icon {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 15px;
    padding: 2px;
    background: var(--gradient-brand);
    box-shadow: 0 6px 18px rgba(214, 41, 118, 0.28);
}

.app-promo__icon img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 13px; }

.app-promo__text { flex: 1 1 auto; min-width: 0; }

.app-promo__title { margin: 0 0 2px; font-weight: 700; font-size: 0.98rem; color: var(--text); }

.app-promo__lead { margin: 0; font-size: 0.82rem; line-height: 1.3; color: var(--text-muted); }

.app-promo__actions { flex: 0 0 auto; }

.app-promo__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 0.9rem;
    padding: 9px 18px;
}

.app-promo__close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: var(--surface-2);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-promo__close:hover { background: var(--border-strong); color: var(--text); }

@media (max-width: 420px) {
    .app-promo { left: 12px; right: 12px; bottom: 12px; padding: 14px 16px; }
    .app-promo__inner { flex-wrap: wrap; }
    .app-promo__actions { flex: 1 1 100%; }
    .app-promo__cta { width: 100%; justify-content: center; }
}

/* ============ Hero ============ */

.hero { padding: 36px 0 28px; }

.hero__title {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 18px;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 540px;
    line-height: 1.6;
    margin-bottom: 28px;
}

.hero-card {
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    background: var(--bg-elev);
}

.hero-card__media img {
    width: 100%;
    height: 360px;
    object-fit: cover;
    display: block;
}

.hero-card__body { padding: 18px 22px; }

.hero-card--icon .hero-card__icon-stage {
    position: relative;
    background: var(--gradient-brand);
    padding: 56px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-card--icon .hero-card__icon-stage::before {
    content: '';
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), transparent 55%);
    pointer-events: none;
}

.hero-card__icon {
    position: relative;
    width: 220px;
    max-width: 60%;
    height: auto;
    display: block;
    filter: drop-shadow(0 18px 36px rgba(0,0,0,0.32));
    transition: transform 0.4s ease;
}

.hero-card--icon:hover .hero-card__icon { transform: scale(1.04) rotate(-2deg); }

.cta-card {
    border-radius: 24px;
    overflow: hidden;
    background: var(--gradient-brand);
    color: #fff;
    padding: 48px 40px;
    box-shadow: var(--shadow);
}

.cta-card h2 {
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    color: #fff;
}

.cta-card p { color: rgba(255, 255, 255, 0.92); }

.cta-card .store-btn--google {
    background: #fff;
    color: #1c1c1c;
    border-color: #fff;
}

.cta-card .store-btn--google:hover { color: #1c1c1c; }

.cta-card .store-btn--outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.55);
}

.cta-card .store-btn--outline:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

@media (max-width: 575.98px) {
    .cta-card { padding: 32px 24px; }
    .hero-card__media img { height: 240px; }
    .hero { padding: 20px 0 16px; }
}

/* ============ Gallery preview gradient mask ============ */

.gallery-fade {
    position: relative;
    max-height: 1000px;
    overflow: hidden;
}

.gallery-fade::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 140px;
    background: linear-gradient(to bottom, transparent, var(--bg));
    pointer-events: none;
}

/* ============ User cards ============ */

.user-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: border-color 0.15s ease;
    height: 100%;
    text-decoration: none;
    color: var(--text);
}

.user-card:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }

.user-card__avatar-wrap {
    width: 80px; height: 80px;
    border-radius: 50%;
    padding: 2px;
    background: var(--gradient-brand);
    flex: 0 0 auto;
}

.user-card__avatar {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-elev);
    background: var(--surface-2);
    display: block;
}

.user-card__name {
    font-weight: 600;
    color: var(--text);
    margin-top: 6px;
    line-height: 1.3;
}

.user-card__meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============ Followers/Followings cards columns ============ */

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

@media (max-width: 575.98px) {
    .users-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .user-card { padding: 18px 12px; }
    .user-card__avatar-wrap { width: 64px; height: 64px; }
}

/* ============ Error ============ */

.error-page {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 16px;
}

.error-page__code {
    font-size: clamp(4rem, 12vw, 7rem);
    font-weight: 800;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 12px;
}

.error-page__lead {
    color: var(--text-muted);
    max-width: 520px;
    margin-bottom: 24px;
    line-height: 1.55;
}

/* ============ Modal generic adjustments ============ */

.modal-backdrop.show { opacity: 0.55; }

[data-theme="dark"] .modal-backdrop.show { opacity: 0.7; }

/* При открытии модалки Bootstrap дописывает body инлайновый padding-right под ширину
   скроллбара. На сайте вертикальный скроллбар принадлежит <html> (из-за overflow-x: hidden,
   что делает <html> контейнером прокрутки) и модалкой не убирается — поэтому компенсация
   лишняя и визуально «расширяет»/сдвигает страницу и фиксированную шапку. Обнуляем её. */
body.modal-open { padding-right: 0 !important; }

/* ============ Loading ============ */

.loading-pulse {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.loading-pulse span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: loadingDot 1.4s infinite ease-in-out both;
}

.loading-pulse span:nth-child(2) { animation-delay: 0.16s; }
.loading-pulse span:nth-child(3) { animation-delay: 0.32s; }

@keyframes loadingDot {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ============ Layout helpers (BEM additions) ============ */

.app-navbar__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.app-navbar.is-scrolled { box-shadow: var(--shadow-sm); }

.brand-text { white-space: nowrap; }

.nav-search { position: relative; }

.nav-search__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.95rem;
}

.nav-search__input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px 8px 38px;
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.nav-search__input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-elev);
}

.nav-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex: 0 0 auto;
}

.theme-toggle__sun { display: none; }
.theme-toggle__moon { display: inline-block; }
[data-theme="dark"] .theme-toggle__sun { display: inline-block; }
[data-theme="dark"] .theme-toggle__moon { display: none; }

.mobile-menu {
    position: fixed;
    top: 64px; left: 12px; right: 12px;
    z-index: 1029;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: mobileMenuIn 0.18s ease;
}

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

.mobile-menu__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s ease;
}

.mobile-menu__link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

.mobile-menu__link.is-active {
    background: var(--gradient-pill);
    color: #fff;
}

.mobile-menu__link.is-active:hover { color: #fff; }

.nav-search--mobile { width: 100%; flex: 0 0 auto; max-width: none; margin: 0 0 4px; }

.menu-toggle { display: none; }
.menu-toggle .bi { font-size: 1.4rem; }

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

@media (max-width: 991.98px) {
    .menu-toggle {
        display: inline-flex;
        align-items: center; justify-content: center;
    }
    .nav-links { display: none; }
    .nav-search:not(.nav-search--mobile) { display: none; }
    .nav-search--mobile { display: block; }
}

@media (min-width: 992px) {
    .nav-links { display: flex; }
    .nav-search { display: block; }
}

/* Override earlier .nav-links rule — keep desktop visible */

/* ============ Store buttons (BEM additions) ============ */

.store-btn__icon { font-size: 1.5rem; line-height: 1; }

.store-btn__label {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.15;
}

.store-btn__label small {
    font-size: 0.65rem;
    opacity: 0.8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.store-btn__label span { font-size: 0.95rem; font-weight: 700; }

.store-buttons--compact .store-btn { padding: 8px 14px; }

.store-buttons--on-dark .store-btn--google {
    background: #fff;
    color: #1c1c1c;
    border-color: #fff;
}

.store-buttons--on-dark .store-btn--google:hover { color: #1c1c1c; }

.store-buttons--on-dark .store-btn--outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.55);
}

.store-buttons--on-dark .store-btn--outline:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* ============ App Store Modal (BEM additions) ============ */

.app-store-modal__hero {
    padding-top: 56px;
    text-align: center;
    color: #fff;
}

@media (max-width: 575.98px) {
    /* На мобильных модалка занимает 90% доступной ширины и центрируется по горизонтали.
       Вертикальное центрирование обеспечивает .modal-dialog-centered. */
    .app-store-modal .modal-dialog {
        width: 90%;
        max-width: 90%;
        margin: 0.5rem auto;
    }
    .app-store-modal .modal-content { width: 100%; }
}

.app-store-modal__hero .bi {
    font-size: 3.6rem;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}

.app-store-modal__body {
    text-align: center;
}

.app-store-modal__title {
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
    color: var(--text);
}

.app-store-modal__lead {
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 16px;
}

.app-store-modal__hint {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--surface-2);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.92rem;
    text-align: left;
}

.app-store-modal__hint .bi { color: var(--link); flex: 0 0 auto; }

.app-store-modal__footer {
    justify-content: center;
}

/* ============ Cookie banner (BEM additions) ============ */

.cookie-banner__text {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1 1 280px;
}

.cookie-banner__icon {
    flex: 0 0 auto;
}

.cookie-banner__title {
    margin: 0 0 4px;
    font-size: 1rem;
    color: var(--text);
}

.cookie-banner__lead {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.cookie-banner__links {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.cookie-banner__links a {
    color: var(--link);
    font-size: 0.9rem;
    text-decoration: none;
}

.cookie-banner__links a:hover { text-decoration: underline; }

/* ============ Footer (BEM additions) ============ */

.brand--footer { font-size: 1.2rem; margin-bottom: 12px; }

.app-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
}

.app-footer__col { min-width: 0; }

.app-footer__lead {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
    max-width: 320px;
    margin-bottom: 16px;
}

.app-footer__title {
    color: var(--text);
    font-weight: 700;
    position: relative;
    padding-bottom: 8px;
    margin-bottom: 16px;
    font-size: 1rem;
}

.app-footer__title::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    height: 3px; width: 36px;
    background: var(--gradient-pill);
    border-radius: 2px;
}

.app-footer__list { list-style: none; padding: 0; margin: 0; }

.app-footer__list li { margin-bottom: 10px; color: var(--text-muted); }

.app-footer__list a, .app-footer__list span {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.15s ease;
}

.app-footer__list a:hover { color: var(--link); }

.app-footer__list .bi { color: var(--link); width: 18px; flex: 0 0 auto; }

.app-footer__social { display: inline-flex; gap: 10px; }

.app-footer__divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0 0;
}

.app-footer__bottom {
    padding-top: 18px;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.app-footer__sub { opacity: 0.85; }

@media (max-width: 767.98px) {
    .app-footer__grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ============ Reactions (BEM additions for emoji + count) ============ */

.reaction-pill__emoji { width: 22px; height: 22px; display: block; }

.reaction-pill__count { font-variant-numeric: tabular-nums; }

/* ============ Post page (BEM additions) ============ */

.post-author__meta { display: flex; flex-direction: column; line-height: 1.2; }

.post-stats {
    display: flex;
    gap: 18px;
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-top: 14px;
}

.post-stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ============ Profile (BEM additions) ============ */

.profile-section { padding: 8px 0 28px; }

.posts-heading {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 28px 0 16px;
    letter-spacing: -0.01em;
    color: var(--text);
}

/* ============ Page intro / search header ============ */

.page-heading {
    font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: var(--text);
}

.page-subheading {
    color: var(--text-muted);
    margin-bottom: 22px;
}

.empty-state {
    padding: 48px 16px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state .bi { font-size: 2.4rem; color: var(--text-muted); display: block; margin-bottom: 10px; }

/* ============ Tile (masonry) overrides — no hover lift ============ */

.grid { width: 100%; }

.grid-item {
    margin-bottom: 0;
    padding: 6px;
    opacity: 1;
    transition: opacity 0.45s ease;
}

.grid-item.is-loading { opacity: 0; }

.grid-item .card,
.grid-item .tile-card {
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    margin: 0;
    transition: border-color 0.15s ease;
}

.grid-item .card:hover,
.grid-item .tile-card:hover {
    border-color: var(--border-strong);
    transform: none;
    box-shadow: none;
}

.grid-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
}

.tile-media--progressive {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
    display: block;
    border-radius: 13px;
}

.tile-media__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease;
    border-radius: 0;
}

.tile-media__img.is-loaded { opacity: 1; }

/* Индикатор видеопоста в ленте */
.tile-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 1.5rem;
    pointer-events: none;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 1;
    transition: opacity 1s ease;
}

/* Видео-превью при наведении на плитку в ленте */
.tile-media__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    transition: opacity 1s ease;
}

.tile-media.is-playing .tile-media__video { opacity: 1; }
.tile-media.is-playing .tile-play { opacity: 0; }

/* Иконка звука на плитке — видна, только когда играет видео при наведении */
.tile-sound {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 4;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.tile-media.is-playing .tile-sound {
    opacity: 1;
    pointer-events: auto;
}

/* Счётчики реакций и комментариев на плитке (фото и видео) — появляются при наведении мыши,
   в том же стиле, что и кнопка звука: тёмная полупрозрачная плашка с размытием. */
.tile-stats {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 4;
    height: 34px;            /* та же высота, что и у кнопки звука */
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 13px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.tile-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tile-stat .bi { font-size: 0.95rem; } /* размер иконок как у кнопки звука */

.tile-card:hover .tile-stats { opacity: 1; }

@media (min-width: 1200px) { .grid-item.col-xl-3 { width: 25%; } }

/* ============ Inline link reset ============ */

.unstyled-link { color: inherit; text-decoration: none; }
.unstyled-link:hover { color: inherit; text-decoration: none; }

/* ============ Profile QR modal ============ */

.qr-modal__dialog { max-width: 360px; }

.qr-modal__content {
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    position: relative;
}

.qr-modal__body {
    padding: 28px 24px 18px;
    text-align: center;
}

.qr-modal__title {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    margin: 0 0 18px;
    color: var(--text);
}

.qr-modal__canvas-wrap {
    display: inline-block;
    padding: 14px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    line-height: 0;
}

.qr-modal__canvas {
    display: block;
    width: 240px;
    height: 240px;
    border-radius: 8px;
}

.qr-modal__login {
    margin-top: 16px;
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    word-break: break-all;
    display: block;
    text-align: center;
}

.qr-modal__footer {
    border-top: 1px solid var(--border);
    padding: 14px 20px;
    justify-content: center;
    gap: 10px;
}

.qr-modal__footer .btn-ghost,
.qr-modal__footer .btn-gradient {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 18px;
    font-size: 0.95rem;
    margin: 0;
}

@media (max-width: 575.98px) {
    .qr-modal .modal-dialog {
        margin: 0.75rem auto;
        max-width: calc(100% - 1.5rem);
        min-height: calc(100% - 1.5rem);
        display: flex;
        align-items: center;
    }
    .qr-modal .modal-content { width: 100%; }
    .qr-modal__body { padding: 24px 18px 14px; }
    .qr-modal__canvas { width: 220px; height: 220px; }
}

/* ============ Feed toolbar (вид + фильтр над лентой) ============ */

.feed-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 18px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.seg {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--surface-2);
    border-radius: 999px;
}

.seg__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease;
}

.seg__btn:hover:not(.is-active) { color: var(--text); }

.seg__btn.is-active {
    background: var(--gradient-pill);
    color: #fff;
    box-shadow: 0 4px 12px rgba(214, 41, 118, 0.25);
}

.seg__btn .bi { font-size: 1rem; }

@media (max-width: 575.98px) {
    .feed-toolbar { padding: 7px 8px; }
    .seg__btn { padding: 7px 11px; }
    .seg--view .seg__label { display: none; }
}

/* ============ Feed stage cross-fade (плавная смена вида/фильтра) ============ */

.feed-stage {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.feed-stage.is-fading { opacity: 0; }

/* ============ Feed (вертикальная лента постов) ============ */

.feed-list {
    max-width: 620px;
    margin: 0 auto;
}

.feed-post {
    padding: 6px 4px 20px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
    /* Чтобы при прокрутке стрелками шапка поста вставала под навбар, а не под него. */
    scroll-margin-top: 80px;
}

.feed-post:last-child { border-bottom: none; margin-bottom: 0; }

.feed-post__author {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 4px 0 12px;
}

.feed-post__author:hover { text-decoration: none; }

.feed-post__avatar-wrap {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 2px;
    background: var(--gradient-brand);
}

.feed-post__avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg);
    background: var(--surface-2);
    display: block;
}

.feed-post__author-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }

.feed-post__author-name {
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    word-break: break-word;
}

.feed-post__author:hover .feed-post__author-name { color: var(--link); }

.feed-post__time { color: var(--text-muted); font-size: 0.82rem; margin-top: 2px; }

.feed-media {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    display: block;
}

.feed-media--video { cursor: pointer; }

.feed-media__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.feed-media__img.is-loaded { opacity: 1; }

.feed-media__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.4s ease;
}

.feed-media--video.is-playing .feed-media__video { opacity: 1; }
.feed-media--video.is-playing .feed-media__img { opacity: 0; }

.feed-media__center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.feed-media--video:not(.is-playing) .feed-media__center { opacity: 1; }
.feed-media--video.is-video-failed .feed-media__center { display: none; }

.feed-media__sound {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 4;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.feed-media--video.is-active .feed-media__sound { opacity: 1; pointer-events: auto; }
.feed-media--video.is-video-failed .feed-media__sound { display: none; }

.feed-post__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.feed-post__reactions {
    flex: 1 1 auto;
    min-width: 0;
    row-gap: 6px;
}

.feed-post__cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.feed-post__comments {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.feed-post__comments:hover { background: var(--border-strong); color: var(--text); text-decoration: none; }

.feed-post__comments .bi { font-size: 1rem; }

.feed-post__more {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 8px 14px 8px 18px;
    font-size: 0.9rem;
}

.feed-post__more .bi { font-size: 1rem; }

.feed-post__desc { margin: 12px 4px 0; }

.feed-post__description {
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.55;
    margin: 0;
    /* По умолчанию — 3 строки без многоточия; полный текст по кнопке «развернуть». */
    max-height: 4.65em; /* 3 × line-height */
    overflow: hidden;
}

.feed-post__description.is-expanded {
    max-height: none;
    overflow: visible;
}

.feed-post__expand {
    margin-top: 4px;
    padding: 0;
    border: none;
    background: none;
    color: var(--link);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.feed-post__expand:hover { color: var(--link-hover); text-decoration: underline; }

@media (max-width: 575.98px) {
    .feed-post { padding-left: 0; padding-right: 0; }
    .feed-media { border-radius: 10px; }
}

/* ============ Reaction gate modal (клик по реакции → «реакции в приложении») ============ */

/* Плашки реакций кликабельны (см. initReactionGate в site.js) */
.reaction-pill { cursor: pointer; }

.reaction-pill:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.18rem rgba(214, 41, 118, 0.28);
}

/* Кнопка закрытия поверх градиентного hero — отдельно от .btn-close-custom,
   так как фон здесь не светлый, а фирменный градиент */
.app-store-modal__hero { position: relative; }

.app-store-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.15s ease;
}

.app-store-modal__close:hover { background: rgba(255, 255, 255, 0.35); color: #fff; }

/* Перебиваем крупный размер иконки hero (.app-store-modal__hero .bi → 3.6rem):
   крестик закрытия должен оставаться маленьким */
.app-store-modal__close .bi { font-size: 0.9rem; filter: none; }

/* Кнопки магазинов в модалке центрируем под текстом */
.app-store-modal .store-buttons { justify-content: center; }

