/* ============================================================
   Maxforum — главный стиль
   ============================================================ */

:root {
    --bg: #ffffff;
    --bg-soft: #f4f7fb;

    --panel: rgba(255, 255, 255, 0.85);
    --panel-strong: #ffffff;
    --panel-light: rgba(0, 204, 82, 0.05);

    --border: rgba(0, 0, 0, 0.06);
    --border-strong: rgba(0, 0, 0, 0.12);

    --text: #1a1f36;
    --muted: #6b7280;
    --muted-2: #9ca3af;

    --pink: #00cc52;
    --violet: #00ff6a;
    --cyan: #00ff6a;
    --green: #00cc52;
    --gold: #ffb800;
    --red: #ff3366;

    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;

    --shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
    --glow: 0 0 40px rgba(0, 204, 82, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

::selection { color: #000; background: var(--pink); }

html { 
    scroll-behavior: smooth; 
}

/* Кастомный глобальный скроллбар */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 106, 0.1);
    border-radius: 8px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--pink);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text);
    font-family: "Inter", "Manrope", system-ui, sans-serif;
    background:
        radial-gradient(circle at 10% -10%, rgba(0, 204, 82, 0.08), transparent 34%),
        radial-gradient(circle at 88% 8%, rgba(0, 255, 106, 0.05), transparent 30%),
        radial-gradient(circle at 50% 35%, rgba(0, 204, 82, 0.03), transparent 36%),
        linear-gradient(180deg, #f0f4f8 0%, #ffffff 55%, #fafcff 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    opacity: 0.8;
    background-image:
        linear-gradient(rgba(0,0,0,.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,.02) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at top, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at top, black 20%, transparent 80%);
}

body::after {
    content: "";
    position: fixed;
    inset: -30%;
    pointer-events: none;
    z-index: -2;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 106, 0.05), transparent 40%),
        radial-gradient(circle at 80% 50%, rgba(0, 204, 82, 0.03), transparent 45%),
        radial-gradient(circle at 40% 20%, rgba(0, 255, 106, 0.04), transparent 35%);
    filter: blur(80px);
    animation: bgFloat 25s ease-in-out infinite alternate;
}

@keyframes bgFloat {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(3%, -3%) scale(1.05); }
    66% { transform: translate(-2%, 4%) scale(0.95); }
    100% { transform: translate(-4%, -2%) scale(1.02); }
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

/* ── Layout ─────────────────────────────────────────────────── */

.app-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    overflow: hidden;
}

.app-sidebar {
    background: var(--panel-strong);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    height: 100%;
    overflow-y: auto;
    z-index: 100;
}

.app-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    position: relative;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-profile-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 99px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 13px;
    transition: all 0.2s;
}
.header-profile-pill:hover {
    background: var(--border);
}
.notif-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}
.notif-btn:hover {
    background: var(--border);
    color: var(--text);
}
.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid #fff;
}
.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    overflow: hidden;
    z-index: 100;
}
.notif-dropdown.show { display: block; }
.notif-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 800;
    font-size: 14px;
}
.notif-list { max-height: 300px; overflow-y: auto; }
.notif-empty { padding: 30px; text-align: center; color: var(--muted); font-size: 13px; }
.notifications-wrapper { position: relative; }

.topbar-brand-mobile {
    display: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    text-decoration: none;
    color: var(--text);
}
.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--green), var(--cyan));
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,255,106,0.3);
}
.sidebar-brand-text {
    font-family: 'Unbounded', sans-serif;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.03em;
}

.sidebar-action-btn-wrap {
    margin-bottom: 32px;
}
.sidebar-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel-light);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
}
.sidebar-action-btn:hover {
    background: var(--border);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}
.sidebar-action-btn svg { color: var(--green); }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.sidebar-nav a svg {
    color: var(--muted-2);
    transition: color 0.2s ease;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: var(--panel-light);
    color: var(--text);
}
.sidebar-nav a:hover svg, .sidebar-nav a.active svg {
    color: var(--green);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.sidebar-footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}
.sidebar-footer-links a {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}
.sidebar-footer-links a:hover {
    color: var(--text);
}
.sidebar-social {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-social a {
    color: var(--muted-2);
    transition: color 0.2s ease;
}
.sidebar-social a:hover {
    color: var(--text);
}

@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 1fr;
        height: auto !important;
        overflow: visible !important;
    }
    .app-sidebar {
        display: none;
    }
    .app-main {
        height: auto !important;
        overflow: visible !important;
    }
    .app-topbar {
        padding: 12px 16px !important;
        justify-content: space-between !important;
    }
    .topbar-brand-mobile {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        text-decoration: none !important;
        margin-right: auto !important;
        color: var(--text) !important;
        flex-shrink: 0 !important;
    }
    .topbar-brand-mobile .sidebar-logo {
        width: 32px !important;
        height: 32px !important;
        font-size: 13px !important;
        border-radius: 10px !important;
        flex-shrink: 0 !important;
    }
    .topbar-brand-mobile .sidebar-brand-text {
        font-size: 15px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
}

/* ── Global Inputs ───────────────────────────────────────────── */
input[type=text], input[type=email], input[type=password], select, textarea {
    width: 100%;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: .22s ease;
}

select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ba3c7' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 48px !important;
}

