/* Velix community shell — dark messenger / forum
   Layout language inspired by the provided dashboard HTML:
   black canvas, dash-header tabs, rail, dialog list, chat pane. */

html.app-shell, html.app-shell body {
    background: var(--bg) !important;
    height: 100%;
}
html.app-shell body {
    margin: 0;
    font-family: Roboto, Figtree, sans-serif;
    color: var(--text);
    overflow: hidden;
}
html.app-shell body::before { display: none; }
html.app-shell .particles { display: none; }

:root {
    --dash-header-h: 64px;
    --rail-w: 84px;
    --list-w: 340px;
    --ice: var(--accent);
}

.dash-header {
    height: var(--dash-header-h);
    min-height: var(--dash-header-h);
    max-height: var(--dash-header-h);
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 18px;
    padding: 0 20px 0 18px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-2);
    position: sticky;
    top: 0;
    z-index: 40;
    overflow: visible;
}
.dash-header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    flex-shrink: 0;
}
.logo-star {
    width: 20px; height: 20px;
    display: inline-block;
    background: var(--accent);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.brand-logo {
    font-family: Montserrat, sans-serif;
    font-weight: 800;
    letter-spacing: .02em;
    font-size: 1.2rem;
    color: var(--text);
    text-transform: lowercase;
}
.dash-header__tabs {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.dash-header__tabs::-webkit-scrollbar { display: none; }
.dash-header__tab {
    appearance: none;
    background: transparent;
    border: 0;
    color: #9a9aa3;
    text-decoration: none;
    cursor: pointer;
    font: 700 .78rem Roboto, sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 0 4px;
}
.dash-header__tab-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    white-space: nowrap;
}
.dash-header__tab { color: var(--muted); }
.dash-header__tab:hover .dash-header__tab-inner { background: var(--hover); color: var(--text); }
.dash-header__tab_active .dash-header__tab-inner,
.dash-header__tab.router-link-active .dash-header__tab-inner {
    background: var(--hover);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--line);
}
.dash-header__tab_add-service .dash-header__tab-inner,
.dash-header__tab_ideas .dash-header__tab-inner {
    border: 1px dashed var(--line);
    color: var(--text);
}
.dash-header__tab-icon { font-size: .95rem; color: var(--text-dim); }
.dash-header__tab-badge,
.dash-header__icon-badge {
    background: var(--bad);
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 999px;
    min-width: 16px;
    text-align: center;
}
.dash-header__user {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
    flex-shrink: 0;
}
.dash-header__actions { display: flex; gap: 6px; }
.dash-header__icon-btn {
    position: relative;
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 0;
    background: transparent;
    color: #b7b7be;
    cursor: pointer;
}
.dash-header__icon-btn { color: var(--muted); }
.dash-header__icon-btn:hover { background: var(--hover); color: var(--text); }
.dash-header__icon-badge { position: absolute; top: 2px; right: 2px; }
.dash-header__account {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 168px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}
.dash-header__account:hover { color: inherit; }
.dash-header__avatar, .dash-header__avatar-img {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--panel-2);
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}
.dash-header__nick { font-weight: 700; color: var(--text); font-size: .92rem; }
.dash-header__role {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent);
    font-weight: 800;
}
.dash-header__menu-btn {
    display: none;
    background: transparent; border: 0; color: var(--text); font-size: 1.2rem; cursor: pointer;
}
.dash-header__avatar-img_empty {
    display: flex; align-items: center; justify-content: center;
    background: var(--panel-2); color: var(--text-dim); font-size: .9rem;
}
.theme-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.theme-switch {
    display: flex;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel-2);
}
.theme-switch__btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: 700 11px/1 Roboto, sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 7px 10px;
    border-radius: 999px;
    cursor: pointer;
}
.theme-switch__btn.on {
    background: var(--text);
    color: var(--bg);
}
.theme-toggle {
    width: 38px; height: 38px;
    border: 0; border-radius: 10px;
    background: var(--hover);
    cursor: pointer;
    position: relative;
}
.theme-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0,0,0,.35);
    z-index: 80;
}
.theme-panel.show { display: block; }
.theme-panel h4 {
    margin: 0 0 8px;
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}
.theme-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.theme-mode {
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    border-radius: 10px;
    padding: 10px 8px;
    cursor: pointer;
    font: 700 12px Roboto, sans-serif;
}
.theme-mode.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-swatch {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
}
.theme-swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 3px var(--text); }
.theme-toggle .theme-icon {
    position: absolute; inset: 10px;
    border-radius: 50%;
    background: #f2c14e;
    box-shadow: inset -4px -2px 0 0 #161618;
}
.theme-toggle.dark .theme-icon {
    background: transparent;
    box-shadow: inset -5px -2px 0 0 #f2c14e;
    border-radius: 50%;
}
html[data-theme="light"] body,
html[data-theme="light"].app-shell,
html[data-theme="light"].app-shell body {
    background: var(--bg) !important;
    color: var(--text);
}