select option, select optgroup { background: #ffffff; color: var(--text); }
select optgroup { font-style: normal; font-weight: 800; color: var(--green); }

input:focus, select:focus, textarea:focus {
    border-color: rgba(0,204,82,.5);
    background: rgba(0,204,82,.03);
    box-shadow: 0 0 20px rgba(0,204,82,.08);
}

/* ── Rich Editor ────────────────────────────────────────────── */
.editor-toolbar {
    display: flex; gap: 6px; padding: 10px;
    background: rgba(0,0,0,.02); border: 1px solid var(--border-strong);
    border-bottom: 0; border-radius: 16px 16px 0 0;
}
.toolbar-btn {
    width: 34px; height: 34px; display: grid; place-items: center;
    border-radius: 10px; background: rgba(0,0,0,.04);
    color: var(--muted); font-size: 14px; cursor: pointer; transition: .2s;
    user-select: none;
}
.toolbar-btn:hover { background: rgba(0,0,0,.08); color: var(--text); transform: translateY(-1px); }
.toolbar-btn.bold { font-weight: 800; }
.toolbar-btn.italic { font-style: italic; font-family: serif; }

textarea { border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }

.char-limit { display: block; text-align: right; font-size: 11px; color: var(--muted-2); margin-top: 5px; font-weight: 700; }

.parsed-link { 
    color: var(--green); 
    text-decoration: underline; 
    font-weight: 800; 
    text-shadow: none;
    transition: .2s;
}
.parsed-link:hover {
    color: var(--text);
}
.parsed-img { max-width: 100%; border-radius: 16px; margin: 10px 0; border: 1px solid var(--border); }

/* ── Breadcrumbs ─────────────────────────────────────────────── */
.breadcrumb {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
}
.breadcrumb a {
    color: var(--muted);
    transition: .2s;
    text-decoration: none;
}
.breadcrumb a:hover {
    color: var(--pink);
}
.breadcrumb span {
    color: var(--muted-2);
}
.breadcrumb span:last-child,
.breadcrumb .active,
.breadcrumb span.active {
    color: var(--text);
    font-weight: 800;
    opacity: 1;
}

.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    aspect-ratio: 1/1;
    border-radius: 50%;
    color: #fff;
    font-family: "Unbounded", sans-serif;
    font-weight: 800;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    filter: drop-shadow(0 0 6px rgba(52,213,255,0.4));
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.verified-badge:hover {
    transform: scale(1.2) rotate(10deg);
    filter: drop-shadow(0 0 10px rgba(52,213,255,0.8));
}

.brand-mark {
    width: 46px; height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: "Unbounded", sans-serif;
    font-weight: 800;
    font-size: 20px;
    border-radius: 15px;
    background: 
        radial-gradient(circle at 30% 20%, rgba(255,255,255,.4), transparent 25%),
        conic-gradient(from 160deg at 50% 50%, #00ff6a, #00cc52, #00ff6a, #00ff6a);
    box-shadow: 
        0 12px 30px -8px rgba(0,255,106,.5),
        0 4px 10px -2px rgba(0,0,0,.3),
        inset 0 0 0 1px rgba(255,255,255,.2);
    position: relative;
    overflow: hidden;
    transition: .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.brand-mark:hover {
    transform: rotate(-3deg) scale(1.08);
    box-shadow: 0 20px 40px -10px rgba(0,255,106,.6);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    position: relative;
    z-index: 2;
}

.brand-text {
    display: flex;
    flex-direction: column;
    font-family: "Unbounded", sans-serif;
    font-weight: 800;
    letter-spacing: -0.04em;
    font-size: 21px;
    background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(165, 180, 252, 0.25));
}

.brand-text small {
    margin-top: 2px;
    color: var(--muted);
    font-family: "Manrope", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    -webkit-text-fill-color: var(--cyan);
    opacity: 0.8;
}

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 700;
}

.breadcrumb a {
    color: var(--muted);
    transition: .2s;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--pink);
}

.breadcrumb span {
    color: var(--muted-2);
}

.breadcrumb span:last-child,
.breadcrumb .active,
.breadcrumb span.active {
    color: var(--text);
    font-weight: 800;
}

.main-nav {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 22px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

.main-nav a {
    position: relative;
    padding: 8px 18px;
    color: #a5b4fc;
    font-size: 13.5px;
    font-weight: 800;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    z-index: 1;
}

.main-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.main-nav a.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.2), rgba(52, 213, 255, 0.1));
    box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.3), 0 4px 15px rgba(0,0,0,0.2);
    text-shadow: 0 0 10px rgba(52, 213, 255, 0.5);
}

.main-nav a.active::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0px;
    height: 3px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--pink), var(--cyan));
    box-shadow: 0 0 10px var(--pink), 0 0 10px var(--cyan);
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* ── Bottom Navigation Island (mobile) ── */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: rgba(12, 14, 32, 0.85);
    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 8px 6px;
    gap: 2px;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(124, 92, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 14px;
    border-radius: 16px;
    color: var(--muted-2);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

.bottom-nav-item svg {
    transition: all 0.25s ease;
}

.bottom-nav-item:active {
    transform: scale(0.9);
}

.bottom-nav-item.active {
    color: #fff;
    background: rgba(124, 92, 255, 0.18);
}

.bottom-nav-item.active svg {
    filter: drop-shadow(0 0 6px rgba(124, 92, 255, 0.6));
    stroke: var(--cyan);
}

.bottom-nav-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 92, 122, 0.5);
}

.search {
    width: 230px; height: 46px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    color: var(--muted);
}

.search input {
    width: 100%;
    border: 0; outline: 0;
    color: #fff;
    background: transparent;
    font-weight: 700;
}

.search input::placeholder { color: #7d86aa; }

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
    min-height: 44px;
    padding: 0 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 15px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
    transition: .22s ease;
    cursor: pointer;
}

.btn:hover { transform: translateY(-2px); }

.btn.primary {
    color: #fff;
    background:
        linear-gradient(135deg, rgba(255,255,255,.18), transparent),
        linear-gradient(135deg, var(--pink), var(--violet) 58%, var(--cyan));
    box-shadow: 0 16px 36px rgba(124,92,255,.34);
}

.btn.ghost {
    color: var(--text);
    background: var(--bg-soft);
    border-color: var(--border-strong);
}

.btn.ghost:hover {
    background: #ffffff;
    border-color: rgba(0, 204, 82, 0.4);
    color: var(--green);
    box-shadow: 0 4px 12px rgba(0, 204, 82, 0.05);
}

.btn.glass {
    color: var(--text);
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--border-strong);
    backdrop-filter: blur(16px);
}

.btn.glass:hover {
    background: #ffffff;
    border-color: rgba(0, 204, 82, 0.3);
    color: var(--green);
}

.btn.big {
    min-height: 54px;
    padding: 0 24px;
    border-radius: 18px;
    font-size: 15px;
}

.btn.full { width: 100%; }

/* ── Page ────────────────────────────────────────────────────── */

.page {
    width: min(1240px, calc(100% - 40px));
    margin: 34px auto 0;
    padding-bottom: 40px;
    flex: 1 0 auto;
}

/* ── Hero ────────────────────────────────────────────────────── */

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 400px;
    padding: 60px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 50px;
    border-radius: 48px;
    border: 1px solid var(--border-strong);
    background: 
        radial-gradient(circle at 0% 0%, rgba(0, 204, 82, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(0, 255, 106, 0.05) 0%, transparent 50%),
        #f8fafc;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.03);
}

@keyframes float-blob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

.hero::before {
    content: "";
    position: absolute;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(0, 255, 106, 0.15) 0%, transparent 70%);
    top: -100px; left: -100px;
    animation: float-blob 15s infinite ease-in-out;
    z-index: -1;
}

.hero::after {
    content: "";
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(0, 204, 82, 0.1) 0%, transparent 70%);
    bottom: -150px; right: -150px;
    animation: float-blob 20s infinite ease-in-out reverse;
    z-index: -1;
}

.hero-content { max-width: 700px; }

.eyebrow {
    width: fit-content;
    margin-bottom: 18px;
    padding: 8px 13px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: rgba(0,0,0,.03);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
}

.eyebrow span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 18px var(--green);
}

.hero h1 {
    font-family: "Unbounded", sans-serif;
    font-size: clamp(32px, 4.5vw, 60px);
    line-height: 1.02;
    letter-spacing: -0.07em;
    background: linear-gradient(180deg, #111 0%, #444 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    max-width: 580px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.75;
    font-weight: 600;
}

.hero-actions {
    margin-top: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
}

/* Hero stat block */
.hero-stat-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    min-width: 220px;
}

.hero-stat {
    padding: 12px 16px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--border-strong);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.hero-stat:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 204, 82, 0.3);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.hero-stat strong {
    display: block;
    font-family: "Unbounded", sans-serif;
    font-size: 20px;
    letter-spacing: -0.05em;
    line-height: 1.2;
    background: linear-gradient(135deg, #111, #444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-stat span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-stat.accent {
    background: linear-gradient(135deg, rgba(0, 204, 82, 0.05), rgba(0, 255, 106, 0.05));
    border-color: rgba(0, 204, 82, 0.2);
}

.hero-stat.accent strong {
    background: linear-gradient(135deg, #00cc52, #00ff6a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Content grid ────────────────────────────────────────────── */

.content-grid {
    margin-top: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 24px;
    align-items: start;
}

/* ── Forum board ─────────────────────────────────────────────── */

.section-head {
    margin-bottom: 18px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.board-head, .topic-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.topic-header-main, .topic-header-info {
    padding: 24px 32px;
    background: #f8fafc;
    border: 1px solid var(--border-strong);
    border-radius: 28px;
    position: relative;
    overflow: hidden;
}

.topic-header-main {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    text-align: center;
}

.topic-header-main::before {
    content: '';
    position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--green), var(--cyan), transparent);
    opacity: 0.8;
}

.topic-header-info {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.board-head h1 {
    font-family: "Unbounded", sans-serif;
    font-size: 28px;
    letter-spacing: -0.05em;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.topic-header-main h1 {
    font-family: "Unbounded", sans-serif;
    font-size: 28px;
    letter-spacing: -0.05em;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.topic-tags {
    display: flex;
    gap: 8px;
}

.topic-header-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.meta-author { display: flex; align-items: center; gap: 12px; }
.meta-info b { display: block; font-size: 14px; font-weight: 900; }
.meta-info span { font-size: 12px; color: var(--muted); font-weight: 700; }

.header-actions { display: flex; gap: 8px; margin-left: auto; }

@media (max-width: 600px) {
    .topic-header-info { flex-direction: column; align-items: flex-start; }
    .header-actions { margin-left: 0; width: 100%; }
    .header-actions .btn { flex: 1; text-align: center; justify-content: center; }
}

.board-head p {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.section-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--pink);
    font-size: 12px;
    font-weight: 1000;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.category {
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 28px;
    border: 1px solid var(--border-strong);
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
}

.category-header {
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-soft);
    position: relative;
    overflow: hidden;
}

.category-header::before {
    content: '';
    position: absolute;
    left: 0; top: 25%; bottom: 25%;
    width: 4px;
    background: var(--green);
    border-radius: 0 4px 4px 0;
}

.category-header h2 {
    font-family: "Unbounded", sans-serif;
    font-size: 20px;
    letter-spacing: -0.05em;
    color: var(--text);
    word-break: break-all;
    overflow-wrap: anywhere;
}

.category-header p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    opacity: 0.8;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.forum-row {
    position: relative;
    padding: 18px 24px;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 80px 190px;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    transition: .22s ease;
}

.forum-row:last-child { border-bottom: 0; }

.forum-row::before {
    content: "";
    position: absolute;
    left: 0; top: 16px; bottom: 16px;
    width: 3px;
    border-radius: 999px;
    background: transparent;
    transition: .22s ease;
}

.forum-row:hover { background: rgba(0,204,82,.02); }

.forum-main-link {
    display: contents;
    text-decoration: none;
    color: inherit;
}

.forum-info h3, .last-post b {
    transition: color .22s ease;
}

.forum-main-link:hover .forum-info h3,
.last-post a:hover b {
    color: var(--green);
}

.forum-row:hover::before {
    background: linear-gradient(180deg, var(--green), var(--cyan));
    box-shadow: 0 0 12px rgba(0,204,82,.3);
}

.forum-row:hover .forum-icon { transform: scale(1.06) rotate(-2deg); }

.forum-row.empty {
    padding: 20px 24px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    grid-template-columns: 1fr;
}

.forum-icon {
    width: 54px; height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 24px;
    border-radius: 18px;
    border: none;
    transition: .22s ease;
    background: rgba(0,204,82,.1);
    color: var(--green);
}

.forum-icon.hot    { background: linear-gradient(135deg, #00ff6a, #00cc52); color: #fff; box-shadow: 0 8px 20px rgba(0,255,106,.2); }
.forum-icon.cyan   { background: linear-gradient(135deg, #00ff6a, #00cc52); color: #fff; box-shadow: 0 8px 20px rgba(0,255,106,.2); }
.forum-icon.violet { background: linear-gradient(135deg, #00cc52, #00ff6a); color: #fff; box-shadow: 0 8px 20px rgba(0,204,82,.2); }
.forum-icon.green  { background: linear-gradient(135deg, #00ff6a, #00cc52); color: #fff; box-shadow: 0 8px 20px rgba(0,255,106,.2); }
.forum-icon.gold   { background: linear-gradient(135deg, #00ff6a, #00cc52); color: #fff; box-shadow: 0 8px 20px rgba(0,255,106,.2); }
.forum-icon.red    { background: linear-gradient(135deg, #00cc52, #00ff6a); color: #fff; box-shadow: 0 8px 20px rgba(0,204,82,.2); }
.forum-icon.pink   { background: linear-gradient(135deg, #00ff6a, #00cc52); color: #fff; box-shadow: 0 8px 20px rgba(0,255,106,.2); }

.forum-info h3 {
    margin-bottom: 5px;
    font-size: 16px;
    font-weight: 1000;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.forum-info p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
    font-weight: 650;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.forum-numbers {
    text-align: center;
}

.forum-numbers b {
    display: block;
    font-family: "Unbounded", sans-serif;
    color: var(--text);
    font-size: 17px;
    letter-spacing: -0.04em;
}

.forum-numbers span {
    display: block;
    margin-top: 2px;
    color: var(--muted-2);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.last-post {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.no-posts {
    color: var(--muted-2);
    font-size: 13px;
    font-weight: 700;
}

/* ── Avatar wrapper — универсальные круглые аватарки ─────────── */
.avatar-wrapper {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    color: #fff;
    font-weight: 900;
    font-size: 13px;
    /* дефолтный размер */
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--pink), var(--violet));
    box-shadow: 0 6px 18px rgba(124,92,255,.22);
    transition: transform .2s, box-shadow .2s;
}

/* Размер sm — для last-post, online-list и т.д. */
.avatar-wrapper.sm,
.avatar-wrapper.avatar.sm {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

/* Обратная совместимость: класс "avatar" применяемый в index.php */
.avatar-wrapper.avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
}


/* profile-avatar styling is now handled by .avatar-container.size-profile block below */
/* Картинка внутри любого avatar-wrapper */
.avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

.last-post {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.last-post > div {
    min-width: 0;
    overflow: hidden;
}

.last-post b {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.last-post span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

/* ── Empty state ─────────────────────────────────────────────── */

.empty-state {
    padding: 52px 32px;
    text-align: center;
    border-radius: 28px;
    border: 1px dashed var(--border-strong);
    background: rgba(255,255,255,.03);
}

.empty-icon { font-size: 52px; margin-bottom: 16px; }

.empty-state h3 {
    font-family: "Unbounded", sans-serif;
    font-size: 20px;
    letter-spacing: -0.05em;
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.7;
    margin-bottom: 22px;
}

.empty-state a { color: var(--cyan); }

/* ── Sidebar ─────────────────────────────────────────────────── */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.widget {
    border-radius: 26px;
    border: 1px solid var(--border-strong);
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
}

.widget:not(.profile-widget) { padding: 20px; }
.widget.profile-widget { overflow: visible; }

.user-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.online-user-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-soft);
    border-radius: 12px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    transition: .2s;
}

.online-user-item:hover {
    background: #ffffff;
    border-color: rgba(0, 204, 82, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 204, 82, 0.05);
}

.online-user-item.staff {
    border-color: rgba(255,62,165,0.3);
    background: rgba(255,62,165,0.05);
}

.online-user-item.staff:hover {
    box-shadow: 0 0 15px rgba(255,62,165,0.2);
    border-color: var(--pink);
}

.widget-head {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.widget h3 {
    font-size: 16px;
    font-weight: 1000;
    color: var(--text);
}

.topic-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-radius: 14px;
    text-decoration: none;
    transition: 0.2s;
}

.topic-list a:hover {
    background: var(--bg-soft);
}

.topic-list a b {
    display: block;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.topic-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
}

.topic-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    margin-right: 8px;
    vertical-align: middle;
    gap: 4px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--border-strong);
    background: var(--bg-soft);
    color: var(--text);
}

.badge.live {
    background: rgba(255, 92, 122, 0.08);
    color: var(--red);
    border-color: rgba(255, 92, 122, 0.2);
    animation: pulse-red 2.5s infinite;
}

.badge.staff {
    background: rgba(0, 204, 82, 0.1);
    color: var(--green);
    border-color: rgba(0, 204, 82, 0.25);
    box-shadow: 0 4px 12px rgba(0, 204, 82, 0.1);
}

.badge.new {
    background: rgba(52, 213, 255, 0.1);
    color: var(--cyan);
    border-color: rgba(52, 213, 255, 0.2);
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 92, 122, 0.2); }
    70% { box-shadow: 0 0 0 6px rgba(255, 92, 122, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 92, 122, 0); }
}

.topic-badge.pin { 
    background: rgba(255, 211, 106, 0.12); 
    color: var(--gold); 
    border: 1px solid rgba(255, 211, 106, 0.22); 
}

.topic-badge.lock { 
    background: rgba(255, 92, 122, 0.12); 
    color: var(--red); 
    border: 1px solid rgba(255, 92, 122, 0.22); 
}

.widget-empty { color: var(--muted); font-size: 13px; font-style: italic; }

/* Статистика форума */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-lbl {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.stat-val {
    color: var(--text);
    font-family: 'Unbounded', sans-serif;
    font-size: 14px;
    font-weight: 800;
}

.newest-user {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.03);
}

.new-user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: 0.2s;
}

.new-user-link:hover {
    transform: translateX(4px);
}

/* ── Notifications ─────────────────────────────────────────── */
.notifications-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.notif-btn {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--muted);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin-right: 8px;
}

.notif-btn:hover {
    background: var(--border);
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.notif-btn.has-new {
    color: var(--pink);
    border-color: rgba(0, 204, 82, 0.2);
    background: rgba(0, 204, 82, 0.04);
}

.notif-btn.has-new svg {
    animation: bell-ring 1.8s ease infinite;
    transform-origin: top center;
}

@keyframes bell-ring {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(12deg); }
    30% { transform: rotate(-10deg); }
    45% { transform: rotate(8deg); }
    60% { transform: rotate(-6deg); }
    75% { transform: rotate(4deg); }
    85% { transform: rotate(-2deg); }
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ff5c7a, #ff3ea5);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 8px;
    border: 2px solid #0f1224;
    box-shadow: 0 3px 8px rgba(255, 92, 122, 0.4);
}

.header-profile-pill {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.header-profile-pill:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.header-profile-pill.active {
    background: rgba(124, 92, 255, 0.12) !important;
    border-color: rgba(124, 92, 255, 0.25) !important;
}

.notif-dropdown {
    display: block;
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 320px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.notif-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notif-head {
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.notif-head span { font-weight: 800; font-size: 14px; color: var(--text); }
.notif-head a { font-size: 12px; color: var(--pink); font-weight: 700; text-decoration: none; }

.notif-list {
    max-height: 400px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: .2s;
}

.notif-item:hover { background: rgba(0, 0, 0, 0.02); }
.notif-item.unread { background: rgba(0, 204, 82, 0.04); }

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.04);
    display: grid;
    place-items: center;
    font-size: 18px;
    flex-shrink: 0;
    color: var(--text);
}

.notif-content p {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 4px;
}

.notif-content p b { color: var(--pink); }
.notif-content p span { color: var(--muted); font-style: italic; }
.notif-content small { color: var(--muted-2); font-size: 11px; font-weight: 700; }

.notif-empty, .notif-loading {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    font-style: italic;
}

.profile-cover {
    height: 110px;
    background: 
        radial-gradient(circle at 80% 20%, rgba(0, 255, 106, 0.18), transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(0, 204, 82, 0.12), transparent 50%),
        linear-gradient(135deg, #f4f7fb 0%, #eef3f9 100%);
    position: relative;
    border-radius: 26px 26px 0 0;
    overflow: hidden;
}

.profile-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: conic-gradient(from 0deg, var(--pink), var(--violet), var(--cyan), var(--pink));
    opacity: 0.08;
    animation: rotate-cover 10s linear infinite;
    filter: blur(10px);
}

@keyframes rotate-cover {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.profile-main { 
    padding: 0 24px 24px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-main h3 { 
    font-size: 18px; 
    font-weight: 900; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text);
    font-family: "Unbounded", sans-serif;
    letter-spacing: -0.03em;
    margin-top: 8px;
}

.profile-main p {
    margin: 6px 0 16px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
    font-weight: 600;
}

.user-cloud {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding: 5px 5px 5px 0;
}

/* Красивый скроллбар для виджета */
.user-cloud::-webkit-scrollbar {
    width: 4px;
}
.user-cloud::-webkit-scrollbar-track {
    background: transparent;
}
.user-cloud::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.1);
    border-radius: 10px;
}
.user-cloud::-webkit-scrollbar-thumb:hover {
    background: var(--violet);
}

.online-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.05);
    transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.online-user-item:hover {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.12);
    z-index: 10;
    position: relative;
}

.online-user-item.staff:hover {
    background: color-mix(in srgb, currentColor 12%, transparent);
    border-color: color-mix(in srgb, currentColor 30%, transparent) !important;
    box-shadow: inset 0 0 10px color-mix(in srgb, currentColor 5%, transparent);
}

.online-user-item span {
    font-size: 12px;
    font-weight: 800;
    color: #eef1ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.topic-list a {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.04);
    transition: all .25s ease;
    text-decoration: none;
    color: inherit;
}

.topic-list a > div {
    min-width: 0;
}

.topic-list a:hover {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.1);
    transform: translateX(4px);
}

.topic-list b {
    display: block;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-list .topic-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: var(--muted-2);
    font-size: 11px;
    font-weight: 700;
}

/* ── Footer ──────────────────────────────────────────────────── */

.footer {
    width: min(1240px, calc(100% - 40px));
    margin: 34px auto 24px;
    padding: 22px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 750;
    flex-shrink: 0;
}

.footer div:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer b {
    color: #fff;
    font-family: "Unbounded", sans-serif;
    letter-spacing: -0.05em;
}

.footer-links { display: flex; gap: 18px; }
.footer a:hover { color: #fff; }

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 1100px) {
    .site-header { 
        grid-template-columns: auto 1fr auto;
        gap: 12px;
        padding: 12px 16px;
    }
    .search { width: 100%; }
    .hero { grid-template-columns: 1fr; }
    .hero-stat-block { grid-template-columns: repeat(4, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    /* Header: fixed at top, logo only */
    .site-header {
        position: fixed;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: auto !important;
        margin: 0;
        padding: 6px !important;
        border-radius: 50% !important;
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 50;
    }
    body { padding-top: 0; }
    body:has(.site-header) { padding-top: 72px; }
    .brand { min-width: 0; }
    .brand-text { display: none; }
    .brand-mark { width: 38px; height: 38px; font-size: 16px; border-radius: 12px; }
    .header-actions { display: none !important; }
    .main-nav { display: none; }
    .bottom-nav { display: flex; }

    .page, .footer { width: calc(100% - 20px); }
    .footer { padding-bottom: 90px; }
    
    /* Hero section optimization on mobile */
    .hero {
        min-height: auto !important;
        padding: 24px 20px !important;
        gap: 24px !important;
        border-radius: 20px !important;
        margin-bottom: 16px !important;
        grid-template-columns: 1fr !important;
    }
    .hero h1 {
        font-size: 24px !important;
        letter-spacing: -0.04em !important;
        text-align: center !important;
        line-height: 1.1 !important;
    }
    .hero p {
        font-size: 13px !important;
        line-height: 1.5 !important;
        text-align: center !important;
        margin-top: 10px !important;
    }
    .hero-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        max-width: 100% !important;
    }
    .hero-actions {
        margin-top: 18px !important;
        justify-content: center !important;
        width: 100% !important;
        gap: 10px !important;
    }
    .hero-actions .btn {
        flex: 1 !important;
        min-width: 120px !important;
        font-size: 13px !important;
        padding: 10px 16px !important;
        text-align: center;
    }
    .hero-stat-block {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        width: 100% !important;
    }
    .hero-stat {
        padding: 8px 10px !important;
        border-radius: 12px !important;
    }
    .hero-stat strong {
        font-size: 16px !important;
    }
    .hero-stat span {
        font-size: 9px !important;
    }
    .eyebrow {
        margin-bottom: 10px !important;
        padding: 4px 10px !important;
        font-size: 10px !important;
    }

    /* Category lists and forum rows on mobile */
    .category {
        border-radius: 20px !important;
        margin-bottom: 18px !important;
    }
    .category-header {
        padding: 14px 18px !important;
    }
    .category-header h2 {
        font-size: 14px !important;
    }
    .category-header p {
        font-size: 11px !important;
    }
    
    .forum-row {
        display: grid !important;
        grid-template-columns: 42px 1fr !important;
        grid-template-rows: auto auto !important;
        row-gap: 2px !important;
        column-gap: 12px !important;
        padding: 12px 16px !important;
        border-bottom: 1px solid rgba(255,255,255,.04) !important;
    }
    .forum-icon {
        grid-column: 1 !important;
        grid-row: 1 / span 2 !important;
        width: 42px !important;
        height: 42px !important;
        font-size: 18px !important;
        border-radius: 10px !important;
        align-self: center !important;
    }
    .forum-info {
        grid-column: 2 !important;
        grid-row: 1 !important;
        align-self: end !important;
    }
    .forum-info h3 {
        font-size: 14px !important;
        margin: 0 !important;
        line-height: 1.25 !important;
        font-weight: 800 !important;
    }
    .forum-info p {
        display: none !important; /* Hide description on mobile to keep it neat */
    }
    .forum-numbers {
        display: none !important; /* Hidden on mobile */
    }
    .forum-row.empty {
        display: block !important;
        text-align: center !important;
        color: var(--muted-2) !important;
        padding: 20px 16px !important;
    }
    .last-post {
        grid-column: 2 !important;
        grid-row: 2 !important;
        align-self: start !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        margin-top: 1px !important;
        min-width: 0 !important;
        width: 100% !important;
    }
    .last-post > a {
        display: block !important;
    }
    .last-post .avatar-wrapper {
        width: 20px !important;
        height: 20px !important;
        font-size: 8px !important;
        box-shadow: none !important;
    }
    .last-post > div {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        min-width: 0 !important;
        width: 100% !important;
        flex-wrap: nowrap !important;
    }
    .last-post > div > a {
        display: block !important;
        max-width: 120px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        font-size: 11px !important;
        color: var(--text) !important;
        font-weight: 700 !important;
        text-decoration: none !important;
    }
    .last-post span {
        display: inline-flex !important;
        align-items: center !important;
        font-size: 10px !important;
        color: var(--muted-2) !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }
    
    /* Online list to horizontal scroll for super-clean height */
    .user-cloud {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 8px !important;
        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }
    .user-cloud::-webkit-scrollbar {
        display: none !important;
    }
    .online-user-item {
        flex-shrink: 0 !important;
    }

    /* Widgets and Sidebar items */
    .widget {
        border-radius: 20px !important;
        padding: 16px !important;
    }
    .widget.profile-widget {
        padding: 0 !important;
    }
    .widget.profile-widget.guest-widget {
        display: none !important;
    }
    .widget-head h3 {
        font-size: 14px !important;
    }
    .profile-main h3 {
        font-size: 15px !important;
    }
    .profile-main p {
        font-size: 12px !important;
    }
    .profile-cover {
        height: 70px !important;
    }
    
    /* Recent topics inside sidebar on mobile */
    .topic-list a {
        padding: 8px 10px !important;
        border-radius: 12px !important;
        grid-template-columns: 24px minmax(0, 1fr) !important;
        gap: 8px !important;
    }
    .topic-list .avatar-wrapper.sm {
        width: 24px !important;
        height: 24px !important;
    }
    .topic-list b {
        font-size: 12px !important;
    }
    .topic-list .topic-meta {
        font-size: 10px !important;
    }
    
    .footer { flex-direction: column; align-items: flex-start; }

    /* Prevent mobile input focus auto-zoom (iOS Safari) */
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select,
    .chat-input,
    .search-big input {
        font-size: 16px !important;
    }

    /* Mobile notifications styling */
    .notif-dropdown {
        position: fixed !important;
        top: 70px !important;
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-width: calc(100% - 16px) !important;
        border-radius: 24px !important;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        background: rgba(18, 19, 26, 0.96) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
    }
    .notif-head {
        border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    }
    .notif-head span {
        color: #fff !important;
    }
    .notif-head a {
        color: var(--green) !important;
    }
    .notif-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
        transition: background 0.2s !important;
    }
    .notif-item:hover {
        background: rgba(255, 255, 255, 0.04) !important;
    }
    .notif-item.unread {
        background: rgba(0, 204, 82, 0.08) !important;
    }
    .notif-icon {
        background: rgba(255, 255, 255, 0.06) !important;
        color: #fff !important;
    }
    .notif-content p {
        color: #eef1ff !important;
    }
    .notif-content p b {
        color: var(--green) !important;
    }
    .notif-content p span {
        color: var(--muted) !important;
    }
    .notif-content small {
        color: var(--muted-2) !important;
    }

    /* Lock horizontal scrolling on mobile */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* Compact header layout on mobile to fit brand text and actions */
    @media (max-width: 600px) {
        .topbar-brand-mobile {
            gap: 6px !important;
        }
        .topbar-brand-mobile .sidebar-brand-text {
            font-size: 13px !important;
            display: inline-block !important;
        }
        .topbar-actions {
            gap: 8px !important;
        }
        .header-profile-pill {
            padding: 4px 8px 4px 4px !important;
            gap: 6px !important;
            max-width: 110px !important;
        }
        .header-profile-pill .truncate-username {
            display: inline-block !important;
            max-width: 55px !important;
            font-size: 11px !important;
        }
        .header-profile-pill img,
        .header-profile-pill .avatar {
            width: 24px !important;
            height: 24px !important;
            margin: 0 !important;
        }
    }
}

@media (max-width: 520px) {
    .site-header { width: auto !important; margin-top: 0 !important; padding: 5px !important; border-radius: 50% !important; }
    .brand-mark { width: 34px; height: 34px; font-size: 14px; border-radius: 10px; }
    .brand { gap: 0; }
    .hero { padding: 18px 14px !important; }
    .hero-actions { flex-direction: column !important; }
    .hero-actions .btn { width: 100% !important; }
    .category-header { flex-direction: column; align-items: flex-start; }
}

/* ── Prefixes ────────────────────────────────────────────────── */
.topic-prefix {
    display: inline-block;
    padding: 4px 10px;
    margin-right: 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}
.prefix-red { background: rgba(255,92,122,.15); color: #ff5c7a; border: 1px solid rgba(255,92,122,.3); }
.prefix-green { background: rgba(66,245,167,.15); color: #42f5a7; border: 1px solid rgba(66,245,167,.3); }
.prefix-blue { background: rgba(52,213,255,.15); color: #34d5ff; border: 1px solid rgba(52,213,255,.3); }
.prefix-violet { background: rgba(124,92,255,.15); color: #7c5cff; border: 1px solid rgba(124,92,255,.3); }
.prefix-cyan { background: rgba(52,213,255,.15); color: #34d5ff; border: 1px solid rgba(52,213,255,.3); }
.prefix-gray { background: rgba(255,255,255,.1); color: #9ba3c7; border: 1px solid rgba(255,255,255,.15); }
.prefix-gold { background: rgba(255,211,106,.15); color: #ffd36a; border: 1px solid rgba(255,211,106,.3); }

/* ── Topic Table ─────────────────────────────────────────────── */
.topic-table {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
}

.topic-table-head {
    display: grid;
    grid-template-columns: 1fr 180px 100px 100px 220px;
    padding: 18px 24px;
    background: rgba(0,0,0,.4);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.topic-row {
    display: grid;
    grid-template-columns: 1fr 180px 100px 100px 220px;
    align-items: center;
    padding: 20px 24px;
    background: var(--panel-light);
    transition: .2s ease;
    text-decoration: none;
    color: inherit;
}

.topic-row:hover {
    background: rgba(255,255,255,.05);
}

.topic-title-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.topic-name {
    font-size: 16px;
    font-weight: 850;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}

.topic-row:hover .topic-name {
    color: #fff;
    text-shadow: 0 0 15px rgba(124, 92, 255, 0.5), 0 0 30px rgba(52, 213, 255, 0.3);
    transform: translateX(4px);
}

.topic-name:active {
    transform: translateX(6px) scale(0.97) !important;
    color: var(--cyan) !important;
    text-shadow: 0 0 20px rgba(52, 213, 255, 0.8) !important;
}

.topic-meta-col {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.topic-num-col {
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
}

.topic-last-col {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.topic-last-col b { display: block; font-weight: 850; color: #fff; }
.topic-last-col span { font-size: 11px; color: var(--muted); font-weight: 700; }

@media (max-width: 1000px) {
    .topic-table-head, .topic-row { grid-template-columns: 1fr 180px 220px; }
    .topic-num-col { display: none; }
}

@media (max-width: 700px) {
    .topic-table-head { display: none; }
    .topic-row { grid-template-columns: 1fr 140px; padding: 16px; gap: 12px; }
    .topic-meta-col { display: none; }
    .topic-last-col { font-size: 12px; }
}
/* ── Editor ─────────────────────────────────────────────────── */
.editor-toolbar {
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: .2s;
}

.toolbar-btn:hover {
    background: #ffffff;
    border-color: rgba(0, 204, 82, 0.3);
    color: var(--green);
    box-shadow: 0 4px 12px rgba(0, 204, 82, 0.05);
}

.editor-content {
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 0 0 20px 20px;
    padding: 20px 24px;
    min-height: 250px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    outline: none;
    transition: .3s;
    overflow-y: auto;
}

.editor-content:focus {
    background: #ffffff;
    border-color: rgba(0, 204, 82, 0.5);
    box-shadow: inset 0 0 20px rgba(0, 204, 82, 0.05);
}

.editor-content[placeholder]:empty:before {
    content: attr(placeholder);
    color: var(--muted);
    cursor: text;
}

/* ── Emoji Picker ─────────────────────────────────────────────── */
.emoji-picker {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    display: none;
    backdrop-filter: blur(20px);
}

.emoji-picker.active { display: grid; }

.emoji-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    border-radius: 10px;
    transition: .2s;
}

.emoji-item:hover {
    background: var(--bg-soft);
    transform: scale(1.1);
}
/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 30, 0.4);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 28px;
    width: min(500px, 100%);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    text-align: left;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.12);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    color: var(--text);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: var(--bg-soft);
    color: var(--text);
}

.modal-header h2, .modal-header h3 {
    font-family: "Unbounded", sans-serif;
    font-size: 18px;
    margin: 0;
    color: var(--text);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    background: #ffffff;
    color: var(--text);
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-soft);
    flex-shrink: 0;
}

/* Красивый скроллбар для модалки */
.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.modal-content h3 {
    font-family: "Unbounded", sans-serif;
    font-size: 18px;
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 28px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-actions .btn {
    flex: 1;
    padding: 12px;
    border-radius: 16px;
    font-weight: 800;
}

/* Статусы Discord-style */
.status-option.active {
    background: var(--bg-soft);
    box-shadow: inset 0 0 0 1px rgba(0, 204, 82, 0.3);
}

.p-avatar-wrap {
    position: relative;
    display: inline-block;
}

.status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3.5px solid #ffffff;
    z-index: 10;
    pointer-events: none;
}

.status-dot.online { background: #42f5a7; box-shadow: 0 0 15px rgba(66,245,167,0.25); }
.status-dot.idle   { background: #ffd36a; box-shadow: 0 0 15px rgba(255,211,106,0.25); }
.status-dot.dnd    { background: #ff5c7a; box-shadow: 0 0 15px rgba(255,92,122,0.25); }
.status-dot.offline{ background: var(--muted); border-color: #ffffff; }

/* ── Toast Notifications ─────────────────────────────────────────────── */
.toast-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

.toast-item {
    width: 320px;
    padding: 16px;
    background: rgba(18, 22, 48, 0.95);
    border: 1px solid rgba(124, 92, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(124, 92, 255, 0.1);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    animation: toast-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
}

.toast-item:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(124, 92, 255, 0.2);
    border-color: rgba(124, 92, 255, 0.5);
}

.toast-item.hiding {
    animation: toast-out 0.3s ease forwards;
}

.toast-icon {
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.toast-content {
    flex: 1;
}

.toast-content p {
    margin: 0 0 4px 0;
    font-size: 13px;
    line-height: 1.4;
}

.toast-content b {
    color: #fff;
}

.toast-content span {
    color: var(--muted);
    font-size: 12px;
}

.toast-content small {
    display: block;
    color: var(--cyan);
    font-size: 11px;
    font-weight: 700;
}

@keyframes toast-in {
    0% { opacity: 0; transform: translateX(50px) scale(0.9); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
    0% { opacity: 1; transform: translateX(0) scale(1); }
    100% { opacity: 0; transform: translateX(50px) scale(0.9); }
}

@media (max-width: 600px) {
    .toast-wrapper {
        bottom: 20px;
        right: 20px;
        left: 20px;
        align-items: stretch;
    }
    .toast-item {
        width: auto;
    }
}

/* ── Avatar Container — wraps avatar-wrapper + frame overlay ── */
.avatar-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* Default size matches .avatar-wrapper default (34px) */
    width: 34px;
    height: 34px;
    --frame-inset: -2px;
    --frame-width: 2.2px;
}

/* Inner wrapper fills the container */
.avatar-container > .avatar-wrapper {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
}

/* Size: sm (28px) */
.avatar-container.size-sm {
    width: 28px;
    height: 28px;
    --frame-inset: -1.8px;
    --frame-width: 1.8px;
}

/* Size: xs (24px) — for smallest avatars */
.avatar-container.size-xs {
    width: 24px;
    height: 24px;
    --frame-inset: -1.5px;
    --frame-width: 1.5px;
}

/* Size: profile-avatar (66px, sidebar widget) */
.avatar-container.size-profile {
    width: 66px;
    height: 66px;
    margin-top: -33px;
    margin-bottom: 12px;
    --frame-inset: -3px;
    --frame-width: 3px;
}
.avatar-container.size-profile > .avatar-wrapper {
    border: 4px solid #ffffff;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    font-family: "Unbounded", sans-serif;
    font-weight: 800;
    font-size: 22px;
}
.avatar-container.size-profile.has-frame > .avatar-wrapper {
    border: none !important;
    box-shadow: none !important;
}

/* Profile page large avatar */
.p-ava-wrap {
    position: relative;
    --frame-inset: -4px;
    --frame-width: 4px;
}

.avatar-frame-overlay {
    position: absolute;
    inset: var(--frame-inset, -2px);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}

/* Pseudo-element for standard rendering of the animated border */
.avatar-frame-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: var(--frame-width, 2px); /* Border thickness must be on the masked element */
    animation: rotate-frame 4s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* Remove border/shadow of inner avatar wrapper if frame is active */
.avatar-container.has-frame .avatar-wrapper {
    border: none !important;
    box-shadow: none !important;
}

@keyframes rotate-frame {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Frame Types */

/* 1. Neon Pulse */
.avatar-frame-overlay.frame-neon::before {
    background: conic-gradient(from 0deg, #00f3ff, #ff007c, #00f3ff);
}
.avatar-frame-overlay.frame-neon {
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.4);
    animation: frame-pulse-neon 2s infinite alternate;
}
@keyframes frame-pulse-neon {
    0% { box-shadow: 0 0 10px rgba(0, 243, 255, 0.4), 0 0 5px rgba(255, 0, 124, 0.2); }
    100% { box-shadow: 0 0 20px rgba(0, 243, 255, 0.7), 0 0 15px rgba(255, 0, 124, 0.5); }
}

/* 2. Fire Glow */
.avatar-frame-overlay.frame-fire::before {
    background: conic-gradient(from 0deg, #ff3300, #ffaa00, #ff3300);
    animation-duration: 3s;
}
.avatar-frame-overlay.frame-fire {
    box-shadow: 0 0 12px rgba(255, 51, 0, 0.4);
    animation: frame-flicker-fire 0.15s infinite alternate;
}
@keyframes frame-flicker-fire {
    0% { box-shadow: 0 0 12px rgba(255, 51, 0, 0.5); filter: brightness(1); }
    100% { box-shadow: 0 0 18px rgba(255, 170, 0, 0.8); filter: brightness(1.2); }
}

/* 3. Cosmic Nebula */
.avatar-frame-overlay.frame-cosmic::before {
    background: conic-gradient(from 0deg, #7c5cff, #34d5ff, #ff3ea5, #7c5cff);
    animation-duration: 6s;
}
.avatar-frame-overlay.frame-cosmic {
    box-shadow: 0 0 15px rgba(124, 92, 255, 0.5);
    animation: frame-pulse-cosmic 3s infinite alternate;
}
@keyframes frame-pulse-cosmic {
    0% { box-shadow: 0 0 10px rgba(124, 92, 255, 0.4), 0 0 10px rgba(255, 62, 165, 0.3); }
    100% { box-shadow: 0 0 22px rgba(52, 213, 255, 0.7), 0 0 22px rgba(124, 92, 255, 0.6); }
}

/* 4. Golden Luxury */
.avatar-frame-overlay.frame-gold::before {
    background: conic-gradient(from 0deg, #ffd36a, #b8860b, #ffd36a);
    animation-duration: 5s;
}
.avatar-frame-overlay.frame-gold {
    box-shadow: 0 0 12px rgba(255, 211, 106, 0.4);
    animation: frame-shine-gold 2.5s infinite alternate;
}
@keyframes frame-shine-gold {
    0% { box-shadow: 0 0 8px rgba(255, 211, 106, 0.3); filter: contrast(1); }
    100% { box-shadow: 0 0 20px rgba(255, 211, 106, 0.7); filter: contrast(1.3); }
}

/* 5. Matrix Code */
.avatar-frame-overlay.frame-matrix::before {
    background: conic-gradient(from 0deg, #42f5a7, #0f3d24, #42f5a7);
    animation-duration: 2.5s;
}
.avatar-frame-overlay.frame-matrix {
    box-shadow: 0 0 10px rgba(66, 245, 167, 0.4);
    animation: frame-pulse-matrix 1.5s infinite alternate;
}
@keyframes frame-pulse-matrix {
    0% { box-shadow: 0 0 8px rgba(66, 245, 167, 0.4); }
    100% { box-shadow: 0 0 18px rgba(66, 245, 167, 0.8); }
}

/* UI Selector elements */
.frame-option {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}
.frame-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}
.frame-option.active {
    background: rgba(124, 92, 255, 0.12) !important;
    border-color: var(--violet) !important;
    box-shadow: 0 0 15px rgba(124, 92, 255, 0.25);
}

/* ── Animated Emojis ── */
.anim-emoji {
    height: 24px;
    width: 24px;
    vertical-align: middle;
    display: inline-block;
    margin: 0 2px;
    transition: transform 0.2s ease;
}
.anim-emoji:hover {
    transform: scale(1.3);
}

/* Emoji picker container specifically for messages.php */
.chat-footer {
    position: relative;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2px 8px;
    width: 100%;
}

.chat-input-wrapper .chat-input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.chat-emoji-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.chat-emoji-btn:hover {
    transform: scale(1.15);
    opacity: 1;
}

.chat-emoji-picker {
    position: absolute;
    bottom: calc(100% + 15px);
    right: 60px;
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    padding: 16px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-emoji-picker.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chat-emoji-picker-header {
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chat-emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
}

/* Красивый скроллбар для сетки эмодзи */
.chat-emoji-grid::-webkit-scrollbar {
    width: 6px;
}
.chat-emoji-grid::-webkit-scrollbar-track {
    background: transparent;
}
.chat-emoji-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
.chat-emoji-grid::-webkit-scrollbar-thumb:hover {
    background: var(--green);
}

.chat-emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 12px;
    padding: 6px;
    transition: all 0.2s ease;
    width: 42px;
    height: 42px;
}

.chat-emoji-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.15);
}

.chat-emoji-item img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* ── Truncate Usernames ── */
.truncate-username {
    display: inline-block;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* For main profile title and header, where max-width should be larger */
h1.truncate-username {
    max-width: 100%;
    display: block;
}
.header-user-btn .truncate-username {
    max-width: 100px;
}
.post-author-name .truncate-username {
    max-width: 100px;
}
.widget-topic-meta .truncate-username {
    max-width: 90px;
}
.topic-last-col b.truncate-username {
    max-width: 110px;
}

.profile-main-name {
    max-width: 100% !important;
}

/* ── Mobile Overrides for Modals ── */
@media (max-width: 600px) {
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .modal-content {
        width: 100%;
        border-radius: 28px 28px 0 0;
        max-height: 90vh;
        transform: translateY(100%);
        margin: 0;
    }
    .modal-overlay.active .modal-content {
        transform: translateY(0);
    }
    .toast-wrapper {
        bottom: 20px;
        right: 16px;
        left: 16px;
        width: auto;
    }
}

/* ─── Telegram Promo Banner ───────────────────────────────────── */
.promo-banner-tg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient(135deg, rgba(20, 110, 245, 0.08) 0%, rgba(124, 92, 255, 0.08) 50%, rgba(0, 204, 82, 0.03) 100%);
    border: 1px solid var(--border-strong);
    border-radius: 28px;
    padding: 28px 40px;
    margin: 28px 0 !important; /* Fixed overlap - 28px top and bottom margin */
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.promo-close-tg {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-size: 18px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}
.promo-close-tg:hover {
    background: rgba(255, 92, 122, 0.1);
    color: #ff5c7a;
    border-color: rgba(255, 92, 122, 0.2);
    transform: rotate(90deg);
}

.promo-banner-tg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(124, 92, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.promo-content {
    flex: 1;
    z-index: 2;
}

.promo-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 204, 82, 0.15);
    color: var(--green);
    border: 1px solid rgba(0, 204, 82, 0.25);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.promo-content h2 {
    font-family: 'Unbounded', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--text) !important;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.promo-content p {
    font-size: 14px;
    color: var(--muted) !important;
    line-height: 1.5;
    margin-bottom: 16px;
    max-width: 600px;
}

.promo-tg-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(20, 110, 245, 0.1);
    border: 1px solid rgba(20, 110, 245, 0.2);
    border-radius: 20px;
    padding: 6px 14px 6px 8px;
}

.tg-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #146ef5;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(20, 110, 245, 0.4);
}

.tg-url {
    font-family: 'Unbounded', sans-serif;
    font-size: 12px;
    font-weight: 800;
    color: #146ef5;
    text-decoration: none;
    transition: 0.2s;
}

.tg-url:hover {
    color: #00ff6a;
}

.promo-btn-tg {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #146ef5, #7c5cff);
    color: #fff;
    font-family: 'Unbounded', sans-serif;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    padding: 16px 28px;
    border-radius: 20px;
    box-shadow: 0 10px 24px rgba(20, 110, 245, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
    white-space: nowrap;
}

.promo-btn-tg:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 14px 32px rgba(124, 92, 255, 0.5);
    background: linear-gradient(135deg, #00ff6a, #00cc52);
}

.promo-btn-tg svg {
    transition: transform 0.2s;
}

.promo-btn-tg:hover svg {
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .promo-banner-tg {
        flex-direction: column;
        align-items: stretch;
        padding: 24px 20px;
        gap: 20px;
    }
    .promo-content h2 {
        font-size: 18px;
    }
    .promo-btn-tg {
        justify-content: center;
        width: 100%;
        padding: 14px 20px;
    }
}