.messages-dashboard { height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.messages-dashboard__body { flex: 1; display: flex; min-height: 0; }

.messenger-rail {
    width: var(--rail-w);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px;
    gap: 4px;
    background: var(--bg-2);
}
.messenger-rail__profile img {
    width: 46px; height: 46px; border-radius: 50%;
    border: 2px solid #222;
}
.messenger-rail__profile, .messenger-rail__btn {
    width: 100%;
    background: transparent;
    border: 0;
    color: #8d8d95;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 12px;
    text-decoration: none;
}
.messenger-rail__btn:hover, .messenger-rail__profile:hover { background: var(--hover); color: var(--text); }
.messenger-rail__btn.on { color: var(--ice); background: var(--hover); }
.messenger-rail__label { font-size: .62rem; font-weight: 700; letter-spacing: .02em; }
.messenger-rail__divider { height: 1px; width: 36px; background: var(--line); margin: 6px 0; }
.messenger-rail__btn-icon { font-size: 1.15rem; }

.messages-dashboard__main { flex: 1; min-width: 0; display: flex; }
.profile-messenger { flex: 1; display: flex; min-width: 0; }

.profile-messenger__sidebar {
    width: var(--list-w);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    background: var(--bg-2);
    min-width: 0;
}
.profile-messenger__list-toolbar {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 14px 8px;
}
.profile-messenger__list-title {
    margin: 0;
    font-family: Montserrat, sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
}
.profile-messenger__search-wrap {
    margin: 0 12px 10px;
    position: relative;
}
.profile-messenger__search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-dim); font-size: .85rem;
}
.profile-messenger__search {
    width: 100%;
    background: var(--panel-2);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 12px 10px 34px;
    font: 400 .9rem Roboto, sans-serif;
    outline: none;
}
.profile-messenger__search:focus { border-color: #333; }

.profile-messenger__dialogs {
    list-style: none; margin: 0; padding: 0 6px 16px;
    overflow-y: auto; flex: 1;
}
.profile-messenger__dialog {
    width: 100%;
    display: flex; gap: 10px; align-items: center;
    background: transparent; border: 0; color: inherit;
    text-align: left; cursor: pointer;
    padding: 10px 10px; border-radius: 14px;
}
.profile-messenger__dialog:hover { background: #121214; }
.profile-messenger__dialog.on { background: #17171c; }
.profile-messenger__dialog-avatar img {
    width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #1a1a1a;
}
.profile-messenger__dialog-body { flex: 1; min-width: 0; display: flex; }
.profile-messenger__dialog-main { flex: 1; min-width: 0; }
.profile-messenger__dialog-top { display: flex; align-items: center; gap: 6px; }
.profile-messenger__room-name {
    display: flex; align-items: center; gap: 6px;
    font-weight: 700; font-size: .92rem; color: var(--text);
    min-width: 0;
}
.profile-messenger__room-name-text {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.official-account-badge { color: var(--ice); font-size: .75rem; }
.profile-messenger__dialog-preview {
    display: block;
    color: var(--muted);
    font-size: .8rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin-top: 3px;
}
.profile-messenger__dialog-rail { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.profile-messenger__dialog-time { color: var(--text-dim); font-size: .7rem; }
.profile-messenger__unread {
    background: var(--ice);
    color: #041016;
    font-size: .68rem;
    font-weight: 800;
    min-width: 18px;
    text-align: center;
    padding: 1px 6px;
    border-radius: 999px;
}
.profile-messenger__room-type-icon { color: #7a7a82; margin-right: 4px; font-size: .75rem; }

.profile-messenger__chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}
.profile-messenger__chat-head {
    height: 62px;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 18px;
}
.profile-messenger__chat-head h2 { margin: 0; font-size: 1.02rem; font-family: Montserrat, sans-serif; }
.profile-messenger__chat-head p { margin: 2px 0 0; color: var(--muted); font-size: .78rem; }

.profile-messenger__log {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bubble {
    max-width: min(640px, 82%);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.bubble.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble img.ava { width: 28px; height: 28px; border-radius: 50%; }
.bubble .pad {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 16px 16px 16px 6px;
    padding: 8px 12px 7px;
}
.bubble.mine .pad {
    background: color-mix(in srgb, var(--accent) 16%, var(--panel-2));
    border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
    border-radius: 16px 16px 6px 16px;
}
.bubble .who { font-size: .72rem; font-weight: 700; margin-bottom: 2px; }
.bubble .who .role { color: var(--ice); margin-left: 6px; text-transform: uppercase; letter-spacing: .06em; font-size: .62rem; }
.bubble .who .role.moderator { color: #c4a5ff; }
.bubble .who .role.seller { color: #ffb020; }
.bubble .who .role.admin { color: var(--ice); }
.bubble .txt { font-size: .95rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.bubble .meta { color: var(--text-dim); font-size: .68rem; margin-top: 4px; text-align: right; }
.bubble .media { max-width: 280px; border-radius: 12px; display: block; margin-top: 6px; }
.bubble .del {
    border: 0; background: transparent; color: #666; cursor: pointer; font-size: .7rem; margin-left: 8px;
}

.profile-messenger__empty-state {
    flex: 1; display: flex; align-items: center; justify-content: center;
}
.profile-messenger__empty-card { text-align: center; color: var(--muted); }
.profile-messenger__empty-icon { font-size: 2.4rem; margin-bottom: 10px; color: #2a2a30; }
.profile-messenger__empty-title { margin: 0 0 6px; color: var(--text); font-family: Montserrat, sans-serif; }

.composer-bar {
    padding: 10px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.composer-tools { display: flex; gap: 6px; }
.iconish {
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid #222;
    background: #121214;
    color: #c8c8ce;
    cursor: pointer;
}
.iconish:hover { color: #fff; border-color: #333; }
.composer-row {
    display: flex; gap: 8px; align-items: flex-end;
}
.composer-row textarea {
    flex: 1;
    resize: none;
    min-height: 44px;
    max-height: 140px;
    background: #141416;
    border: 1px solid #26262b;
    border-radius: 16px;
    color: var(--text);
    padding: 12px 14px;
    font: 400 .95rem Roboto, sans-serif;
    outline: none;
}
.composer-row textarea:focus { border-color: #3a3a42; }
.send-btn {
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 800;
    cursor: pointer;
}

.picker {
    display: none;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px;
    max-height: 220px;
    overflow: auto;
}
.picker.show { display: block; }
.emoji-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-grid button {
    width: 36px; height: 36px;
    border: 0; background: transparent; cursor: pointer; border-radius: 8px;
    padding: 0;
}
.emoji-grid button:hover { background: #1b1b1f; }
.apple-emoji { width: 1.25em; height: 1.25em; vertical-align: -0.2em; display: inline-block; }
.gif-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.gif-grid img { width: 100%; height: 78px; object-fit: cover; border-radius: 8px; cursor: pointer; }
.gif-search { width: 100%; margin-bottom: 8px; }

.modal-back {
    position: fixed; inset: 0; background: rgba(0,0,0,.55);
    display: none; align-items: center; justify-content: center; z-index: 40;
}
.modal-back.show { display: flex; }
.modal-card {
    width: min(420px, 92vw);
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    padding: 18px;
}
.modal-card h3 { margin: 0 0 12px; font-family: Montserrat, sans-serif; }
.people-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; cursor: pointer; color: var(--text);
}
.people-row img { width: 36px; height: 36px; border-radius: 50%; }

.forum-shell { height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.forum-body { flex: 1; overflow: auto; padding: 24px 22px 56px; color: var(--text); }
.forum-wrap { max-width: 1040px; margin: 0 auto; }
.forum-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.forum-pagehead h1 { margin: 0 0 6px; font-family: Montserrat, sans-serif; font-size: 1.45rem; }
.forum-pagehead p { margin: 0; color: #8b8b93; font-size: .9rem; }
.forum-crumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--text-dim); font-size: .82rem; margin-bottom: 14px; }
.forum-crumbs a { color: #b7b7be; }
.forum-crumbs a:hover { color: #fff; }
.forum-board, .forum-threads {
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-2);
}
.forum-board__head, .forum-threads__head {
    display: grid;
    grid-template-columns: 1fr 72px 72px minmax(140px, 200px);
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-dim);
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
    background: var(--panel-2);
}
.forum-board__row, .forum-threads__row {
    display: grid;
    grid-template-columns: 1fr 72px 72px minmax(140px, 200px);
    gap: 10px;
    align-items: center;
    padding: 14px 16px;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid #16161a;
}
.forum-board__row { grid-template-columns: 42px 1fr 72px 72px minmax(140px, 200px); }
.forum-board__row:last-child, .forum-threads__row:last-child { border-bottom: 0; }
.forum-board__row:hover, .forum-threads__row:hover { background: #121214; color: inherit; }
.forum-board__icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: #17171a; color: #c8c8ce;
}
.forum-board__meta strong, .forum-threads__main strong { display: block; color: var(--text); font-size: .98rem; }
.forum-board__meta em, .forum-threads__main em { display: block; font-style: normal; color: #8b8b93; font-size: .78rem; margin-top: 3px; }
.forum-board__n { text-align: center; color: #8b8b93; font-size: .88rem; }
.forum-board__last { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.forum-board__last b { font-size: .8rem; color: #ddd; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.forum-board__last i { font-style: normal; color: var(--text-dim); font-size: .74rem; }
.forum-threads__row { grid-template-columns: 36px 1fr 72px 72px minmax(140px, 200px); }
.forum-threads__row.is-pinned { background: #101214; }
.forum-threads__ico { color: #7a7a82; text-align: center; }
.forum-empty { padding: 28px 16px; color: #8b8b93; text-align: center; }
.forum-pager { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.forum-pager a {
    min-width: 34px; height: 34px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; border: 1px solid #2a2a30; color: #c8c8ce; text-decoration: none;
}
.forum-pager a.on, .forum-pager a:hover { background: #17171a; color: #fff; }
.forum-post {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--surface);
}
.forum-post__author {
    background: var(--bg-2);
    border-right: 1px solid var(--line);
    padding: 16px 14px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    text-align: center;
}
.forum-post__author img { width: 64px; height: 64px; border-radius: 50%; background: #1a1a1a; }
.forum-post__author strong { color: var(--text); font-size: .92rem; }
.forum-post__body { padding: 0; min-width: 0; }
.forum-post__meta {
    display: flex; gap: 12px; align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #16161a;
    color: var(--text-dim); font-size: .78rem;
}
.forum-post__acts { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.forum-post__acts a, .forum-post__acts button {
    background: none; border: 0; color: #8b8b93; cursor: pointer; font: inherit; padding: 0;
}
.forum-post__acts a:hover, .forum-post__acts button:hover { color: #fff; }
.forum-post__acts form.inline { display: inline; }
.forum-post__text { padding: 16px 18px 20px; line-height: 1.6; word-break: break-word; }
.forum-quote {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-left: 3px solid var(--line-strong);
    background: var(--panel-2);
    border-radius: 0 10px 10px 0;
    white-space: pre-wrap;
}
.forum-quote cite { display: block; color: #8b8b93; font-size: .78rem; margin-bottom: 4px; font-style: normal; }
.forum-compose {
    width: 100%; min-height: 130px;
    background: #141416; border: 1px solid #26262b; border-radius: 12px;
    color: var(--text); padding: 12px; font: 400 .95rem Roboto, sans-serif;
}
.forum-mod { display: flex; gap: 8px; }

/* Custom right-click menu — same dashboard chrome */
.vx-menu {
    position: fixed;
    z-index: 400;
    min-width: 248px;
    max-width: min(320px, calc(100vw - 16px));
    max-height: min(72vh, 520px);
    overflow: auto;
    padding: 6px;
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04) inset;
    color: var(--text);
    font: 500 13px/1.3 Roboto, sans-serif;
    display: none;
    transform-origin: top left;
}
.vx-menu.show { display: block; animation: vxPop .12s ease-out; }
@keyframes vxPop {
    from { opacity: 0; transform: scale(.96) translateY(-4px); }
    to { opacity: 1; transform: none; }
}
.vx-menu__top {
    padding: 8px 10px 8px;
    border-bottom: 1px solid #222228;
    margin: 0 0 4px;
}
.vx-menu__top strong { display: block; font-size: 13px; }
.vx-menu__filter {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    color: var(--text-dim);
    font-weight: 500;
}
.vx-menu__label {
    padding: 8px 10px 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.vx-menu button, .vx-menu a.vx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
}
.vx-menu button:hover, .vx-menu button.on,
.vx-menu a.vx-item:hover, .vx-menu a.vx-item.on {
    background: var(--hover);
    color: var(--text);
}
.vx-menu .vx-ico {
    width: 18px;
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
}
.vx-menu button:hover .vx-ico, .vx-menu a.vx-item:hover .vx-ico { color: var(--text); }
.vx-menu .vx-kbd {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: .04em;
}
.vx-menu .vx-sep {
    height: 1px;
    background: var(--line);
    margin: 5px 6px;
}
.vx-menu .vx-danger { color: var(--bad); }
.vx-menu .vx-danger .vx-ico { color: var(--bad); }
.vx-menu .vx-danger:hover { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
@media (max-width: 760px) {
    .forum-board__head, .forum-threads__head { display: none; }
    .forum-board__row, .forum-threads__row { grid-template-columns: 36px 1fr; }
    .forum-board__n, .forum-board__last { display: none; }
    .forum-post { grid-template-columns: 1fr; }
    .forum-post__author { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); justify-content: flex-start; text-align: left; }
}
.post {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 12px;
}
.role-pill {
    font-size: .65rem; font-weight: 800; letter-spacing: .08em;
    text-transform: uppercase; padding: 2px 7px; border-radius: 999px;
    border: 1px solid currentColor;
}
.role-pill.admin { color: var(--ice); }
.role-pill.moderator { color: #c4a5ff; }
.role-pill.seller { color: #ffb020; }
.role-pill.member { color: #8b8b93; }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-size:.9rem; border:1px solid; display:flex; gap:10px; }
.alert[hidden] { display: none !important; }
.alert-success { background: rgba(62,232,154,.1); border-color: rgba(62,232,154,.4); color:#8ff0c4; }
.alert-error { background: rgba(255,90,106,.1); border-color: rgba(255,90,106,.4); color:#ffb3b8; }
.alert-info { background: rgba(61,232,255,.08); border-color: #244; color: var(--ice); }
.muted { color: var(--text-dim); }
.tool-page-react { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }
.tools-wide { max-width: 1480px; }
.tools-hub { padding-bottom: 48px; }
.tools-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin: 0 0 14px; position: sticky; top: 88px; z-index: 8;
    padding: 10px 0; background: color-mix(in srgb, var(--bg, #000) 88%, transparent);
    backdrop-filter: blur(10px);
}
.tools-search { position: relative; flex: 1 1 280px; min-width: 200px; }
.tools-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }
.tools-search .input { padding-left: 36px; }
.tools-sort { width: auto; min-width: 160px; }
.tools-chips {
    display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px;
}
.tools-chips button {
    border: 1px solid var(--line); background: var(--panel); color: var(--text-dim);
    border-radius: 999px; padding: 6px 11px; font-size: .8rem; cursor: pointer;
}
.tools-chips button em,
.tools-cat-n {
    font-style: normal;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #e23b3b;
    margin-left: 6px;
    opacity: 1;
    letter-spacing: 0;
}
.tools-cat-n { font-size: .78em; vertical-align: middle; }
.tools-chips button.on, .tools-chips button:hover { border-color: var(--line-strong); background: var(--hover); color: var(--text); }
.tools-chips button em, .tools-chips button.on em, .tools-chips button:hover em { color: #ff2d2d !important; opacity: 1 !important; }
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}
.tool-tile {
    position: relative;
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    padding: 14px 14px 12px; display: flex; flex-direction: column; min-height: 214px;
}
.tool-tile.is-openable { cursor: pointer; }
.tool-tile.is-openable:hover { border-color: var(--line-strong); background: var(--hover); }
.tool-tile.is-openable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool-tile__hit {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 3;
    border-radius: inherit;
    display: block;
    pointer-events: auto;
}
.tool-stars, .tool-acts { position: relative; z-index: 4; }
.tool-tile h3 { margin: 8px 0 4px; font-size: .98rem; line-height: 1.25; }
.tool-tile p {
    margin: 0 0 8px; font-size: .8rem; color: var(--text-dim); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    flex: 1;
}
.tool-tile__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tool-tile__ico { font-size: 1.25rem; color: var(--primary, #e8e8ea); }
.tool-tile__meta { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tool-stars { display: flex; align-items: center; gap: 1px; margin: 0 0 8px; }
.tool-star {
    border: 0; background: none; padding: 0 1px; cursor: pointer;
    color: #3a3a42; font-size: 1.05rem; line-height: 1;
}
.tool-star.on, .tool-star:hover { color: #ffb020; }
.tool-stars__avg { margin-left: 6px; font-size: .75rem; color: #8b8b93; }
.tool-stars__avg em { font-style: normal; opacity: .7; }
.tool-acts { display: flex; gap: 8px; align-items: center; }
.tool-like, .tool-views {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
    border-radius: 999px; padding: 5px 10px; font-size: .78rem; text-decoration: none;
}
.tool-like { cursor: pointer; }
.tool-like.on { color: #ff4d5a; border-color: #5a2228; }
.tool-like:hover { border-color: var(--line-strong); color: var(--text); }
.tool-views { cursor: default; color: var(--text-dim); }
.tool-views.is-off { opacity: .55; }
.tool-views__lbl { font-size: .75rem; }
@media (max-width: 900px) {
    .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .tools-bar { top: var(--dash-header-h); }
}
@media (max-width: 560px) {
    .tools-grid { grid-template-columns: 1fr; gap: 10px; }
    .tool-tile { min-height: 0; padding: 14px; }
}

.tools-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 22px;
    align-items: start;
}
.tools-main { min-width: 0; }
.tools-recent {
    position: sticky;
    top: calc(var(--dash-header-h, 64px) + 12px);
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 14px;
    padding: 14px 12px;
    max-height: calc(100vh - 96px);
    overflow: auto;
}
.tools-recent__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 10px;
}
.tools-recent__head h2 { margin: 0; font-size: .95rem; }
.tools-recent__head .muted { font-size: .72rem; }
.tools-recent__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tools-recent__item { border-radius: 10px; }
.tools-recent__item.is-last {
    box-shadow: inset 2px 0 0 var(--accent, var(--ice));
}
.tools-recent__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
}
.tools-recent__link:hover { background: var(--hover); }
.tools-recent__ico {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: var(--text);
}
.tools-recent__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.tools-recent__name {
    font-size: .84rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tools-recent__when { font-size: .72rem; }
.tools-recent__empty { margin: 8px 2px 0; font-size: .8rem; }
@media (max-width: 980px) {
    .tools-layout { grid-template-columns: 1fr; }
    .tools-recent {
        position: static;
        order: -1;
        max-height: none;
        overflow: visible;
        padding: 12px;
    }
    .tools-recent__list {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .tools-recent__item { flex: 0 0 auto; }
    .tools-recent__item.is-last { box-shadow: none; }
    .tools-recent__link {
        border: 1px solid var(--line);
        background: var(--panel-2);
        border-radius: 999px;
        padding: 6px 12px 6px 8px;
        gap: 8px;
    }
    .tools-recent__body {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    .tools-recent__when { white-space: nowrap; }
    .tools-recent__empty { margin: 0; }
}

.tg-widget { text-align: center; }
.tg-widget--official { display: flex; justify-content: center; margin: 8px 0 4px; }
.tg-login-notes {
    margin: 0 0 18px; padding-left: 1.15rem;
    color: #8b8b93; font-size: .88rem; line-height: 1.55;
}
.tg-login-notes li { margin: 0 0 4px; }
.tg-preview {
    display: flex; align-items: center; gap: 14px;
    margin: 0 0 16px; padding: 12px 14px;
    border: 1px solid var(--line, #1d1d22); border-radius: 12px;
    background: rgba(42,171,238,.06);
}
.tg-preview img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line, #1d1d22); }
.tg-preview__ph {
    width: 56px; height: 56px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #229ed9; color: #fff; font-size: 1.4rem;
}
html[data-theme="light"] .tg-preview { background: #e8f6fd; border-color: #c5e4f5; }

@media (max-width: 860px) {
    .messenger-rail { display: none; }
    .profile-messenger__sidebar { width: 100%; }
    .profile-messenger.room-open .profile-messenger__sidebar { display: none; }
    .profile-messenger:not(.room-open) .profile-messenger__chat { display: none; }
    .dash-header__tabs { display: none; }
    .dash-header__menu-btn { display: inline-flex; }
    .dash-header__tabs.open {
        display: flex !important;
        position: absolute;
        top: calc(100% + 6px);
        right: 8px;
        left: auto;
        bottom: auto;
        width: min(380px, calc(100vw - 16px));
        max-width: calc(100vw - 16px);
        height: auto;
        background: var(--panel);
        color: var(--text);
        border: 1px solid var(--line);
        border-radius: 14px;
        box-shadow: var(--shadow, 0 18px 40px rgba(0,0,0,.45));
        padding: 10px;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 4px;
        max-height: min(72dvh, calc(100dvh - var(--dash-header-h) - 16px));
        overflow-x: hidden;
        overflow-y: auto;
        z-index: 60;
    }
}
/* === cat-count-red === */
.tools-chips button em,
.tools-chips button.on em,
.tools-chips button:hover em,
h2 .tools-cat-n,
.tools-cat-n {
    font-style: normal !important;
    font-weight: 800 !important;
    color: #ff2d2d !important;
    opacity: 1 !important;
    margin-left: 6px;
}
