/* ------------[Файл «theme-system.css»]------------ // Содержит исходный код модуля «оформление интерфейса» и его связанные обработчики. Модуль: «карта исходного кода». Часть 1/1 */
/*
 * VMESTA semantic theme system
 *
 * Ровно 15 цветовых ролей на режим:
 *  5 поверхностей, 5 уровней текста, 5 системных цветов.
 * Компоненты ниже используют только эти роли и не создают свои палитры.
 */

/* Стандартная дневная тема. */
:root {
    --theme-surface-page: rgb(244 247 251);
    --theme-surface-panel: rgb(255 255 255);
    --theme-surface-nested: rgb(235 241 248);
    --theme-surface-control: rgb(229 238 252);
    --theme-surface-active: rgb(215 229 247);

    --theme-text-primary: rgb(32 79 145);
    --theme-text-secondary: rgb(68 104 154);
    --theme-text-muted: rgb(105 132 170);
    --theme-text-disabled: rgb(157 174 198);
    --theme-text-inverse: rgb(255 255 255);

    --theme-accent: var(--color-dynamic, #2563eb);
    --theme-divider: rgb(210 220 233);
    --theme-success: #16a36a;
    --theme-warning: #d68a19;
    --theme-danger: #dc3545;
}

/* Стандартная ночная тема: роли те же, меняются только значения. */
html.dark {
    --theme-surface-page: rgb(10 15 24);
    --theme-surface-panel: rgb(20 29 43);
    --theme-surface-nested: rgb(29 40 56);
    --theme-surface-control: rgb(35 51 73);
    --theme-surface-active: rgb(43 62 87);

    --theme-text-primary: rgb(232 238 246);
    --theme-text-secondary: rgb(183 195 211);
    --theme-text-muted: rgb(132 148 170);
    --theme-text-disabled: rgb(88 104 126);
    --theme-text-inverse: rgb(10 15 24);

    --theme-divider: rgb(52 68 89);
    --theme-success: #35c987;
    --theme-warning: #efb04f;
    --theme-danger: #ff6b75;
}

/* Полная цветная тема, включая Monet: входная палитра задаёт только основу,
   а все пять уровней строятся здесь одинаково. */
html.adaptive-theme {
    --theme-surface-page: var(--adaptive-background);
    --theme-surface-panel: var(--adaptive-surface);
    --theme-surface-nested: var(--adaptive-surface-2);
    --theme-surface-control: var(--adaptive-control-light, var(--adaptive-surface-2));
    --theme-surface-active: var(--adaptive-active-light, var(--adaptive-border));

    --theme-text-primary: color-mix(in srgb, #0f172a 90%, var(--theme-accent) 10%);
    --theme-text-secondary: color-mix(in srgb, #475569 91%, var(--theme-accent) 9%);
    --theme-text-muted: color-mix(in srgb, #64748b 89%, var(--theme-accent) 11%);
    --theme-text-disabled: color-mix(in srgb, var(--theme-text-muted) 52%, var(--theme-surface-panel) 48%);
    --theme-text-inverse: #ffffff;

    --theme-divider: var(--adaptive-border);
}

html.adaptive-theme.dark {
    --theme-surface-control: var(--adaptive-control-dark, var(--adaptive-surface-2));
    --theme-surface-active: var(--adaptive-active-dark, var(--adaptive-border));

    --theme-text-primary: color-mix(in srgb, #f8fafc 93%, var(--theme-accent) 7%);
    --theme-text-secondary: color-mix(in srgb, #cbd5e1 90%, var(--theme-accent) 10%);
    --theme-text-muted: color-mix(in srgb, #94a3b8 89%, var(--theme-accent) 11%);
    --theme-text-disabled: color-mix(in srgb, var(--theme-text-muted) 48%, var(--theme-surface-panel) 52%);
    --theme-text-inverse: var(--theme-surface-page);
}

/* Мост для старых компонентов. Их прежние имена теперь указывают на одну
   семантическую шкалу и больше не образуют независимые палитры. */
html:root {
    --vmesta-ui-primary: var(--theme-accent);
    --vmesta-ui-ink: var(--theme-text-primary);
    --vmesta-ui-muted: var(--theme-text-muted);
    --vmesta-ui-panel: var(--theme-surface-panel);
    --vmesta-ui-soft: var(--theme-surface-nested);
    --vmesta-unified-surface: var(--theme-surface-panel);
    --vmesta-unified-inner: var(--theme-surface-nested);
    --vmesta-unified-strong: var(--theme-surface-control);
    --vmesta-unified-ink: var(--theme-text-primary);
    --vmesta-unified-muted: var(--theme-text-muted);
    --vmesta-unified-line: var(--theme-divider);
    --vmesta-post-surface: var(--theme-surface-panel);
    --vmesta-post-surface-hover: var(--theme-surface-panel);
    --vmesta-post-inner: var(--theme-surface-nested);
    --vmesta-post-inner-strong: var(--theme-surface-control);
    --vmesta-post-line: var(--theme-divider);
    --vmesta-rail-surface: var(--theme-surface-panel);
    --vmesta-feed-surface: var(--theme-surface-panel);
    --vmesta-feed-active: var(--theme-surface-control);
    --vmesta-full-panel: var(--theme-surface-panel);
    --vmesta-full-panel-soft: var(--theme-surface-nested);
    --vmesta-menu-surface: var(--theme-surface-nested);
    --vmesta-messages-surface: var(--theme-surface-panel);
    --vmesta-left-reference-surface: var(--theme-surface-panel);
}

html:root.adaptive-theme {
    --vmesta-left-reference-surface: var(--adaptive-card-tint, var(--theme-surface-panel));
}

html:root:not(.adaptive-theme) {
    --standard-panel: var(--theme-surface-panel);
    --standard-panel-soft: var(--theme-surface-nested);
    --standard-active: var(--theme-surface-control);
    --standard-line: var(--theme-divider);
    --standard-text-active: var(--theme-text-primary);
    --standard-text-secondary: var(--theme-text-secondary);
    --standard-text-passive: var(--theme-text-muted);
}

html:root.adaptive-theme {
    --adaptive-ui-panel: var(--theme-surface-panel);
    --adaptive-ui-active: var(--theme-surface-control);
    --adaptive-ui-line: var(--theme-divider);
    --adaptive-ui-line-strong: var(--theme-accent);
    --adaptive-text-active: var(--theme-text-primary);
    --adaptive-text-secondary: var(--theme-text-secondary);
    --adaptive-text-passive: var(--theme-text-muted);
    --adaptive-text-strong: var(--theme-text-primary);
    --adaptive-text-muted: var(--theme-text-muted);
}

/* Уровень 1: фон маршрута. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body,
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body #content-area {
    background-color: var(--theme-surface-page) !important;
    color: var(--theme-text-primary) !important;
}

/* Уровень 2: несущие панели. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    #site-header,
    #profile-tabs-container,
    #profile-left-rail nav,
    #profile-left-rail #profile-friends-open-button,
    #profile-left-rail .space-left-photos,
    #profile-right-rail .achievement-sidebar-card,
    #profile-right-rail .profile-interests-card,
    #profile-right-rail .interest-match-card,
    .post-item,
    .space-post,
    .space-switchboard,
    .space-composer,
    .space-side-card,
    .space-list-panel,
    .space-intro-card,
    .spaces-index-toolbar,
    .spaces-index-card,
    #post-viewer-panel,
    #viewer-sidebar,
    #viewer-scroll-region,
    #viewer-post-header,
    #viewer-post-summary,
    #viewer-comments-block,
    #viewer-comments-list,
    .media-viewer-post-slot,
    #space-about-panel,
    #space-about-panel .space-about-head,
    #space-about-panel .space-about-body,
    #space-about-panel .space-about-footer,
    #space-about-panel .space-about-identity-bar,
    .achievement-sidebar-card,
    .achievements-dialog,
    .achievement-showcase-dialog,
    .achievements-dialog-head,
    .achievements-scope-tabs,
    .achievements-dialog-tabs,
    .achievements-dialog-body,
    .achievement-showcase-dialog-body,
    .achievements-dialog-footer,
    .theme-catalog-dialog,
    .messenger-shell,
    .messenger-dialogs-panel,
    .messenger-conversation,
    .messenger-side-section,
    .messenger-main-header,
    .messenger-conversation-header,
    .messenger-message-stream,
    .messenger-loading
) {
    border-color: transparent !important;
    background: var(--theme-surface-panel) !important;
    background-image: none !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

/* Старое окно «О пространстве» использует ID в селекторе. Этот мост
   направляет и его внутренние карточки на общий третий уровень. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #space-about-panel :is(
        .space-about-card,
        .space-about-quote,
        .space-about-longform,
        .space-about-contact-section,
        .profile-spaces-section
    ) {
    border-color: transparent !important;
    background: var(--theme-surface-nested) !important;
    background-image: none !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(.post-item, .space-post, .spaces-index-card):hover {
    border-color: transparent !important;
    background: var(--theme-surface-panel) !important;
    box-shadow: none !important;
}

/* Уровень 3: содержимое внутри несущей панели. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    .post-attachment-card,
    .post-file-selection-card,
    .post-media-grid,
    .post-hashtag-chip,
    .space-post-file,
    .space-about-card,
    .space-about-quote,
    .space-about-longform,
    .space-about-contact-section,
    .profile-spaces-section,
    .achievement-row,
    .achievement-task,
    .achievement-badge,
    .achievement-showcase-item,
    .achievement-scope-empty,
    .achievement-showcase-empty,
    .profile-interest-chip,
    .interest-match-card,
    .comment-node,
    .viewer-form-shell,
    .messenger-search,
    .messenger-chat-search,
    .messenger-composer,
    .messenger-pinned-panel,
    .messenger-inline-media-bar,
    .messenger-message.is-incoming .messenger-bubble,
    .messenger-bubble.is-poll,
    .messenger-poll-option,
    .global-search-result-section,
    .global-search-side,
    .theme-catalog-section
) {
    border-color: transparent !important;
    background: var(--theme-surface-nested) !important;
    background-image: none !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

/* Уровень 4: поля, кнопки и локальные управляющие поверхности. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    #global-search,
    .spaces-index-search,
    .spaces-index-search input,
    .messenger-chat-search input,
    .messenger-chat-search button,
    .messenger-composer textarea,
    #space-about-panel input,
    #space-about-panel textarea,
    #space-about-panel select,
    .achievements-scope-tabs button,
    .achievements-dialog-tabs button,
    .publisher-search-button,
    .publisher-create-button,
    .space-tabs button,
    .theme-scope-switch button,
    .theme-builder-grid label,
    .messenger-chat-menu,
    .messenger-message-menu,
    .messenger-attach-menu,
    .messenger-blank-context-menu,
    .notification-settings-menu,
    .comment-dropdown,
    .post-dropdown
) {
    border-color: transparent !important;
    background: var(--theme-surface-control) !important;
    background-image: none !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

/* Уровень 5: выбранное, активное и наведённое. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    .nav-item[aria-current="page"],
    .nav-item.bg-blue-50,
    .tab-btn.active-tab,
    .space-tabs button.is-active,
    .spaces-index-scope button.is-active,
    .achievements-scope-tabs button.is-active,
    .achievements-dialog-tabs button.is-active,
    .messenger-chat-row.is-active,
    .messenger-message.is-outgoing .messenger-bubble,
    .messenger-poll-option.is-selected
) {
    border-color: transparent !important;
    background: var(--theme-surface-active) !important;
    background-image: none !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    .nav-item,
    .tab-btn,
    .messenger-chat-row,
    .comment-dropdown button,
    .post-dropdown button
):hover {
    background-color: var(--theme-surface-active) !important;
    color: var(--theme-text-primary) !important;
}

/* Пять уровней текста. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    h1, h2, h3, h4,
    strong,
    .post-author,
    .post-author-link,
    .space-post-title,
    .space-card-title,
    .item-name,
    .comment-author-link
) {
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    [class*="text-gray-700"], [class*="text-gray-600"], [class*="text-gray-500"],
    [class*="text-slate-700"], [class*="text-slate-600"], [class*="text-slate-500"],
    .post-date, .space-post-date
) {
    color: var(--theme-text-secondary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    [class*="text-gray-400"], [class*="text-gray-300"],
    [class*="text-slate-400"], [class*="text-slate-300"],
    small, time
) {
    color: var(--theme-text-muted) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(:disabled, [aria-disabled="true"], .is-disabled) {
    color: var(--theme-text-disabled) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(input, textarea)::placeholder {
    color: var(--theme-text-muted) !important;
    opacity: 1 !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(.btn-publish, .space-primary-button, .load-more-posts) {
    background: var(--theme-accent) !important;
    color: var(--theme-text-inverse) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body #theme-monet-apply {
    background: var(--theme-accent) !important;
    color: var(--theme-text-inverse) !important;
}

/* Единственный цвет линий используется только как разделитель, не как
   обводка карточек. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    .post-actions,
    .space-post-footer,
    .viewer-comments-head,
    .theme-catalog-head,
    .theme-catalog-footer
) {
    border-color: var(--theme-divider) !important;
}

/* Окно сообщений и редактор разделяются уровнями фона без контуров. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(#messages-root, #messages-side-root) {
    --msg-bg: var(--theme-surface-page);
    --msg-panel: var(--theme-surface-panel);
    --msg-panel-strong: var(--theme-surface-control);
    --msg-line: transparent;
    --msg-text: var(--theme-text-primary);
    --msg-muted: var(--theme-text-muted);
    --msg-accent: var(--theme-accent);
    --msg-menu-surface: var(--theme-surface-control);
    --msg-menu-soft: var(--theme-surface-nested);
    --msg-menu-active: var(--theme-surface-active);
    --msg-search-shell-surface: var(--theme-surface-panel);
    --msg-search-field-surface: var(--theme-surface-control);
    --msg-composer-surface: var(--theme-surface-nested);
    --msg-poll-surface: var(--theme-surface-nested);
    --msg-poll-option-surface: var(--theme-surface-control);
    --msg-poll-option-active: var(--theme-surface-active);
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(#messages-root, #messages-side-root),
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(#messages-root, #messages-side-root) :is(
    .messenger-shell,
    .messenger-dialogs-panel,
    .messenger-conversation,
    .messenger-side-panel,
    .messenger-side-section,
    .messenger-main-header,
    .messenger-conversation-header,
    .messenger-message-stream,
    .messenger-search,
    .messenger-chat-search,
    .messenger-composer
) {
    border: 0 !important;
    border-color: transparent !important;
    outline: 0 !important;
    box-shadow: none !important;
}

/* Статусы не входят в основную шкалу поверхностей. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(.text-green-500, .text-green-600, .is-success) { color: var(--theme-success) !important; }
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(.text-amber-500, .text-yellow-500, .is-warning) { color: var(--theme-warning) !important; }
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(.text-red-500, .text-red-600, .is-danger) { color: var(--theme-danger) !important; }

/* Иконки интерфейса используют уже существующие роли палитры. Значок
   действия окрашен акцентом темы, а подпись рядом остаётся основным текстом. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    #site-header button,
    #site-header a,
    #profile-tabs-container .tab-btn,
    #profile-left-rail .nav-item,
    .profile-contact-link,
    .profile-contact-links-bar a,
    .publisher-search-button,
    .publisher-create-button,
    .space-tabs button,
    .spaces-index-search,
    .messenger-search,
    .messenger-chat-search,
    .messenger-composer,
    .messenger-room-action,
    .messenger-header-action,
    .settings-menu-icon
) :is(svg, .profile-tab-icon) {
    color: var(--theme-accent) !important;
    stroke: var(--theme-accent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #profile-left-rail .nav-item svg.fill-blue-600 {
    fill: var(--theme-accent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #profile-left-rail .nav-item svg.fill-none {
    fill: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    #profile-tabs-container .profile-tab-label,
    #profile-left-rail .nav-item span,
    .publisher-search-button span,
    .publisher-create-button span
) {
    color: var(--theme-text-primary) !important;
}

/* Пассивные действия публикации спокойнее основного текста; выбранное
   действие снова использует акцент и поэтому не путается с подписью. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    .post-actions,
    .space-post-footer,
    #viewer-post-actions
) button {
    color: var(--theme-text-secondary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    .post-actions,
    .space-post-footer,
    #viewer-post-actions
) button:is(:hover, .active, [aria-pressed="true"]) {
    color: var(--theme-accent) !important;
}

/* Цвет награды — это идентификатор типа достижения, а не шестнадцатый
   уровень темы. Поверхности и подписи остаются в общей 15-ролевой палитре,
   но сердце, комментарий, контакт и остальные награды сохраняют свой цвет. */
html:root body :is(.achievement-showcase-item, .achievement-badge, .achievement-task-icon).achievement-kind-likes { --achievement-kind-color: #ec4899; }
html:root body :is(.achievement-showcase-item, .achievement-badge, .achievement-task-icon).achievement-kind-comments { --achievement-kind-color: #06b6d4; }
html:root body :is(.achievement-showcase-item, .achievement-badge, .achievement-task-icon).achievement-kind-messages,
html:root body :is(.achievement-showcase-item, .achievement-badge, .achievement-task-icon).achievement-kind-signal { --achievement-kind-color: #0ea5e9; }
html:root body :is(.achievement-showcase-item, .achievement-badge, .achievement-task-icon).achievement-kind-posts { --achievement-kind-color: #3b82f6; }
html:root body :is(.achievement-showcase-item, .achievement-badge, .achievement-task-icon).achievement-kind-views { --achievement-kind-color: #6366f1; }
html:root body :is(.achievement-showcase-item, .achievement-badge, .achievement-task-icon).achievement-kind-spaces { --achievement-kind-color: #14b8a6; }
html:root body :is(.achievement-showcase-item, .achievement-badge, .achievement-task-icon).achievement-kind-verified { --achievement-kind-color: #10b981; }
html:root body :is(.achievement-showcase-item, .achievement-badge, .achievement-task-icon).achievement-kind-friends,
html:root body :is(.achievement-showcase-item, .achievement-badge, .achievement-task-icon).achievement-kind-members,
html:root body :is(.achievement-showcase-item, .achievement-badge, .achievement-task-icon).achievement-kind-zodiac,
html:root body :is(.achievement-showcase-item, .achievement-badge, .achievement-task-icon).achievement-kind-star { --achievement-kind-color: #8b5cf6; }

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    :is(.achievement-showcase-item, .achievement-badge, .achievement-task-icon)[class*="achievement-kind-"] {
    color: var(--achievement-kind-color) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .achievement-showcase-item[class*="achievement-kind-"] > span,
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .achievement-badge[class*="achievement-kind-"] > span,
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .achievement-task-icon[class*="achievement-kind-"] {
    background: color-mix(in srgb, var(--achievement-kind-color) 16%, var(--theme-surface-nested)) !important;
    color: var(--achievement-kind-color) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    :is(.achievement-showcase-item, .achievement-badge, .achievement-task-icon)[class*="achievement-kind-"] :is(svg, svg *) {
    color: var(--achievement-kind-color) !important;
    stroke: currentColor !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .achievement-showcase-item[class*="achievement-kind-"] > small,
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .achievement-badge[class*="achievement-kind-"] > b {
    color: var(--achievement-kind-color) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .achievement-showcase-item[class*="achievement-kind-"] > strong {
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .achievement-badge[class*="achievement-kind-"] > i:not(.is-lock) {
    background: var(--achievement-kind-color) !important;
    color: var(--theme-text-inverse) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    :is(.achievement-row.is-locked .achievement-badge, .achievement-badge.is-locked) {
    --achievement-kind-color: var(--theme-text-disabled);
}

/* ------------[Геометрия и недостающие семейства компонентов]------------ // Оформляет связанный блок интерфейса.
   Окна управления, каталог пространств и фотопросмотрщик используют те же
   уровни 2–5. Здесь нет новых цветов — только маршрутизация на 15 ролей. Модуль: «оформление интерфейса». Часть 1/18 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    .space-manage-panel,
    .space-role-picker-modal > section,
    .spaces-index-toolbar,
    .media-viewer-post-slot,
    #media-viewer .media-viewer-post-slot #viewer-sidebar,
    #media-viewer .media-viewer-post-slot #viewer-scroll-region,
    #media-viewer .media-viewer-post-slot #viewer-post-header,
    #media-viewer .media-viewer-post-slot #viewer-post-summary,
    #media-viewer .media-viewer-post-slot #viewer-comments-block,
    #media-viewer .media-viewer-post-slot #viewer-comments-list,
    #media-viewer .media-viewer-post-slot .viewer-comments-head,
    #media-viewer .media-viewer-post-slot #viewer-form-container,
    #media-viewer .media-viewer-post-slot .viewer-form-shell
) {
    border-color: transparent !important;
    background: var(--theme-surface-panel) !important;
    background-image: none !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    .space-role-visibility,
    .space-team-section,
    #media-viewer .media-viewer-post-slot .comment-node,
    #media-viewer .media-viewer-post-slot .comment-form-container,
    #media-viewer .media-viewer-post-slot #viewer-comments-count
) {
    border-color: transparent !important;
    background: var(--theme-surface-nested) !important;
    background-image: none !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    .space-role-visibility-options button,
    .space-team-person,
    .space-role-picker-list > button,
    .spaces-index-view,
    .spaces-index-view button
) {
    border-color: transparent !important;
    background: var(--theme-surface-control) !important;
    background-image: none !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    .space-role-visibility-options button.is-active,
    .space-role-picker-list > button:hover,
    .spaces-index-view button:is(.is-active, :hover)
) {
    border-color: transparent !important;
    background: var(--theme-surface-active) !important;
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .spaces-index-scope {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .spaces-index-scope button {
    border: 0 !important;
    background: transparent !important;
    color: var(--theme-text-secondary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .spaces-index-scope button:is(.is-active, :hover) {
    background: var(--theme-surface-control) !important;
    color: var(--theme-accent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .spaces-index-scope button span {
    border: 0 !important;
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
}

/* Внутренние обёртки веток комментариев прозрачны: цвет принадлежит списку
   и самой карточке комментария, а не случайной промежуточной обёртке. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #media-viewer .media-viewer-post-slot :is(.root-wrapper, .replies-group, .replies-inner-list) {
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* Одинаковое скругление несущих карточек и внутренних полей. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    .space-manage-panel,
    .space-role-picker-modal > section,
    .spaces-index-toolbar,
    .achievement-sidebar-card,
    .profile-interests-card,
    .media-viewer-post-slot,
    #media-viewer .media-viewer-post-slot #viewer-sidebar,
    .messenger-composer
) {
    border-radius: 1rem !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    #global-search,
    .search-wrapper,
    .spaces-index-search,
    .space-role-picker-search,
    .messenger-search,
    .messenger-chat-search,
    .messenger-room-member-search,
    .messenger-room-member-picker-search,
    .messenger-composer textarea
) {
    border: 0 !important;
    border-radius: .78rem !important;
    outline: 0 !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    #global-search,
    .spaces-index-search,
    .space-role-picker-search,
    .messenger-search,
    .messenger-chat-search,
    .messenger-room-member-search,
    .messenger-room-member-picker-search
) {
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    .spaces-index-search input,
    .space-role-picker-search input,
    .messenger-search input,
    .messenger-chat-search input,
    .messenger-room-member-search input,
    .messenger-room-member-picker-search input
) {
    border: 0 !important;
    background: transparent !important;
    color: var(--theme-text-primary) !important;
    outline: 0 !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-composer textarea {
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
}

/* Адресные правила не дают высокой специфичности старых ID-селекторов
   вернуть собственный фон поиску чата и комментариям фотопросмотрщика. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #messages-root .messenger-shell .messenger-chat-search.messenger-chat-search {
    border: 0 !important;
    border-radius: .78rem !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #space-role-picker-modal .space-role-picker-search {
    border: 0 !important;
    border-radius: .78rem !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #media-viewer .media-viewer-post-slot #viewer-sidebar #viewer-comments-list .comment-node,
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #media-viewer .media-viewer-post-slot #viewer-sidebar #viewer-form-container .comment-form-container {
    border-color: transparent !important;
    background: var(--theme-surface-nested) !important;
    background-image: none !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    .space-role-visibility,
    .space-team-section,
    .space-team-person,
    .achievement-showcase-item,
    #media-viewer .media-viewer-post-slot .comment-node,
    #media-viewer .media-viewer-post-slot .comment-form-container
) {
    border-radius: .78rem !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    .space-manage-panel header strong,
    .space-role-visibility strong,
    .space-team-section > header span,
    .space-team-person strong,
    .space-role-picker-modal header strong,
    .space-role-picker-list strong,
    #media-viewer .media-viewer-post-slot .comment-node strong
) {
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    .space-role-visibility small,
    .space-role-visibility p,
    .space-team-person small,
    .space-team-edit-note,
    .space-team-grid > p,
    .space-role-picker-modal header span,
    .space-role-picker-list small,
    #media-viewer .media-viewer-post-slot .comment-node small
) {
    color: var(--theme-text-muted) !important;
}

/* Хвост сообщения остаётся видимым, но почти полностью заходит под пузырь и
   больше не выпирает отдельным прямоугольником у голосовых и опросов. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-message.is-incoming .messenger-bubble:not(.is-poll) {
    --message-shape-fill: var(--theme-surface-nested);
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-message.is-outgoing .messenger-bubble:not(.is-poll) {
    --message-shape-fill: var(--theme-surface-active);
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-bubble > .messenger-bubble-tail {
    bottom: 0 !important;
    width: .78rem !important;
    height: .98rem !important;
    overflow: visible !important;
    color: var(--message-shape-fill, var(--theme-surface-nested)) !important;
    filter: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-message.is-outgoing .messenger-bubble > .messenger-bubble-tail {
    right: -.44rem !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-message.is-incoming .messenger-bubble > .messenger-bubble-tail {
    left: -.44rem !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-bubble.is-poll > .messenger-bubble-tail {
    color: var(--theme-surface-nested) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-bubble > .messenger-bubble-tail-fill {
    fill: currentColor !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-bubble > .messenger-bubble-tail-line {
    display: none !important;
}

/* Ответ внутри сообщения всегда отделён акцентной линией. Цвет берётся из
   системной роли темы, а не из старой локальной палитры мессенджера. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-bubble > .messenger-reply-quote {
    border: 0 !important;
    border-left: .2rem solid var(--theme-accent) !important;
    border-radius: .32rem .65rem .65rem .32rem !important;
    background: color-mix(in srgb, var(--theme-accent) 10%, transparent) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-bubble > .messenger-reply-quote strong {
    color: var(--theme-accent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-bubble > .messenger-reply-quote span {
    color: var(--theme-text-secondary) !important;
}

/* Голосовое с цитатой не получает служебный класс is-voice-note-only.
   Поэтому гасим старую отдельную подложку плеера непосредственно внутри
   пузыря: цитата, плеер и время снова воспринимаются одним сообщением. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-bubble :is(.messenger-voice-note-list, .messenger-voice-note) {
    border-color: transparent !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-bubble:has(> .messenger-reply-quote) > .messenger-reply-quote {
    margin: .02rem 0 .34rem !important;
}

/* Правая колонка — только раскладка. Фон рисуют её скруглённые секции,
   поэтому за ними больше не появляется квадратная подложка. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #messages-side-root .messenger-side-panel {
    border: 0 !important;
    border-radius: 1rem !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #messages-side-root .messenger-side-section {
    border-color: transparent !important;
    border-radius: 1rem !important;
    background: var(--theme-surface-panel) !important;
    background-image: none !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

/* Поиск обязан отличаться от несущей панели во всех режимах. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(
    #global-search,
    .spaces-index-search,
    .space-role-picker-search,
    .messenger-search,
    .messenger-chat-search,
    .messenger-room-member-search,
    .messenger-room-member-picker-search
) {
    background: var(--theme-surface-control) !important;
    background-image: none !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme-accent) 20%, var(--theme-divider)) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #site-header #global-search {
    background: var(--theme-surface-control) !important;
    background-image: none !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme-accent) 20%, var(--theme-divider)) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #site-header #global-search:focus {
    background: var(--theme-surface-active) !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme-accent) 42%, var(--theme-divider)) !important;
}

/* Фото профиля получает тонкую рамку, а служебные значки располагаются
   внутри изображения и больше не теряются на фоне страницы. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #profile-avatar-card > div:first-child {
    border: 2px solid color-mix(in srgb, var(--theme-accent) 38%, var(--theme-divider)) !important;
    background: var(--theme-surface-panel) !important;
    box-shadow: 0 .7rem 1.8rem color-mix(in srgb, var(--theme-text-primary) 18%, transparent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #profile-avatar-card > .profile-avatar-role-badge {
    top: .52rem !important;
    right: -.72rem !important;
    z-index: 25 !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #profile-avatar-card > .profile-avatar-verification-badge {
    top: .52rem !important;
    right: -.62rem !important;
    z-index: 25 !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #profile-avatar-card > .profile-avatar-verification-badge.is-below-role {
    top: 2.38rem !important;
}

/* Значки прав действительно сидят на линии рамки, а не закрывают лицо. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #profile-avatar-card {
    overflow: visible !important;
}

/* ------------[Единая узкая прокрутка]------------ // Оформляет связанный блок интерфейса.
   Один размер и один тематический цвет используются у документа, окон и
   внутренних списков. В отличие от старого правила сюда входит сам html,
   поэтому полоса главной страницы больше не выпадает из системы. Модуль: «оформление интерфейса». Часть 2/18 */
html:root,
html:root body,
html:root body * {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--theme-accent) 68%, var(--theme-text-muted)) transparent;
}

html:root::-webkit-scrollbar,
html:root body::-webkit-scrollbar,
html:root body *::-webkit-scrollbar {
    width: .34rem;
    height: .34rem;
}

html:root::-webkit-scrollbar-track,
html:root body::-webkit-scrollbar-track,
html:root body *::-webkit-scrollbar-track {
    border: 0 !important;
    background: transparent !important;
}

html:root::-webkit-scrollbar-thumb,
html:root body::-webkit-scrollbar-thumb,
html:root body *::-webkit-scrollbar-thumb {
    min-height: 1.8rem;
    border: 0 !important;
    border-radius: 999px;
    background: color-mix(in srgb, var(--theme-accent) 68%, var(--theme-text-muted)) !important;
}

html:root::-webkit-scrollbar-thumb:hover,
html:root body::-webkit-scrollbar-thumb:hover,
html:root body *::-webkit-scrollbar-thumb:hover {
    background: var(--theme-accent) !important;
}

html:root::-webkit-scrollbar-button,
html:root body::-webkit-scrollbar-button,
html:root body *::-webkit-scrollbar-button {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

html:root::-webkit-scrollbar-corner,
html:root body::-webkit-scrollbar-corner,
html:root body *::-webkit-scrollbar-corner {
    background: transparent !important;
}

/* ------------[Редакторы статуса и истории]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 3/41 */
html:root body #about-modal .profile-field-editor {
    position: relative;
    width: 100%;
}

html:root body #about-modal .profile-field-editor > textarea {
    width: 100% !important;
    min-height: 4rem !important;
    padding: .58rem 5.15rem 2.6rem .68rem !important;
    resize: none !important;
    border: 0 !important;
    border-radius: .78rem !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme-accent) 18%, var(--theme-divider)) !important;
}

html:root body #about-modal .profile-details-story-editor > textarea {
    min-height: 9rem !important;
}

html:root body #about-modal .profile-field-editor.is-expanded > textarea {
    min-height: min(24rem, 48vh) !important;
}

html:root body #about-modal .profile-field-editor-tools {
    position: absolute;
    right: .5rem;
    bottom: .5rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

html:root body #about-modal .profile-field-editor-tools > :is(.profile-field-editor-expand, .profile-details-story-emoji) {
    position: static !important;
    inset: auto !important;
    display: inline-grid !important;
    width: 1.82rem !important;
    height: 1.82rem !important;
    place-items: center;
    border: 0 !important;
    border-radius: .58rem !important;
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
    box-shadow: none !important;
}

/* Контраст плеера и отправки задаётся одной парой системных ролей во всех
   темах: акцентная поверхность + инверсный знак. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    :is(#global-music-play, .messenger-send-button) {
    border: 0 !important;
    background: var(--theme-accent) !important;
    color: var(--theme-text-inverse) !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme-text-inverse) 28%, transparent),
                0 .38rem .9rem color-mix(in srgb, var(--theme-accent) 26%, transparent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #global-music-play :is(svg, svg *) {
    color: currentColor !important;
    fill: currentColor !important;
    stroke: currentColor !important;
    opacity: 1 !important;
}

/* ------------[Редактирование сообщения]------------ // Оформляет связанный блок интерфейса.
   Заголовок редактирования — самостоятельная внутренняя карточка. Его
   радиус больше не обрезается прямоугольным фоном редактора. Модуль: «оформление интерфейса». Часть 3/18 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-composer:has(> .messenger-composer-reply.is-editing) {
    border: 0 !important;
    border-radius: 1rem !important;
    background: var(--theme-surface-nested) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-composer > .messenger-composer-reply.is-editing {
    width: auto !important;
    min-height: 2.7rem !important;
    margin: .06rem .08rem .32rem !important;
    padding: .48rem .58rem !important;
    border: 0 !important;
    border-radius: .78rem !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-composer > .messenger-composer-reply.is-editing > button {
    border-radius: .62rem !important;
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
}

/* Поиск в шапке повторяет заполненное поле поиска сообщений: без рамки и
   с заметной смесью панели и акцента, одинаковой для всех палитр. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #site-header #global-search {
    border: 0 !important;
    background: color-mix(in srgb, var(--theme-surface-panel) 76%, var(--theme-accent) 24%) !important;
    color: var(--theme-text-primary) !important;
    outline: 0 !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #site-header #global-search:focus {
    background: color-mix(in srgb, var(--theme-surface-panel) 68%, var(--theme-accent) 32%) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #site-header #global-search::placeholder {
    color: var(--theme-text-secondary) !important;
    opacity: 1 !important;
}

/* Поиск в шапке — полноценное поле, а не текст на фоне шапки. Для него
   используется готовый пятый уровень поверхности, поэтому форма остаётся
   заметной даже в палитрах, где цвет панели близок к акценту. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #site-header #global-search {
    min-height: 2.35rem !important;
    padding: .55rem 1rem .55rem 2.5rem !important;
    border-radius: .88rem !important;
    background: var(--theme-surface-active) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #site-header #global-search:focus {
    background: var(--theme-surface-control) !important;
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--theme-accent) 38%, transparent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #site-header .search-wrapper > .group > div:first-of-type {
    color: var(--theme-accent) !important;
    pointer-events: none;
}

/* ------------[Управление пространством]------------ // Оформляет связанный блок интерфейса.
   Несущая панель больше не выглядит одним высоким цветным прямоугольником:
   тело прозрачно, а каждая группа команды занимает свой реальный уровень. Модуль: «оформление интерфейса». Часть 4/18 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .space-manage-panel {
    display: grid !important;
    width: min(32rem, calc(100vw - 1.5rem)) !important;
    max-height: min(44rem, calc(100dvh - 5rem)) !important;
    grid-template-rows: auto minmax(0, auto) !important;
    overflow: hidden !important;
    border: 1px solid var(--theme-divider) !important;
    border-radius: 1.12rem !important;
    background: var(--theme-surface-nested) !important;
    box-shadow: 0 1.25rem 3.2rem color-mix(in srgb, var(--theme-text-primary) 20%, transparent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .space-manage-panel > header {
    min-height: 4.35rem !important;
    padding: .9rem 1rem !important;
    border: 0 !important;
    border-bottom: 1px solid var(--theme-divider) !important;
    border-radius: 0 !important;
    background: var(--theme-surface-active) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .space-manage-panel .space-manage-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: .24rem !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .space-manage-panel .space-manage-icon-button {
    border: 1px solid var(--theme-divider) !important;
    border-radius: .62rem !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-accent) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .space-manage-panel .space-manage-icon-button:hover {
    background: var(--theme-surface-active) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .space-manage-panel .space-manage-icon-button.is-save {
    border-color: transparent !important;
    background: var(--theme-accent) !important;
    color: var(--theme-text-inverse) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .space-manage-panel .space-manage-icon-button:is(.is-close, .is-back, .is-save) svg {
    width: 1rem !important;
    height: 1rem !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2.2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .space-manage-body {
    display: grid !important;
    min-height: 0 !important;
    align-content: start !important;
    gap: .72rem !important;
    overflow-y: auto !important;
    padding: .8rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .space-manage-panel :is(.space-role-visibility, .space-team-section) {
    min-height: 0 !important;
    align-content: start !important;
    gap: .58rem !important;
    padding: .72rem !important;
    border: 1px solid color-mix(in srgb, var(--space-team-role, var(--theme-accent)) 24%, var(--theme-divider)) !important;
    border-radius: .88rem !important;
    background: color-mix(in srgb, var(--theme-surface-panel) 87%, var(--space-team-role, var(--theme-accent)) 13%) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .space-manage-panel .space-role-visibility-options {
    gap: .42rem !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .space-manage-panel .space-role-visibility-options > button {
    min-height: 3.25rem !important;
    padding: .56rem .62rem !important;
    border: 1px solid var(--theme-divider) !important;
    border-radius: .7rem !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-secondary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .space-manage-panel .space-role-visibility-options > button.is-active {
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .space-manage-panel .space-team-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: start !important;
    gap: .42rem !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .space-manage-panel .space-team-person {
    min-height: 2.8rem !important;
    padding: .42rem !important;
    border: 1px solid color-mix(in srgb, var(--space-team-role, var(--theme-accent)) 17%, var(--theme-divider)) !important;
    border-radius: .7rem !important;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

@media (max-width: 560px) {
    html:root body .space-manage-panel .space-team-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ------------[Плеер и отправка: видимые знаки]------------ // Оформляет связанный блок интерфейса.
   Фон кнопки и сама пиктограмма получают разные роли. Контурные SVG не
   превращаются в сплошную заливку, из-за которой знак пропадал. Модуль: «оформление интерфейса». Часть 5/18 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #global-music-play :is(svg, svg path) {
    display: block !important;
    color: var(--theme-text-inverse) !important;
    fill: var(--theme-text-inverse) !important;
    stroke: var(--theme-text-inverse) !important;
    stroke-width: 1.45 !important;
    opacity: 1 !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-send-button > :is(.messenger-icon, svg) {
    display: grid !important;
    width: 1.12rem !important;
    height: 1.12rem !important;
    place-items: center;
    color: var(--theme-text-inverse) !important;
    opacity: 1 !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-send-button :is(svg, svg path) {
    display: block !important;
    fill: none !important;
    stroke: var(--theme-text-inverse) !important;
    stroke-width: 2.15 !important;
    opacity: 1 !important;
}

/* ------------[Группы и каналы: единые уровни темы]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 7/41 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    :is(#messages-root, #messages-side-root, .messenger-new-modal, .messenger-room-panel-layer) {
    --msg-bg: var(--theme-surface-page);
    --msg-panel: var(--theme-surface-panel);
    --msg-panel-strong: var(--theme-surface-control);
    --msg-menu-surface: var(--theme-surface-panel);
    --msg-menu-soft: var(--theme-surface-nested);
    --msg-menu-active: var(--theme-surface-active);
    --msg-line: var(--theme-divider);
    --msg-text: var(--theme-text-primary);
    --msg-muted: var(--theme-text-muted);
    --msg-accent: var(--theme-accent);
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-panel {
    border: 0 !important;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: 0 1.15rem 3rem color-mix(in srgb, var(--theme-text-primary) 18%, transparent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-panel > header {
    border: 0 !important;
    border-radius: 1rem 1rem .82rem .82rem !important;
    background: var(--theme-surface-nested) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-panel > nav {
    margin-top: .45rem !important;
    padding: .42rem !important;
    border: 0 !important;
    border-radius: .82rem !important;
    background: var(--theme-surface-control) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-panel > nav button {
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
    color: var(--theme-text-secondary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-panel > nav button:is(.is-active, :hover) {
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-panel > section {
    margin-top: .45rem !important;
    border: 0 !important;
    border-radius: .82rem !important;
    background: var(--theme-surface-nested) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-panel :is(.messenger-room-panel-meta button, .messenger-room-panel-members article, .messenger-room-link-list article, .messenger-attachment-media, .messenger-attachment-file) {
    border: 0 !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

/* ------------[Настройки комнаты: список разрешений]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 8/41 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-settings-modal > section {
    border: 0 !important;
    background: var(--theme-surface-panel) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-settings-form {
    background: var(--theme-surface-nested) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-controls-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-policy {
    overflow: hidden !important;
    border: 0 !important;
    border-radius: .9rem !important;
    background: var(--theme-surface-panel) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-policy-toggle {
    min-height: 3.5rem !important;
    padding: .72rem .8rem !important;
    border: 0 !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-policy-content:not(.hidden) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
    padding: .35rem .75rem .75rem !important;
    background: var(--theme-surface-panel) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-policy-content > label:not(.messenger-room-slow-mode) {
    min-height: 3.35rem !important;
    padding: .56rem .18rem !important;
    border: 0 !important;
    border-bottom: 1px solid var(--theme-divider) !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-slow-mode {
    display: grid !important;
    gap: .5rem !important;
    padding: .85rem .18rem .28rem !important;
    border: 0 !important;
    background: transparent !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-slow-mode > span {
    display: grid !important;
    gap: .12rem !important;
    color: var(--theme-text-primary) !important;
}

html:root body .messenger-room-slow-mode > span > b { font-size: .7rem !important; }
html:root body .messenger-room-slow-mode > span > small { color: var(--theme-text-muted) !important; font-size: .56rem !important; }

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-slow-mode-scale {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    gap: .18rem !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-slow-mode-scale > button {
    min-width: 0 !important;
    padding: .25rem .08rem !important;
    border: 0 !important;
    border-radius: .42rem !important;
    background: transparent !important;
    color: var(--theme-text-muted) !important;
    font-size: .56rem !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-slow-mode-scale > button:is(.is-active, :hover) {
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-slow-mode-range {
    position: relative !important;
    width: 100% !important;
    height: 1rem !important;
    margin: -.15rem 0 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    appearance: none !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: linear-gradient(to right,
        var(--theme-accent) 0 var(--slow-progress, 0%),
        var(--theme-surface-control) var(--slow-progress, 0%) 100%) !important;
    background-clip: content-box !important;
    accent-color: var(--theme-accent) !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

html:root body .messenger-room-slow-mode-range::-webkit-slider-runnable-track {
    height: .28rem;
    border-radius: 999px;
    background: transparent;
}

html:root body .messenger-room-slow-mode-range::-webkit-slider-thumb {
    width: .82rem;
    height: .82rem;
    margin-top: -.27rem;
    appearance: none;
    border: .14rem solid var(--theme-surface-panel);
    border-radius: 50%;
    background: var(--theme-accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--theme-accent) 40%, transparent);
}

html:root body .messenger-room-slow-mode-range::-moz-range-track {
    height: .28rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
}

html:root body .messenger-room-slow-mode-range::-moz-range-thumb {
    width: .68rem;
    height: .68rem;
    border: .14rem solid var(--theme-surface-panel);
    border-radius: 50%;
    background: var(--theme-accent);
}

@media (max-width: 560px) {
    html:root body .messenger-room-slow-mode-scale { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

/* Тело управления пространством остаётся прозрачным контейнером даже после
   подключения общих правил вложенных поверхностей. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .space-manage-panel > .space-manage-body {
    background: transparent !important;
}

/* ------------[Музыкальное сообщение: цельный хвост]------------ // Оформляет связанный блок интерфейса.
   У трека видимую карточку рисует вложенный плеер, а внешний bubble прозрачен.
   Поэтому хвост получает ту же заливку и компактный нахлёст именно здесь. Модуль: «оформление интерфейса». Часть 6/18 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-bubble.is-track-only > .messenger-bubble-tail {
    bottom: .04rem !important;
    width: .7rem !important;
    height: .84rem !important;
    color: var(--track-message-fill, var(--theme-surface-active)) !important;
    filter: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-message.is-outgoing .messenger-bubble.is-track-only > .messenger-bubble-tail {
    right: -.27rem !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-message.is-incoming .messenger-bubble.is-track-only > .messenger-bubble-tail {
    left: -.27rem !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-bubble.is-track-only > .messenger-bubble-tail-fill {
    fill: var(--track-message-fill, var(--theme-surface-active)) !important;
}

/* ------------[Поиск в шапке: единая оболочка поля]------------ // Оформляет связанный блок интерфейса.
   Иконка и ввод находятся внутри одной заметной поверхности. Сам input
   прозрачен, чтобы старые правила тем не могли снова разбить поле на части. Модуль: «оформление интерфейса». Часть 7/18 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #site-header .search-wrapper > .group {
    display: flex !important;
    width: 12rem !important;
    min-height: 2.35rem !important;
    align-items: center !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: .88rem !important;
    background: var(--theme-surface-active) !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme-divider) 78%, transparent) !important;
    transition: width .2s ease, background-color .2s ease, box-shadow .2s ease !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #site-header .search-wrapper > .group:focus-within {
    width: 20rem !important;
    background: var(--theme-surface-control) !important;
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--theme-accent) 38%, transparent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #site-header .search-wrapper > .group > #global-search {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 2.35rem !important;
    padding: .55rem 1rem .55rem 2.5rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    color: var(--theme-text-primary) !important;
    outline: 0 !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #site-header .search-wrapper > .group > #global-search:focus {
    width: 100% !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* ------------[Каналы и группы: единые уровни фона]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 11/41 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-settings-modal > section {
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-settings-modal > section > header {
    border-bottom: 1px solid var(--theme-divider) !important;
    background: var(--theme-surface-panel) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-settings-form {
    background: var(--theme-surface-nested) !important;
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-settings-form :is(
        input[type="text"], textarea, select,
        .messenger-room-invite-settings,
        .messenger-room-member-picker-trigger,
        .messenger-room-member-search,
        .messenger-room-member-list article
    ) {
    border: 0 !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-settings-form :is(.messenger-room-policy, .messenger-room-members-manage) {
    border: 0 !important;
    background: var(--theme-surface-panel) !important;
    box-shadow: none !important;
}

/* Файлы в профиле группы/канала не слипаются даже когда содержимое вкладки
   переключено старым правилом в display:block. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-panel-content:is(.is-music, .is-file) {
    display: grid !important;
    align-content: start !important;
    gap: .55rem !important;
    padding: .62rem !important;
    background: var(--theme-surface-nested) !important;
}

html:root body .messenger-shared-attachments > :is(.messenger-attachment-audio, .messenger-attachment-file)
    + :is(.messenger-attachment-audio, .messenger-attachment-file) {
    margin-top: .12rem !important;
}

/* ------------[Музыкальный пузырь: одна заливка с хвостом]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 12/41 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-message.is-incoming .messenger-bubble.is-track-only {
    --track-message-fill: var(--theme-surface-nested) !important;
    --message-shape-fill: var(--theme-surface-nested) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-message.is-outgoing .messenger-bubble.is-track-only {
    --track-message-fill: var(--theme-surface-active) !important;
    --message-shape-fill: var(--theme-surface-active) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-bubble.is-track-only .vmesta-track-player {
    border-color: transparent !important;
    background: var(--track-message-fill) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-bubble.is-track-only > .messenger-bubble-tail {
    bottom: .08rem !important;
    width: .58rem !important;
    height: .72rem !important;
    color: var(--track-message-fill) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-message.is-outgoing .messenger-bubble.is-track-only > .messenger-bubble-tail {
    right: -.18rem !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-message.is-incoming .messenger-bubble.is-track-only > .messenger-bubble-tail {
    left: -.18rem !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-bubble.is-track-only > .messenger-bubble-tail-fill {
    fill: var(--track-message-fill) !important;
}

/* ------------[Меню темы]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 13/41 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #settings-dropdown {
    border: 0 !important;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: 0 1rem 2.6rem color-mix(in srgb, var(--theme-text-primary) 18%, transparent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #settings-dropdown #menu-settings-content {
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #settings-dropdown :is(#system-theme-btn, .adaptive-theme-shell) {
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #settings-dropdown .adaptive-theme-mode-menu {
    border: 0 !important;
    background: var(--theme-surface-control) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #settings-dropdown .adaptive-theme-mode-menu > button {
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #settings-dropdown .adaptive-theme-mode-menu > button:is(:hover, .is-active) {
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
}

/* ------------[Настройки профиля]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 14/41 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #cover-animation-panel .cover-editor-workspace {
    border: 0 !important;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #cover-animation-panel :is(#cover-animation-grid, #cover-image-grid) {
    border-radius: .9rem !important;
    padding: .65rem !important;
    background: var(--theme-surface-nested) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #cover-animation-panel .cover-animation-tile {
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #cover-animation-panel .cover-animation-tile:is(:hover, .is-active) {
    border-color: transparent !important;
    background: var(--theme-surface-control) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #cover-animation-panel :is(.cover-animation-actions button, .cover-editor-tab) {
    border: 0 !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-accent) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #cover-animation-panel :is(.cover-animation-actions button:last-child, .cover-editor-tab.is-active) {
    background: var(--theme-accent) !important;
    color: var(--theme-text-inverse) !important;
}

/* ------------[Фото и альбомы: заметные действия]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 15/41 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #tab-photos > div {
    border: 0 !important;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    :is(#upload-photo-btn, #create-album-btn) {
    border: 0 !important;
    border-radius: .72rem !important;
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
    box-shadow: inset 0 0 0 1px var(--theme-divider) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    :is(#upload-photo-btn, #create-album-btn) :is(span, svg) {
    color: var(--theme-accent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    :is(#upload-photo-btn, #create-album-btn):hover {
    background: var(--theme-surface-control) !important;
}

/* ------------[Иконка плеера в шапке]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 16/41 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .global-music-toggle {
    width: 2rem !important;
    height: 2rem !important;
    border: 0 !important;
    border-radius: .68rem !important;
    background: color-mix(in srgb, var(--theme-surface-panel) 78%, var(--theme-accent) 22%) !important;
    color: var(--theme-accent) !important;
    box-shadow: inset 0 0 0 1px var(--theme-divider) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .global-music-toggle:is(:hover, :focus-visible) {
    background: color-mix(in srgb, var(--theme-surface-panel) 66%, var(--theme-accent) 34%) !important;
    color: var(--theme-accent) !important;
}

html:root body .global-music-toggle svg {
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
}

/* Старый adaptive-слой задавал отдельно полупрозрачный background-color.
   Явно гасим и цвет, и изображение фона у внешней оболочки меню. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #settings-dropdown#settings-dropdown#settings-dropdown {
    --adaptive-ui-modal: var(--theme-surface-panel) !important;
    background: var(--theme-surface-panel) !important;
    background-color: var(--theme-surface-panel) !important;
    background-image: none !important;
    transition: none !important;
}

@supports (color: color-mix(in lab, red, red)) {
    html:root.adaptive-theme body #settings-dropdown#settings-dropdown#settings-dropdown {
        background: var(--theme-surface-panel) !important;
        background-color: var(--theme-surface-panel) !important;
        background-image: none !important;
    }
}

/* ------------[Голосовая запись: цвет темы -> красный у корзины]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 17/41 */
html:root body .messenger-recording-panel {
    --recording-danger: #ef4444;
}

html:root body .messenger-recording-panel :is(
    .messenger-recording-cancel,
    .messenger-recording-send,
    .messenger-recording-lock
) {
    border: 0 !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-accent) !important;
    box-shadow: none !important;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease !important;
}

html:root body .messenger-recording-panel.is-locked .messenger-recording-send,
html:root body .messenger-recording-panel.is-locked .messenger-recording-lock {
    background: var(--theme-accent) !important;
    color: var(--theme-text-inverse) !important;
}

html:root body .messenger-recording-panel .messenger-recording-status strong {
    color: var(--theme-text-primary) !important;
}

html:root body .messenger-recording-panel .messenger-recording-status span {
    color: var(--theme-text-secondary) !important;
}

html:root body .messenger-recording-panel .messenger-recording-wave i {
    background: var(--theme-accent) !important;
    transition: background-color 160ms ease !important;
}

/* Красный появляется только во время движения к корзине. Процент жеста
   обеспечивает плавный переход и возвращает палитру темы при движении назад. */
html:root body .messenger-recording-panel.is-canceling :is(
    .messenger-recording-cancel,
    .messenger-recording-send,
    .messenger-recording-lock
) {
    background: color-mix(in srgb, var(--recording-danger) var(--recording-cancel-progress, 0%), var(--theme-surface-control)) !important;
    color: color-mix(in srgb, var(--recording-danger) var(--recording-cancel-progress, 0%), var(--theme-accent)) !important;
}

html:root body .messenger-recording-panel.is-canceling .messenger-recording-status strong {
    color: color-mix(in srgb, var(--recording-danger) var(--recording-cancel-progress, 0%), var(--theme-text-primary)) !important;
}

html:root body .messenger-recording-panel.is-canceling .messenger-recording-status span {
    color: color-mix(in srgb, var(--recording-danger) var(--recording-cancel-progress, 0%), var(--theme-text-secondary)) !important;
}

html:root body .messenger-recording-panel.is-canceling .messenger-recording-wave i {
    background: color-mix(in srgb, var(--recording-danger) var(--recording-cancel-progress, 0%), var(--theme-accent)) !important;
}

html:root body .messenger-recording-panel.is-cancel-ready .messenger-recording-cancel {
    background: var(--recording-danger) !important;
    color: var(--theme-text-inverse) !important;
}

html:root body .messenger-recording-panel.is-cancel-ready :is(
    .messenger-recording-send,
    .messenger-recording-lock
) {
    background: color-mix(in srgb, var(--recording-danger) 16%, var(--theme-surface-control)) !important;
    color: var(--recording-danger) !important;
}

html:root body .messenger-recording-panel.is-cancel-ready :is(
    .messenger-recording-status strong,
    .messenger-recording-status span
) {
    color: var(--recording-danger) !important;
}

html:root body .messenger-recording-panel.is-cancel-ready .messenger-recording-wave i {
    background: var(--recording-danger) !important;
}

html:root body .messenger-recording-panel :is(.messenger-recording-cancel, .messenger-recording-send, .messenger-recording-lock) :is(svg, svg *) {
    color: currentColor !important;
    fill: none !important;
    stroke: currentColor !important;
}

/* Отправленные голосовые используют системный акцент выбранной темы. */
html:root body .messenger-voice-note :is(
    .messenger-voice-note-toggle,
    .messenger-voice-speed,
    .messenger-voice-note-tools > button
) {
    border-color: transparent !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-accent) !important;
    box-shadow: none !important;
}

/* Микрофон — индикатор, а не кнопка: ему не нужна квадратная площадка. */
html:root body .messenger-voice-note .messenger-voice-mic {
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--theme-accent) !important;
    box-shadow: none !important;
}

html:root body .messenger-voice-note :is(
    .messenger-voice-note-toggle,
    .messenger-voice-speed,
    .messenger-voice-note-tools > button
):is(:hover, :focus-visible, .is-active) {
    background: #ef4444 !important;
    color: var(--theme-text-inverse) !important;
}

html:root body .messenger-voice-note :is(
    .messenger-voice-note-toggle,
    .messenger-voice-speed,
    .messenger-voice-mic,
    .messenger-voice-note-tools > button
) :is(svg, svg *) {
    color: currentColor !important;
    stroke: currentColor !important;
}

/* ------------[Поиск в шапке: заметная акцентная площадка]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 18/41 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #site-header .search-wrapper > .group {
    border: 0 !important;
    background: color-mix(in srgb, var(--theme-surface-panel) 58%, var(--theme-accent) 42%) !important;
    background-image: none !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    #site-header .search-wrapper > .group:focus-within {
    background: color-mix(in srgb, var(--theme-surface-panel) 46%, var(--theme-accent) 54%) !important;
    box-shadow: none !important;
}

html:root body #site-header .search-wrapper > .group > #global-search {
    border: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* ------------[Достижения: реакция вкладок и карточек]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 19/41 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    :is(.achievements-scope-tabs, .achievements-dialog-tabs) > button {
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
    transition: transform .16s ease, background-color .16s ease, color .16s ease !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    :is(.achievements-scope-tabs, .achievements-dialog-tabs) > button:is(:hover, :focus-visible, .is-active, [aria-selected="true"]) {
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
    transform: translateY(-1px);
}

html:root body :is(.achievement-showcase-item, .achievement-row) {
    transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease, opacity .18s ease !important;
}

html:root body :is(.achievement-showcase-item, .achievement-row):is(:hover, :focus-visible) {
    border-color: transparent !important;
    background: var(--theme-surface-active) !important;
    box-shadow: 0 .55rem 1.15rem color-mix(in srgb, var(--theme-text-primary) 12%, transparent) !important;
    transform: translateY(-2px);
}

/* ------------[Фото и альбомы: акцентные действия без обводки]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 20/41 */
html:root body :is(#upload-photo-btn, #create-album-btn, .space-media-upload) {
    border: 0 !important;
    border-radius: .78rem !important;
    background: color-mix(in srgb, var(--theme-surface-panel) 62%, var(--theme-accent) 38%) !important;
    color: var(--theme-accent) !important;
    box-shadow: none !important;
}

html:root body :is(#upload-photo-btn, #create-album-btn, .space-media-upload):is(:hover, :focus-visible) {
    background: color-mix(in srgb, var(--theme-surface-panel) 48%, var(--theme-accent) 52%) !important;
    color: var(--theme-text-inverse) !important;
}

html:root body :is(#upload-photo-btn, #create-album-btn, .space-media-upload) :is(span, svg, svg *) {
    color: currentColor !important;
    stroke: currentColor !important;
}

html:root body :is(#albums-placeholder, .space-profile-photo-field) {
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 1.15rem !important;
    background: var(--theme-surface-nested) !important;
    box-shadow: none !important;
}

/* ------------[Карточка группы или канала]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 21/41 */
html:root body .messenger-room-panel {
    border: 0 !important;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: 0 .9rem 2rem color-mix(in srgb, var(--theme-text-primary) 12%, transparent) !important;
}

html:root body .messenger-room-panel > header {
    border: 0 !important;
    border-radius: .95rem .95rem .78rem .78rem !important;
    background: var(--theme-surface-nested) !important;
}

html:root body .messenger-room-panel > nav {
    border: 0 !important;
    background: var(--theme-surface-control) !important;
}

html:root body .messenger-room-panel > section {
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
}

html:root body .messenger-room-panel :is(.messenger-room-panel-meta button, nav button) {
    border: 0 !important;
    background: var(--theme-surface-control) !important;
    box-shadow: none !important;
}

/* Логин остаётся одной плашкой; @ отделяется только тонким разделителем. */
html:root body .messenger-room-handle-field {
    display: grid !important;
    grid-template-columns: 2.2rem minmax(0, 1fr) !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: .78rem !important;
    background: var(--theme-surface-control) !important;
    box-shadow: none !important;
}

html:root body .messenger-room-handle-field > b {
    border-right: 1px solid var(--theme-divider) !important;
    background: transparent !important;
    color: var(--theme-accent) !important;
}

html:root body .messenger-room-handle-field > input {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Медленный режим занимает всю строку разрешений. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-room-policy-content > label.messenger-room-slow-mode {
    display: grid !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
    gap: .42rem !important;
    padding: .65rem .7rem !important;
    background: var(--theme-surface-nested) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    label.messenger-room-slow-mode .messenger-room-slow-mode-scale {
    width: 100% !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    label.messenger-room-slow-mode .messenger-room-slow-mode-scale > button {
    min-height: 1.8rem !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--theme-text-muted) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    label.messenger-room-slow-mode .messenger-room-slow-mode-scale > button:is(.is-active, :focus-visible) {
    background: var(--theme-accent) !important;
    color: var(--theme-text-inverse) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    label.messenger-room-slow-mode .messenger-room-slow-mode-scale > button:hover:not(.is-active) {
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
}

/* ------------[Голосование: два уровня заполнения]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 22/41 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-poll-card .messenger-poll-option {
    --poll-fill: color-mix(in srgb, var(--theme-surface-active) 48%, var(--theme-accent) 52%);
    isolation: isolate !important;
    border: 0 !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-poll-card .messenger-poll-option.is-selected {
    --poll-fill: color-mix(in srgb, var(--theme-surface-active) 34%, var(--theme-accent) 66%);
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-poll-card .messenger-poll-option::before {
    z-index: 0 !important;
    background: var(--poll-fill) !important;
}

html:root body .messenger-poll-option > * {
    position: relative;
    z-index: 1;
}

html:root body .messenger-poll-card > footer {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: end !important;
    gap: .45rem !important;
}

html:root body .messenger-poll-card > footer > span {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    gap: .12rem .3rem !important;
}

html:root body .messenger-poll-card > footer > span > .messenger-icon { grid-row: 1 / 3; }
html:root body .messenger-poll-card > footer > span > :is(b, small) { grid-column: 2; padding: 0 !important; }

html:root body .messenger-poll-public-voters > div {
    max-height: 11rem !important;
    padding: .12rem .5rem .55rem !important;
}

html:root body .messenger-poll-public-voters section > div {
    grid-template-columns: 1fr !important;
    gap: .32rem !important;
}

html:root body .messenger-poll-public-voters section button {
    min-height: 2.55rem !important;
    grid-template-columns: 1.85rem minmax(0, 1fr) !important;
    gap: .45rem !important;
    padding: .38rem .45rem !important;
    border-radius: .62rem !important;
    background: var(--theme-surface-panel) !important;
}

html:root body .messenger-poll-public-voters section button .messenger-avatar {
    width: 1.85rem !important;
    height: 1.85rem !important;
}

html:root body .messenger-poll-public-voters section button b { font-size: .56rem !important; }
html:root body .messenger-poll-public-voters section button small { font-size: .47rem !important; }

/* Расширенный вопрос прокручивается внутри окна, не выталкивая его шапку. */
html:root body .messenger-poll-modal > section {
    overscroll-behavior: contain !important;
    scroll-padding-block: .75rem 1rem !important;
    scrollbar-gutter: stable !important;
}

/* ------------[Панель смайликов: видимые границы]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 23/41 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .emoji-picker-expanded {
    border: 0 !important;
    background: var(--theme-surface-panel) !important;
    box-shadow: inset 0 0 0 1px var(--theme-divider),
                0 .9rem 2rem color-mix(in srgb, var(--theme-text-primary) 14%, transparent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .emoji-picker-expanded :is(.emoji-picker-search-wrap, .emoji-picker-mode-tabs) {
    border: 0 !important;
    background: var(--theme-surface-control) !important;
    box-shadow: inset 0 0 0 1px var(--theme-divider) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .emoji-picker-expanded :is(.emoji-picker-grid, .emoji-picker-emoji-view) {
    border-radius: .78rem !important;
    background: var(--theme-surface-nested) !important;
}

html:root body .emoji-picker-expanded .emoji-picker-tab:is(:hover, .is-active) {
    background: var(--theme-surface-active) !important;
}

/* ------------[Музыкальный хвост и выравнивание в группе]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 24/41 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-message.has-tail .messenger-bubble.is-track-only > svg.messenger-bubble-tail {
    bottom: .14rem !important;
    width: .52rem !important;
    height: .62rem !important;
    overflow: hidden !important;
    border-radius: 0 0 .15rem 0 !important;
    background: var(--track-message-fill) !important;
    clip-path: polygon(0 0, 0 100%, 100% 100%) !important;
    color: var(--track-message-fill) !important;
    filter: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-message.is-outgoing.has-tail .messenger-bubble.is-track-only > svg.messenger-bubble-tail {
    right: -.36rem !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-message.is-incoming.has-tail .messenger-bubble.is-track-only > svg.messenger-bubble-tail {
    right: auto !important;
    left: -.36rem !important;
    transform: scaleX(-1) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .messenger-message.has-tail .messenger-bubble.is-track-only > svg.messenger-bubble-tail > * {
    opacity: 0 !important;
}

/* У пользовательской адаптивной палитры старый слой сообщений мог вернуть
   локальный синий. Эти две главные кнопки всегда берут системный акцент темы. */
html:root body #messages-root .messenger-send-button {
    border: 0 !important;
    background: var(--theme-accent) !important;
    color: var(--theme-text-inverse) !important;
}

html:root body .spaces-index-toolbar .spaces-index-scope button.is-active {
    border: 0 !important;
    background: var(--theme-surface-active) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root body .messenger-room-panel-content.is-music .vmesta-track-player {
    grid-template-columns: 2.2rem minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto !important;
    gap: .12rem .5rem !important;
}

html:root body .messenger-room-panel-content.is-music .vmesta-track-head {
    grid-column: 2;
    grid-row: 1;
}

html:root body .messenger-room-panel-content.is-music .vmesta-track-body { display: contents !important; }
html:root body .messenger-room-panel-content.is-music .vmesta-track-play {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center !important;
}

html:root body .messenger-room-panel-content.is-music .vmesta-track-timeline {
    grid-column: 2;
    grid-row: 2;
}

html:root body .messenger-room-panel-content.is-music .vmesta-track-tools {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center !important;
}

/* В окне прогресса вкладки должны различаться визуально даже при наличии
   старых локальных переменных компонента. */
html:root body .achievements-dialog.achievements-dialog :is(
    .achievements-scope-tabs,
    .achievements-dialog-tabs
) > button {
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
    transition: none !important;
}

html:root body .achievements-dialog.achievements-dialog :is(
    .achievements-scope-tabs,
    .achievements-dialog-tabs
) > button:is(:hover, :focus-visible, .is-active, [aria-selected="true"]) {
    background-color: var(--theme-accent) !important;
    background-image: none !important;
    color: var(--theme-text-inverse) !important;
    transform: translateY(-1px) !important;
    transition: none !important;
}

html:root body .achievements-dialog.achievements-dialog.achievements-dialog
    .achievements-scope-tabs.achievements-scope-tabs > button:is(:hover, :focus-visible, .is-active, [aria-selected="true"]),
html:root body .achievements-dialog.achievements-dialog.achievements-dialog
    .achievements-dialog-tabs.achievements-dialog-tabs > button:is(:hover, :focus-visible, .is-active, [aria-selected="true"]) {
    border-color: transparent !important;
    background: var(--theme-accent) !important;
    color: var(--theme-text-inverse) !important;
    box-shadow: none !important;
    transform: translateY(-1px) !important;
    transition: none !important;
}

html:root body .achievements-dialog.achievements-dialog.achievements-dialog
    :is(.achievements-scope-tabs, .achievements-dialog-tabs) > button:is(:hover, :focus-visible) {
    outline: .12rem solid color-mix(in srgb, var(--theme-accent) 62%, transparent) !important;
    outline-offset: .1rem !important;
}

html:root body .achievements-dialog.achievements-dialog.achievements-dialog
    :is(.achievements-scope-tabs, .achievements-dialog-tabs) > button:is(.is-active, [aria-selected="true"]) {
    outline: .12rem solid var(--theme-accent) !important;
    outline-offset: -.12rem !important;
    box-shadow: inset 0 0 0 .12rem var(--theme-accent) !important;
}

/* ------------[Музыкальное сообщение без отдельного хвоста]------------ // Оформляет связанный блок интерфейса.
   У плеера уже есть собственная цельная карточка. SVG-кончик создавал второй
   силуэт и выглядел как случайный острый выступ, поэтому для треков он скрыт. Модуль: «оформление интерфейса». Часть 8/18 */
html:root body .messenger-message.has-tail
    .messenger-bubble.is-track-only > svg.messenger-bubble-tail {
    display: none !important;
}

html:root body .messenger-message.has-tail
    .messenger-bubble.is-track-only .vmesta-track-player {
    border-bottom-right-radius: 1rem !important;
    border-bottom-left-radius: 1rem !important;
}

/* ------------[Голосовые: подсветка текущей темы]------------ // Оформляет связанный блок интерфейса.
   Отправленный плеер не является опасным действием и использует палитру
   выбранной темы. Красный остаётся только у удаления записи. Модуль: «оформление интерфейса». Часть 9/18 */
html:root body .messenger-voice-note :is(
    .messenger-voice-note-toggle,
    .messenger-voice-speed,
    .messenger-voice-note-tools > button
) {
    border-color: transparent !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-accent) !important;
    box-shadow: none !important;
}

html:root body .messenger-voice-note :is(
    .messenger-voice-note-toggle,
    .messenger-voice-speed,
    .messenger-voice-note-tools > button
):is(:hover, :focus-visible, .is-active) {
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
}

/* Быстрые реакции используют ту же поверхность, что подсветка пунктов
   расположенного под ними меню сообщения. */
html:root body .messenger-message-menu-stack > .messenger-reaction-panel {
    border-color: transparent !important;
    background: var(--msg-menu-active, var(--theme-surface-active)) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

/* ------------[Шапка: цельная заметная площадка поиска]------------ // Оформляет связанный блок интерфейса.
   Поиск и компактная кнопка плеера используют одну тематическую заливку.
   Один ровный фон проходит под вводом и лупой без рамки и второго слоя. Модуль: «оформление интерфейса». Часть 10/18 */
html:root body #site-header
    .search-wrapper.search-wrapper > .group.group {
    width: 12rem !important;
    min-height: 2.45rem !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: .9rem !important;
    background: color-mix(in srgb, var(--theme-surface-panel) 78%, var(--theme-accent) 22%) !important;
    background-color: color-mix(in srgb, var(--theme-surface-panel) 78%, var(--theme-accent) 22%) !important;
    background-image: none !important;
    box-shadow: none !important;
    transition: width .2s ease !important;
}

html:root body #site-header
    .search-wrapper.search-wrapper > .group.group:focus-within {
    width: 20rem !important;
    background: color-mix(in srgb, var(--theme-surface-panel) 66%, var(--theme-accent) 34%) !important;
    background-color: color-mix(in srgb, var(--theme-surface-panel) 66%, var(--theme-accent) 34%) !important;
    box-shadow: none !important;
}

html:root body #site-header
    .search-wrapper.search-wrapper > .group.group > #global-search {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 2.45rem !important;
    padding: .55rem 1rem .55rem 2.5rem !important;
    border: 0 !important;
    border-radius: .9rem !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: var(--theme-text-primary) !important;
    outline: 0 !important;
    box-shadow: none !important;
}

html:root body #site-header
    .search-wrapper.search-wrapper > .group.group > #global-search:focus {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

html:root body #site-header
    .search-wrapper.search-wrapper > .group.group > div:first-of-type {
    z-index: 1 !important;
    color: var(--theme-accent) !important;
}

/* Повышенная специфичность намеренно исключает индикатор микрофона из
   площадок кнопок. Проверяем и shorthand, и отдельные слои фона. */
html:root body .messenger-voice-note
    .messenger-voice-note-top > .messenger-voice-mic.messenger-voice-mic {
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: var(--theme-accent) !important;
    box-shadow: none !important;
}
/* ======[ФИНАЛЬНЫЙ БАЛАНС MONET И СООБЩЕНИЙ 2026-09-08]==========
   Этот файл загружается после основной таблицы: правила здесь являются
   единственным последним слоем и не дают поздней теме перекрасить поиск. */

html:root.adaptive-theme.theme-monet-active:not(.dark) {
    --vmesta-monet-canvas: var(--theme-surface-page);
    --vmesta-monet-surface: var(--theme-surface-panel);
    --vmesta-monet-inner: var(--theme-surface-nested);
    --vmesta-monet-strong: var(--theme-surface-control);
    --vmesta-monet-line: var(--theme-divider);
    --vmesta-monet-ink: var(--theme-text-primary);
    --vmesta-monet-muted: var(--theme-text-muted);
    --vmesta-tone-1: var(--theme-surface-panel);
    --vmesta-tone-2: var(--theme-surface-nested);
    --vmesta-tone-3: var(--theme-surface-control);
    --vmesta-tone-4: var(--theme-surface-active);
    --vmesta-tone-5: var(--theme-accent);
}

html:root.adaptive-theme.theme-monet-active.dark {
    --vmesta-monet-canvas: var(--theme-surface-page);
    --vmesta-monet-surface: var(--theme-surface-panel);
    --vmesta-monet-inner: var(--theme-surface-nested);
    --vmesta-monet-strong: var(--theme-surface-control);
    --vmesta-monet-line: var(--theme-divider);
    --vmesta-monet-ink: var(--theme-text-primary);
    --vmesta-monet-muted: var(--theme-text-muted);
    --vmesta-tone-1: var(--theme-surface-panel);
    --vmesta-tone-2: var(--theme-surface-nested);
    --vmesta-tone-3: var(--theme-surface-control);
    --vmesta-tone-4: var(--theme-surface-active);
    --vmesta-tone-5: var(--theme-accent);
}

html:root.adaptive-theme.theme-monet-active body {
    background-color: var(--vmesta-monet-canvas) !important;
    background-image: none !important;
}

/* Поиск в Monet равен по заливке кнопке плеера и не зависит от route.
   Оболочка и поле получают одну ступень, поэтому старое непрозрачное правило
   поля не может спрятать цвет площадки. */
html:root.adaptive-theme.theme-monet-active body #site-header
    .search-wrapper.search-wrapper > .group.group,
html:root.adaptive-theme.theme-monet-active body #site-header
    .search-wrapper.search-wrapper > .group.group:focus-within,
html:root.adaptive-theme.theme-monet-active body #site-header .global-music-toggle {
    border: 0 !important;
    outline: 0 !important;
    background: var(--vmesta-tone-4) !important;
    background-color: var(--vmesta-tone-4) !important;
    background-image: none !important;
    color: var(--vmesta-monet-ink) !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active body #site-header
    .search-wrapper.search-wrapper > .group.group > #global-search,
html:root.adaptive-theme.theme-monet-active body #site-header
    .search-wrapper.search-wrapper > .group.group > #global-search:focus {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: var(--vmesta-tone-4) !important;
    background-color: var(--vmesta-tone-4) !important;
    background-image: none !important;
    color: var(--vmesta-monet-ink) !important;
    box-shadow: inset 0 0 0 999px var(--vmesta-tone-4) !important;
}

html:root.adaptive-theme.theme-monet-active body #site-header :is(.search-wrapper svg, .global-music-toggle) {
    color: var(--vmesta-ui-primary) !important;
}

/* Группы и каналы: округлённые действия и цельный нижний край. */
html:root body .messenger-room-settings-modal > section,
html:root body .messenger-room-settings-form {
    scrollbar-color: var(--msg-accent) var(--room-tone-1, var(--msg-bg));
}

html:root body .messenger-room-settings-header-actions > button,
html:root body .messenger-room-panel :is(.messenger-room-panel-close, .messenger-room-panel-manage, .messenger-room-panel-leave) {
    min-width: 2.55rem !important;
    width: 2.55rem !important;
    min-height: 2.25rem !important;
    height: 2.25rem !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 0 !important;
    background: var(--room-tone-3, var(--msg-menu-soft)) !important;
    box-shadow: none !important;
}

html:root body .messenger-room-settings-header-actions > .messenger-room-settings-leave,
html:root body .messenger-room-panel .messenger-room-panel-leave {
    min-width: 2.75rem !important;
    width: 2.75rem !important;
    color: #ef4444 !important;
}

html:root body .messenger-room-settings-form > footer {
    box-sizing: border-box;
    width: calc(100% + 1.64rem) !important;
    margin: .15rem -.82rem -.8rem !important;
    padding: .72rem .82rem .8rem !important;
    border: 0 !important;
    border-radius: 0 0 1.35rem 1.35rem !important;
    background: var(--room-tone-2, var(--msg-panel)) !important;
    box-shadow: none !important;
}

html:root body .messenger-room-settings-form > footer button {
    min-height: 2.35rem;
    border: 0 !important;
    border-radius: 999px !important;
    padding-inline: 1rem !important;
    background: var(--room-tone-4, var(--msg-menu-active)) !important;
    box-shadow: none !important;
}

html:root body .messenger-room-settings-form > footer .is-primary {
    background: var(--msg-accent) !important;
}

/* Отметка существует только среди быстрых действий сообщения. */
html:root body .messenger-message-mention-marker { display: none !important; }

html:root body .messenger-message-hover-actions .messenger-message-mention-action {
    display: inline-grid;
    width: 1.7rem;
    height: 1.7rem;
    place-items: center;
    border: 0 !important;
    border-radius: 999px;
    background: var(--msg-accent) !important;
    color: #fff !important;
    font-size: .8rem;
    font-weight: 950;
}

html:root body .messenger-message .messenger-bubble {
    transition: none !important;
}

html:root body .messenger-message:hover .messenger-bubble:not(.is-poll) {
    background: var(--message-shape-fill) !important;
}

html:root body .messenger-message.is-mention-unread .messenger-bubble:not(.is-poll) {
    background: color-mix(in srgb, var(--message-shape-fill) 84%, var(--msg-accent) 16%) !important;
    outline: 0 !important;
}

html:root body .messenger-message.is-mention-focus .messenger-bubble:not(.is-poll) {
    animation: none !important;
    background: color-mix(in srgb, var(--message-shape-fill) 68%, var(--msg-accent) 32%) !important;
}

/* Панель смайликов: пять спокойных слоёв, ни одной обводки или неоновой линии. */
html:root body .emoji-picker-expanded {
    border: 0 !important;
    outline: 0 !important;
    background: var(--vmesta-tone-2, var(--msg-menu-surface)) !important;
    box-shadow: none !important;
}

html:root body .emoji-picker-expanded :is(.emoji-picker-header, .emoji-picker-mode-tabs) {
    border: 0 !important;
    background: transparent !important;
}

html:root body .emoji-picker-expanded .emoji-picker-emoji-view {
    border: 0 !important;
    outline: 0 !important;
    background: var(--vmesta-tone-3, var(--msg-menu-soft)) !important;
    box-shadow: none !important;
}

html:root body .emoji-picker-expanded :is(.emoji-picker-search-wrap, .emoji-picker-search) {
    border: 0 !important;
    outline: 0 !important;
    background: var(--vmesta-tone-4, var(--msg-menu-active)) !important;
    color: var(--vmesta-ui-ink, var(--msg-text)) !important;
    box-shadow: none !important;
}

html:root body .emoji-picker-expanded :is(.emoji-picker-grid, .emoji-picker-tabs, .emoji-picker-tab, .emoji-picker-item, button) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

html:root body .emoji-picker-expanded :is(.emoji-picker-mode-button.is-active, .emoji-picker-tab.is-active, .emoji-picker-item:hover) {
    background: var(--vmesta-tone-5, var(--msg-menu-active)) !important;
}

/* Пространства и список сообщений не сливаются в одну плашку. */
html:root body :is(.spaces-index-toolbar, .space-list-panel, .space-intro-card, .space-left-actions) {
    background: var(--vmesta-tone-2) !important;
}

html:root body :is(.spaces-index-card, .spaces-index-card .spaces-index-open, .spaces-index-card .spaces-index-body,
    .space-left-message, .space-subscribe-split, .space-left-subscribe, .space-followers-count) {
    background: var(--vmesta-tone-3) !important;
}

html:root body :is(.spaces-index-card:hover, .spaces-index-card:hover .spaces-index-open,
    .space-left-message:hover, .space-subscribe-split:hover) {
    background: var(--vmesta-tone-4) !important;
}

/* Действия пространства не должны сливаться с собственной подложкой.
   Основное действие остаётся акцентным, активная отписка — четвёртым
   уровнем, а счётчик отделён спокойным вторым уровнем. */
html:root.adaptive-theme.theme-monet-active body .space-left-message,
html:root.adaptive-theme.theme-monet-active body .space-left-message:hover,
html:root.adaptive-theme.theme-monet-active body .space-left-subscribe:not(.is-active),
html:root.adaptive-theme.theme-monet-active body .space-left-subscribe:not(.is-active):hover {
    border: 0 !important;
    background: var(--theme-accent) !important;
    color: #fff !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active body .space-subscribe-split,
html:root.adaptive-theme.theme-monet-active body .space-subscribe-split:hover {
    border: 0 !important;
    background: var(--vmesta-tone-3) !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active body .space-left-subscribe.is-active,
html:root.adaptive-theme.theme-monet-active body .space-left-subscribe.is-active:hover {
    background: var(--vmesta-tone-4) !important;
    color: var(--theme-text-primary) !important;
}

html:root.adaptive-theme.theme-monet-active body .space-followers-count,
html:root.adaptive-theme.theme-monet-active body .space-followers-count:hover {
    border: 0 !important;
    background: var(--vmesta-tone-2) !important;
    color: var(--theme-text-primary) !important;
}

html:root body.messages-route :is(.messenger-dialogs-panel, .messenger-conversation, .messenger-message-stream) {
    background: var(--vmesta-tone-1, var(--msg-bg)) !important;
}

html:root body.messages-route :is(.messenger-chat-list, .messenger-media-settings) {
    border: 0 !important;
    background: var(--vmesta-tone-2, var(--msg-panel)) !important;
    box-shadow: none !important;
}

html:root body.messages-route .messenger-media-settings > label {
    border-radius: .68rem;
    padding: .5rem;
    background: var(--vmesta-tone-3, var(--msg-menu-soft)) !important;
}

html:root body.messages-route :is(.messenger-chat-row, .messenger-chat-row .messenger-chat-open) {
    background: transparent !important;
}

html:root body.messages-route .messenger-chat-row:is(:hover, .is-active) {
    background: var(--vmesta-tone-4, var(--msg-menu-active)) !important;
}

/* Опросы Monet: тёмная основа ответа совпадает с карточками проголосовавших,
   а заполненная часть остаётся отдельным более светлым слоем. */
html:root.adaptive-theme.theme-monet-active:not(.dark) body.messages-route {
    --msg-poll-answer-deep: var(--theme-surface-active);
    --msg-poll-answer-progress: var(--theme-accent);
}

html:root.adaptive-theme.theme-monet-active.dark body.messages-route {
    --msg-poll-answer-deep: var(--theme-surface-active);
    --msg-poll-answer-progress: var(--theme-accent);
}

html:root.adaptive-theme.theme-monet-active body.messages-route :is(.messenger-poll-option, .messenger-poll-public-voters) {
    border: 0 !important;
    background: var(--msg-poll-answer-deep) !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-option::before {
    background: var(--msg-poll-answer-progress) !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-public-voters section > div > button {
    border: 0 !important;
    background: var(--msg-poll-answer-deep) !important;
    box-shadow: none !important;
}

/* Ввод и уведомления сохраняют контраст и для текста рядом с emoji. */
html:root body :is(.messenger-composer textarea, .space-composer textarea, .space-composer input,
    .notification-history-copy p, .notification-item-copy, .messenger-bubble > p) {
    color: var(--vmesta-ui-ink, var(--msg-text)) !important;
    text-shadow: none !important;
}

html:root body #settings-dropdown .adaptive-theme-mode-menu {
    border: 0 !important;
    background: var(--vmesta-tone-2) !important;
    box-shadow: none !important;
}

html:root body #settings-dropdown .adaptive-theme-mode-menu > button {
    border: 0 !important;
    background: var(--vmesta-tone-3) !important;
    box-shadow: none !important;
}

html:root body #settings-dropdown .adaptive-theme-mode-menu > button:is(:hover, .is-active) {
    background: var(--vmesta-tone-4) !important;
}

/* ------------[Опрос Monet как заполненная пробирка]------------ // Оформляет связанный блок интерфейса.
   Дорожка — тёмная ступень текущей Monet-палитры, процент — её светлая
   ступень. В обычных темах остаётся их собственная прежняя отрисовка. Модуль: «оформление интерфейса». Часть 11/18 */
html:root body .messenger-poll-fill { display: none !important; }

html:root.adaptive-theme.theme-monet-active body.messages-route {
    --monet-poll-track: var(--theme-surface-active);
    --monet-poll-fill: var(--theme-accent);
    --monet-poll-voters: var(--theme-surface-control);
    --monet-poll-voter-row: var(--theme-surface-nested);
}

html:root.adaptive-theme.theme-monet-active.dark body.messages-route {
    --monet-poll-fill: var(--theme-accent);
    --monet-poll-voter-row: var(--theme-surface-nested);
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-option {
    position: relative !important;
    isolation: isolate !important;
    overflow: hidden !important;
    min-height: 2.2rem !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--monet-poll-track) !important;
    background-color: var(--monet-poll-track) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-option::before {
    display: none !important;
    content: none !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-option > .messenger-poll-fill {
    position: absolute !important;
    z-index: 0 !important;
    inset: 0 auto 0 0 !important;
    display: block !important;
    height: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-radius: 999px 0 0 999px !important;
    background: var(--monet-poll-fill) !important;
    pointer-events: none !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-option[style*="--poll-percent:100%"] > .messenger-poll-fill {
    border-radius: 999px !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-option > * {
    position: relative !important;
    z-index: 1 !important;
    color: inherit !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-option > .messenger-poll-fill {
    position: absolute !important;
    z-index: 0 !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-option > i {
    border-color: color-mix(in srgb, var(--theme-text-primary) 72%, transparent) !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-option > em {
    color: var(--theme-text-secondary) !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-option:is(:hover, .is-selected) {
    background: var(--monet-poll-track) !important;
    color: var(--theme-text-primary) !important;
}

/* «Кто проголосовал» использует ещё одну тёмную Monet-ступень без
   процентной заливки; строки участников отделены соседним уровнем. */
html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-public-voters {
    border: 0 !important;
    background: var(--monet-poll-voters) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-public-voters > summary,
html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-public-voters section,
html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-public-voters section > header {
    background: transparent !important;
    color: var(--theme-text-primary) !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-public-voters section > div > button {
    border: 0 !important;
    background: var(--monet-poll-voter-row) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-public-voters :is(b, strong) {
    color: var(--theme-text-primary) !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-poll-card .messenger-poll-public-voters small {
    color: var(--theme-text-muted) !important;
}

/* Хвост и статус исходят из поверхности карточки, а не из яркого акцента. */
html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-bubble.is-poll > .messenger-bubble-tail {
    color: var(--msg-poll-surface) !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-bubble.is-poll > .messenger-bubble-tail .messenger-bubble-tail-fill {
    fill: var(--msg-poll-surface) !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-bubble.is-poll > .messenger-bubble-tail .messenger-bubble-tail-line {
    display: none !important;
    stroke: transparent !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-bubble.is-poll .messenger-delivery-stars {
    color: var(--vmesta-monet-muted) !important;
}

/* ======[MONET: ЕДИНЫЙ ФИНАЛЬНЫЙ СЛОЙ 2026-09-08]==========
   Все компоненты ниже получают цвета только из пяти поверхностей Monet.
   Блок намеренно последний: он отменяет накопившиеся локальные смеси,
   контуры и цветные тени старых компонентов. */
html:root.adaptive-theme.theme-monet-active:not(.dark) {
    --theme-surface-page: var(--adaptive-bg-light);
    --theme-surface-panel: var(--adaptive-surface-light);
    --theme-surface-nested: var(--adaptive-surface-2-light);
    --theme-surface-control: var(--adaptive-control-light);
    --theme-surface-active: var(--adaptive-active-light);
    --theme-divider: var(--adaptive-border-light);
}

html:root.adaptive-theme.theme-monet-active.dark {
    --theme-surface-page: var(--adaptive-bg-dark);
    --theme-surface-panel: var(--adaptive-surface-dark);
    --theme-surface-nested: var(--adaptive-surface-2-dark);
    --theme-surface-control: var(--adaptive-control-dark);
    --theme-surface-active: var(--adaptive-active-dark);
    --theme-divider: var(--adaptive-border-dark);
}

html:root.adaptive-theme.theme-monet-active {
    --adaptive-background: var(--theme-surface-page);
    --adaptive-surface: var(--theme-surface-panel);
    --adaptive-surface-2: var(--theme-surface-nested);
    --adaptive-border: var(--theme-divider);
    --adaptive-ui-panel: var(--theme-surface-panel);
    --adaptive-ui-modal: var(--theme-surface-nested);
    --adaptive-ui-active: var(--theme-surface-control);
    --adaptive-ui-line: transparent;
    --adaptive-ui-line-strong: transparent;
    --vmesta-ui-panel: var(--theme-surface-panel);
    --vmesta-ui-soft: var(--theme-surface-nested);
    --vmesta-ui-line: transparent;
    --vmesta-tone-1: var(--theme-surface-panel);
    --vmesta-tone-2: var(--theme-surface-nested);
    --vmesta-tone-3: var(--theme-surface-control);
    --vmesta-tone-4: var(--theme-surface-active);
    --vmesta-tone-5: var(--theme-accent);
}

html:root.adaptive-theme.theme-monet-active body,
html:root.adaptive-theme.theme-monet-active body #content-area {
    background: var(--theme-surface-page) !important;
    color: var(--theme-text-primary) !important;
}

html:root.adaptive-theme.theme-monet-active body :is(
    #site-header, #profile-tabs-container, #profile-left-rail nav,
    #profile-left-rail #profile-friends-open-button,
    #profile-right-rail .achievement-sidebar-card,
    #profile-right-rail .profile-interests-card,
    .post-item, .space-post, .space-switchboard, .space-composer,
    .space-side-card, .space-list-panel, .space-intro-card,
    .spaces-index-toolbar, .spaces-index-card,
    #post-viewer-panel, #viewer-sidebar, #viewer-scroll-region,
    #viewer-comments-block, .media-viewer-post-slot,
    #space-about-panel, .achievements-dialog, .theme-catalog-dialog,
    .messenger-shell, .messenger-dialogs-panel, .messenger-conversation,
    .messenger-side-section, .messenger-main-header,
    .messenger-conversation-header, .messenger-message-stream
) {
    border: 0 !important;
    outline: 0 !important;
    background: var(--theme-surface-panel) !important;
    background-image: none !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active body :is(
    .post-attachment-card, .post-file-selection-card, .space-post-file,
    .space-about-card, .space-about-quote, .space-about-longform,
    .profile-spaces-section, .achievement-row, .achievement-task,
    .achievement-showcase-item, .comment-node, .viewer-form-shell,
    .messenger-search, .messenger-chat-search, .messenger-composer,
    .messenger-pinned-panel, .messenger-inline-media-bar,
    .global-search-result-section, .global-search-side,
    .theme-catalog-section
) {
    border: 0 !important;
    outline: 0 !important;
    background: var(--theme-surface-nested) !important;
    background-image: none !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active body :is(
    #global-search, .spaces-index-search, .spaces-index-search input,
    .messenger-chat-search input, .messenger-chat-search button,
    .messenger-composer textarea, .messenger-day-button,
    .messenger-chat-menu, .messenger-message-menu,
    .messenger-attach-menu, .messenger-blank-context-menu,
    .notification-settings-menu, .comment-dropdown, .post-dropdown
) {
    border: 0 !important;
    outline: 0 !important;
    background: var(--theme-surface-control) !important;
    background-image: none !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route :is(#messages-root, #messages-side-root) {
    --msg-bg: var(--theme-surface-page);
    --msg-panel: var(--theme-surface-panel);
    --msg-panel-strong: var(--theme-surface-active);
    --msg-line: transparent;
    --msg-text: var(--theme-text-primary);
    --msg-muted: var(--theme-text-muted);
    --msg-accent: var(--theme-accent);
    --msg-menu-surface: var(--theme-surface-control);
    --msg-menu-soft: var(--theme-surface-nested);
    --msg-menu-active: var(--theme-surface-active);
    --msg-search-shell-surface: var(--theme-surface-nested);
    --msg-search-field-surface: var(--theme-surface-control);
    --msg-composer-surface: var(--theme-surface-nested);
}

html:root.adaptive-theme.theme-monet-active body.messages-route
    .messenger-message.is-incoming .messenger-bubble:not(.is-poll) {
    --message-shape-fill: var(--theme-surface-nested) !important;
    border: 0 !important;
    outline: 0 !important;
    background: var(--theme-surface-nested) !important;
    box-shadow: none !important;
    filter: none !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route
    .messenger-message.is-outgoing .messenger-bubble:not(.is-poll) {
    --message-shape-fill: var(--theme-surface-active) !important;
    border: 0 !important;
    outline: 0 !important;
    background: var(--theme-surface-active) !important;
    box-shadow: none !important;
    filter: none !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route
    .messenger-bubble.is-track-only .vmesta-track-player {
    border: 0 !important;
    outline: 0 !important;
    background: var(--message-shape-fill) !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route :is(
    .vmesta-track-player, .vmesta-track-tools button,
    .messenger-voice-note, .messenger-voice-note-toggle,
    .messenger-voice-speed, .messenger-voice-note-tools > button,
    .messenger-composer, .messenger-composer textarea
) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    filter: none !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route
    .messenger-voice-note-toggle::before,
html:root.adaptive-theme.theme-monet-active body.messages-route
    .messenger-voice-note-toggle::after {
    display: none !important;
    content: none !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-composer {
    background: var(--theme-surface-nested) !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-composer textarea {
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route
    .messenger-message:hover .messenger-bubble:not(.is-poll) {
    background: var(--message-shape-fill) !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route :is(
    .messenger-bubble-tail, .messenger-bubble-tail-fill,
    .messenger-bubble-tail-line
) {
    filter: none !important;
}

/* Список диалогов является частью основной панели, а не вложенной карточкой.
   Раньше он занимал всю нижнюю половину экрана более светлым цветом и ломал
   композицию тёмной Monet-темы. Отдельной заливкой остаются только строки. */
html:root.adaptive-theme.theme-monet-active body.messages-route .messenger-chat-list {
    border: 0 !important;
    outline: 0 !important;
    background: var(--theme-surface-panel) !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route
    .messenger-chat-row:not(.is-active):not(:hover) {
    background: transparent !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route
    .messenger-chat-row:is(.is-active, :hover) {
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
    box-shadow: none !important;
}

/* Финальный контроль всплывающей панели смайликов. Старое правило использует
   несколько :is() и потому имело повышенную специфичность: без этого моста
   оно возвращало цветное внутреннее кольцо и неоновую тень. */
html:root.adaptive-theme.theme-monet-active body
    .emoji-picker-expanded.emoji-picker-expanded {
    border: 0 !important;
    outline: 0 !important;
    background: var(--theme-surface-panel) !important;
    box-shadow: none !important;
    filter: none !important;
}

html:root.adaptive-theme.theme-monet-active body
    .emoji-picker-expanded.emoji-picker-expanded :is(
        .emoji-picker-mode-tabs, .emoji-picker-search-wrap,
        .emoji-picker-search, .emoji-picker-emoji-view,
        .emoji-picker-grid, .emoji-picker-tabs
    ) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    filter: none !important;
}

html:root.adaptive-theme.theme-monet-active body
    .emoji-picker-expanded.emoji-picker-expanded :is(
        .emoji-picker-mode-button.is-active,
        .emoji-picker-tab.is-active,
        .emoji-picker-item:hover
    ) {
    background: var(--theme-surface-active) !important;
    box-shadow: none !important;
}

/* Карточка аватара раньше сохраняла белую Tailwind-рамку и тяжёлую тень,
   хотя соседние Monet-панели уже были плоскими. */
html:root.adaptive-theme.theme-monet-active body
    #profile-sidebar-shell#profile-sidebar-shell > div:first-child {
    border: 0 !important;
    outline: 0 !important;
    border-radius: 1rem !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Заливка принадлежит рамке фотографии, а не квадратной внешней обёртке.
   Изображение наследует тот же радиус, поэтому углы не проступают при
   загрузке, смене аватара и аппаратном масштабировании. */
html:root body #profile-avatar-card > div:first-child,
html:root body #profile-avatar-card > div:first-child > #avatar-img {
    border-radius: 1rem !important;
}

/* Подписка в пространстве — обычное тематическое действие, а не отдельная
   неоновая плашка. Оба состояния остаются внутри пятиступенчатой шкалы. */
html:root.adaptive-theme.theme-monet-active body
    .space-subscribe-split.space-subscribe-split {
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active body
    .space-left-subscribe.space-left-subscribe,
html:root.adaptive-theme.theme-monet-active body
    .space-left-subscribe.space-left-subscribe:hover {
    border: 0 !important;
    background: var(--theme-surface-active) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

/* Светлые и тёмные окна сообщений должны продолжать общую Monet-шкалу.
   Эти явные назначения перекрывают старую смесь msg-menu-surface, которая
   на тёплых палитрах выглядела почти белой. */
html:root.adaptive-theme.theme-monet-active body
    :is(.messenger-attachments-modal, .messenger-room-settings-modal,
        .messenger-poll-modal, .messenger-forward-modal).messenger-new-modal > section {
    border: 0 !important;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active body
    :is(.messenger-attachments-modal, .messenger-room-settings-modal,
        .messenger-poll-modal, .messenger-forward-modal).messenger-new-modal > section > header,
html:root.adaptive-theme.theme-monet-active body
    .messenger-attachment-filters.messenger-attachment-filters {
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active body
    .messenger-room-settings-form.messenger-room-settings-form {
    background: var(--theme-surface-nested) !important;
}

/* Медленный режим визуально отделён от последнего обычного разрешения. */
html:root.adaptive-theme.theme-monet-active body
    .messenger-room-policy-content > label.messenger-room-slow-mode {
    margin-top: .72rem !important;
}

/* Старый просмотрщик публикации содержал отдельные правила #fff для светлой
   темы. В Monet его шапка, обсуждение и боковая область продолжают цвет поста. */
html:root.adaptive-theme.theme-monet-active:not(.dark) body
    #post-viewer.is-discussion-mode :is(
        #viewer-post-header, #viewer-comments-block, .viewer-comments-head
    ),
html:root.adaptive-theme.theme-monet-active:not(.dark) body
    #media-viewer .media-viewer-post-slot :is(
        #viewer-sidebar, #viewer-scroll-region, #viewer-post-header,
        #viewer-post-summary, #viewer-comments-block, #viewer-comments-list,
        .viewer-comments-head, .viewer-form-shell, #viewer-form-container
    ) {
    border-color: transparent !important;
    background: var(--theme-surface-panel) !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active:not(.dark) body
    #media-viewer .media-viewer-post-slot :is(
        .viewer-form-shell, #viewer-form-container, .comment-node
    ) {
    background: var(--theme-surface-nested) !important;
}

/* ------------[Все модальные окна: без внешней обводки]------------ // Оформляет связанный блок интерфейса.
   Диалоги используют разные реализации (статические панели, динамические
   section и Tailwind ring). Единый финальный слой убирает только внешний
   контур окна; внутренние разделители и уровни поверхностей сохраняются. Модуль: «оформление интерфейса». Часть 12/18 */
html:root body :is(dialog, [role="dialog"], [role="alertdialog"]),
html:root body :is(
    #post-viewer-panel,
    #media-viewer-layout,
    #modal-box,
    .cover-security-dialog,
    #album-create-panel,
    #album-viewer-panel,
    #album-photo-picker-panel,
    #album-access-panel,
    #album-share-panel,
    #album-delete-panel,
    #delete-confirm-modal > div,
    #friend-action-panel,
    .global-search-dialog,
    .signal-probe-dialog,
    .notification-history-dialog,
    .notification-clear-dialog,
    .achievements-dialog,
    .achievement-showcase-dialog,
    .space-showcase-editor-modal,
    .verification-center-panel,
    .content-report-dialog,
    .my-reports-dialog,
    .galaxy-guard-dialog,
    .messenger-photo-viewer,
    .messenger-shared-media-viewer,
    .messenger-forward-modal > section,
    .messenger-confirm-modal > section,
    .messenger-poll-modal > section,
    .messenger-new-modal > section,
    .messenger-room-panel
) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    --tw-ring-offset-shadow: 0 0 #0000 !important;
}

/* У просмотрщиков раньше была более специфичная рамка на вложенной панели. */
html:root body #post-viewer #post-viewer-panel,
html:root body #media-viewer #media-viewer-layout,
html:root body #media-viewer .media-viewer-post-slot,
html:root body #media-viewer .media-viewer-post-slot #viewer-sidebar {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    --tw-ring-offset-shadow: 0 0 #0000 !important;
}

/* ------------[Тема динамически перерисованных публикаций]------------ // Оформляет связанный блок интерфейса.
   Лента заменяет карточки после загрузки, поиска и пагинации. Семантическая
   метка уровня не хранит конкретный цвет: она всегда разрешается через
   актуальные переменные выбранной темы и потому не возвращает старую палитру. Модуль: «оформление интерфейса». Часть 13/18 */
html:root body :is(#feed-posts-container, #posts-container)
    > [data-post-card][data-theme-surface="panel"] {
    border: 0 !important;
    outline: 0 !important;
    background: var(--theme-surface-panel) !important;
    background-image: none !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root body :is(#feed-posts-container, #posts-container)
    > [data-post-card][data-theme-surface="panel"] :is(
        .post-attachment-card,
        .post-file-selection-card,
        .post-media-grid,
        .shared-post-card,
        .post-hashtag-chip
    ) {
    border-color: transparent !important;
    background: var(--theme-surface-nested) !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* ------------[Лента по тону левой панели]------------ // Оформляет связанный блок интерфейса.
   Левая навигация остаётся цветовым эталоном профиля. Шапка ленты,
   динамические карточки публикаций и «Интересы» используют ровно ту же
   переменную, включая дневную и ночную Monet-палитры. Модуль: «оформление интерфейса». Часть 14/18 */
html:root body #profile-layout-grid #content-main .profile-publisher-hub .space-switchboard,
html:root body #tab-feed .feed-search-hub .space-switchboard,
html:root body #profile-layout-grid #content-main #posts-container > [data-post-card],
html:root body #tab-feed #feed-posts-container > [data-post-card],
html:root body #profile-layout-grid #profile-right-rail #profile-interests-card {
    border-color: transparent !important;
    background: var(--vmesta-left-reference-surface) !important;
    background-color: var(--vmesta-left-reference-surface) !important;
    background-image: none !important;
    box-shadow: none !important;
}

html:root body #profile-layout-grid #content-main #posts-container > [data-post-card]:hover,
html:root body #tab-feed #feed-posts-container > [data-post-card]:hover {
    background: var(--vmesta-left-reference-surface) !important;
    background-color: var(--vmesta-left-reference-surface) !important;
}

/* ------------[Сообщения: только актуальные уровни темы]------------ // Оформляет связанный блок интерфейса.
   Последний слой закрывает старые локальные заливки чатов и опросов.
   Он одинаков для стандартной светлой/тёмной и обеих Monet-тем. Модуль: «оформление интерфейса». Часть 15/18 */
html:root body.messages-route :is(#messages-root, #messages-side-root) {
    --msg-bg: var(--theme-surface-page);
    --msg-panel: var(--vmesta-left-reference-surface);
    --msg-panel-strong: var(--theme-surface-control);
    --msg-line: transparent;
    --msg-text: var(--theme-text-primary);
    --msg-muted: var(--theme-text-muted);
    --msg-accent: var(--theme-accent);
    --msg-menu-surface: var(--theme-surface-control);
    --msg-menu-soft: var(--theme-surface-nested);
    --msg-menu-active: var(--theme-surface-active);
    --msg-search-shell-surface: var(--theme-surface-nested);
    --msg-search-field-surface: var(--theme-surface-control);
    --msg-composer-surface: var(--theme-surface-nested);
    --msg-poll-surface: var(--theme-surface-nested);
    --msg-poll-option-surface: var(--theme-surface-active);
    --msg-poll-option-active: var(--theme-accent);
    --monet-poll-track: var(--theme-surface-active);
    --monet-poll-fill: var(--theme-accent);
    --monet-poll-voters: var(--theme-surface-control);
    --monet-poll-voter-row: var(--theme-surface-nested);
}

html:root body.messages-route :is(
    .messenger-shell,
    .messenger-dialogs-panel,
    .messenger-conversation,
    .messenger-message-stream,
    .messenger-main-header,
    .messenger-conversation-header,
    .messenger-side-section
) {
    border-color: transparent !important;
    background: var(--vmesta-left-reference-surface) !important;
    background-color: var(--vmesta-left-reference-surface) !important;
    background-image: none !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root body.messages-route .messenger-chat-list {
    border: 0 !important;
    background: var(--vmesta-left-reference-surface) !important;
    background-color: var(--vmesta-left-reference-surface) !important;
    box-shadow: none !important;
}

html:root body.messages-route :is(.messenger-search, .messenger-chat-search) {
    border: 0 !important;
    background: var(--theme-surface-control) !important;
    background-color: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root body.messages-route .messenger-chat-row:not(.is-active):not(:hover),
html:root body.messages-route .messenger-chat-row:not(.is-active):not(:hover) .messenger-chat-open {
    background: transparent !important;
}

html:root body.messages-route .messenger-chat-row:is(.is-active, :hover),
html:root body.messages-route .messenger-chat-row:is(.is-active, :hover) .messenger-chat-open {
    border-color: transparent !important;
    background: var(--theme-surface-nested) !important;
    background-color: var(--theme-surface-nested) !important;
    box-shadow: none !important;
}

html:root body.messages-route .messenger-bubble.is-poll {
    --message-shape-fill: var(--theme-surface-nested);
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
    background-color: var(--theme-surface-nested) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root body.messages-route .messenger-poll-card .messenger-poll-option,
html:root body.messages-route .messenger-poll-card .messenger-poll-option:is(:hover, .is-selected) {
    border: 0 !important;
    background: var(--theme-surface-active) !important;
    background-color: var(--theme-surface-active) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root body.messages-route .messenger-poll-card .messenger-poll-option > .messenger-poll-fill {
    background: var(--theme-accent) !important;
    background-color: var(--theme-accent) !important;
}

html:root body.messages-route .messenger-poll-card .messenger-poll-option :is(i, em, span) {
    color: inherit !important;
}

html:root body.messages-route .messenger-poll-card .messenger-poll-option > i {
    border-color: color-mix(in srgb, var(--theme-text-primary) 62%, transparent) !important;
}

html:root body.messages-route .messenger-poll-card .messenger-poll-public-voters {
    border: 0 !important;
    background: var(--theme-surface-control) !important;
    background-color: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root body.messages-route .messenger-poll-card .messenger-poll-public-voters
    :is(summary, section, section > header) {
    background: transparent !important;
    color: var(--theme-text-primary) !important;
}

html:root body.messages-route .messenger-poll-card .messenger-poll-public-voters
    section > div > button {
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
    background-color: var(--theme-surface-nested) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root body.messages-route .messenger-poll-card .messenger-poll-public-voters small {
    color: var(--theme-text-muted) !important;
}

html:root body.messages-route .messenger-bubble.is-poll > .messenger-bubble-tail {
    color: var(--theme-surface-nested) !important;
}

html:root body.messages-route .messenger-bubble.is-poll > .messenger-bubble-tail .messenger-bubble-tail-fill {
    fill: var(--theme-surface-nested) !important;
}

/* ------------[Пространства и сообщения по фактическому тону левой панели]------------ // Оформляет связанный блок интерфейса.
   В Monet левая панель окрашивается через adaptive-card-tint. Старые более
   специфичные правила оставляли центр на theme-surface-panel, поэтому светлая
   версия выглядела бледнее, а тёмная проваливалась почти в чёрный. Модуль: «оформление интерфейса». Часть 16/18 */
html:root body {
    --vmesta-route-reference-surface: var(--vmesta-left-reference-surface);
}

html:root.adaptive-theme.theme-monet-active.dark body {
    --vmesta-route-reference-surface: color-mix(in srgb, var(--vmesta-left-reference-surface) 88%, transparent);
}

html:root.adaptive-theme.theme-monet-active body.spaces-catalog-route
    #space-page-root :is(.space-intro-card, .spaces-index-toolbar, .spaces-index-card),
html:root:not(.adaptive-theme) body.spaces-catalog-route
    #space-page-root :is(.space-intro-card, .spaces-index-toolbar, .spaces-index-card) {
    border: 0 !important;
    outline: 0 !important;
    background: var(--vmesta-route-reference-surface) !important;
    background-color: var(--vmesta-route-reference-surface) !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* Карточка пространства уже имеет нужную несущую поверхность. Внутренняя
   полноразмерная кнопка больше не кладёт поверх неё старый тёмный прямоугольник. */
html:root.adaptive-theme.theme-monet-active body.spaces-catalog-route
    #space-page-root .spaces-index-card :is(.spaces-index-open, .spaces-index-body),
html:root:not(.adaptive-theme) body.spaces-catalog-route
    #space-page-root .spaces-index-card :is(.spaces-index-open, .spaces-index-body) {
    border-color: transparent !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

html:root.adaptive-theme.theme-monet-active body.messages-route
    :is(#messages-root, #messages-side-root) :is(
        .messenger-shell,
        .messenger-dialogs-panel,
        .messenger-conversation,
        .messenger-message-stream,
        .messenger-main-header,
        .messenger-conversation-header,
        .messenger-chat-list,
        .messenger-side-panel,
        .messenger-side-section,
        .messenger-loading
    ),
html:root:not(.adaptive-theme) body.messages-route
    :is(#messages-root, #messages-side-root) :is(
        .messenger-shell,
        .messenger-dialogs-panel,
        .messenger-conversation,
        .messenger-message-stream,
        .messenger-main-header,
        .messenger-conversation-header,
        .messenger-chat-list,
        .messenger-side-panel,
        .messenger-side-section,
        .messenger-loading
    ) {
    border: 0 !important;
    outline: 0 !important;
    background: var(--vmesta-route-reference-surface) !important;
    background-color: var(--vmesta-route-reference-surface) !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* ------------[Раздельная правая колонка сообщений]------------ // Оформляет связанный блок интерфейса.
   Общая обёртка отвечает только за раскладку. Каждая секция рисует свою
   карточку, поэтому между «Разделами» и «Контактами» снова виден фон страницы. Модуль: «оформление интерфейса». Часть 17/18 */
html:root body.messages-route #messages-side-root > .messenger-side-panel {
    display: grid !important;
    gap: .72rem !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

html:root body.messages-route #messages-side-root > .messenger-side-panel > .messenger-side-section {
    margin-top: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: var(--vmesta-route-reference-surface, var(--vmesta-left-reference-surface)) !important;
    background-color: var(--vmesta-route-reference-surface, var(--vmesta-left-reference-surface)) !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* ------------[Действия в левой колонке пространства]------------ // Оформляет связанный блок интерфейса.
   Межкнопочный зазор остаётся частью страницы, а уровни «Написать»,
   подписки и счётчика берутся только из текущей темы. Модуль: «оформление интерфейса». Часть 18/18 */
html:root body.space-route #space-left-actions.space-left-actions {
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

html:root body.space-route #space-left-actions .space-left-message,
html:root body.space-route #space-left-actions .space-left-message:hover {
    border: 0 !important;
    background: var(--theme-accent, var(--color-dynamic)) !important;
    background-color: var(--theme-accent, var(--color-dynamic)) !important;
    color: var(--theme-text-inverse, #fff) !important;
    box-shadow: none !important;
}

html:root body.space-route #space-left-actions .space-subscribe-split,
html:root body.space-route #space-left-actions .space-subscribe-split:hover {
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
    background-color: var(--theme-surface-nested) !important;
    box-shadow: none !important;
}

html:root body.space-route #space-left-actions .space-left-subscribe,
html:root body.space-route #space-left-actions .space-left-subscribe:hover {
    border: 0 !important;
    background: var(--theme-surface-active) !important;
    background-color: var(--theme-surface-active) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root body.space-route #space-left-actions .space-followers-count,
html:root body.space-route #space-left-actions .space-followers-count:hover {
    border: 0 !important;
    border-left: 0 !important;
    background: var(--theme-surface-control) !important;
    background-color: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

/* ------------[Проголосовавшие без растягивания сообщения]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 36/41 */
html:root body.messages-route .messenger-poll-card {
    width: min(20.5rem, 82vw) !important;
}

html:root body.messages-route .messenger-poll-voters-trigger {
    display: grid !important;
    width: 100% !important;
    min-height: 2.35rem !important;
    grid-template-columns: minmax(0, 1fr) auto .9rem !important;
    align-items: center !important;
    gap: .48rem !important;
    border: 0 !important;
    border-radius: .72rem !important;
    padding: .48rem .62rem !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
    cursor: pointer;
}

html:root body.messages-route .messenger-poll-voters-trigger:hover {
    background: var(--theme-surface-active) !important;
}

html:root body.messages-route .messenger-poll-voters-trigger > span {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .36rem;
    font-size: .58rem;
    font-weight: 850;
    text-align: left;
}

html:root body.messages-route .messenger-poll-voters-trigger > b {
    font-size: .57rem;
    font-variant-numeric: tabular-nums;
}

html:root body.messages-route .messenger-poll-voters-trigger .messenger-icon {
    width: .82rem;
    height: .82rem;
    color: var(--theme-accent) !important;
}

html:root body .messenger-poll-voters-list {
    display: grid;
    min-height: 0;
    align-content: start;
    gap: .75rem;
    padding: .8rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--theme-surface-active) transparent;
}

html:root body .messenger-poll-voter-group {
    display: grid;
    gap: .58rem;
    border: 0 !important;
    border-radius: .9rem;
    padding: .7rem;
    background: var(--theme-surface-nested) !important;
    box-shadow: none !important;
}

html:root body .messenger-poll-voter-group > header {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: .7rem;
    border: 0 !important;
    padding: 0 .12rem !important;
    background: transparent !important;
}

html:root body .messenger-poll-voter-group > header > strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: .72rem;
    font-weight: 850;
    line-height: 1.35;
}

html:root body .messenger-poll-voter-group > header > span {
    display: grid;
    min-width: 1.7rem;
    min-height: 1.7rem;
    place-items: center;
    border-radius: 999px;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
    font-size: .58rem;
    font-weight: 900;
}

html:root body .messenger-poll-voter-group > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}

html:root body .messenger-poll-voter-row {
    display: grid !important;
    min-width: 0;
    min-height: 3.5rem;
    grid-template-columns: 2.45rem minmax(0, 1fr) !important;
    align-items: center;
    gap: .7rem !important;
    border: 0 !important;
    border-radius: .78rem !important;
    padding: .55rem .62rem !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
    text-align: left;
    box-shadow: none !important;
    cursor: pointer;
}

html:root body .messenger-poll-voter-row:hover {
    background: var(--theme-surface-active) !important;
}

html:root body .messenger-poll-voter-row .messenger-avatar {
    width: 2.45rem !important;
    height: 2.45rem !important;
}

html:root body .messenger-poll-voter-copy {
    display: grid !important;
    min-width: 0;
    gap: .13rem;
}

html:root body .messenger-poll-voter-copy > b,
html:root body .messenger-poll-voter-copy > small {
    display: block;
    min-width: 0;
    overflow: hidden;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html:root body .messenger-poll-voter-copy > b {
    color: var(--theme-text-primary) !important;
    font-size: .7rem;
    font-weight: 850;
}

html:root body .messenger-poll-voter-copy > small {
    color: var(--theme-text-muted) !important;
    font-size: .57rem;
}

/* У длинных ответов и подписи публичности есть собственная ширина и строка. */
html:root body.messages-route .messenger-poll-option-copy {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.35 !important;
}

html:root body.messages-route .messenger-poll-card > footer {
    align-items: start !important;
    gap: .75rem !important;
    line-height: 1.3 !important;
}

html:root body.messages-route .messenger-poll-card > footer > span {
    min-width: 0;
}

html:root body.messages-route .messenger-poll-card > footer > span > :is(b, small) {
    line-height: 1.3 !important;
}

/* ------------[Друзья без обводки вкладок]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 37/41 */
html:root body #friends-sub-tabs .sub-tab-btn,
html:root body #friends-sub-tabs .sub-tab-btn:is(:hover, :focus, .active) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

/* ------------[Отступ текста в редакторах публикаций]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 38/41 */
html:root body .profile-post-composer .post-composer-writing-shell > textarea,
html:root body .space-composer .publication-editor-text-shell > .space-composer-text {
    box-sizing: border-box !important;
    padding: .76rem 2.7rem .84rem .82rem !important;
    line-height: 1.45 !important;
    text-indent: 0 !important;
}

/* Заголовок пересылки использует плотный шрифт остального интерфейса. */
html:root body .post-share-modal header h2 {
    font-family: "Segoe UI", Arial, sans-serif !important;
    font-size: 1.05rem !important;
    font-weight: 850 !important;
    letter-spacing: -.02em !important;
    line-height: 1.2 !important;
}

/* ------------[Компактный popover проголосовавших]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 39/41 */
html:root body .messenger-poll-voters-popover {
    position: fixed;
    z-index: 4200;
    display: grid;
    width: min(22rem, calc(100vw - 1.5rem));
    max-height: min(27rem, calc(100dvh - 1.5rem));
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 0 !important;
    border-radius: 1rem;
    outline: 0 !important;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: 0 1.1rem 3rem color-mix(in srgb, #000 24%, transparent) !important;
    animation: messengerPollPopoverIn .16s ease-out both;
}

html:root body .messenger-poll-voters-popover::after {
    content: '';
    position: absolute;
    left: calc(50% - .45rem);
    bottom: -.4rem;
    width: .9rem;
    height: .9rem;
    border-radius: .18rem;
    background: var(--theme-surface-panel);
    transform: rotate(45deg);
}

html:root body .messenger-poll-voters-popover.opens-below::after {
    top: -.4rem;
    bottom: auto;
}

@keyframes messengerPollPopoverIn {
    from { opacity: 0; transform: translateY(.35rem) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

html:root body .messenger-poll-voters-popover > header,
html:root body .messenger-poll-voters-popover > footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border: 0 !important;
    background: var(--theme-surface-panel) !important;
}

html:root body .messenger-poll-voters-popover > header {
    padding: .8rem .85rem .6rem;
}

html:root body .messenger-poll-voters-popover > header h2 {
    margin: .08rem 0 0;
    font-size: .86rem;
    font-weight: 900;
}

html:root body .messenger-poll-voters-popover > header > button {
    display: grid;
    width: 1.9rem;
    height: 1.9rem;
    flex: 0 0 auto;
    place-items: center;
    border: 0 !important;
    border-radius: .62rem;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-secondary) !important;
}

html:root body .messenger-poll-voters-popover .messenger-poll-voters-list {
    grid-template-columns: 1fr;
    gap: .55rem;
    padding: .25rem .7rem .7rem;
}

html:root body .messenger-poll-voters-popover .messenger-poll-voter-group {
    gap: .42rem;
    padding: .58rem;
}

html:root body .messenger-poll-voters-popover .messenger-poll-voter-group > div {
    grid-template-columns: 1fr;
    gap: .38rem;
}

html:root body .messenger-poll-voters-popover .messenger-poll-voter-row {
    min-height: 3rem;
    grid-template-columns: 2rem minmax(0, 1fr) !important;
    gap: .55rem !important;
    padding: .42rem .5rem !important;
}

html:root body .messenger-poll-voters-popover .messenger-poll-voter-row .messenger-avatar {
    width: 2rem !important;
    height: 2rem !important;
}

html:root body .messenger-poll-voters-popover > footer {
    padding: .6rem .82rem;
    background: var(--theme-surface-nested) !important;
    color: var(--theme-text-secondary) !important;
    font-size: .57rem;
    font-weight: 750;
}

html:root body .messenger-poll-voters-popover > footer > span {
    display: flex;
    align-items: center;
    gap: .32rem;
}

html:root body .messenger-poll-voters-popover > footer .messenger-icon {
    width: .72rem;
    height: .72rem;
    color: var(--theme-accent) !important;
}

/* ------------[Интерактивный уровень]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 40/41 */
html:root body .top-level-widget,
html:root body .achievement-level-trigger {
    width: 100%;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: inherit;
    font: inherit;
    text-align: inherit;
    box-shadow: none !important;
    cursor: pointer;
}

html:root body .top-level-widget {
    width: 8.125rem;
    padding: .28rem .35rem;
    border-radius: .62rem;
}

html:root body .top-level-widget:hover,
html:root body .achievement-level-trigger:hover {
    background: var(--theme-surface-control) !important;
}

html:root body .achievement-level-trigger {
    display: block;
    border-top: 0 !important;
    border-radius: .8rem;
    padding: .75rem .55rem .4rem !important;
}

html:root body .achievement-row.is-level-link {
    cursor: pointer;
}

html:root body .achievement-row.is-level-link:hover {
    background: var(--theme-surface-active) !important;
}

/* ------------[Окна уровня и настройки HP]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 41/41 */
html:root body .level-details-modal {
    position: fixed;
    inset: 0;
    z-index: 5200;
    display: grid;
    place-items: center;
    padding: 1rem;
}

html:root body .level-details-modal.hidden { display: none !important; }

html:root body .level-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0 !important;
    background: color-mix(in srgb, #08080b 62%, transparent) !important;
    backdrop-filter: blur(.45rem);
}

html:root body .level-details-modal > section {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(38rem, 100%);
    max-height: min(46rem, calc(100dvh - 2rem));
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 0 !important;
    border-radius: 1.25rem;
    outline: 0 !important;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: 0 1.5rem 4rem color-mix(in srgb, #000 28%, transparent) !important;
}

html:root body .level-details-modal > section > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem 1.1rem .8rem;
    border: 0 !important;
    background: var(--theme-surface-panel) !important;
}

html:root body .level-details-modal > section > header span,
html:root body .level-subject small,
html:root body .level-how-card header small {
    display: block;
    color: var(--theme-accent) !important;
    font-size: .56rem;
    font-weight: 900;
    letter-spacing: .16em;
}

html:root body .level-details-modal > section > header h2 {
    margin: .12rem 0 0;
    font-size: 1.15rem;
    font-weight: 900;
}

html:root body .level-details-modal > section > header p {
    margin: .2rem 0 0;
    color: var(--theme-text-muted) !important;
    font-size: .64rem;
}

html:root body .level-details-modal > section > header > button {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    flex: 0 0 auto;
    place-items: center;
    border: 0 !important;
    border-radius: .72rem;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-secondary) !important;
    font-size: 1.15rem;
}

html:root body .level-details-body,
html:root body .level-settings-modal form {
    min-height: 0;
    padding: .25rem 1rem 1rem;
    overflow-y: auto;
}

html:root body .level-subject {
    display: grid;
    grid-template-columns: 3.35rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .8rem;
    border: 0 !important;
    border-radius: 1rem;
    padding: .8rem;
    background: var(--theme-surface-nested) !important;
}

html:root body .level-subject-avatar {
    display: grid;
    width: 3.35rem;
    height: 3.35rem;
    place-items: center;
    overflow: hidden;
    border-radius: .9rem;
    background: var(--theme-surface-control) !important;
}

html:root body .level-subject-avatar img { width: 100%; height: 100%; object-fit: cover; }
html:root body .level-subject > span:nth-child(2) { display: grid; min-width: 0; gap: .12rem; }
html:root body .level-subject > span:nth-child(2) strong { overflow: hidden; font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
html:root body .level-subject > span:nth-child(2) em { color: var(--theme-text-muted) !important; font-size: .62rem; font-style: normal; }
html:root body .level-subject-stats { display:grid; min-width:5.2rem; justify-items:center; gap:.3rem; }
html:root body .level-subject-stats > b { color: var(--theme-accent) !important; font-size: 1rem; font-weight: 950; }
html:root body .level-wallet-button { display:grid; min-width:5.2rem; grid-template-columns:1rem minmax(1rem,auto); grid-template-rows:auto auto; align-items:center; justify-content:center; column-gap:.35rem; border:0 !important; border-radius:.65rem; padding:.38rem .52rem; background:var(--theme-surface-control) !important; color:var(--theme-accent) !important; cursor:pointer; }
html:root body .level-wallet-button:hover { background:var(--theme-surface-active) !important; transform:translateY(-1px); }
html:root body .level-wallet-button svg { grid-row:1/3; width:1rem; height:1rem; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
html:root body .level-wallet-button span { align-self:end; color:var(--theme-text-primary) !important; font-family:Arial,sans-serif; font-size:.72rem; font-weight:950; line-height:1; }
html:root body .level-wallet-button small { align-self:start; color:var(--theme-text-muted) !important; font-size:.4rem; font-weight:850; letter-spacing:.07em; line-height:1.05; text-transform:uppercase; }

html:root body .level-progress-card,
html:root body .level-how-card {
    margin-top: .72rem;
    border: 0 !important;
    border-radius: 1rem;
    padding: .82rem;
    background: var(--theme-surface-nested) !important;
}

html:root body .level-progress-card > div:first-child { display: flex; justify-content: space-between; gap: 1rem; }
html:root body .level-progress-card > div:first-child span { display: grid; gap: .12rem; }
html:root body .level-progress-card > div:first-child span:last-child { text-align: right; }
html:root body .level-progress-card small { color: var(--theme-text-muted) !important; font-size: .56rem; }
html:root body .level-progress-card strong { font-size: .82rem; }

html:root body .level-progress-track {
    height: .58rem;
    margin-top: .72rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--theme-surface-control) !important;
}

html:root body .level-progress-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--theme-accent) !important;
}

html:root body .level-progress-card p,
html:root body .level-how-card > p {
    margin: .55rem 0 0;
    color: var(--theme-text-secondary) !important;
    font-size: .62rem;
    line-height: 1.45;
}

html:root body .level-how-card header strong { display: block; margin-top: .12rem; font-size: .78rem; }
html:root body .level-how-card ul { display: grid; gap: .38rem; margin: .65rem 0 0; padding: 0; list-style: none; }
html:root body .level-how-card li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    border-radius: .72rem;
    padding: .52rem .58rem;
    background: var(--theme-surface-control) !important;
}
html:root body .level-how-card li > span { display: grid; min-width: 0; gap: .08rem; }
html:root body .level-how-card li strong { font-size: .66rem; }
html:root body .level-how-card li small { color: var(--theme-text-muted) !important; font-size: .54rem; line-height: 1.35; }
html:root body .level-how-card li > b { flex: 0 0 auto; color: var(--theme-accent) !important; font-size: .63rem; }

html:root body .level-settings-modal > section { width: min(42rem, 100%); }
html:root body .level-settings-modal form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: 0; overflow: hidden; }
html:root body .level-settings-tools { display:grid; gap:.6rem; padding:.25rem 1rem .7rem; border-bottom:1px solid var(--theme-border-subtle); background:var(--theme-surface-panel) !important; }
html:root body .level-settings-tools > label { display:flex; align-items:center; gap:.5rem; min-height:2.5rem; border:1px solid var(--theme-border-subtle); border-radius:.8rem; padding:0 .75rem; background:var(--theme-surface-control) !important; color:var(--theme-accent) !important; }
html:root body .level-settings-tools > label svg { width:1rem; height:1rem; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:2; }
html:root body .level-settings-tools > label input { width:100%; border:0 !important; outline:0 !important; background:transparent !important; color:var(--theme-text-primary) !important; font-size:.68rem; font-weight:750; }
html:root body .level-settings-tools > nav { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.42rem; }
html:root body .level-settings-tools > nav button { min-height:2.2rem; border:1px solid transparent !important; border-radius:.72rem; background:var(--theme-surface-nested) !important; color:var(--theme-text-secondary) !important; font-size:.58rem; font-weight:900; cursor:pointer; }
html:root body .level-settings-tools > nav button.is-active { border-color:color-mix(in srgb,var(--theme-accent) 46%,transparent) !important; background:var(--theme-accent) !important; color:var(--theme-accent-contrast,#fff) !important; box-shadow:0 .42rem 1rem color-mix(in srgb,var(--theme-accent) 20%,transparent); }
html:root body .level-settings-list { display: grid; gap: .5rem; padding: .3rem 1rem 1rem; overflow-y: auto; }
html:root body .level-settings-list.has-empty-search::after { content:"Настройки по этому запросу не найдены"; display:grid; min-height:9rem; place-items:center; color:var(--theme-text-muted); font-size:.65rem; font-weight:800; }
html:root body .level-settings-group { display: grid; gap: .48rem; }
html:root body .level-settings-group + .level-settings-group { margin-top: .45rem; }
html:root body .level-settings-group > header { display: grid; gap: .12rem; padding: .5rem .25rem .2rem; }
html:root body .level-settings-group > header span { color: var(--theme-accent) !important; font-size: .5rem; font-weight: 950; letter-spacing: .16em; }
html:root body .level-settings-group > header strong { font-size: .82rem; }
html:root body .level-settings-group > header small { color: var(--theme-text-muted) !important; font-size: .58rem; line-height: 1.45; }
html:root body .level-settings-group > div { display: grid; gap: .5rem; }
html:root body .level-settings-group label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 14rem);
    align-items: center;
    gap: .85rem;
    border: 0 !important;
    border-radius: .9rem;
    padding: .7rem .75rem;
    background: var(--theme-surface-nested) !important;
}
html:root body .level-settings-group label > span:first-child { display: grid; min-width: 0; gap: .13rem; }
html:root body .level-gift-setting { display:grid !important; grid-template-columns:2.2rem minmax(0,1fr); align-items:center; gap:.55rem !important; }
html:root body .level-gift-setting > i { display:grid; width:2.2rem; height:2.2rem; place-items:center; border-radius:.68rem; background:var(--theme-surface-control); font-size:1.25rem; font-style:normal; }
html:root body .level-gift-setting > span { display:grid; gap:.12rem; }
html:root body .level-settings-list strong { font-size: .71rem; }
html:root body .level-settings-list small { color: var(--theme-text-muted) !important; font-size: .57rem; line-height: 1.35; }
html:root body .level-setting-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .35rem; border-radius: .7rem; padding: .18rem .5rem; background: var(--theme-surface-control) !important; }
html:root body .level-setting-input input { width: 100%; border: 0 !important; outline: 0 !important; padding: .45rem 0; background: transparent !important; color: var(--theme-text-primary) !important; font-size: .75rem; font-weight: 850; }
html:root body .level-setting-input b { color: var(--theme-accent) !important; font-size: .57rem; }
html:root body .level-setting-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: .4rem; align-items: center; }
html:root body .level-setting-controls > em { justify-self: end; color: var(--theme-text-muted) !important; font-size: .55rem; font-style: normal; font-weight: 850; }
html:root body .level-settings-modal form > footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border: 0 !important; padding: .75rem 1rem; background: var(--theme-surface-nested) !important; }
html:root body .level-settings-modal form > footer span { color: var(--theme-text-muted) !important; font-size: .57rem; }
html:root body .level-settings-modal form > footer button { border: 0 !important; border-radius: .72rem; padding: .65rem .85rem; background: var(--theme-accent) !important; color: var(--theme-accent-contrast, #fff) !important; font-size: .62rem; font-weight: 900; }
html:root body .level-modal-loading,
html:root body .level-modal-error { padding: 1.5rem; color: var(--theme-text-muted) !important; font-size: .68rem; text-align: center; }

html:root body .level-up-celebration-modal > section {
    display: block;
    width: min(29rem, 100%);
    overflow: visible;
    background:
        radial-gradient(circle at 50% 0, color-mix(in srgb, var(--theme-accent) 22%, transparent), transparent 48%),
        var(--theme-surface-panel) !important;
}
html:root body .level-up-celebration-close { position:absolute; z-index:2; top:.85rem; right:.85rem; display:grid; width:2.15rem; height:2.15rem; place-items:center; border:0 !important; border-radius:.72rem; background:var(--theme-surface-control) !important; color:var(--theme-text-secondary) !important; font-size:1.05rem; }
html:root body #level-up-celebration-body { display:grid; justify-items:center; padding:2.1rem 1.35rem 1.35rem; text-align:center; }
html:root body .level-up-orbit { position:relative; display:grid; width:6.2rem; height:6.2rem; place-items:center; margin-bottom:.9rem; border-radius:50%; background:color-mix(in srgb,var(--theme-accent) 13%,var(--theme-surface-control)) !important; box-shadow:0 1rem 2.7rem color-mix(in srgb,var(--theme-accent) 22%,transparent); }
html:root body .level-up-orbit::before,
html:root body .level-up-orbit::after { content:""; position:absolute; inset:50% auto auto 50%; width:7.9rem; height:2.85rem; border:2px solid color-mix(in srgb,var(--theme-accent) 58%,transparent); border-radius:50%; transform:translate(-50%,-50%) rotate(-14deg); }
html:root body .level-up-orbit::after { width:.65rem; height:.65rem; border:0; background:var(--theme-accent) !important; transform:translate(2.65rem,-2rem); box-shadow:-5.6rem 2rem 0 color-mix(in srgb,var(--theme-accent) 54%,transparent); }
html:root body .level-up-orbit i { position:relative; z-index:1; display:grid; width:4.25rem; height:4.25rem; place-items:center; border-radius:1.25rem; background:var(--theme-accent) !important; color:var(--theme-accent-contrast,#fff) !important; font-size:1.75rem; font-style:normal; font-weight:950; }
html:root body #level-up-celebration-body > small { color:var(--theme-accent) !important; font-size:.55rem; font-weight:950; letter-spacing:.18em; }
html:root body #level-up-celebration-body > h2 { margin:.28rem 0 0; color:var(--theme-text-primary) !important; font-size:1.35rem; font-weight:950; }
html:root body #level-up-celebration-body > p { max-width:23rem; margin:.55rem 0 0; color:var(--theme-text-secondary) !important; font-size:.7rem; line-height:1.55; }
html:root body .level-up-coin-reward { display:flex; width:min(20rem,100%); align-items:center; gap:.72rem; margin-top:1rem; border-radius:1rem; padding:.72rem .82rem; background:var(--theme-surface-nested) !important; text-align:left; }
html:root body .level-up-coin-reward > span { display:grid; width:2.7rem; height:2.7rem; flex:0 0 auto; place-items:center; border-radius:.8rem; background:color-mix(in srgb,#f59e0b 18%,var(--theme-surface-control)) !important; color:#d97706 !important; font-size:1.2rem; font-weight:950; }
html:root body .level-up-coin-reward > div { display:grid; gap:.12rem; }
html:root body .level-up-coin-reward small { color:var(--theme-text-muted) !important; font-size:.48rem; font-weight:900; letter-spacing:.12em; }
html:root body .level-up-coin-reward strong { color:var(--theme-text-primary) !important; font-size:.78rem; }
html:root body .level-up-celebration-actions { display:grid; width:min(20rem,100%); grid-template-columns:1fr 1fr; gap:.5rem; margin-top:1rem; }
html:root body .level-up-celebration-actions button { min-height:2.65rem; border:0 !important; border-radius:.78rem; background:var(--theme-accent) !important; color:var(--theme-accent-contrast,#fff) !important; font-size:.62rem; font-weight:900; }
html:root body .level-up-celebration-actions button.is-secondary { background:var(--theme-surface-control) !important; color:var(--theme-text-primary) !important; }

html:root body .level-manual-coin-grant { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(6.6rem,.7fr); gap:.55rem; border-radius:1rem; padding:.75rem; background:var(--theme-surface-nested) !important; }
html:root body .level-settings-group .level-manual-coin-grant > label { display:grid; grid-template-columns:1fr; gap:.25rem; border:0 !important; border-radius:0; padding:0; background:transparent !important; }
html:root body .level-settings-group .level-manual-coin-grant > label.is-reason { grid-column:1 / -1; }
html:root body .level-manual-coin-grant label > span { color:var(--theme-text-secondary) !important; font-size:.54rem; font-weight:850; }
html:root body .level-manual-coin-grant input { width:100%; min-height:2.45rem; border:1px solid var(--theme-border-subtle) !important; border-radius:.72rem; outline:0 !important; padding:0 .7rem; background:var(--theme-surface-control) !important; color:var(--theme-text-primary) !important; font-size:.67rem; font-weight:750; }
html:root body .level-manual-coin-grant input:focus { border-color:color-mix(in srgb,var(--theme-accent) 58%,transparent) !important; box-shadow:0 0 0 .18rem color-mix(in srgb,var(--theme-accent) 12%,transparent); }
html:root body .level-manual-coin-grant > button { min-height:2.55rem; grid-column:1 / -1; border:0 !important; border-radius:.75rem; background:var(--theme-accent) !important; color:var(--theme-accent-contrast,#fff) !important; font-size:.62rem; font-weight:900; }
html:root body .level-manual-coin-grant > button:disabled { opacity:.55; cursor:wait; }
html:root body .level-manual-coin-status { min-height:.9rem; grid-column:1 / -1; margin:0; color:var(--theme-text-muted) !important; font-size:.56rem; font-weight:800; }
html:root body .level-manual-coin-status.is-success { color:var(--theme-accent) !important; }
html:root body .level-manual-coin-status.is-error { color:var(--theme-danger,#ef4444) !important; }

@media (max-width: 640px) {
    html:root body .level-details-modal { padding: .55rem; }
    html:root body .level-details-modal > section { max-height: calc(100dvh - 1.1rem); border-radius: 1rem; }
    html:root body .level-settings-group label { grid-template-columns: 1fr; }
    html:root body .level-manual-coin-grant { grid-template-columns:1fr; }
    html:root body .level-settings-group .level-manual-coin-grant > label.is-reason { grid-column:auto; }
    html:root body .level-settings-modal form > footer { align-items: stretch; flex-direction: column; }
    html:root body .level-settings-modal form > footer button { width: 100%; }
}

/* ------------[Единый магазин подарков]------------ // Каталог и отправка больше не дублируются в центре истории. */
html:root body .gift-center-tabs button:last-child { margin-left: 0; }
html:root body .vmesta-market-dialog { width: min(68rem, 100%); max-height: min(50rem, calc(100dvh - 2rem)); }
html:root body .vmesta-market-dialog > header {
    grid-template-columns: 2.65rem minmax(11rem, .72fr) minmax(18rem, 1.15fr) auto 2.35rem;
}
html:root body .vmesta-market-heading { min-width: 0; }
html:root body .vmesta-market-gift-search { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 2.4rem; gap: .35rem; }
html:root body .vmesta-market-gift-search[hidden] { display: none; }
html:root body .vmesta-market-gift-search > label { display: flex; min-width: 0; align-items: center; gap: .5rem; border-radius: .78rem; padding: 0 .75rem; background: var(--theme-surface-control); color: var(--theme-accent); }
html:root body .vmesta-market-gift-search svg { width: 1rem; height: 1rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
html:root body .vmesta-market-gift-search input { width: 100%; min-width: 0; height: 2.4rem; border: 0; outline: 0; background: transparent; color: var(--theme-text-primary); font: 800 .61rem/1 inherit; }
html:root body .vmesta-market-gift-search > button { display: grid; width: 2.4rem; height: 2.4rem; place-items: center; border: 0; border-radius: .78rem; background: var(--theme-surface-control); color: var(--theme-accent); cursor: pointer; }
html:root body .vmesta-market-gift-filter { position: absolute; z-index: 12; top: calc(100% + .45rem); right: 0; display: none; width: min(18rem, 80vw); max-height: 22rem; overflow: auto; gap: .25rem; border-radius: .9rem; padding: .65rem; background: var(--theme-surface-panel); box-shadow: 0 1.1rem 3rem rgb(0 0 0 / .22); }
html:root body .vmesta-market-gift-filter.is-open { display: grid; }
html:root body .vmesta-market-gift-filter > small { padding: .25rem .35rem; color: var(--theme-accent); font-size: .46rem; font-weight: 950; letter-spacing: .14em; }
html:root body .vmesta-market-gift-filter > button { display: flex; min-height: 2.2rem; align-items: center; justify-content: space-between; border: 0; border-radius: .62rem; padding: .45rem .6rem; background: transparent; color: var(--theme-text-secondary); font-size: .56rem; font-weight: 850; cursor: pointer; }
html:root body .vmesta-market-gift-filter > button:hover,
html:root body .vmesta-market-gift-filter > button.is-active { background: var(--theme-surface-active); color: var(--theme-accent); }
html:root body .vmesta-market-gift-filter b { display: grid; min-width: 1.35rem; height: 1.35rem; place-items: center; border-radius: 999px; background: var(--theme-surface-control); font-size: .48rem; }
html:root body .vmesta-market-tabs { grid-template-columns: minmax(0, 1fr); }
html:root body .vmesta-market-gift-catalog { position: relative; display: grid; gap: .8rem; }
html:root body .vmesta-market-gift-categories { display: flex; gap: .42rem; overflow-x: auto; padding: .05rem .05rem .35rem; scrollbar-width: thin; }
html:root body .vmesta-market-gift-categories > button { display: flex; flex: 0 0 auto; min-height: 2.25rem; align-items: center; gap: .42rem; border: 0; border-radius: 999px; padding: .48rem .75rem; background: var(--theme-surface-panel); color: var(--theme-text-secondary); font-size: .55rem; font-weight: 900; cursor: pointer; }
html:root body .vmesta-market-gift-categories > button.is-active { background: var(--theme-accent); color: var(--theme-accent-contrast, #fff); }
html:root body .vmesta-market-gift-categories b { display: grid; min-width: 1.25rem; height: 1.25rem; place-items: center; border-radius: 999px; background: color-mix(in srgb, currentColor 12%, transparent); font-size: .45rem; }
html:root body .vmesta-market-gift-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
html:root body .vmesta-market-gift-card { position: relative; min-height: 10.5rem; overflow: hidden; border: 0; outline: 0; border-radius: 1.05rem; background: var(--theme-surface-panel); color: var(--theme-text-primary); box-shadow: none; transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease; }
html:root body .vmesta-market-gift-card:hover { transform: translateY(-2px); background: var(--theme-surface-active); }
html:root body .vmesta-market-gift-card.is-selected { background: color-mix(in srgb, var(--theme-accent) 13%, var(--theme-surface-panel)); box-shadow: 0 .75rem 1.8rem color-mix(in srgb, var(--theme-accent) 13%, transparent); }
html:root body .vmesta-market-gift-select { display: grid; width: 100%; min-height: 10.5rem; place-items: center; align-content: center; gap: .35rem; border: 0; outline: 0; padding: .8rem .65rem 1.3rem; background: transparent; color: inherit; cursor: pointer; }
html:root body .vmesta-market-gift-card.is-selected .vmesta-market-gift-select { padding-bottom: 3.6rem; }
html:root body .vmesta-market-gift-select > span { display: grid; width: 5.1rem; height: 5.1rem; place-items: center; }
html:root body .vmesta-market-gift-card .gift-artwork-svg { width: 100%; height: 100%; }
html:root body .vmesta-market-gift-select > strong { max-width: 100%; overflow: hidden; font-size: .65rem; font-weight: 950; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
html:root body .vmesta-market-gift-select > small { color: var(--theme-text-muted); font-size: .45rem; font-weight: 800; text-transform: uppercase; }
html:root body .vmesta-market-gift-select > em { position: absolute; right: .55rem; top: .55rem; border-radius: .48rem; padding: .25rem .4rem; background: var(--theme-surface-control); color: var(--theme-accent); font-size: .5rem; font-style: normal; font-weight: 950; }
html:root body .vmesta-market-gift-send { position: absolute; right: .7rem; bottom: .65rem; left: .7rem; display: flex; min-height: 2.25rem; align-items: center; justify-content: center; gap: .4rem; border: 0; border-radius: .7rem; background: var(--theme-accent); color: var(--theme-accent-contrast, #fff); font-size: .57rem; font-weight: 950; cursor: pointer; box-shadow: 0 .5rem 1.2rem color-mix(in srgb, var(--theme-accent) 22%, transparent); }
html:root body .vmesta-market-gift-send svg { width: .95rem; height: .95rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
html:root body .vmesta-market-gift-empty { grid-column: 1 / -1; display: grid; min-height: 20rem; place-items: center; align-content: center; gap: .55rem; color: var(--theme-text-muted); text-align: center; }
html:root body .vmesta-market-gift-empty > svg { width: 3rem; fill: none; stroke: var(--theme-accent); stroke-width: 1.5; }
html:root body .vmesta-market-gift-empty strong { color: var(--theme-text-primary); font-size: .8rem; }
html:root body .vmesta-market-gift-empty span { font-size: .58rem; }

html:root body .gift-shop-compose-modal { position: fixed; inset: 0; z-index: 10140; display: grid; place-items: center; padding: 1rem; }
html:root body .gift-shop-compose-modal.hidden { display: none; }
html:root body .gift-shop-compose-backdrop { position: absolute; inset: 0; border: 0; background: rgb(5 19 23 / .72); backdrop-filter: blur(.7rem); }
html:root body .gift-shop-compose-dialog { position: relative; z-index: 1; width: min(62rem, 100%); max-height: calc(100dvh - 2rem); overflow: auto; border-radius: 1.4rem; padding: 1rem; background: var(--theme-surface-panel); box-shadow: 0 2rem 6rem rgb(0 0 0 / .38); }
html:root body .gift-shop-compose-close { position: absolute; z-index: 3; top: .8rem; right: .8rem; display: grid; width: 2.5rem; height: 2.5rem; place-items: center; border: 0; border-radius: .75rem; background: var(--theme-surface-control); color: var(--theme-text-secondary); cursor: pointer; }
html:root body .gift-shop-compose-close svg { width: 1rem; fill: none; stroke: currentColor; stroke-width: 2; }
html:root body #gift-shop-compose-content { display: grid; grid-template-columns: minmax(18rem, 1fr) minmax(19rem, .85fr); gap: 1rem; }
html:root body .gift-shop-compose-art { display: grid; min-height: 32rem; place-items: center; align-content: center; overflow: hidden; border-radius: 1.1rem; padding: 2rem; background: linear-gradient(145deg, color-mix(in srgb, var(--theme-accent) 10%, var(--theme-surface-control)), color-mix(in srgb, #ed4772 10%, var(--theme-surface-panel))); text-align: center; }
html:root body .gift-shop-compose-art > small { color: var(--theme-accent); font-size: .48rem; font-weight: 950; letter-spacing: .18em; }
html:root body .gift-shop-compose-art > div { width: min(16rem, 70%); margin: 1.2rem auto .75rem; }
html:root body .gift-shop-compose-art .gift-artwork-svg { width: 100%; height: auto; }
html:root body .gift-shop-compose-art h2 { margin: 0; color: var(--theme-text-primary); font-size: 1.45rem; font-weight: 950; }
html:root body .gift-shop-compose-art p { margin: .3rem 0 .8rem; color: var(--theme-text-muted); font-size: .58rem; text-transform: uppercase; }
html:root body .gift-shop-compose-art > strong { border-radius: 999px; padding: .45rem .72rem; background: var(--theme-surface-panel); color: var(--theme-accent); font-size: .65rem; }
html:root body .gift-shop-compose-form { position: static; align-self: stretch; display: grid; align-content: center; border: 0; border-radius: 1.1rem; padding: 1.15rem; background: var(--theme-surface-nested); box-shadow: none; }

@media (max-width: 980px) {
    html:root body .vmesta-market-dialog > header { grid-template-columns: 2.65rem minmax(9rem, 1fr) auto 2.35rem; }
    html:root body .vmesta-market-gift-search { grid-column: 1 / -1; grid-row: 2; }
    html:root body .vmesta-market-gift-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    html:root body .vmesta-market-gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html:root body .vmesta-market-gift-card { min-height: 9rem; }
    html:root body #gift-shop-compose-content { grid-template-columns: 1fr; }
    html:root body .gift-shop-compose-art { min-height: 15rem; }
    html:root body .gift-shop-compose-art > div { width: 8rem; }
}
@media (max-width: 460px) {
    html:root body .vmesta-market-dialog > header { grid-template-columns: 2.35rem minmax(0, 1fr) 2.15rem; }
    html:root body .vmesta-market-balance { grid-column: 1 / -1; grid-row: 3; }
    html:root body .vmesta-market-gift-search { grid-row: 2; }
    html:root body .gift-shop-compose-modal { padding: .45rem; }
    html:root body .gift-shop-compose-dialog { max-height: calc(100dvh - .9rem); padding: .65rem; }
}

/* V2.0.46 — безопасный выбор получателя и магазин наград пространств. */
html:root body .level-market-user-picker { position:relative; z-index:8; }
html:root body .level-market-user-results { position:absolute; z-index:40; inset:calc(100% + .28rem) 0 auto; display:grid; gap:.28rem; max-height:14rem; overflow:auto; border:1px solid var(--theme-border-subtle); border-radius:.85rem; padding:.36rem; background:var(--theme-surface-elevated,var(--theme-surface-panel)) !important; box-shadow:0 1rem 2.2rem color-mix(in srgb,var(--theme-shadow,#10233f) 22%,transparent); }
html:root body .level-market-user-results[hidden], html:root body .level-market-user-selected[hidden] { display:none !important; }
html:root body .level-market-user-results > button { display:grid; grid-template-columns:2.3rem minmax(0,1fr) auto; align-items:center; gap:.55rem; min-height:3.05rem; border:0 !important; border-radius:.68rem; padding:.38rem .5rem; text-align:left; background:transparent !important; color:var(--theme-text-primary) !important; }
html:root body .level-market-user-results > button:hover { background:var(--theme-surface-control) !important; }
html:root body .level-market-user-results > button > span:nth-child(2) { display:grid; min-width:0; gap:.08rem; }
html:root body .level-market-user-results strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.64rem; }
html:root body .level-market-user-results small { color:var(--theme-text-muted) !important; font-size:.55rem; }
html:root body .level-market-user-results em { color:var(--theme-accent) !important; font-size:.53rem; font-style:normal; font-weight:900; }
html:root body .level-market-user-avatar { position:relative; display:grid !important; width:2.3rem; height:2.3rem; place-items:center; }
html:root body .level-market-user-avatar img { width:100%; height:100%; border-radius:.72rem; object-fit:cover; }
html:root body .level-market-user-avatar i { display:grid; width:100%; height:100%; place-items:center; border-radius:.72rem; background:var(--theme-surface-control); font-style:normal; }
html:root body .level-market-user-avatar b { position:absolute; right:-.05rem; bottom:-.05rem; width:.55rem; height:.55rem; border:.12rem solid var(--theme-surface-panel); border-radius:50%; background:var(--theme-text-muted); }
html:root body .level-market-user-avatar b.is-online { background:var(--theme-accent); }
html:root body .level-market-user-loading, html:root body .level-market-user-empty { padding:.65rem; color:var(--theme-text-muted) !important; font-size:.58rem; font-weight:800; text-align:center; }
html:root body .level-market-user-selected { display:grid; grid-template-columns:2rem minmax(0,1fr) auto; align-items:center; gap:.48rem; margin-top:.28rem; border-radius:.7rem; padding:.34rem .45rem; background:color-mix(in srgb,var(--theme-accent) 10%,var(--theme-surface-control)) !important; }
html:root body .level-market-user-selected img, html:root body .level-market-user-selected > i { display:grid; width:2rem; height:2rem; place-items:center; border-radius:.62rem; object-fit:cover; background:var(--theme-surface-panel); font-style:normal; }
html:root body .level-market-user-selected > span { display:grid; gap:.05rem; }
html:root body .level-market-user-selected strong { color:var(--theme-text-primary) !important; font-size:.61rem; }
html:root body .level-market-user-selected small { color:var(--theme-text-muted) !important; font-size:.52rem; }
html:root body .level-market-user-selected > b { color:var(--theme-accent) !important; }
html:root body .level-space-reward-grid { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.45rem; padding:.55rem !important; }
html:root body .level-settings-group .level-space-reward-grid > label { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:.5rem; min-height:4.1rem; border:1px solid var(--theme-border-subtle) !important; border-radius:.86rem; padding:.52rem; background:var(--theme-surface-nested) !important; }
html:root body .level-space-reward-summary { display:grid !important; grid-template-columns:2.4rem minmax(0,1fr); align-items:center; gap:.48rem; }
html:root body .level-space-reward-summary > i { display:grid; width:2.4rem; height:2.4rem; place-items:center; border-radius:.72rem; background:var(--theme-surface-control); font-size:1.28rem; font-style:normal; }
html:root body .level-space-reward-summary > span { display:grid; gap:.1rem; }
html:root body .level-space-reward-summary strong { color:var(--theme-text-primary) !important; font-size:.61rem; }
html:root body .level-space-reward-summary small { color:var(--theme-text-muted) !important; font-size:.5rem; line-height:1.25; }
html:root body .level-space-reward-grant { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; border-radius:1rem; padding:.75rem; background:var(--theme-surface-nested) !important; }
html:root body .level-settings-group .level-space-reward-grant > label { position:relative; display:grid; grid-template-columns:1fr; gap:.25rem; border:0 !important; padding:0; background:transparent !important; }
html:root body .level-settings-group .level-space-reward-grant > label.is-message { grid-column:1 / -1; }
html:root body .level-space-reward-grant label > span { color:var(--theme-text-secondary) !important; font-size:.54rem; font-weight:850; }
html:root body .level-space-reward-grant input, html:root body .level-space-reward-grant select { width:100%; min-height:2.45rem; border:1px solid var(--theme-border-subtle) !important; border-radius:.72rem; outline:0 !important; padding:0 .7rem; background:var(--theme-surface-control) !important; color:var(--theme-text-primary) !important; font-size:.62rem; font-weight:750; }
html:root body .level-space-reward-grant > button { min-height:2.55rem; grid-column:1 / -1; border:0 !important; border-radius:.75rem; background:var(--theme-accent) !important; color:var(--theme-accent-contrast,#fff) !important; font-size:.62rem; font-weight:900; }
html:root body .level-space-reward-status { min-height:.9rem; grid-column:1 / -1; margin:0; color:var(--theme-text-muted) !important; font-size:.56rem; font-weight:800; }
html:root body .level-space-reward-status.is-success { color:var(--theme-accent) !important; }
html:root body .level-space-reward-status.is-error { color:var(--theme-danger,#ef4444) !important; }
@media (max-width: 700px) {
    html:root body .level-space-reward-grid, html:root body .level-space-reward-grant { grid-template-columns:1fr; }
    html:root body .level-settings-group .level-space-reward-grant > label.is-message { grid-column:auto; }
}

@media (max-width: 620px) {
    html:root body .messenger-poll-voter-group > div { grid-template-columns: 1fr; }
}

/* ------------[Межпространственный рынок]------------ // Оформляет цены подарков и единое окно магазина. Модуль: «оформление интерфейса». Часть 1/1 */
html:root body .gift-catalog-item { position:relative; padding-bottom:1.9rem; }
html:root body .gift-price { position:absolute; right:.55rem; bottom:.5rem; display:inline-grid; min-width:2.35rem; min-height:1.35rem; place-items:center; border-radius:.48rem; padding:.2rem .38rem; background:var(--theme-surface-control) !important; color:var(--theme-accent) !important; font-size:.53rem; font-style:normal; font-weight:950; }
html:root body .gift-compose-price { margin-left:auto; flex:0 0 auto; border-radius:.55rem; padding:.34rem .46rem; background:var(--theme-surface-panel) !important; color:var(--theme-accent) !important; font-size:.58rem; }

html:root body .vmesta-market-modal { position:fixed; inset:0; z-index:10120; display:grid; place-items:center; padding:1rem; }
html:root body .vmesta-market-modal.hidden { display:none !important; }
html:root body .vmesta-market-backdrop { position:absolute; inset:0; border:0 !important; background:color-mix(in srgb,#07171b 72%,transparent) !important; backdrop-filter:blur(.65rem); }
html:root body .vmesta-market-dialog { position:relative; z-index:1; display:grid; width:min(62rem,100%); max-height:min(47rem,calc(100dvh - 2rem)); grid-template-rows:auto auto minmax(0,1fr); overflow:hidden; border:1px solid color-mix(in srgb,var(--theme-accent) 30%,transparent) !important; border-radius:1.55rem; background:var(--theme-surface-panel) !important; color:var(--theme-text-primary) !important; box-shadow:0 2rem 6rem rgb(0 0 0/.34); }
html:root body .vmesta-market-close { position:absolute; right:1rem; top:1rem; z-index:3; display:grid; width:2.6rem; height:2.6rem; place-items:center; border:0 !important; border-radius:.82rem; background:var(--theme-surface-control) !important; color:var(--theme-text-secondary) !important; font-size:1.3rem; cursor:pointer; }
html:root body .vmesta-market-dialog > header { display:grid; grid-template-columns:3.4rem minmax(0,1fr) auto; align-items:center; gap:.8rem; min-height:6.2rem; padding:1rem 5rem 1rem 1.2rem; background:linear-gradient(120deg,var(--theme-surface-panel),color-mix(in srgb,var(--theme-accent) 10%,var(--theme-surface-panel)),color-mix(in srgb,#ed4772 8%,var(--theme-surface-panel))) !important; }
html:root body .vmesta-market-dialog > header > span { display:grid; width:3.4rem; height:3.4rem; place-items:center; border-radius:1rem; background:var(--theme-surface-control); color:var(--theme-accent); }
html:root body .vmesta-market-dialog > header > span svg { width:1.8rem; height:1.8rem; fill:none; stroke:currentColor; stroke-width:1.7; }
html:root body .vmesta-market-dialog > header div small,.vmesta-market-section-head small,.vmesta-market-guide>div>small,.vmesta-market-coming>small { color:var(--theme-accent) !important; font-size:.5rem; font-weight:950; letter-spacing:.16em; }
html:root body .vmesta-market-dialog > header h2 { margin:.15rem 0 .1rem; font-size:1.35rem; font-weight:950; }
html:root body .vmesta-market-dialog > header p { margin:0; color:var(--theme-text-muted) !important; font-size:.62rem; font-weight:650; }
html:root body .vmesta-market-balance { display:grid; min-width:5.4rem; border:0 !important; border-radius:.9rem; padding:.6rem .72rem; background:var(--theme-surface-panel) !important; color:var(--theme-accent) !important; cursor:pointer; text-align:center; }
html:root body .vmesta-market-balance b { font-size:1.1rem; font-weight:950; }
html:root body .vmesta-market-balance span { color:var(--theme-text-muted) !important; font-size:.47rem; font-weight:850; text-transform:uppercase; }
html:root body .vmesta-market-tabs { display:flex; gap:.45rem; overflow-x:auto; border-block:1px solid var(--theme-border-subtle); padding:.62rem 1.15rem; background:var(--theme-surface-panel) !important; }
html:root body .vmesta-market-tabs button { flex:0 0 auto; min-height:2.25rem; border:1px solid transparent !important; border-radius:.72rem; padding:.5rem .8rem; background:var(--theme-surface-nested) !important; color:var(--theme-text-secondary) !important; font-size:.58rem; font-weight:900; cursor:pointer; }
html:root body .vmesta-market-tabs button.is-active { border-color:color-mix(in srgb,var(--theme-accent) 42%,transparent) !important; background:var(--theme-accent) !important; color:var(--theme-accent-contrast,#fff) !important; box-shadow:0 .45rem 1rem color-mix(in srgb,var(--theme-accent) 20%,transparent); }
html:root body .vmesta-market-content { min-height:20rem; overflow-y:auto; padding:1.1rem 1.2rem 1.35rem; }
html:root body .vmesta-market-loading { min-height:20rem; display:grid; place-items:center; align-content:center; gap:.7rem; color:var(--theme-text-muted); font-size:.65rem; font-weight:850; }
html:root body .vmesta-market-loading i { width:2rem; height:2rem; border:3px solid var(--theme-surface-control); border-top-color:var(--theme-accent); border-radius:50%; animation:gift-spin .8s linear infinite; }
html:root body .vmesta-market-section-head { display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
html:root body .vmesta-market-section-head h3,.vmesta-market-guide h3,.vmesta-market-coming h3 { margin:.2rem 0 0; font-size:1.05rem; font-weight:950; }
html:root body .vmesta-market-section-head p,.vmesta-market-guide>div>p,.vmesta-market-coming p { margin:.25rem 0 0; color:var(--theme-text-muted) !important; font-size:.62rem; line-height:1.5; }
html:root body .vmesta-market-section-head button,.vmesta-market-coming button { flex:0 0 auto; border:0 !important; border-radius:.72rem; padding:.65rem .85rem; background:var(--theme-accent) !important; color:var(--theme-accent-contrast,#fff) !important; font-size:.58rem; font-weight:900; cursor:pointer; }
html:root body .vmesta-market-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.65rem; }
html:root body .vmesta-market-grid article { position:relative; display:grid; grid-template-columns:3rem minmax(0,1fr); align-items:center; gap:.6rem; min-height:5rem; border-radius:1rem; padding:.7rem 3.2rem .7rem .72rem; background:var(--theme-surface-nested) !important; }
html:root body .vmesta-market-grid article>span { display:grid; width:3rem; height:3rem; place-items:center; border-radius:.85rem; background:var(--theme-surface-control); font-size:1.8rem; }
html:root body .vmesta-market-grid article>div { display:grid; min-width:0; gap:.15rem; }
html:root body .vmesta-market-grid strong { overflow:hidden; font-size:.64rem; text-overflow:ellipsis; white-space:nowrap; }
html:root body .vmesta-market-grid small { color:var(--theme-text-muted) !important; font-size:.48rem; text-transform:uppercase; }
html:root body .vmesta-market-grid article>b { position:absolute; right:.6rem; top:.6rem; border-radius:.48rem; padding:.28rem .38rem; background:var(--theme-surface-control); color:var(--theme-accent); font-size:.53rem; }
html:root body .vmesta-market-guide { display:grid; gap:1rem; }
html:root body .vmesta-market-rule-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.65rem; }
html:root body .vmesta-market-rule-grid article { display:grid; grid-template-columns:auto minmax(0,1fr); gap:.25rem .7rem; border-radius:1rem; padding:.85rem; background:var(--theme-surface-nested) !important; }
html:root body .vmesta-market-rule-grid article>span { grid-row:1/4; display:grid; min-width:3.3rem; height:3.3rem; place-items:center; border-radius:.9rem; background:var(--theme-surface-control); color:var(--theme-accent); font-size:.78rem; font-weight:950; }
html:root body .vmesta-market-rule-grid strong { font-size:.7rem; }
html:root body .vmesta-market-rule-grid p { margin:0; color:var(--theme-text-secondary) !important; font-size:.57rem; line-height:1.4; }
html:root body .vmesta-market-rule-grid small { color:var(--theme-text-muted) !important; font-size:.5rem; }
html:root body .vmesta-market-coming { min-height:20rem; display:grid; place-items:center; align-content:center; text-align:center; }
html:root body .vmesta-market-coming>span { font-size:4rem; }
html:root body .vmesta-market-coming p { max-width:27rem; margin-bottom:1rem; }

@media (max-width: 760px) {
    html:root body .vmesta-market-modal { padding:.45rem; }
    html:root body .vmesta-market-dialog { max-height:calc(100dvh - .9rem); border-radius:1.1rem; }
    html:root body .vmesta-market-dialog > header { grid-template-columns:2.8rem minmax(0,1fr); padding:.8rem 3.7rem .8rem .85rem; }
    html:root body .vmesta-market-dialog > header > span { width:2.8rem; height:2.8rem; }
    html:root body .vmesta-market-balance { grid-column:1/-1; width:100%; grid-template-columns:auto auto; justify-content:center; gap:.35rem; min-height:2.2rem; }
    html:root body .vmesta-market-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    html:root body .vmesta-market-rule-grid { grid-template-columns:1fr; }
    html:root body .vmesta-market-section-head { align-items:flex-start; flex-direction:column; }
    html:root body .vmesta-market-section-head button { width:100%; }
}

/* ------------[Компактный рынок VMESTA]------------ // Верхняя навигация, витрина и баланс используют одну тему без лишней шапки. Модуль: «оформление интерфейса». Часть 1/1 */
html:root body .vmesta-market-dialog { width:min(58rem,100%); max-height:min(44rem,calc(100dvh - 2rem)); grid-template-rows:auto auto minmax(0,1fr); border:0 !important; border-radius:1.35rem; background:var(--theme-surface-panel) !important; box-shadow:0 2rem 6rem rgb(0 0 0/.36); }
html:root body .vmesta-market-dialog > header { display:grid; grid-template-columns:2.65rem minmax(0,1fr) auto 2.35rem; align-items:center; gap:.7rem; min-height:4.65rem; padding:.72rem .8rem .72rem .9rem; border-bottom:1px solid var(--theme-border-subtle); background:linear-gradient(120deg,var(--theme-surface-panel),color-mix(in srgb,var(--theme-accent) 7%,var(--theme-surface-panel))) !important; }
html:root body .vmesta-market-dialog > header > .vmesta-market-brand { display:grid; width:2.65rem; height:2.65rem; place-items:center; border-radius:.82rem; background:var(--theme-surface-control) !important; color:var(--theme-accent) !important; }
html:root body .vmesta-market-dialog > header > .vmesta-market-brand svg { width:1.42rem; height:1.42rem; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
html:root body .vmesta-market-dialog > header > div { min-width:0; }
html:root body .vmesta-market-dialog > header > div small { display:block; overflow:hidden; color:var(--theme-accent) !important; font-size:.47rem; font-weight:950; letter-spacing:.15em; text-overflow:ellipsis; white-space:nowrap; }
html:root body .vmesta-market-dialog > header h2 { overflow:hidden; margin:.12rem 0 0; font-size:1.05rem; font-weight:950; text-overflow:ellipsis; white-space:nowrap; }
html:root body .vmesta-market-balance { display:flex; grid-column:auto; width:auto; min-width:0; align-items:center; justify-content:flex-start; gap:.45rem; border:0 !important; border-radius:.75rem; padding:.43rem .62rem; background:var(--theme-surface-control) !important; color:var(--theme-accent) !important; cursor:pointer; text-align:left; }
html:root body .vmesta-market-balance:hover { background:var(--theme-surface-active) !important; }
html:root body .vmesta-market-balance > svg { width:1.05rem; height:1.05rem; fill:none; stroke:currentColor; stroke-width:1.8; }
html:root body .vmesta-market-balance > span { display:grid; gap:.03rem; }
html:root body .vmesta-market-balance b { color:var(--theme-text-primary) !important; font-size:.72rem; font-weight:950; line-height:1; }
html:root body .vmesta-market-balance small { color:var(--theme-text-muted) !important; font-size:.4rem; font-weight:850; letter-spacing:.08em; line-height:1.1; text-transform:uppercase; }
html:root body .vmesta-market-close { position:static; display:grid; width:2.35rem; height:2.35rem; place-items:center; border:0 !important; border-radius:.72rem; background:var(--theme-surface-control) !important; color:var(--theme-text-secondary) !important; cursor:pointer; }
html:root body .vmesta-market-close:hover { background:var(--theme-surface-active) !important; color:var(--theme-accent) !important; }
html:root body .vmesta-market-close svg { width:1rem; height:1rem; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; }
html:root body .vmesta-market-tabs { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:.65rem; overflow:hidden; border:0; border-bottom:1px solid var(--theme-border-subtle); padding:.55rem .8rem; background:var(--theme-surface-panel) !important; }
html:root body .vmesta-market-tab-scroll { display:flex; min-width:0; gap:.3rem; overflow-x:auto; scrollbar-width:none; }
html:root body .vmesta-market-tab-scroll::-webkit-scrollbar { display:none; }
html:root body .vmesta-market-tabs [data-market-tab] { display:flex; flex:0 0 auto; min-height:2.25rem; align-items:center; gap:.42rem; border:0 !important; border-radius:.68rem; padding:.45rem .68rem; background:transparent !important; color:var(--theme-text-muted) !important; font-size:.57rem; font-weight:900; cursor:pointer; }
html:root body .vmesta-market-tabs [data-market-tab]:hover { background:var(--theme-surface-control) !important; color:var(--theme-text-primary) !important; }
html:root body .vmesta-market-tabs [data-market-tab].is-active { background:var(--theme-surface-active) !important; color:var(--theme-accent) !important; box-shadow:none; }
html:root body .vmesta-market-tabs svg { width:1rem; height:1rem; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
html:root body .vmesta-market-tabs > .vmesta-market-catalog-action { display:flex; min-height:2.3rem; align-items:center; gap:.42rem; border:0 !important; border-radius:.72rem; padding:.45rem .7rem; background:var(--theme-surface-control) !important; color:var(--theme-accent) !important; font-size:.57rem; font-weight:950; white-space:nowrap; cursor:pointer; }
html:root body .vmesta-market-catalog-action svg:last-child { width:.82rem; }
html:root body .vmesta-market-catalog-action.is-prominent { background:var(--theme-accent) !important; color:var(--theme-accent-contrast,#fff) !important; }
html:root body .vmesta-market-content { min-height:21rem; overflow-y:auto; padding:1rem; background:color-mix(in srgb,var(--theme-surface-nested) 42%,var(--theme-surface-panel)) !important; }
html:root body .vmesta-market-showcase,.vmesta-market-guide { display:grid; gap:.9rem; }
html:root body .vmesta-market-showcase > header,.vmesta-market-guide > header { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:1rem; border-radius:1rem; padding:.9rem 1rem; background:var(--theme-surface-panel) !important; }
html:root body .vmesta-market-showcase > header small,.vmesta-market-guide > header > div > small,.vmesta-market-preview > div > small { color:var(--theme-accent) !important; font-size:.48rem; font-weight:950; letter-spacing:.15em; }
html:root body .vmesta-market-showcase h3,.vmesta-market-guide h3,.vmesta-market-preview h3 { margin:.18rem 0 0; font-size:1rem; font-weight:950; }
html:root body .vmesta-market-showcase p,.vmesta-market-guide header p,.vmesta-market-preview p { margin:.22rem 0 0; color:var(--theme-text-muted) !important; font-size:.6rem; line-height:1.5; }
html:root body .vmesta-market-showcase > header > span { display:grid; min-width:4.3rem; justify-items:center; border-radius:.8rem; padding:.55rem; background:var(--theme-surface-control) !important; }
html:root body .vmesta-market-showcase > header > span b { color:var(--theme-accent) !important; font-size:1rem; }
html:root body .vmesta-market-showcase > header > span small { color:var(--theme-text-muted) !important; font-size:.42rem; letter-spacing:.05em; }
html:root body .vmesta-market-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.6rem; }
html:root body .vmesta-market-grid > button { position:relative; display:grid; grid-template-columns:2.9rem minmax(0,1fr); align-items:center; gap:.6rem; min-height:4.75rem; overflow:hidden; border:0 !important; border-radius:.9rem; padding:.62rem 2.85rem .62rem .65rem; background:var(--theme-surface-panel) !important; color:var(--theme-text-primary) !important; text-align:left; cursor:pointer; transition:transform .16s ease,background-color .16s ease; }
html:root body .vmesta-market-grid > button:hover { background:var(--theme-surface-active) !important; transform:translateY(-2px); }
html:root body .vmesta-market-grid > button > span { display:grid; width:2.9rem; height:2.9rem; place-items:center; border-radius:.8rem; background:var(--theme-surface-control) !important; font-size:1.65rem; }
html:root body .vmesta-market-grid > button > div { display:grid; min-width:0; gap:.12rem; }
html:root body .vmesta-market-grid strong { overflow:hidden; font-size:.61rem; font-weight:900; text-overflow:ellipsis; white-space:nowrap; }
html:root body .vmesta-market-grid small { overflow:hidden; color:var(--theme-text-muted) !important; font-size:.43rem; text-overflow:ellipsis; text-transform:uppercase; white-space:nowrap; }
html:root body .vmesta-market-grid > button > b { position:absolute; right:.48rem; top:.48rem; border-radius:.45rem; padding:.25rem .35rem; background:var(--theme-surface-control) !important; color:var(--theme-accent) !important; font-size:.5rem; font-weight:950; }
html:root body .vmesta-market-grid > button > b i { font-style:normal; }
html:root body .vmesta-market-guide > header { grid-template-columns:2.8rem minmax(0,1fr) auto; }
html:root body .vmesta-market-content-icon { display:grid; width:2.8rem; height:2.8rem; place-items:center; border-radius:.8rem; background:var(--theme-surface-control) !important; color:var(--theme-accent) !important; }
html:root body .vmesta-market-content-icon svg { width:1.3rem; height:1.3rem; fill:none; stroke:currentColor; stroke-width:1.8; }
html:root body .vmesta-market-guide > header > strong { display:grid; justify-items:end; color:var(--theme-accent) !important; font-size:1rem; }
html:root body .vmesta-market-guide > header > strong small { color:var(--theme-text-muted) !important; font-size:.42rem; text-transform:uppercase; }
html:root body .vmesta-market-rule-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.6rem; }
html:root body .vmesta-market-rule-grid article { display:grid; grid-template-columns:2.35rem minmax(0,1fr) auto; align-items:center; gap:.65rem; border-radius:.9rem; padding:.72rem; background:var(--theme-surface-panel) !important; }
html:root body .vmesta-market-rule-grid article > span { display:grid; grid-row:auto; width:2.35rem; min-width:0; height:2.35rem; place-items:center; border-radius:.68rem; background:var(--theme-surface-control) !important; color:var(--theme-accent) !important; }
html:root body .vmesta-market-rule-grid svg { width:1rem; height:1rem; fill:none; stroke:currentColor; stroke-width:1.8; }
html:root body .vmesta-market-rule-grid article > div { display:grid; min-width:0; gap:.1rem; }
html:root body .vmesta-market-rule-grid strong { font-size:.62rem; }
html:root body .vmesta-market-rule-grid p { margin:0; color:var(--theme-text-secondary) !important; font-size:.52rem; line-height:1.4; }
html:root body .vmesta-market-rule-grid small { color:var(--theme-text-muted) !important; font-size:.45rem; }
html:root body .vmesta-market-rule-grid article > b { color:var(--theme-accent) !important; font-size:.7rem; }
html:root body .vmesta-market-preview { display:grid; min-height:23rem; grid-template-columns:minmax(12rem,.72fr) minmax(16rem,1fr); align-items:center; gap:1.6rem; border-radius:1.1rem; padding:1.4rem; background:var(--theme-surface-panel) !important; }
html:root body .vmesta-market-preview-art { position:relative; display:grid; min-height:15rem; place-items:center; overflow:hidden; border-radius:1rem; background:linear-gradient(135deg,var(--theme-surface-control),color-mix(in srgb,var(--theme-accent) 18%,var(--theme-surface-nested))) !important; color:var(--theme-accent) !important; }
html:root body .vmesta-market-preview-art > svg { width:5rem; height:5rem; fill:none; stroke:currentColor; stroke-width:1.25; }
html:root body .vmesta-market-preview-art i { position:absolute; width:3rem; height:3rem; border-radius:50%; background:color-mix(in srgb,var(--theme-accent) 18%,transparent); }
html:root body .vmesta-market-preview-art i:nth-of-type(1) { left:12%; top:16%; }
html:root body .vmesta-market-preview-art i:nth-of-type(2) { right:10%; bottom:14%; width:4rem; height:4rem; }
html:root body .vmesta-market-preview-art i:nth-of-type(3) { right:18%; top:12%; width:1.2rem; height:1.2rem; }
html:root body .vmesta-market-preview > div:last-child { display:grid; justify-items:start; }
html:root body .vmesta-market-preview > div:last-child > button { display:flex; align-items:center; gap:.45rem; margin-top:.9rem; border:0 !important; border-radius:.72rem; padding:.62rem .75rem; background:var(--theme-accent) !important; color:var(--theme-accent-contrast,#fff) !important; font-size:.57rem; font-weight:900; cursor:pointer; }
html:root body .vmesta-market-preview > div:last-child > button svg { width:1rem; height:1rem; fill:none; stroke:currentColor; stroke-width:1.8; }
html:root body .vmesta-market-loading { min-height:22rem; }

/* Единое активное состояние медиавкладок профиля. */
html:root body .profile-media-tabs { border:0 !important; background:var(--theme-surface-control) !important; }
html:root body .profile-media-tab { border:0 !important; background:transparent !important; color:var(--theme-text-muted) !important; box-shadow:none !important; }
html:root body .profile-media-tab:hover { color:var(--theme-text-primary) !important; }
html:root body .profile-media-tab.is-active { background:var(--theme-surface-active) !important; color:var(--theme-accent) !important; box-shadow:none !important; }
html:root body .profile-video-tabs { border:0 !important; background:var(--theme-surface-control) !important; }
html:root body .profile-video-tabs button.is-active { background:var(--theme-surface-active) !important; color:var(--theme-accent) !important; box-shadow:none !important; }

/* Компактные действия редактора: сохранить и вернуться либо закрыть без сохранения. */
html:root body .cover-editor-icon-actions { margin-left:0; }
html:root body .cover-editor-icon-actions .cover-editor-header-action { display:grid; width:2.35rem; height:2.35rem; min-height:2.35rem; place-items:center; border:0 !important; border-radius:.72rem; padding:0; background:var(--theme-surface-control) !important; color:var(--theme-accent) !important; box-shadow:none !important; }
html:root body .cover-editor-icon-actions .cover-editor-header-action:hover { background:var(--theme-surface-active) !important; transform:translateY(-1px); }
html:root body .cover-editor-icon-actions .cover-editor-header-action svg { width:1rem; height:1rem; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
html:root body .cover-editor-icon-actions .cover-editor-check-icon { display:none; }
html:root body .cover-editor-icon-actions .cover-editor-header-action.is-dirty { background:var(--theme-accent) !important; color:var(--theme-accent-contrast,#fff) !important; }
html:root body .cover-editor-icon-actions .cover-editor-header-action.is-dirty .cover-editor-back-icon { display:none; }
html:root body .cover-editor-icon-actions .cover-editor-header-action.is-dirty .cover-editor-check-icon { display:block; }
html:root body .cover-editor-icon-actions .cover-editor-header-action.is-saving { cursor:wait; opacity:.62; }

/* V2.0.47 — каталог наград пространств непосредственно в магазине. */
html:root body .vmesta-market-tabs [data-market-tab][hidden], html:root body .vmesta-market-catalog-action[hidden] { display:none !important; }
html:root body .vmesta-space-market { display:grid; gap:.8rem; }
html:root body .vmesta-space-market > header { display:grid; grid-template-columns:minmax(0,1fr) minmax(11rem,.55fr) auto; align-items:end; gap:.8rem; border-radius:1rem; padding:.85rem; background:var(--theme-surface-panel) !important; }
html:root body .vmesta-space-market > header > div { display:grid; gap:.12rem; }
html:root body .vmesta-space-market > header small { color:var(--theme-accent) !important; font-size:.48rem; font-weight:950; letter-spacing:.12em; }
html:root body .vmesta-space-market > header h3 { margin:0; color:var(--theme-text-primary) !important; font-size:1rem; font-weight:950; }
html:root body .vmesta-space-market > header p { margin:.12rem 0 0; color:var(--theme-text-muted) !important; font-size:.57rem; line-height:1.45; }
html:root body .vmesta-space-market > header > label { display:grid; gap:.25rem; color:var(--theme-text-muted) !important; font-size:.5rem; font-weight:900; }
html:root body .vmesta-space-market > header select { width:100%; min-height:2.4rem; border:1px solid var(--theme-border-subtle) !important; border-radius:.7rem; padding:0 .65rem; outline:0; background:var(--theme-surface-control) !important; color:var(--theme-text-primary) !important; font-size:.58rem; font-weight:850; }
html:root body .vmesta-space-market > header > strong { display:grid; min-width:6.4rem; gap:.05rem; border-radius:.8rem; padding:.58rem .7rem; background:var(--theme-surface-control) !important; color:var(--theme-accent) !important; font-size:.9rem; text-align:right; }
html:root body .vmesta-space-market > header > strong small { color:var(--theme-text-muted) !important; font-size:.42rem; letter-spacing:0; }
html:root body .vmesta-space-market > header > aside { display:grid; grid-column:2/-1; gap:.12rem; border-radius:.8rem; padding:.58rem .7rem; background:var(--theme-surface-control) !important; }
html:root body .vmesta-space-market > header > aside strong { color:var(--theme-text-primary) !important; font-size:.58rem; }
html:root body .vmesta-space-market > header > aside small { color:var(--theme-text-muted) !important; font-size:.46rem; font-weight:750; letter-spacing:0; line-height:1.4; }
html:root body .vmesta-space-market-compose { display:grid; grid-template-columns:minmax(11rem,1fr) minmax(11rem,1fr) minmax(8rem,.7fr) auto; align-items:end; gap:.55rem; border-radius:1rem; padding:.7rem; background:var(--theme-surface-panel) !important; }
html:root body .vmesta-space-market-compose label { display:grid; gap:.22rem; color:var(--theme-text-secondary) !important; font-size:.5rem; font-weight:900; }
html:root body .vmesta-space-market-compose input { width:100%; min-height:2.45rem; border:1px solid var(--theme-border-subtle) !important; border-radius:.7rem; padding:0 .65rem; outline:0; background:var(--theme-surface-control) !important; color:var(--theme-text-primary) !important; font-size:.58rem; font-weight:750; }
html:root body .vmesta-space-recipient { position:relative; }
html:root body .vmesta-space-user-results { position:absolute; z-index:20; inset:calc(100% + .25rem) 0 auto; display:grid; gap:.25rem; max-height:12rem; overflow:auto; border:1px solid var(--theme-border-subtle); border-radius:.78rem; padding:.3rem; background:var(--theme-surface-panel) !important; box-shadow:0 1rem 2rem rgb(0 0 0/.2); }
html:root body .vmesta-space-user-results[hidden] { display:none !important; }
html:root body .vmesta-space-user-results > span { padding:.65rem; color:var(--theme-text-muted) !important; font-size:.55rem; text-align:center; }
html:root body .vmesta-space-user-results > button { display:grid; grid-template-columns:2rem minmax(0,1fr) auto; align-items:center; gap:.45rem; border:0 !important; border-radius:.62rem; padding:.35rem; background:transparent !important; color:var(--theme-text-primary) !important; text-align:left; }
html:root body .vmesta-space-user-results > button:hover { background:var(--theme-surface-active) !important; }
html:root body .vmesta-space-user-results img, html:root body .vmesta-space-user-results i { display:grid; width:2rem; height:2rem; place-items:center; border-radius:.6rem; object-fit:cover; background:var(--theme-surface-control); font-style:normal; }
html:root body .vmesta-space-user-results > button > span { display:grid; min-width:0; }
html:root body .vmesta-space-user-results strong { overflow:hidden; font-size:.58rem; text-overflow:ellipsis; white-space:nowrap; }
html:root body .vmesta-space-user-results small { color:var(--theme-text-muted) !important; font-size:.48rem; }
html:root body .vmesta-space-user-results b { color:var(--theme-accent) !important; font-size:.48rem; }
html:root body .vmesta-space-selected-user { display:grid; grid-template-columns:1.8rem minmax(0,1fr) auto; align-items:center; gap:.4rem; margin-top:.3rem; border-radius:.65rem; padding:.3rem .4rem; background:var(--theme-surface-active) !important; }
html:root body .vmesta-space-selected-user img, html:root body .vmesta-space-selected-user i { display:grid; width:1.8rem; height:1.8rem; place-items:center; border-radius:.55rem; object-fit:cover; background:var(--theme-surface-panel); font-style:normal; }
html:root body .vmesta-space-selected-user > span { display:grid; min-width:0; }
html:root body .vmesta-space-selected-user strong { overflow:hidden; color:var(--theme-text-primary) !important; font-size:.55rem; text-overflow:ellipsis; white-space:nowrap; }
html:root body .vmesta-space-selected-user small { color:var(--theme-text-muted) !important; font-size:.46rem; }
html:root body .vmesta-space-selected-user > b { color:var(--theme-accent) !important; }
html:root body .vmesta-space-choice { display:grid; min-height:2.45rem; align-content:center; gap:.05rem; border-radius:.7rem; padding:.35rem .55rem; background:var(--theme-surface-control) !important; }
html:root body .vmesta-space-choice > span, html:root body .vmesta-space-choice > small { color:var(--theme-text-muted) !important; font-size:.43rem; }
html:root body .vmesta-space-choice > strong { color:var(--theme-text-primary) !important; font-size:.55rem; }
html:root body .vmesta-space-market-compose > button { min-height:2.45rem; border:0 !important; border-radius:.7rem; padding:.55rem .8rem; background:var(--theme-accent) !important; color:var(--theme-accent-contrast,#fff) !important; font-size:.55rem; font-weight:950; white-space:nowrap; }
html:root body .vmesta-space-market-compose > button:disabled { cursor:not-allowed; opacity:.45; }
html:root body .vmesta-space-market-status { grid-column:1/-1; min-height:.7rem; margin:0; color:var(--theme-text-muted) !important; font-size:.52rem; font-weight:850; }
html:root body .vmesta-space-market-status.is-success { color:var(--theme-accent) !important; }
html:root body .vmesta-space-market-status.is-error { color:var(--theme-danger,#ef4444) !important; }
html:root body .vmesta-space-reward-catalog { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.55rem; }
html:root body .vmesta-space-reward-catalog > button { position:relative; display:grid; grid-template-columns:2.75rem minmax(0,1fr); align-items:center; gap:.55rem; min-height:4.8rem; border:0 !important; border-radius:.9rem; padding:.58rem 3.1rem .58rem .6rem; background:var(--theme-surface-panel) !important; color:var(--theme-text-primary) !important; text-align:left; box-shadow:none !important; outline:0 !important; }
html:root body .vmesta-space-reward-catalog > button:hover, html:root body .vmesta-space-reward-catalog > button.is-active { border:0 !important; background:var(--theme-surface-active) !important; box-shadow:none !important; outline:0 !important; transform:translateY(-1px); }
html:root body .vmesta-space-reward-catalog > button:disabled { cursor:default; opacity:1; }
html:root body .vmesta-space-reward-catalog > button:disabled:hover { border:0 !important; background:var(--theme-surface-panel) !important; transform:none; }
html:root body .vmesta-space-reward-catalog > button > span { display:grid; width:2.75rem; height:2.75rem; place-items:center; border-radius:.78rem; background:var(--theme-surface-control); font-size:1.45rem; }
html:root body .vmesta-space-reward-catalog > button > div { display:grid; min-width:0; gap:.1rem; }
html:root body .vmesta-space-reward-catalog strong { overflow:hidden; font-size:.58rem; text-overflow:ellipsis; white-space:nowrap; }
html:root body .vmesta-space-reward-catalog small { display:-webkit-box; overflow:hidden; color:var(--theme-text-muted) !important; font-size:.45rem; line-height:1.3; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
html:root body .vmesta-space-reward-catalog b { position:absolute; right:.45rem; top:.45rem; border-radius:.42rem; padding:.22rem .3rem; background:var(--theme-surface-control); color:var(--theme-accent); font-size:.47rem; }
html:root body .vmesta-space-market-empty { display:grid; min-height:21rem; place-items:center; align-content:center; gap:.45rem; text-align:center; }
html:root body .vmesta-space-market-empty > span { display:grid; width:4rem; height:4rem; place-items:center; border-radius:1.1rem; background:var(--theme-surface-control); color:var(--theme-accent); }
html:root body .vmesta-space-market-empty svg { width:2rem; fill:none; stroke:currentColor; }
html:root body .vmesta-space-market-empty h3 { margin:.2rem 0 0; }
html:root body .vmesta-space-market-empty p { margin:0; color:var(--theme-text-muted) !important; font-size:.58rem; }

@media (max-width:760px) {
    html:root body .vmesta-market-dialog > header { grid-template-columns:2.4rem minmax(0,1fr) auto 2.2rem; gap:.5rem; padding:.6rem; }
    html:root body .vmesta-market-dialog > header > .vmesta-market-brand { width:2.4rem; height:2.4rem; }
    html:root body .vmesta-market-balance { padding:.4rem .5rem; }
    html:root body .vmesta-market-tabs { grid-template-columns:minmax(0,1fr); gap:.45rem; }
    html:root body .vmesta-market-catalog-action { width:100%; justify-content:center; }
    html:root body .vmesta-market-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    html:root body .vmesta-market-rule-grid { grid-template-columns:1fr; }
    html:root body .vmesta-market-preview { grid-template-columns:1fr; }
    html:root body .vmesta-market-preview-art { min-height:9rem; }
    html:root body .vmesta-space-market > header { grid-template-columns:1fr 1fr; }
    html:root body .vmesta-space-market > header > div { grid-column:1/-1; }
    html:root body .vmesta-space-market > header > aside { grid-column:1/-1; }
    html:root body .vmesta-space-market-compose { grid-template-columns:1fr 1fr; }
    html:root body .vmesta-space-reward-catalog { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width:460px) {
    html:root body .vmesta-market-dialog > header { grid-template-columns:2.35rem minmax(0,1fr) 2.15rem; }
    html:root body .vmesta-market-balance { grid-column:1/-1; grid-row:2; justify-content:center; }
    html:root body .vmesta-market-close { grid-column:3; grid-row:1; }
    html:root body .vmesta-market-content { padding:.65rem; }
    html:root body .vmesta-market-grid { grid-template-columns:1fr; }
    html:root body .vmesta-market-showcase > header { grid-template-columns:1fr; }
    html:root body .vmesta-market-showcase > header > span { display:none; }
    html:root body .level-subject { grid-template-columns:2.8rem minmax(0,1fr) auto; gap:.55rem; }
    html:root body .level-subject-avatar { width:2.8rem; height:2.8rem; }
    html:root body .vmesta-space-market > header, html:root body .vmesta-space-market-compose, html:root body .vmesta-space-reward-catalog { grid-template-columns:1fr; }
    html:root body .vmesta-space-market > header > div { grid-column:auto; }
    html:root body .vmesta-space-market > header > strong { text-align:left; }
}

/* ------------[Единые иллюстрированные пустые состояния]------------ // Оформляет связанный блок интерфейса. Модуль: «оформление интерфейса». Часть 1/1 */
html:root body .vmesta-empty-state {
    display: grid !important;
    width: 100%;
    min-height: 15rem;
    place-items: center !important;
    align-content: center !important;
    gap: .7rem !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 1rem !important;
    padding: 1.5rem !important;
    background: transparent !important;
    color: var(--theme-text-muted) !important;
    text-align: center !important;
    box-shadow: none !important;
}
html:root body .vmesta-empty-state.hidden { display: none !important; }
html:root body .vmesta-empty-state.is-compact { min-height: 9rem; padding: 1rem !important; }
html:root body .vmesta-empty-visual {
    position: relative;
    display: grid;
    width: min(11.25rem, 58vw);
    height: 7rem;
    place-items: center;
    border-radius: 2rem;
    background: radial-gradient(circle at 50% 52%, color-mix(in srgb, var(--theme-accent) 15%, transparent), transparent 68%);
    color: color-mix(in oklab, var(--theme-accent) 72%, var(--theme-text-muted) 28%);
}
html:root body .is-compact > .vmesta-empty-visual { width: 8.2rem; height: 5.1rem; }
html:root body .vmesta-empty-visual svg { display: block; width: 100%; height: 100%; overflow: visible; fill: color-mix(in srgb, var(--theme-surface-control) 86%, transparent); stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
html:root body .vmesta-empty-visual :is(.empty-orbit, .empty-signal) { fill: none; opacity: .48; stroke-dasharray: 6 8; animation: vmesta-empty-dash 8s linear infinite; }

/* V2.0.77: заявки в друзья используют семантические стили вместо динамических utility-классов. */
html:root body .friends-requests-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;border-bottom:1px solid var(--theme-border-soft);border-radius:1rem 1rem 0 0;padding:1rem 1.15rem;background:var(--theme-surface-panel)}
html:root body .friend-requests-direction-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:min(24rem,100%);align-items:stretch;gap:.35rem;border:1px solid var(--theme-border-soft);border-radius:1rem;padding:.32rem;background:var(--theme-surface-control)}
html:root body .friend-requests-direction-tabs button{display:grid;grid-template-columns:1.9rem minmax(0,1fr) auto;min-width:0;min-height:3rem;align-items:center;gap:.48rem;border:1px solid transparent;border-radius:.78rem;padding:.42rem .55rem;background:transparent;color:var(--theme-text-muted);text-align:left;cursor:pointer;transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease}
html:root body .friend-requests-direction-tabs button:hover{border-color:color-mix(in srgb,var(--theme-accent) 24%,var(--theme-border-soft));background:color-mix(in srgb,var(--theme-accent) 7%,var(--theme-surface-panel));color:var(--theme-text-primary);transform:translateY(-1px)}
html:root body .friend-request-direction-icon{display:grid;width:1.9rem;height:1.9rem;place-items:center;border-radius:.62rem;background:var(--theme-surface-panel);color:var(--theme-text-muted);transition:background .16s ease,color .16s ease,transform .16s ease}
html:root body .friend-request-direction-icon svg{display:block;width:1.05rem;height:1.05rem;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
html:root body .friend-request-direction-copy{display:grid;min-width:0;gap:.05rem}
html:root body .friend-request-direction-copy strong{overflow:hidden;color:inherit;font-size:.61rem;font-weight:950;letter-spacing:.025em;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}
html:root body .friend-request-direction-copy small{overflow:hidden;color:var(--theme-text-muted);font-size:.46rem;font-weight:720;text-overflow:ellipsis;white-space:nowrap}
html:root body .friend-requests-direction-tabs button b{display:grid;min-width:1.28rem;height:1.28rem;place-items:center;border:1px solid var(--theme-border-soft);border-radius:999px;background:var(--theme-surface-panel);color:var(--theme-text-muted);font-size:.5rem;font-weight:950}
html:root body .friend-requests-direction-tabs button.is-active{border-color:color-mix(in srgb,var(--theme-accent) 24%,var(--theme-border-soft));background:color-mix(in srgb,var(--theme-accent) 12%,var(--theme-surface-panel));color:var(--theme-accent);box-shadow:0 .38rem 1rem color-mix(in srgb,var(--theme-accent) 12%,transparent)}
html:root body .friend-requests-direction-tabs button.is-active .friend-request-direction-icon{background:var(--theme-accent);color:var(--theme-accent-contrast,#fff);transform:scale(1.03)}
html:root body .friend-requests-direction-tabs button.is-active b{border-color:var(--theme-accent);background:var(--theme-accent);color:var(--theme-accent-contrast,#fff)}
html:root body .friend-requests-direction-tabs button:focus-visible{outline:2px solid color-mix(in srgb,var(--theme-accent) 58%,transparent);outline-offset:2px}
html:root body .friends-requests-list{display:grid;gap:.65rem;padding:1rem}
html:root body .friend-request-card{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.8rem;min-height:4.6rem;border:1px solid var(--theme-border-soft);border-radius:1.05rem;padding:.7rem .8rem;background:var(--theme-surface-panel);box-shadow:0 .4rem 1.2rem color-mix(in srgb,var(--theme-text-primary) 6%,transparent);transition:opacity .18s,transform .18s,border-color .18s}
html:root body .friend-request-card:hover{border-color:color-mix(in srgb,var(--theme-accent) 35%,var(--theme-border-soft))}
html:root body .friend-request-card .request-card-person{display:grid;grid-template-columns:2.8rem minmax(0,1fr);align-items:center;gap:.72rem;min-width:0;border:0;background:transparent;text-align:left;cursor:pointer}
html:root body .friend-request-avatar{position:relative;display:block;width:2.8rem;height:2.8rem}
html:root body .friend-request-avatar>img{width:100%!important;height:100%!important;border-radius:.85rem!important;object-fit:cover}
html:root body .friend-request-avatar>.user-online-dot{position:absolute;right:-.12rem;bottom:-.12rem;width:.68rem;height:.68rem;border:2px solid var(--theme-surface-panel);border-radius:50%;background:#b8c6cf}
html:root body .friend-request-avatar>.user-online-dot.is-online{background:#22c55e}
html:root body .request-card-copy{display:grid;min-width:0;gap:.16rem}
html:root body .request-card-copy strong{overflow:hidden;color:var(--theme-text-primary);font-size:.7rem;font-weight:950;text-overflow:ellipsis;white-space:nowrap}
html:root body .request-card-copy small{color:var(--theme-text-muted);font-size:.53rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em}
html:root body .request-card-actions,html:root body .notification-friend-actions{display:flex;align-items:center;gap:.42rem;flex:0 0 auto}
html:root body .friend-request-action{display:grid;width:2.35rem;height:2.35rem;place-items:center;border:1px solid transparent;border-radius:.75rem;padding:0;cursor:pointer;transition:transform .14s,background .14s,color .14s,border-color .14s}
html:root body .friend-request-action svg{display:block;width:1rem;height:1rem;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
html:root body .friend-request-action .friend-request-check{display:block;color:var(--theme-accent-contrast,#fff);-webkit-text-fill-color:var(--theme-accent-contrast,#fff);font-size:1.18rem;font-weight:950;line-height:1}
html:root body .friend-request-action.is-accept{background:var(--theme-accent);color:var(--theme-accent-contrast,#fff);box-shadow:0 .35rem .9rem color-mix(in srgb,var(--theme-accent) 25%,transparent)}
html:root body .friend-request-action.is-decline{border-color:var(--theme-border-soft);background:var(--theme-surface-control);color:var(--theme-text-muted)}
html:root body .friend-request-action:hover{transform:translateY(-1px)}
html:root body .friend-request-action.is-decline:hover{border-color:color-mix(in srgb,#ef476f 35%,var(--theme-border-soft));background:color-mix(in srgb,#ef476f 12%,var(--theme-surface-control));color:#df365e}
html:root body .friend-request-action:disabled{pointer-events:none;opacity:.5}
html:root body .friends-requests-list.is-empty{min-height:25rem;padding:.75rem 1rem 1.2rem}
html:root body .friend-requests-empty{display:grid;min-height:22rem;place-content:center;justify-items:center;gap:.35rem;text-align:center}
html:root body .friend-requests-empty>.vmesta-empty-visual{width:min(15.5rem,72vw);height:9rem;margin-bottom:.25rem}
html:root body .friend-requests-empty.is-outgoing .empty-orbit{animation-direction:reverse}
html:root body .friend-requests-empty.is-outgoing .empty-pulse{animation-delay:-1.2s}
html:root body .friend-requests-empty strong{color:var(--theme-text-primary);font-size:.72rem;font-weight:950;text-transform:uppercase}
html:root body .friend-requests-empty span{color:var(--theme-text-muted);font-size:.56rem;font-weight:700}
@media(max-width:700px){html:root body .friends-requests-head{align-items:flex-start;flex-direction:column}html:root body .friend-requests-direction-tabs{width:100%}html:root body .friend-requests-direction-tabs button{grid-template-columns:1.75rem minmax(0,1fr) auto;padding:.38rem}.friend-request-direction-icon{width:1.75rem;height:1.75rem}}

/* V2.0.77: SVG-поздравление — метеоритный дождь и вспышка новой планеты. */
html:root body .level-up-space-scene{position:relative;width:min(25rem,100%);height:10.6rem;margin:-1.2rem 0 .15rem;overflow:hidden;contain:layout paint;isolation:isolate}
html:root body .level-up-space-scene>svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
html:root body .level-up-stars{fill:color-mix(in srgb,var(--theme-accent) 56%,#fff);animation:level-stars-twinkle 1.8s ease-in-out infinite alternate}
html:root body .level-up-meteors path{fill:none;stroke:url(#levelMeteorTrail);stroke-width:3;stroke-linecap:round;stroke-dasharray:95;stroke-dashoffset:95;animation:level-meteor-fall 2.6s cubic-bezier(.2,.7,.25,1) infinite}
html:root body .level-up-meteors circle{fill:#fff5b8;opacity:0;animation:level-meteor-head 2.6s ease-out infinite}
html:root body .level-up-meteors :is(path,circle):nth-child(2),html:root body .level-up-meteors :is(path,circle):nth-child(6){animation-delay:.55s}
html:root body .level-up-meteors :is(path,circle):nth-child(3),html:root body .level-up-meteors :is(path,circle):nth-child(7){animation-delay:1.2s}
html:root body .level-up-meteors :is(path,circle):nth-child(4),html:root body .level-up-meteors :is(path,circle):nth-child(8){animation-delay:1.75s}
html:root body .level-up-planet-burst{transform-origin:180px 96px;animation:level-planet-arrive .8s cubic-bezier(.18,.9,.25,1.2) both}
html:root body .level-up-planet{fill:url(#levelPlanetGlow);stroke:rgba(255,255,255,.72);stroke-width:2}
html:root body .level-up-planet-ring{fill:none;stroke:color-mix(in srgb,var(--theme-accent) 54%,#ffe58a);stroke-width:4;stroke-linecap:round;stroke-dasharray:20 8;animation:level-planet-ring 5s linear infinite;transform-origin:center}
html:root body .level-up-planet-crack{fill:none;stroke:rgba(255,255,255,.82);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;animation:level-crack-flash 2.2s ease-in-out infinite}
html:root body .level-up-burst-rays{fill:none;stroke:#ffd86a;stroke-width:3;stroke-linecap:round;animation:level-burst-pulse 1.45s ease-in-out infinite;transform-origin:center}
html:root body .level-up-space-scene .level-up-orbit{position:absolute;left:50%;top:50%;z-index:2;width:4.8rem;height:4.8rem;margin:0;transform:translate(-50%,-50%);background:transparent!important;box-shadow:none}
html:root body .level-up-space-scene .level-up-orbit::before{width:7.1rem;height:2.45rem;border-color:rgba(255,255,255,.66)}
html:root body .level-up-space-scene .level-up-orbit::after{background:#fff6b2!important;box-shadow:-5.05rem 1.75rem 0 rgba(139,215,255,.9)}
html:root body .level-up-space-scene .level-up-orbit i{width:3.5rem;height:3.5rem;border-radius:1.1rem;background:rgba(38,79,176,.92)!important;box-shadow:inset 0 0 0 1px rgba(255,255,255,.42),0 0 1rem rgba(62,125,255,.4);animation:level-number-float 2.4s ease-in-out infinite}
@keyframes level-meteor-fall{0%,12%{stroke-dashoffset:95;opacity:0}24%{opacity:1}58%{stroke-dashoffset:0;opacity:1}70%,100%{stroke-dashoffset:-95;opacity:0}}
@keyframes level-meteor-head{0%,18%{opacity:0;transform:translate(-20px,-17px)}42%,57%{opacity:1;transform:translate(0,0)}72%,100%{opacity:0;transform:translate(9px,8px)}}
@keyframes level-stars-twinkle{from{opacity:.35}to{opacity:1}}
@keyframes level-planet-arrive{from{opacity:0;transform:translate(180px,96px) scale(.25) rotate(-18deg)}to{opacity:1;transform:translate(180px,96px) scale(1) rotate(0)}}
@keyframes level-planet-ring{to{transform:rotate(360deg)}}
@keyframes level-burst-pulse{0%,100%{opacity:.28;transform:scale(.88)}50%{opacity:1;transform:scale(1.08)}}
@keyframes level-crack-flash{0%,65%,100%{opacity:.25}76%{opacity:1}}
@keyframes level-number-float{0%,100%{transform:translateY(0) rotate(-2deg)}50%{transform:translateY(-.28rem) rotate(2deg)}}
@media(prefers-reduced-motion:reduce){html:root body .level-up-space-scene *{animation-duration:8s!important}}

/* Сначала дешёвая compositor-анимация закрытия, затем levels.js скрывает окно
   и снимает глобальную блокировку прокрутки уже вне исходного pointer-события. */
html:root body .level-up-celebration-modal>.level-modal-backdrop,
html:root body .level-up-celebration-modal>section{transition:opacity .15s ease,transform .15s ease}
html:root body .level-up-celebration-modal.is-closing{pointer-events:none}
html:root body .level-up-celebration-modal.is-closing>.level-modal-backdrop{opacity:0}
html:root body .level-up-celebration-modal.is-closing>section{opacity:0;transform:translate3d(0,.35rem,0) scale(.985)}
html:root body .level-up-celebration-modal.is-closing .level-up-space-scene *{animation-play-state:paused!important}

/* Поиск в переписке не участвует в раскладке и не сдвигает сообщения. */
html:root body .messenger-conversation.has-chat-search:not(.has-selection-toolbar){grid-template-rows:auto minmax(0,1fr) auto!important}
html:root body .messenger-conversation.has-chat-search.has-selection-toolbar{grid-template-rows:auto auto minmax(0,1fr) auto!important}
html:root body .messenger-conversation.has-chat-search .messenger-chat-search{position:absolute!important;inset:4.85rem .72rem auto!important;z-index:58!important;width:auto!important;margin:0!important;border:1px solid color-mix(in srgb,var(--msg-accent) 22%,var(--msg-line))!important;box-shadow:0 .85rem 2rem rgb(15 23 42/.16)!important;backdrop-filter:blur(18px)}
html:root body .messenger-conversation.has-space-link.has-chat-search:not(.has-selection-toolbar){grid-template-rows:auto auto minmax(0,1fr) auto!important}
html:root body .messenger-conversation.has-space-link.has-chat-search.has-selection-toolbar{grid-template-rows:auto auto auto minmax(0,1fr) auto!important}
html:root body .vmesta-empty-visual .empty-star { fill: currentColor; stroke: none; opacity: .72; animation: vmesta-empty-pulse 2.8s ease-in-out infinite; transform-origin: center; }
html:root body .vmesta-empty-visual .empty-float-a { animation: vmesta-empty-float 4.2s ease-in-out infinite; transform-origin: center; }
html:root body .vmesta-empty-visual .empty-float-b { animation: vmesta-empty-float 4.2s ease-in-out -1.4s infinite; transform-origin: center; }
html:root body .vmesta-empty-visual .empty-pulse { animation: vmesta-empty-pulse 3s ease-in-out infinite; transform-origin: center; }
html:root body .vmesta-empty-visual .empty-equalizer path:nth-child(2) { animation-delay: -.45s; }
html:root body .vmesta-empty-visual .empty-equalizer path:nth-child(3) { animation-delay: -.9s; }
html:root body .vmesta-empty-visual .empty-equalizer path:nth-child(4) { animation-delay: -1.35s; }
html:root body .vmesta-empty-visual .empty-equalizer path { animation: vmesta-empty-eq 1.8s ease-in-out infinite; transform-origin: center bottom; }
html:root body .vmesta-empty-copy { display: grid; max-width: 26rem; gap: .28rem; }
html:root body .vmesta-empty-copy strong { color: var(--theme-text-primary) !important; font-size: .72rem !important; font-weight: 950 !important; letter-spacing: .08em !important; line-height: 1.25 !important; text-transform: uppercase !important; }
html:root body .vmesta-empty-copy small { color: var(--theme-text-muted) !important; font-size: .6rem !important; font-weight: 680 !important; line-height: 1.5 !important; text-transform: none !important; }
html:root body .is-compact .vmesta-empty-copy strong { font-size: .64rem !important; }
html:root body .is-compact .vmesta-empty-copy small { font-size: .55rem !important; }
@keyframes vmesta-empty-float { 50% { transform: translateY(-4px); } }
@keyframes vmesta-empty-pulse { 50% { opacity: .58; transform: scale(.94); } }
@keyframes vmesta-empty-dash { to { stroke-dashoffset: -56; } }
@keyframes vmesta-empty-eq { 50% { transform: scaleY(.55); opacity: .55; } }

/* Кнопка дозагрузки всегда сохраняет читаемую подпись при любой палитре. */
html:root body .load-more-posts {
    display: inline-flex !important;
    min-width: 12rem;
    min-height: 3rem;
    align-items: center !important;
    justify-content: center !important;
    gap: .45rem !important;
    border: 0 !important;
    background: var(--theme-accent) !important;
    color: #fff !important;
    box-shadow: none !important;
}
html:root body .load-more-posts:hover { filter: brightness(1.06); transform: translateY(-1px); }
html:root body .load-more-posts > * { color: inherit !important; }
html:root body .load-more-posts:disabled { color: #fff !important; opacity: .72 !important; }
html:root body .end-feed-msg { border: 0 !important; }

@media (prefers-reduced-motion: reduce) {
    html:root body .vmesta-empty-visual * { animation: none !important; }
}

/* ------------[Финальная фиксация прозрачного стикера и компактная отправка набора]------------ */
html:root body .messenger-message .messenger-bubble.is-sticker-only,
html:root body .messenger-message:hover .messenger-bubble.is-sticker-only,
html:root body .messenger-message.is-incoming .messenger-bubble.is-sticker-only,
html:root body .messenger-message.is-outgoing .messenger-bubble.is-sticker-only {
    --message-shape-fill: transparent !important;
    --msg-bubble-in: transparent !important;
    --msg-bubble-out: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}
html:root body .vmesta-sticker-library-card { grid-template-columns: 3.5rem minmax(0, 1fr) auto auto auto; }
html:root body .vmesta-sticker-library-share {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 0;
    border-radius: .62rem;
    padding: 0;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-accent) !important;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease;
}
html:root body .vmesta-sticker-library-share:hover { transform: translateY(-.08rem); background: var(--theme-surface-active) !important; }
html:root body .vmesta-sticker-library-share svg { width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

html:root body .vmesta-sticker-share-modal > section {
    width: min(25rem, 94vw);
    max-height: min(32rem, 86vh);
    border: 0;
    border-radius: 1.15rem;
    padding: .8rem;
    background: var(--theme-surface-panel) !important;
}
html:root body .vmesta-sticker-share-modal > section > header {
    display: grid;
    grid-template-columns: 2.8rem minmax(0, 1fr) 2.2rem;
    align-items: center;
    gap: .65rem;
    margin: 0 0 .65rem;
    padding: .2rem;
}
html:root body .vmesta-sticker-share-brand {
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    place-items: center;
    border-radius: .82rem;
    background: var(--theme-surface-control) !important;
    color: var(--theme-accent);
}
html:root body .vmesta-sticker-share-brand svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.75; }
html:root body .vmesta-sticker-share-modal h3 { margin: .06rem 0; color: var(--theme-text-primary) !important; font-size: .85rem; font-weight: 950; }
html:root body .vmesta-sticker-share-modal header p { margin: 0; color: var(--theme-text-muted) !important; font-size: .46rem; line-height: 1.35; }
html:root body .vmesta-sticker-share-search { min-height: 2.7rem; border: 0; border-radius: .78rem; background: var(--theme-surface-control) !important; }
html:root body .vmesta-sticker-share-search > span { display: grid; width: 1.25rem; place-items: center; }
html:root body .vmesta-sticker-share-search svg { width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
html:root body .vmesta-sticker-share-targets { display: grid; gap: .3rem; padding-top: .25rem; }
html:root body .vmesta-sticker-share-targets > button {
    min-height: 3.35rem;
    border-radius: .78rem;
    padding: .45rem .55rem;
    background: var(--theme-surface-elevated, var(--theme-surface-control)) !important;
}
html:root body .vmesta-sticker-share-targets > button:hover { background: var(--theme-surface-active) !important; }
html:root body .vmesta-sticker-share-targets > button > b {
    display: grid;
    width: 1.8rem;
    height: 1.8rem;
    place-items: center;
    border-radius: .56rem;
    background: var(--theme-accent) !important;
    color: var(--theme-accent-contrast, #fff) !important;
    font-size: .8rem;
}
html:root body .vmesta-sticker-share-targets > button:disabled { opacity: .65; cursor: wait; }

@media (max-width: 620px) {
    html:root body .vmesta-sticker-library-card { grid-template-columns: 3.4rem minmax(0, 1fr) auto auto; }
    html:root body .vmesta-sticker-library-archive { grid-column: auto; }
    html:root body .vmesta-sticker-library-switch b { display: none; }
}

html:root body .post-comments-empty-state .empty-discussion-core { animation: vmesta-discussion-breathe 3.4s ease-in-out infinite; transform-origin: center; }
html:root body .post-comments-empty-state .empty-discussion-core circle:nth-of-type(1) { animation: vmesta-comment-dot 1.5s ease-in-out infinite; }
html:root body .post-comments-empty-state .empty-discussion-core circle:nth-of-type(2) { animation: vmesta-comment-dot 1.5s ease-in-out -.5s infinite; }
html:root body .post-comments-empty-state .empty-discussion-core circle:nth-of-type(3) { animation: vmesta-comment-dot 1.5s ease-in-out -1s infinite; }
html:root body .post-comments-empty-state .empty-discussion-signal { animation: vmesta-discussion-signal 2.4s ease-out infinite; transform-origin: 136px 48px; }
html:root body .post-comments-empty-state .empty-comment-a { animation: vmesta-comment-float-a 4s ease-in-out infinite; transform-origin: center; }
html:root body .post-comments-empty-state .empty-comment-b { animation: vmesta-comment-float-b 4s ease-in-out -1.4s infinite; transform-origin: center; }
@keyframes vmesta-discussion-breathe { 50% { transform: translateY(-4px) scale(1.035); } }
@keyframes vmesta-comment-dot { 50% { opacity:.28; transform:scale(.55); } }
@keyframes vmesta-discussion-signal { 0%,100% { opacity:.18; transform:scale(.72); } 45% { opacity:.9; transform:scale(1.08); } }
@keyframes vmesta-comment-float-a { 50% { transform:translate(-3px,-5px) rotate(-1deg); } }
@keyframes vmesta-comment-float-b { 50% { transform:translate(4px,-4px) rotate(2deg); } }

/* ------------[Прозрачная сетка смайликов]------------ // Убирает цветную подложку у смайликов и отделяет поиск, вкладки и границы панели контрастным оттенком активной темы. Модуль: «панель смайликов и стикеров». Часть 1/1 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .emoji-picker-expanded.emoji-picker-expanded {
    --emoji-picker-accent: var(--theme-accent, var(--color-dynamic, #2563eb));
    --emoji-picker-outline: color-mix(in srgb, var(--emoji-picker-accent) 48%, var(--theme-divider) 52%);
    --emoji-picker-outline-soft: color-mix(in srgb, var(--emoji-picker-accent) 25%, var(--theme-divider) 75%);
    border: 1px solid var(--emoji-picker-outline) !important;
    outline: 0 !important;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: 0 1rem 2.4rem color-mix(in srgb, var(--theme-text-primary) 14%, transparent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-emoji-view,
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-grid {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .emoji-picker-expanded.emoji-picker-expanded :is(.emoji-picker-mode-tabs, .emoji-picker-search-wrap) {
    border: 1px solid var(--emoji-picker-outline-soft) !important;
    background: color-mix(in srgb, var(--theme-surface-control) 72%, transparent) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-tabs {
    border: 0 !important;
    border-bottom: 1px solid var(--emoji-picker-outline) !important;
    background: transparent !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .emoji-picker-expanded.emoji-picker-expanded :is(.emoji-picker-item, .emoji-picker-tab) {
    border: 1px solid transparent !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-item:hover {
    border-color: var(--emoji-picker-outline-soft) !important;
    background: transparent !important;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--emoji-picker-accent) 16%, transparent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-tab:is(:hover, .is-active) {
    border-color: var(--emoji-picker-outline) !important;
    background: transparent !important;
    color: var(--emoji-picker-accent) !important;
    box-shadow: inset 0 -.14rem 0 var(--emoji-picker-accent) !important;
}

/* ------------[Левая навигация как меню центра событий]------------ */
html:root body #profile-left-rail .profile-sidebar-navigation-frame {
    padding: .42rem !important;
    border: 0 !important;
    border-radius: 1rem !important;
    background: var(--theme-surface-panel) !important;
    box-shadow: none !important;
}
html:root body #profile-left-rail .profile-sidebar-navigation {
    display: grid !important;
    gap: .18rem !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: .82rem !important;
    background: transparent !important;
    box-shadow: none !important;
}
html:root body #profile-left-rail .profile-sidebar-navigation > .nav-item {
    min-height: 2.65rem !important;
    gap: .7rem !important;
    padding: .58rem .72rem !important;
    border: 0 !important;
    border-radius: .72rem !important;
    background: transparent !important;
    color: var(--theme-text-secondary) !important;
    box-shadow: none !important;
}
html:root body #profile-left-rail .profile-sidebar-navigation > .nav-item:hover {
    background: var(--theme-surface-nested) !important;
    background-color: var(--theme-surface-nested) !important;
    color: var(--theme-text-primary) !important;
}
html:root body #profile-left-rail .profile-sidebar-navigation > .nav-item:is([aria-current="page"], .bg-blue-50) {
    background: var(--theme-surface-active) !important;
    background-color: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
}
html:root body #profile-left-rail .profile-sidebar-navigation > .nav-item :is(svg, .nav-text) {
    color: inherit !important;
}

/* ------------[Центр событий: целая иерархия и читаемая история]------------ */
html:root body #notifications-dropdown .notification-settings-menu {
    gap: .28rem !important;
    padding: .42rem !important;
    border: 0 !important;
    background: var(--theme-surface-panel) !important;
    box-shadow: 0 1rem 2.4rem color-mix(in srgb, var(--theme-text-primary) 14%, transparent) !important;
}
html:root body #notifications-dropdown .notification-settings-menu > button {
    min-height: 3rem !important;
    border: 0 !important;
    border-radius: .72rem !important;
    background: var(--theme-surface-nested) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}
html:root body #notifications-dropdown .notification-settings-menu > button:hover {
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
}
html:root body #notifications-dropdown .notification-settings-menu > .notification-settings-history {
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
}
html:root body #notifications-dropdown .notification-settings-menu > button.is-danger {
    background: color-mix(in srgb, var(--theme-danger, #ef4444) 11%, var(--theme-surface-panel)) !important;
    color: var(--theme-danger, #ef4444) !important;
}

html:root body .notification-history-dialog {
    --history-bg: var(--theme-surface-panel);
    --history-soft: var(--theme-surface-nested);
    --history-text: var(--theme-text-primary);
    --history-muted: var(--theme-text-muted);
    --history-border: var(--theme-divider);
    border: 0 !important;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
}
html:root body .notification-history-head {
    background: var(--theme-surface-panel) !important;
}
html:root body .notification-history-filters {
    gap: .35rem !important;
    margin: 0 1rem .58rem !important;
    padding: .28rem !important;
    border-radius: .82rem !important;
    background: var(--theme-surface-nested) !important;
}
html:root body .notification-history-filters > button {
    min-height: 2.15rem !important;
    border: 0 !important;
    border-radius: .62rem !important;
    background: transparent !important;
    color: var(--theme-text-muted) !important;
    box-shadow: none !important;
}
html:root body .notification-history-filters > button:hover {
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-primary) !important;
}
html:root body .notification-history-filters > button.is-active {
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
    box-shadow: inset 0 -.13rem 0 var(--theme-accent) !important;
}
html:root body .notification-history-filters > button > span:not(.galaxy-protect-icon) {
    background: var(--theme-surface-control) !important;
    color: inherit !important;
}
html:root body .notification-history-filters > button.is-active > span:not(.galaxy-protect-icon) {
    background: color-mix(in srgb, var(--theme-accent) 16%, var(--theme-surface-panel)) !important;
}
html:root body .notification-history-item {
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
    box-shadow: none !important;
}
html:root body .notification-history-item.is-unread {
    border-left: .2rem solid var(--theme-accent) !important;
    background: color-mix(in srgb, var(--theme-accent) 12%, var(--theme-surface-nested)) !important;
}
html:root body .notification-history-item.is-system.is-unread {
    border-left-color: #8a55ff !important;
    background: color-mix(in srgb, #8a55ff 10%, var(--theme-surface-nested)) !important;
}
html:root body .notification-history-system-icon,
html:root body .notification-system-filter-mark {
    flex: 0 0 auto !important;
    aspect-ratio: 1 !important;
}
html:root body .notification-history-empty > .vmesta-empty-visual {
    width: min(11.25rem, 58vw) !important;
    height: 7rem !important;
    margin-bottom: .2rem !important;
    border-radius: 2rem !important;
    background: radial-gradient(circle at 50% 52%, color-mix(in srgb, var(--theme-accent) 15%, transparent), transparent 68%) !important;
}
html:root body .notification-history-empty > .vmesta-empty-copy {
    width: auto !important;
    height: auto !important;
    max-width: 26rem !important;
    margin: 0 !important;
    background: transparent !important;
}

@media (max-width: 620px) {
    html:root body .notification-history-filters { margin-inline: .75rem !important; }
    html:root body .notification-history-filters > button { flex: 1 0 auto; justify-content: center; }
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-mode-button {
    border: 0 !important;
    background: transparent !important;
    color: var(--theme-text-secondary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-mode-button.is-active {
    background: color-mix(in srgb, var(--emoji-picker-accent) 14%, var(--theme-surface-panel)) !important;
    color: var(--emoji-picker-accent) !important;
    box-shadow: inset 0 0 0 1px var(--emoji-picker-outline-soft) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-header > button {
    border: 1px solid var(--emoji-picker-outline-soft) !important;
    background: transparent !important;
    color: var(--theme-text-secondary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body
    .emoji-picker-expanded.emoji-picker-expanded :is(button, input):focus-visible {
    outline: 2px solid var(--emoji-picker-accent) !important;
    outline-offset: 2px !important;
}

/* ------------[Единое кольцо передачи медиа]------------ // Показывает одинаковый прогресс скачивания и отправки вокруг кнопок видео, видеокружков, голосовых, музыки и вложений публикации. Модуль: «медиа сообщений и публикаций». Часть 1/2 */
html:root body :is(
    .messenger-voice-note:is(.is-uploading, .is-downloading) .messenger-voice-note-toggle,
    .messenger-video-note:is(.is-uploading, .is-downloading) > button,
    .messenger-generic-media:is(.is-uploading, .is-downloading) > .messenger-media-transfer-control,
    .vmesta-track-player:is(.is-uploading, .is-downloading) .vmesta-track-download,
    .post-file-selection-card.is-uploading .post-attachment-transfer-icon
) {
    --unified-transfer-accent: var(--msg-accent, var(--track-accent, var(--theme-accent)));
    position: relative;
    isolation: isolate;
}

html:root body :is(
    .messenger-voice-note:is(.is-uploading, .is-downloading) .messenger-voice-note-toggle,
    .messenger-video-note:is(.is-uploading, .is-downloading) > button,
    .messenger-generic-media:is(.is-uploading, .is-downloading) > .messenger-media-transfer-control
) { --unified-transfer-progress: var(--media-transfer-progress, 0%); }

html:root body .vmesta-track-player:is(.is-uploading, .is-downloading) .vmesta-track-download {
    --unified-transfer-progress: var(--track-download-progress, 0%);
    --unified-transfer-accent: var(--track-accent, var(--theme-accent));
}

html:root body .post-file-selection-card.is-uploading .post-attachment-transfer-icon {
    --unified-transfer-progress: var(--media-transfer-progress, 0%);
    --unified-transfer-accent: var(--theme-accent);
}

html:root body :is(
    .messenger-voice-note:is(.is-uploading, .is-downloading) .messenger-voice-note-toggle,
    .messenger-video-note:is(.is-uploading, .is-downloading) > button,
    .messenger-generic-media:is(.is-uploading, .is-downloading) > .messenger-media-transfer-control,
    .vmesta-track-player:is(.is-uploading, .is-downloading) .vmesta-track-download,
    .post-file-selection-card.is-uploading .post-attachment-transfer-icon
)::after {
    position: absolute !important;
    inset: -.2rem !important;
    display: block !important;
    border-radius: inherit !important;
    background: conic-gradient(
        from -90deg,
        var(--unified-transfer-accent) var(--unified-transfer-progress),
        color-mix(in srgb, var(--unified-transfer-accent) 22%, transparent) 0
    ) !important;
    content: "" !important;
    opacity: 1 !important;
    pointer-events: none !important;
    transform: none !important;
    animation: none !important;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - .12rem), #000 0) !important;
    mask: radial-gradient(farthest-side, transparent calc(100% - .12rem), #000 0) !important;
}

html:root body :is(
    .messenger-voice-note.is-transfer-indeterminate .messenger-voice-note-toggle,
    .messenger-video-note.is-transfer-indeterminate > button,
    .messenger-generic-media.is-transfer-indeterminate > .messenger-media-transfer-control,
    .vmesta-track-player.is-transfer-indeterminate .vmesta-track-download
)::after {
    background: conic-gradient(from -90deg, transparent 0 64%, var(--unified-transfer-accent) 76% 100%) !important;
    animation: vmesta-unified-transfer-spin .82s linear infinite !important;
}

html:root body :is(
    .messenger-voice-note-toggle,
    .messenger-video-note > button,
    .messenger-generic-media > .messenger-media-transfer-control,
    .vmesta-track-download,
    .post-attachment-transfer-icon
) > :is(svg, .messenger-icon) {
    position: relative;
    z-index: 1;
}

html:root body .messenger-video-note:is(.is-uploading, .is-downloading)::before,
html:root body .messenger-video-note:is(.is-uploading, .is-downloading)::after {
    display: none !important;
}

html:root body .vmesta-track-player.is-uploading :is(.vmesta-track-play, .vmesta-track-wave input) {
    opacity: .5 !important;
    pointer-events: none !important;
}

@keyframes vmesta-unified-transfer-spin { to { transform: rotate(1turn); } }

/* ------------[Ожидание видео и отправка публикаций]------------ // Даёт обычным видео состояние буферизации, а загружаемым в публикацию файлам — ту же кнопку с кольцом вместо текстового процента. Модуль: «медиа сообщений и публикаций». Часть 2/2 */
html:root body .messenger-generic-media {
    position: relative;
    overflow: hidden;
    border-radius: .82rem;
}

html:root body .messenger-generic-media > video {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 7rem;
    object-fit: contain;
    background: color-mix(in srgb, var(--msg-panel-strong) 88%, #000 12%);
}

html:root body :is(.messenger-video-note, .messenger-generic-media) .messenger-media-buffer-indicator {
    position: absolute;
    z-index: 7;
    top: 50%;
    left: 50%;
    display: grid;
    width: 2.7rem;
    height: 2.7rem;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--msg-panel-strong) 78%, transparent);
    color: var(--msg-accent);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(.88);
    transition: opacity 160ms ease, transform 180ms ease;
    backdrop-filter: blur(8px);
}

html:root body :is(.messenger-video-note, .messenger-generic-media) .messenger-media-buffer-indicator::after {
    position: absolute;
    inset: -.18rem;
    border-radius: 50%;
    background: conic-gradient(from -90deg, transparent 0 62%, var(--msg-accent) 76% 100%);
    content: "";
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - .12rem), #000 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - .12rem), #000 0);
    animation: vmesta-unified-transfer-spin .82s linear infinite;
}

html:root body :is(.messenger-video-note, .messenger-generic-media).is-media-loading:not(.is-uploading):not(.is-downloading):not(.is-download-required)
    .messenger-media-buffer-indicator {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

html:root body .messenger-media-buffer-indicator .messenger-icon {
    width: .9rem;
    height: .9rem;
}

html:root body .messenger-generic-media > .messenger-media-transfer-control {
    position: absolute;
    z-index: 8;
    top: 50%;
    left: 50%;
    display: grid;
    width: 2.7rem;
    height: 2.7rem;
    place-items: center;
    border: 0 !important;
    border-radius: 50%;
    background: color-mix(in srgb, var(--msg-panel-strong) 82%, transparent) !important;
    color: var(--msg-accent) !important;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(8px);
}

html:root body .post-file-selection-card.is-uploading .post-attachment-transfer-icon {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    border-radius: .58rem;
    background: color-mix(in srgb, var(--theme-accent) 12%, var(--theme-surface-panel));
    color: var(--theme-accent);
}

html:root body .post-file-selection-card.is-uploading .post-attachment-transfer-icon svg {
    width: .86rem;
    height: .86rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
    html:root body :is(.messenger-media-buffer-indicator, .is-transfer-indeterminate > button)::after {
        animation-duration: 1.6s !important;
    }
}

/* ------------[Видеотека в семантических цветах]------------ // Убирает
   оставшиеся локальные смеси adaptive-card-tint: библиотека, карточки и подписи
   используют те же уровни панели, вложения и управления, что остальной профиль.
   Это особенно важно для Monet Dark, где старый тёплый fallback мог остаться
   светлым. Модуль: «видео профиля». Часть 1/1 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .profile-video-library {
    border: 0 !important;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .profile-video-library-head :is(h2, p) {
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .profile-video-library-head p {
    color: var(--theme-text-muted) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .profile-video-card {
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .profile-video-card strong {
    color: var(--theme-text-primary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(.profile-video-add, .profile-video-open-post) {
    border: 0 !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-accent) !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body :is(.profile-video-add, .profile-video-open-post):is(:hover, :focus-visible) {
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
}

/* Фактическое кольцо является дочерним элементом кнопки: так глобальные
   сбросы псевдоэлементов в Monet-теме не могут скрыть прогресс передачи. */
html:root body :is(
    .messenger-voice-note-toggle,
    .messenger-video-note > button,
    .messenger-generic-media > .messenger-media-transfer-control,
    .vmesta-track-download
)::after {
    display: none !important;
    content: none !important;
}

html:root body .messenger-voice-note:is(.is-uploading, .is-downloading) .messenger-voice-note-toggle::before {
    display: none !important;
    content: none !important;
}

html:root body .messenger-media-transfer-ring {
    position: absolute;
    z-index: 2;
    inset: -.2rem;
    display: none;
    border-radius: inherit;
    background: conic-gradient(
        from -90deg,
        var(--unified-transfer-accent) var(--unified-transfer-progress),
        color-mix(in srgb, var(--unified-transfer-accent) 22%, transparent) 0
    );
    pointer-events: none;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - .12rem), #000 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - .12rem), #000 0);
}

html:root body :is(
    .messenger-voice-note:is(.is-uploading, .is-downloading) .messenger-voice-note-toggle,
    .messenger-video-note:is(.is-uploading, .is-downloading) > button,
    .messenger-generic-media:is(.is-uploading, .is-downloading) > .messenger-media-transfer-control,
    .vmesta-track-player:is(.is-uploading, .is-downloading) .vmesta-track-download
) > .messenger-media-transfer-ring {
    display: block;
}

html:root body :is(
    .messenger-voice-note.is-transfer-indeterminate .messenger-voice-note-toggle,
    .messenger-video-note.is-transfer-indeterminate > button,
    .messenger-generic-media.is-transfer-indeterminate > .messenger-media-transfer-control,
    .vmesta-track-player.is-transfer-indeterminate .vmesta-track-download
) > .messenger-media-transfer-ring {
    background: conic-gradient(from -90deg, transparent 0 64%, var(--unified-transfer-accent) 76% 100%);
    animation: vmesta-unified-transfer-spin .82s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    html:root body .is-transfer-indeterminate .messenger-media-transfer-ring {
        animation-duration: 1.6s;
    }
}

/* ------------[Тематическая кнопка загруженного трека]------------ //
   Галочка является настоящей SVG, поэтому не исчезает после сброса
   псевдоэлементов и всегда наследует активный цвет выбранной темы. Модуль: «оформление интерфейса». Часть 1/1 */
html:root body .vmesta-track-player.is-downloaded .vmesta-track-download {
    border-color: color-mix(in srgb, var(--track-accent, var(--theme-accent)) 48%, var(--track-line)) !important;
    background: color-mix(in srgb, var(--track-accent, var(--theme-accent)) 12%, var(--track-strong)) !important;
    color: var(--track-accent, var(--theme-accent)) !important;
}

html:root body .vmesta-track-player.is-downloaded .vmesta-track-download > .vmesta-track-download-glyph {
    display: block !important;
    opacity: 1 !important;
    fill: none !important;
    stroke: currentColor !important;
}

html:root body .vmesta-track-player.is-downloaded .vmesta-track-download::before {
    display: none !important;
    content: none !important;
}

/* ------------[Чистая панель эмодзи без рамок]------------ // Финальный слой
   убирает оставшиеся обводки у самой панели, категорий и отдельных смайликов.
   Состояние кнопки передаётся мягкой заливкой и масштабом, поэтому системные
   эмодзи не выглядят набором квадратных плиток ни в одной теме. Модуль:
   «панель смайликов и стикеров». Часть 1/1 */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .emoji-picker-expanded.emoji-picker-expanded {
    --emoji-picker-accent: var(--theme-accent, var(--color-dynamic, #2563eb));
    border: 0 !important;
    outline: 0 !important;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: 0 1.1rem 2.8rem color-mix(in srgb, var(--theme-text-primary) 16%, transparent) !important;
    filter: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .emoji-picker-expanded.emoji-picker-expanded :is(
    .emoji-picker-emoji-view,
    .emoji-picker-grid,
    .emoji-picker-tabs,
    .emoji-picker-tab,
    .emoji-picker-item,
    .emoji-picker-mode-tabs,
    .emoji-picker-mode-button,
    .emoji-picker-search-wrap,
    .emoji-picker-search,
    .emoji-picker-header > button
) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .emoji-picker-expanded.emoji-picker-expanded :is(.emoji-picker-emoji-view, .emoji-picker-grid, .emoji-picker-tabs) {
    background: transparent !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-mode-tabs {
    background: var(--theme-surface-nested) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-search-wrap {
    background: var(--theme-surface-control) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .emoji-picker-expanded.emoji-picker-expanded :is(.emoji-picker-item, .emoji-picker-tab) {
    background: transparent !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-item:is(:hover, :focus-visible) {
    background: var(--theme-surface-active) !important;
    transform: translateY(-1px) scale(1.08);
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-item:active {
    transform: scale(.94);
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-tab:is(:hover, :focus-visible, .is-active),
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-mode-button:is(:hover, :focus-visible, .is-active) {
    background: var(--theme-surface-active) !important;
    color: var(--emoji-picker-accent) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-header > button {
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-secondary) !important;
}

html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .emoji-picker-expanded.emoji-picker-expanded .emoji-picker-header > button:is(:hover, :focus-visible) {
    background: var(--theme-surface-active) !important;
    color: var(--emoji-picker-accent) !important;
}

/* ------------[Фиксированное окно друзей и подписчиков]------------ // Окно
   сохраняет одну геометрию при любом числе строк, а прокрутка принадлежит
   только списку. Все поверхности берутся из пяти ролей темы, поэтому Monet
   Light и Monet Dark сохраняют ту же иерархию, что стандартные режимы. Модуль:
   «модальное окно друзей и подписчиков». Часть 1/1 */
html:root body #friends-modal > div {
    width: min(32rem, calc(100vw - 2rem)) !important;
    height: min(42rem, calc(100dvh - 2rem)) !important;
    min-height: min(42rem, calc(100dvh - 2rem)) !important;
    max-height: calc(100dvh - 2rem) !important;
    flex: 0 0 auto !important;
    border: 0 !important;
    border-radius: 1.15rem !important;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: 0 1.35rem 3.4rem color-mix(in srgb, var(--theme-text-primary) 18%, transparent) !important;
}

html:root body #friends-modal > div > .p-8 {
    flex: 0 0 auto !important;
    padding: 1.35rem 1.35rem .75rem !important;
    background: var(--theme-surface-panel) !important;
}

html:root body #friends-modal > div > .p-8 > h3 {
    margin: 0 !important;
    color: var(--theme-text-primary) !important;
    font-size: 1.35rem !important;
    line-height: 1.1 !important;
    letter-spacing: -.035em !important;
}

html:root body #friends-modal > div > .friends-modal-footer-fill {
    display: none !important;
}

html:root body #friends-modal > div > button[aria-label="Закрыть модальное окно"] {
    top: .8rem !important;
    right: .8rem !important;
    width: 2.05rem !important;
    height: 2.05rem !important;
    border: 0 !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-secondary) !important;
    box-shadow: none !important;
}

html:root body #friends-modal .friends-modal-tabs {
    width: min(100%, 18rem) !important;
    margin-top: 1rem !important;
    padding: .2rem !important;
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
    box-shadow: none !important;
}

html:root body #friends-modal .friends-modal-tab {
    min-height: 2.25rem !important;
    padding: .45rem .85rem !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--theme-text-muted) !important;
    box-shadow: none !important;
}

html:root body #friends-modal .friends-modal-tab:is(:hover, :focus-visible, .is-active) {
    border: 0 !important;
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
    box-shadow: none !important;
}

html:root body #friends-modal .friends-modal-filter-shell {
    padding: .75rem 0 .25rem !important;
    border: 0 !important;
}

html:root body #friends-modal .friends-modal-search-block {
    height: 2.55rem !important;
    border: 0 !important;
    background: var(--theme-surface-control) !important;
    box-shadow: none !important;
}

html:root body #friends-modal #modal-friends-search {
    height: 2.55rem !important;
    min-height: 2.55rem !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root body #friends-modal #modal-friends-list {
    display: grid !important;
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    align-content: start !important;
    gap: .28rem !important;
    padding: .45rem 1.35rem 1.25rem !important;
    overflow-y: auto !important;
    border: 0 !important;
    background: var(--theme-surface-panel) !important;
    box-shadow: none !important;
}

html:root body #friends-modal #modal-friends-list .modal-friend-card {
    min-height: 4.15rem !important;
    margin: 0 !important;
    padding: .58rem .65rem !important;
    border: 0 !important;
    border-radius: .82rem !important;
    background: transparent !important;
    color: var(--theme-text-primary) !important;
    box-shadow: none !important;
}

html:root body #friends-modal #modal-friends-list .modal-friend-card:is(:hover, :focus-within) {
    border: 0 !important;
    background: var(--theme-surface-nested) !important;
    box-shadow: none !important;
}

html:root body #friends-modal :is(.modal-friend-name, .modal-friend-details) {
    color: var(--theme-text-primary) !important;
}

html:root body #friends-modal .modal-friend-login {
    color: var(--theme-text-muted) !important;
}

html:root body #friends-modal :is(.modal-friend-action, .space-subscriber-kebab, .modal-friends-filter-button) {
    display: grid !important;
    width: 2.15rem !important;
    height: 2.15rem !important;
    min-width: 2.15rem !important;
    padding: 0 !important;
    place-items: center !important;
    border: 0 !important;
    border-radius: .68rem !important;
    background: var(--theme-surface-control) !important;
    color: var(--theme-accent) !important;
    box-shadow: none !important;
}

html:root body #friends-modal :is(.modal-friend-action, .space-subscriber-kebab, .modal-friends-filter-button):is(:hover, :focus-visible, .is-active, .has-filters) {
    background: var(--theme-surface-active) !important;
    color: var(--theme-accent) !important;
    transform: translateY(-1px);
}

html:root body #friends-modal .modal-friends-empty {
    display: grid;
    min-height: 11rem;
    place-items: center;
    gap: .38rem;
    padding: 1.5rem;
    border: 0 !important;
    border-radius: .9rem;
    background: var(--theme-surface-nested) !important;
    color: var(--theme-text-muted) !important;
    text-align: center;
}

html:root body #friends-modal .modal-friends-empty > svg {
    width: 2rem;
    height: 2rem;
    fill: none;
    stroke: var(--theme-accent);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

html:root body #friends-modal .modal-friends-empty strong {
    color: var(--theme-text-primary) !important;
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

html:root body #friends-modal .modal-friends-empty span {
    color: var(--theme-text-muted) !important;
    font-size: .6rem;
    font-weight: 750;
}

@media (max-width: 640px) {
    html:root body #friends-modal > div {
        width: 100% !important;
        height: calc(100dvh - 1rem) !important;
        min-height: calc(100dvh - 1rem) !important;
        max-height: calc(100dvh - 1rem) !important;
    }

    html:root body #friends-modal #modal-friends-list {
        max-height: none !important;
        padding-inline: .8rem !important;
    }
}

/* Финальный порядок каскада для расширенного каталога магазина. */
html:root body .gift-center-tabs button:last-child { margin-left: 0; }
html:root body .vmesta-market-dialog { width: min(68rem, 100%); max-height: min(50rem, calc(100dvh - 2rem)); }
html:root body .vmesta-market-dialog > header { grid-template-columns: 2.65rem minmax(11rem, .72fr) minmax(18rem, 1.15fr) auto 2.35rem; }
html:root body .vmesta-market-tabs { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 980px) {
    html:root body .vmesta-market-dialog > header { grid-template-columns: 2.65rem minmax(9rem, 1fr) auto 2.35rem; }
    html:root body .vmesta-market-gift-search { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 460px) {
    html:root body .vmesta-market-dialog > header { grid-template-columns: 2.35rem minmax(0, 1fr) 2.15rem; }
    html:root body .vmesta-market-gift-search { grid-column: 1 / -1; grid-row: 2; }
    html:root body .vmesta-market-balance { grid-column: 1 / -1; grid-row: 3; }
    html:root body .vmesta-market-close { grid-column: 3; grid-row: 1; }
}

/* ------------[Миниатюрная монета-планета]------------ // Баланс не растягивает шапку без поиска. */
html:root body .vmesta-market-dialog > header.is-without-gift-search {
    grid-template-columns: 2.65rem minmax(11rem, 1fr) auto 2.35rem;
}
html:root body .vmesta-market-balance {
    width: max-content;
    min-width: 4.35rem;
    max-width: 7rem;
    justify-self: end;
    gap: .38rem;
    padding: .38rem .52rem;
    white-space: nowrap;
}
html:root body .vmesta-market-balance > .vmesta-venus-coin {
    width: 1.18rem;
    height: 1.18rem;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}
html:root body .vmesta-market-balance > .vmesta-venus-coin circle:first-child {
    fill: color-mix(in srgb, var(--theme-accent) 16%, var(--theme-surface-panel));
}
html:root body .vmesta-market-balance > .vmesta-venus-coin circle:last-child { fill: currentColor; stroke: none; }
html:root body .vmesta-market-balance b { font-size: .68rem; }
html:root body .vmesta-market-balance small { font-size: .36rem; }

@media (max-width: 460px) {
    html:root body .vmesta-market-dialog > header,
    html:root body .vmesta-market-dialog > header.is-without-gift-search {
        grid-template-columns: 2.35rem minmax(0, 1fr) auto 2.15rem;
    }
    html:root body .vmesta-market-gift-search { grid-column: 1 / -1; grid-row: 2; }
    html:root body .vmesta-market-balance { grid-column: 3; grid-row: 1; min-width: 3.9rem; padding-inline: .42rem; }
    html:root body .vmesta-market-close { grid-column: 4; grid-row: 1; }
}

/* ------------[Единое облако поиска и фильтра]------------ */
html:root body .vmesta-market-gift-search {
    grid-template-columns: minmax(0, 1fr) 2.65rem;
    gap: 0;
    overflow: visible;
    border-radius: .82rem;
    background: var(--theme-surface-control) !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme-accent) 7%, transparent);
}
html:root body .vmesta-market-gift-search > label {
    border-radius: .82rem 0 0 .82rem;
    background: transparent !important;
}
html:root body .vmesta-market-gift-search > button {
    position: relative;
    width: 2.65rem;
    border-radius: 0 .82rem .82rem 0;
    background: transparent !important;
}
html:root body .vmesta-market-gift-search > button::before {
    position: absolute;
    left: 0;
    width: 1px;
    height: 1.25rem;
    background: color-mix(in srgb, var(--theme-accent) 20%, transparent);
    content: '';
}
html:root body .vmesta-market-gift-search:focus-within {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--theme-accent) 34%, transparent);
}

/* ------------[Каталог стикеров]------------ */
html:root body .vmesta-sticker-market { display: grid; gap: .8rem; }
html:root body .gift-sticker-artwork { display: grid; place-items: center; width: 100%; height: 100%; min-width: 3.8rem; min-height: 3.8rem; border-radius: 1rem; background: var(--theme-surface-panel); }
html:root body .gift-sticker-artwork img { display: block; width: 72%; height: 72%; object-fit: contain; }
html:root body .vmesta-sticker-audiences { display: flex; flex-wrap: wrap; gap: .4rem; padding: .35rem; border-radius: .9rem; background: var(--theme-surface-panel) !important; }
html:root body .vmesta-sticker-audiences button { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.2rem; border: 0; border-radius: .7rem; padding: .4rem .7rem; background: transparent !important; color: var(--theme-text-secondary) !important; font-size: .58rem; font-weight: 900; cursor: pointer; }
html:root body .vmesta-sticker-audiences button.is-active { background: var(--theme-accent) !important; color: var(--theme-accent-contrast, #fff) !important; box-shadow: 0 .35rem .8rem rgb(0 0 0 / .12); }
html:root body .vmesta-sticker-audiences b { display: grid; min-width: 1.15rem; height: 1.15rem; place-items: center; border-radius: 99px; background: rgb(127 148 180 / .15); font-size: .49rem; }
html:root body .vmesta-sticker-audience-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .55rem; min-height: 2.5rem; border-radius: .85rem; padding: .35rem .55rem .35rem .8rem; background: var(--theme-surface-panel) !important; }
html:root body .vmesta-sticker-audience-tools > span { color: var(--theme-text-secondary) !important; font-size: .55rem; font-weight: 750; line-height: 1.4; }
html:root body .vmesta-sticker-audience-tools > .vmesta-sticker-import-toggle { flex-shrink: 0; }
html:root body .vmesta-sticker-gift-action { display: inline-flex; align-items: center; gap: .32rem; min-height: 2.2rem; border: 0; border-radius: .62rem; padding: .4rem .65rem; background: var(--theme-accent) !important; color: var(--theme-accent-contrast, #fff) !important; font-size: .52rem; font-weight: 950; cursor: pointer; }
html:root body .vmesta-sticker-gift-action svg { width: .8rem; height: .8rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
html:root body .vmesta-sticker-gift-panel { display: grid; gap: .5rem; border: 1px solid var(--theme-border-subtle); border-radius: 1rem; padding: .7rem; background: var(--theme-surface-panel) !important; }
html:root body .vmesta-sticker-gift-panel > strong { color: var(--theme-text-primary) !important; font-size: .7rem; }
html:root body .vmesta-sticker-gift-panel .vmesta-space-market-compose { grid-template-columns: minmax(10rem, .8fr) minmax(11rem, 1fr) minmax(11rem, 1fr) auto; padding: 0; }
html:root body .vmesta-sticker-gift-panel select { width: 100%; min-height: 2.45rem; border: 1px solid var(--theme-border-subtle); border-radius: .7rem; padding: 0 .65rem; background: var(--theme-surface-control) !important; color: var(--theme-text-primary) !important; font-size: .58rem; }
html:root body .vmesta-sticker-gift-status { margin: 0; color: var(--theme-text-secondary) !important; font-size: .55rem; }
@media (max-width: 800px) { html:root body .vmesta-sticker-gift-panel .vmesta-space-market-compose { grid-template-columns: 1fr; } }
html:root body .vmesta-sticker-market > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    border-radius: 1rem;
    padding: .88rem 1rem;
    background: var(--theme-surface-panel) !important;
}
html:root body .vmesta-sticker-market > header small,
html:root body .vmesta-sticker-pack-view > header small,
html:root body .vmesta-sticker-import small { color: var(--theme-accent) !important; font-size: .46rem; font-weight: 950; letter-spacing: .15em; }
html:root body .vmesta-sticker-market h3 { margin: .16rem 0 0; font-size: 1rem; font-weight: 950; }
html:root body .vmesta-sticker-market > header p { margin: .2rem 0 0; color: var(--theme-text-muted) !important; font-size: .57rem; line-height: 1.45; }
html:root body .vmesta-sticker-import-toggle {
    display: flex;
    align-items: center;
    gap: .4rem;
    border: 0;
    border-radius: .72rem;
    padding: .62rem .78rem;
    background: var(--theme-surface-control) !important;
    color: var(--theme-accent) !important;
    font-size: .55rem;
    font-weight: 950;
    cursor: pointer;
}
html:root body .vmesta-sticker-import-toggle.is-active { background: var(--theme-accent) !important; color: var(--theme-accent-contrast, #fff) !important; }
html:root body .vmesta-sticker-import-toggle svg { width: .95rem; height: .95rem; fill: none; stroke: currentColor; stroke-width: 1.8; transform: rotate(90deg); }
html:root body .vmesta-sticker-import {
    display: grid;
    grid-template-columns: minmax(14rem, .75fr) minmax(18rem, 1.25fr);
    gap: .8rem 1rem;
    border-radius: 1rem;
    padding: .9rem 1rem;
    background: color-mix(in srgb, var(--theme-accent) 8%, var(--theme-surface-panel)) !important;
}
html:root body .vmesta-sticker-import > div { display: grid; align-content: center; gap: .18rem; }
html:root body .vmesta-sticker-import strong { font-size: .68rem; font-weight: 950; }
html:root body .vmesta-sticker-import p { margin: 0; color: var(--theme-text-muted) !important; font-size: .5rem; line-height: 1.45; }
html:root body .vmesta-sticker-import > label { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-self: center; gap: .45rem; }
html:root body .vmesta-sticker-import input { min-width: 0; height: 2.55rem; border: 0; outline: 0; border-radius: .72rem; padding: 0 .8rem; background: var(--theme-surface-panel) !important; color: var(--theme-text-primary) !important; font-size: .58rem; font-weight: 750; }
html:root body .vmesta-sticker-import button { border: 0; border-radius: .72rem; padding: 0 .85rem; background: var(--theme-accent) !important; color: var(--theme-accent-contrast, #fff) !important; font-size: .54rem; font-weight: 950; cursor: pointer; }
html:root body .vmesta-sticker-import button:disabled,
html:root body .vmesta-sticker-import input:disabled { cursor: not-allowed; opacity: .55; }
html:root body .vmesta-sticker-import-status { grid-column: 2; }
html:root body .vmesta-sticker-import-status.is-warning { color: #c2742d !important; }
html:root body .vmesta-sticker-pack-layout { display: grid; grid-template-columns: minmax(12.5rem, .34fr) minmax(0, 1fr); gap: .8rem; align-items: start; }
html:root body .vmesta-sticker-pack-layout > aside { display: grid; max-height: 30rem; gap: .48rem; overflow-y: auto; padding-right: .16rem; scrollbar-width: thin; }
html:root body .vmesta-sticker-pack-card {
    display: grid;
    grid-template-columns: 3.35rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .58rem;
    border: 0;
    border-radius: .9rem;
    padding: .58rem .62rem;
    background: var(--theme-surface-panel) !important;
    color: var(--theme-text-primary) !important;
    text-align: left;
    cursor: pointer;
}
html:root body .vmesta-sticker-pack-card:hover,
html:root body .vmesta-sticker-pack-card.is-active { background: var(--theme-surface-active) !important; }
html:root body .vmesta-sticker-pack-card.is-active { box-shadow: inset .2rem 0 0 var(--theme-accent); }
html:root body .vmesta-sticker-pack-card > span:not(.vmesta-sticker-pack-cover) { display: grid; min-width: 0; gap: .08rem; }
html:root body .vmesta-sticker-pack-card strong { overflow: hidden; font-size: .61rem; font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }
html:root body .vmesta-sticker-pack-card small { overflow: hidden; color: var(--theme-text-muted) !important; font-size: .45rem; text-overflow: ellipsis; white-space: nowrap; }
html:root body .vmesta-sticker-pack-card > b { display: grid; min-width: 1.45rem; height: 1.45rem; place-items: center; border-radius: 999px; background: var(--theme-surface-control); color: var(--theme-accent); font-size: .48rem; }
html:root body .vmesta-sticker-pack-cover { display: block; width: 3.35rem; height: 3.35rem; object-fit: contain; border-radius: .75rem; background: var(--theme-surface-control); }
html:root body .vmesta-sticker-pack-cover.is-sprite { background-repeat: no-repeat; background-size: 500% 400%; }
html:root body .vmesta-sticker-pack-cover.is-fallback { display: grid; place-items: center; color: var(--theme-accent); font-size: 1.2rem; }
html:root body .vmesta-sticker-pack-view { min-height: 20rem; border-radius: 1rem; padding: .85rem; background: var(--theme-surface-panel) !important; }
html:root body .vmesta-sticker-pack-view > header { display: grid; grid-template-columns: 4rem minmax(0, 1fr); align-items: center; gap: .7rem; margin-bottom: .7rem; }
html:root body .vmesta-sticker-pack-view > header .vmesta-sticker-pack-cover { width: 4rem; height: 4rem; }
html:root body .vmesta-sticker-pack-view h4 { margin: .12rem 0 0; font-size: .85rem; font-weight: 950; }
html:root body .vmesta-sticker-pack-view header p { margin: .14rem 0 0; color: var(--theme-text-muted) !important; font-size: .5rem; }
html:root body .vmesta-sticker-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .46rem; }
html:root body .vmesta-sticker-grid article { display: grid; min-width: 0; justify-items: center; gap: .24rem; border-radius: .8rem; padding: .35rem .25rem .42rem; background: var(--theme-surface-nested) !important; overflow: hidden; }
html:root body .vmesta-sticker-grid article:hover { background: var(--theme-surface-active) !important; }
html:root body .vmesta-sticker-grid article > span:last-child { max-width: 100%; overflow: hidden; color: var(--theme-text-secondary) !important; font-size: .43rem; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
html:root body .vmesta-sticker-media { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; transform-origin: 50% 76%; }
html:root body .vmesta-sticker-media.is-sprite { background-repeat: no-repeat; background-size: 500% 400%; }
html:root body .vmesta-sticker-media.is-fallback { display: grid; place-items: center; color: var(--theme-accent); font-size: 1.7rem; }
@keyframes vmesta-sticker-wave { to { transform: rotate(5deg) scale(1.04); } }
@keyframes vmesta-sticker-hop { to { transform: translateY(-.28rem) scale(1.03); } }
@keyframes vmesta-sticker-laugh { to { transform: translateX(.08rem) rotate(1deg); } }
@keyframes vmesta-sticker-heart { to { transform: scale(1.075); } }
@keyframes vmesta-sticker-float { to { transform: translateY(-.18rem) rotate(-2deg); } }
html:root body .vmesta-sticker-empty { display: grid; grid-column: 1 / -1; min-height: 9rem; place-items: center; align-content: center; gap: .3rem; border-radius: .9rem; background: var(--theme-surface-panel); color: var(--theme-text-muted); text-align: center; }
html:root body .vmesta-sticker-empty svg { width: 2rem; height: 2rem; fill: none; stroke: var(--theme-accent); stroke-width: 1.6; }
html:root body .vmesta-sticker-empty strong { color: var(--theme-text-primary); font-size: .68rem; }
html:root body .vmesta-sticker-empty span { font-size: .5rem; }
/* Общая анимированная сцена не наследует размеры старой маленькой иконки. */
html:root body .vmesta-sticker-empty .vmesta-empty-visual svg { width: 100%; height: 100%; fill: color-mix(in srgb, var(--theme-surface-control) 86%, transparent); stroke: currentColor; stroke-width: 3; }
html:root body .vmesta-sticker-pack-view > .vmesta-sticker-empty > .vmesta-sticker-empty-scene { min-height: 18rem; }

@media (max-width: 820px) {
    html:root body .vmesta-sticker-pack-layout { grid-template-columns: 1fr; }
    html:root body .vmesta-sticker-pack-layout > aside { display: flex; max-height: none; overflow-x: auto; }
    html:root body .vmesta-sticker-pack-card { min-width: 14rem; }
    html:root body .vmesta-sticker-import { grid-template-columns: 1fr; }
    html:root body .vmesta-sticker-import-status { grid-column: 1; }
}
@media (max-width: 560px) {
    html:root body .vmesta-sticker-market > header { grid-template-columns: 1fr; }
    html:root body .vmesta-sticker-import > label { grid-template-columns: 1fr; }
    html:root body .vmesta-sticker-import button { min-height: 2.4rem; }
    html:root body .vmesta-sticker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    html:root body .vmesta-sticker-grid article:hover .vmesta-sticker-media { animation: none !important; }
}

/* ------------[Стикеры в панели чата и сообщениях]------------ // Объединяет магазинный каталог с редактором сообщений и сохраняет прозрачный формат отдельного стикера. Модуль: «стикеры». Часть 1/1 */
html:root body .emoji-picker-sticker-view {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: 100%;
    min-height: 17.35rem;
    max-height: 17.35rem;
    align-items: stretch;
    justify-content: stretch;
    border: 0;
    border-radius: .82rem;
    background: var(--theme-surface-panel) !important;
    overflow: hidden;
    text-align: left;
}
html:root body .emoji-picker-sticker-view > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .48rem .62rem .34rem;
}
html:root body .emoji-picker-sticker-view > header strong { color: var(--theme-text-primary) !important; font-size: .68rem; font-weight: 950; }
html:root body .emoji-picker-sticker-view > header small { color: var(--theme-text-muted) !important; font-size: .47rem; font-weight: 800; }
html:root body .emoji-sticker-packs {
    display: flex;
    gap: .3rem;
    min-height: 3.1rem;
    padding: .42rem .48rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--theme-border-subtle);
    scrollbar-width: thin;
}
html:root body .emoji-sticker-packs button {
    display: grid;
    flex: 0 0 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border: 0;
    border-radius: .68rem;
    background: var(--theme-surface-control) !important;
    color: var(--theme-accent) !important;
    cursor: pointer;
}
html:root body .emoji-sticker-packs button:hover,
html:root body .emoji-sticker-packs button.is-active { background: var(--theme-surface-active) !important; box-shadow: inset 0 -.14rem 0 var(--theme-accent); }
html:root body .emoji-sticker-packs img,
html:root body .emoji-sticker-packs .is-sprite { display: block; width: 1.8rem; height: 1.8rem; object-fit: contain; }
html:root body .emoji-sticker-packs .is-sprite { background-repeat: no-repeat; background-size: 500% 400%; }
html:root body .emoji-sticker-packs .is-store { font-size: 1rem; font-weight: 900; }

/* ------------[Монеты, компактные режимы и недавние стикеры]------------ */
html:root body .vmesta-coin-icon{display:inline-block;flex:0 0 auto;width:1.05em;height:1.05em;overflow:visible;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:-.18em}
html:root body .vmesta-coin-icon .vmesta-coin-moon{fill:currentColor;stroke:none}
html:root body .vmesta-coin-amount{display:inline-flex;align-items:center;justify-content:center;gap:.25rem;color:var(--theme-accent);white-space:nowrap}
html:root body .vmesta-coin-amount b{color:inherit;font:inherit;font-weight:950}.vmesta-coin-amount small{color:var(--theme-text-muted);font-size:.72em;font-weight:850}
html:root body .gift-price .vmesta-coin-amount,html:root body .gift-compose-price .vmesta-coin-amount,html:root body .vmesta-market-gift-card em .vmesta-coin-amount{font-size:inherit}
html:root body .gift-price .vmesta-coin-icon{width:.78rem;height:.78rem}.level-setting-input b .vmesta-coin-icon{width:.9rem;height:.9rem}.level-up-coin-reward>span .vmesta-coin-icon{width:1.35rem;height:1.35rem}
html:root body .emoji-picker-expanded .emoji-picker-mode-tabs{width:auto;gap:.22rem;padding:.2rem;border:1px solid var(--theme-border);border-radius:.8rem;background:var(--theme-surface-control)}
html:root body .emoji-picker-expanded .emoji-picker-mode-button{display:grid;width:2.3rem;min-width:2.3rem;height:2.3rem;padding:0;place-items:center;border-radius:.62rem}
html:root body .emoji-picker-expanded .emoji-picker-mode-button svg{width:1.15rem;height:1.15rem;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
html:root body .emoji-sticker-packs .is-recent svg{width:1.25rem;height:1.25rem;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
html:root body .emoji-sticker-packs .is-recent,html:root body .emoji-sticker-packs .is-store{flex:0 0 2.35rem;border:1px solid var(--theme-border);background:var(--theme-surface-control)}
html:root body .emoji-sticker-grid.is-empty{display:grid;place-items:center}.emoji-sticker-recent-empty{display:grid;max-width:14rem;place-items:center;gap:.35rem;padding:2rem 1rem;color:var(--theme-text-muted);text-align:center}.emoji-sticker-recent-empty svg{width:2.2rem;height:2.2rem;fill:none;stroke:var(--theme-accent);stroke-width:1.5}.emoji-sticker-recent-empty strong{color:var(--theme-text-primary);font-size:.68rem}.emoji-sticker-recent-empty span{font-size:.54rem}
html:root body .emoji-sticker-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    gap: .28rem;
    min-height: 0;
    padding: .25rem .42rem .52rem;
    overflow: hidden auto;
    scrollbar-width: thin;
}
html:root body .emoji-sticker-grid > button {
    display: grid;
    aspect-ratio: 1;
    min-width: 0;
    place-items: center;
    border: 0;
    border-radius: .72rem;
    padding: .16rem;
    background: transparent !important;
    cursor: pointer;
}
html:root body .emoji-sticker-grid > button:hover { background: var(--theme-surface-active) !important; }
html:root body .emoji-sticker-grid > button:disabled { cursor: wait; opacity: .55; }
html:root body .emoji-sticker-media { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; transform-origin: 50% 76%; }
html:root body .emoji-sticker-media.is-sprite { background-repeat: no-repeat; background-size: 500% 400%; }
html:root body .emoji-sticker-media.is-fallback { display: grid; place-items: center; color: var(--theme-accent); font-size: 1.55rem; }
html:root body .emoji-sticker-loading,
html:root body .emoji-sticker-empty { display: grid; grid-row: 1 / -1; min-height: 100%; place-items: center; align-content: center; gap: .34rem; padding: 1rem; color: var(--theme-text-muted) !important; text-align: center; }
html:root body .emoji-sticker-loading i { width: 1.2rem; height: 1.2rem; border: .14rem solid var(--theme-border-subtle); border-top-color: var(--theme-accent); border-radius: 50%; animation: vmesta-unified-transfer-spin .75s linear infinite; }
html:root body .emoji-sticker-loading span,
html:root body .emoji-sticker-empty p { margin: 0; color: var(--theme-text-muted) !important; font-size: .55rem; }
html:root body .emoji-sticker-empty button { min-height: 2rem; border: 0; border-radius: .62rem; padding: 0 .75rem; background: var(--theme-accent) !important; color: var(--theme-accent-contrast, #fff) !important; font-size: .52rem; font-weight: 900; }

html:root body .messenger-bubble.is-sticker-only {
    min-width: 8.8rem;
    max-width: 11rem;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
html:root body .messenger-bubble.is-sticker-only .messenger-bubble-tail { display: none; }
html:root body .messenger-sticker-message { position: relative; width: 10rem; max-width: 38vw; margin: 0; aspect-ratio: 1; }
html:root body .messenger-sticker-media { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 .35rem .55rem rgb(15 23 42 / .14)); }
html:root body .messenger-sticker-media.is-sprite { background-repeat: no-repeat; background-size: 500% 400%; }
html:root body .messenger-sticker-media.is-fallback { display: grid; place-items: center; color: var(--theme-accent); font-size: 4rem; }
html:root body .messenger-sticker-message figcaption { display: none; }
html:root body .messenger-bubble.is-sticker-only > span {
    position: absolute;
    right: .25rem;
    bottom: .18rem;
    display: flex;
    align-items: center;
    min-height: 1.35rem;
    border-radius: 999px;
    padding: .12rem .4rem;
    background: rgb(15 23 42 / .58) !important;
    color: #fff !important;
    backdrop-filter: blur(.35rem);
}
html:root body .messenger-bubble.is-sticker-only > span time,
html:root body .messenger-bubble.is-sticker-only > span em { color: inherit !important; }
@media (max-width: 480px) {
    html:root body .emoji-sticker-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    html:root body .messenger-sticker-message { width: 8.6rem; max-width: 44vw; }
}
@media (prefers-reduced-motion: reduce) {
    html:root body .emoji-sticker-grid > button:hover .emoji-sticker-media,
    html:root body .emoji-sticker-loading i { animation: none !important; }
}

/* ------------[Личная коллекция и прозрачные сообщения-стикеры]------------ // Связывает магазин, библиотеку пользователя и панель чата без цветной карточки вокруг изображения. */
html:root body.messages-route .messenger-message .messenger-bubble.is-sticker-only,
html:root body.messages-route .messenger-message:hover .messenger-bubble.is-sticker-only,
html:root body .messenger-message .messenger-bubble.is-sticker-only,
html:root body .messenger-sticker-message {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}
html:root body .messenger-sticker-message { cursor: pointer; outline: 0; }
html:root body .messenger-sticker-message:focus-visible { filter: drop-shadow(0 0 .35rem color-mix(in srgb, var(--theme-accent) 55%, transparent)); }
html:root body :is(.messenger-sticker-media,.emoji-sticker-media,.vmesta-sticker-media).is-lottie > svg { display: block; width: 100% !important; height: 100% !important; overflow: visible; }

html:root body .vmesta-sticker-pack-view > header { grid-template-columns: 4rem minmax(0, 1fr) auto; }
html:root body .vmesta-sticker-collection-action,
html:root body .vmesta-sticker-preview-add {
    min-height: 2.15rem;
    border: 0;
    border-radius: .68rem;
    padding: 0 .8rem;
    background: var(--theme-accent) !important;
    color: var(--theme-accent-contrast, #fff) !important;
    font-size: .52rem;
    font-weight: 950;
    cursor: pointer;
}
html:root body :is(.vmesta-sticker-collection-action,.vmesta-sticker-preview-add).is-added { background: var(--theme-surface-control) !important; color: var(--theme-accent) !important; cursor: default; }

html:root body :is(.vmesta-sticker-preview-modal,.vmesta-sticker-library-modal) {
    position: fixed;
    inset: 0;
    z-index: 2147483612;
    display: grid;
    place-items: center;
    padding: 1rem;
}
html:root body :is(.vmesta-sticker-preview-modal,.vmesta-sticker-library-modal).hidden { display: none !important; }
html:root body :is(.vmesta-sticker-preview-backdrop,.vmesta-sticker-library-backdrop) {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgb(7 16 27 / .68) !important;
    backdrop-filter: blur(.45rem);
}
html:root body .vmesta-sticker-preview-modal > section {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(42rem, 94vw);
    max-height: min(38rem, 88vh);
    border-radius: 1.2rem;
    padding: 0;
    background: var(--theme-surface-elevated, var(--theme-surface-panel)) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: 0 1.4rem 4rem rgb(7 16 27 / .28);
    overflow: hidden;
}
html:root body .vmesta-sticker-preview-content {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: .38rem .28rem .38rem .38rem;
    padding: .62rem .95rem .62rem .62rem;
    scrollbar-gutter: stable;
}
html:root body .vmesta-sticker-preview-close {
    position: absolute;
    z-index: 2;
    top: .7rem;
    right: .7rem;
    width: 2.35rem;
    height: 2.35rem;
    border: 0;
    border-radius: .72rem;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-secondary) !important;
    font-size: 1.15rem;
    cursor: pointer;
}
html:root body .vmesta-sticker-preview-content > header {
    display: grid;
    grid-template-columns: 4.2rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    padding: .2rem 3rem .8rem 0;
}
html:root body .vmesta-sticker-preview-content > header .vmesta-sticker-pack-cover { width: 4.2rem; height: 4.2rem; background-color: transparent !important; }
html:root body .vmesta-sticker-preview-content h3 { margin: .1rem 0; font-size: 1rem; font-weight: 950; }
html:root body .vmesta-sticker-preview-content p,
html:root body .vmesta-sticker-preview-content small { margin: 0; color: var(--theme-text-muted) !important; font-size: .52rem; font-weight: 800; }
html:root body .vmesta-sticker-preview-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .42rem; }
html:root body .vmesta-sticker-preview-grid article { display: grid; aspect-ratio: 1; place-items: center; border-radius: .85rem; padding: .2rem; background: transparent !important; }
html:root body .vmesta-sticker-preview-grid article:hover { background: var(--theme-surface-control) !important; }

html:root body .vmesta-sticker-library-modal > section {
    position: relative;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: min(46rem, 94vw);
    height: min(36rem, 88vh);
    border-radius: 1.2rem;
    background: var(--theme-surface-elevated, var(--theme-surface-panel)) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: 0 1.4rem 4rem rgb(7 16 27 / .28);
    overflow: hidden;
}
html:root body .vmesta-sticker-library-modal > section > header { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; align-items: center; gap: .7rem; padding: .9rem 1rem .7rem; }
html:root body .vmesta-sticker-library-modal > section > header > span { display: grid; width: 3rem; height: 3rem; place-items: center; border-radius: .85rem; background: var(--theme-surface-control); color: var(--theme-accent); }
html:root body .vmesta-sticker-library-modal > section > header svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.7; }
html:root body .vmesta-sticker-library-modal h2 { margin: .08rem 0; font-size: 1rem; font-weight: 950; }
html:root body .vmesta-sticker-library-modal header p,
html:root body .vmesta-sticker-library-modal header small { margin: 0; color: var(--theme-text-muted) !important; font-size: .5rem; }
html:root body .vmesta-sticker-library-modal > section > header > button { width: 2.35rem; height: 2.35rem; border: 0; border-radius: .72rem; background: var(--theme-surface-control) !important; color: var(--theme-text-secondary) !important; font-size: 1.15rem; cursor: pointer; }
html:root body .vmesta-sticker-library-modal > section > nav { display: flex; gap: .42rem; padding: 0 1rem .75rem; border-bottom: 1px solid var(--theme-border-subtle); }
html:root body .vmesta-sticker-library-modal > section > nav button { min-height: 2.15rem; border: 0; border-radius: .65rem; padding: 0 .75rem; background: var(--theme-surface-control) !important; color: var(--theme-text-secondary) !important; font-size: .52rem; font-weight: 900; cursor: pointer; }
html:root body .vmesta-sticker-library-modal > section > nav button.is-active,
html:root body .vmesta-sticker-library-modal > section > nav button.is-shop { background: var(--theme-accent) !important; color: var(--theme-accent-contrast, #fff) !important; }
html:root body .vmesta-sticker-library-modal > section > nav button.is-shop { margin-left: auto; }
html:root body .vmesta-sticker-library-content { min-height: 0; margin: 0 .28rem .28rem 0; padding: .8rem .8rem 1rem 1rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
html:root body .vmesta-sticker-library-card { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) auto auto; align-items: center; gap: .65rem; margin-bottom: .45rem; border-radius: .9rem; padding: .55rem .65rem; background: var(--theme-surface-control) !important; }
html:root body .vmesta-sticker-library-cover { border: 0; padding: 0; background: transparent !important; cursor: pointer; }
html:root body .vmesta-sticker-library-cover .vmesta-sticker-pack-cover { background-color: transparent !important; }
html:root body .vmesta-sticker-library-card > div { display: grid; gap: .12rem; min-width: 0; }
html:root body .vmesta-sticker-library-card strong { overflow: hidden; font-size: .65rem; font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }
html:root body .vmesta-sticker-library-card small { color: var(--theme-text-muted) !important; font-size: .47rem; }
html:root body .vmesta-sticker-library-switch { display: grid; grid-template-columns: auto auto; align-items: center; gap: .38rem; cursor: pointer; }
html:root body .vmesta-sticker-library-switch input { position: absolute; opacity: 0; pointer-events: none; }
html:root body .vmesta-sticker-library-switch span { position: relative; width: 2rem; height: 1.12rem; border-radius: 999px; background: var(--theme-border-strong) !important; }
html:root body .vmesta-sticker-library-switch span::after { content: ''; position: absolute; top: .14rem; left: .14rem; width: .84rem; height: .84rem; border-radius: 50%; background: #fff; transition: transform .18s ease; }
html:root body .vmesta-sticker-library-switch input:checked + span { background: var(--theme-accent) !important; }
html:root body .vmesta-sticker-library-switch input:checked + span::after { transform: translateX(.88rem); }
html:root body .vmesta-sticker-library-switch b { color: var(--theme-text-muted); font-size: .46rem; }
html:root body :is(.vmesta-sticker-library-archive,.vmesta-sticker-library-restore) { min-height: 2rem; border: 0; border-radius: .62rem; padding: 0 .65rem; background: var(--theme-surface-panel) !important; color: var(--theme-text-secondary) !important; font-size: .48rem; font-weight: 900; cursor: pointer; }
html:root body .vmesta-sticker-library-restore { color: var(--theme-accent) !important; }

@media (max-width: 620px) {
    html:root body .vmesta-sticker-pack-view > header,
    html:root body .vmesta-sticker-preview-content > header { grid-template-columns: 3.6rem minmax(0, 1fr); }
    html:root body :is(.vmesta-sticker-collection-action,.vmesta-sticker-preview-add) { grid-column: 1 / -1; }
    html:root body .vmesta-sticker-preview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    html:root body .vmesta-sticker-library-card { grid-template-columns: 3.4rem minmax(0, 1fr) auto; }
    html:root body .vmesta-sticker-library-archive { grid-column: 2 / -1; }
    html:root body .vmesta-sticker-library-switch b { display: none; }
}

/* ------------[Стабильный фон и экономное TGS-воспроизведение]------------ // Перекрывает Monet-заливку с той же специфичностью и оставляет SVG активным только у выбранного runtime стикера. */
html:root.adaptive-theme.theme-monet-active body.messages-route
    .messenger-message.is-incoming .messenger-bubble.is-sticker-only:not(.is-poll),
html:root.adaptive-theme.theme-monet-active body.messages-route
    .messenger-message.is-outgoing .messenger-bubble.is-sticker-only:not(.is-poll),
html:root.adaptive-theme.theme-monet-active body.messages-route
    .messenger-message.is-incoming:hover .messenger-bubble.is-sticker-only:not(.is-poll),
html:root.adaptive-theme.theme-monet-active body.messages-route
    .messenger-message.is-outgoing:hover .messenger-bubble.is-sticker-only:not(.is-poll) {
    --message-shape-fill: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
}
html:root body [data-vmesta-lottie].is-lottie { position: relative; overflow: visible; isolation: isolate; }
html:root body [data-vmesta-lottie].is-lottie > :is(svg,.vmesta-lottie-poster) {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    pointer-events: none;
}
html:root body [data-vmesta-lottie].is-lottie > svg { z-index: 2; opacity: 0; overflow: visible; }
html:root body [data-vmesta-lottie].is-lottie > .vmesta-lottie-poster { z-index: 1; opacity: 1; }
html:root body [data-vmesta-lottie].is-lottie.is-playing > svg,
html:root body [data-vmesta-lottie].is-lottie.is-lottie-ready:not(.has-lottie-poster) > svg { opacity: 1; }
html:root body [data-vmesta-lottie].is-lottie.is-playing > .vmesta-lottie-poster { opacity: 0; }

/* ------------[Canvas-TGS без фонового WEBP]------------ // Настоящий кадр TGS остаётся прозрачным и резким даже при выключенной анимации. */
html:root body [data-vmesta-lottie].is-lottie > canvas,
html:root body [data-vmesta-lottie].is-lottie > .vmesta-lottie-fallback {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    background: transparent !important;
    pointer-events: none;
}
html:root body [data-vmesta-lottie].is-lottie > canvas { opacity: 0; }
html:root body [data-vmesta-lottie].is-lottie.is-lottie-ready > canvas { opacity: 1; }
html:root body [data-vmesta-lottie].is-lottie.is-lottie-ready > .vmesta-lottie-poster { display: none !important; }

/* ------------[Анимированные состояния библиотеки стикеров]------------ */
html:root body .vmesta-sticker-library-modal > section > header > span { animation: vmestaStickerIconFloat 2.8s ease-in-out infinite; }
html:root body .vmesta-sticker-empty > .vmesta-sticker-empty-motion {
    position: relative;
    display: grid;
    width: 3.4rem;
    height: 3.4rem;
    place-items: center;
    border-radius: 1rem;
    background: var(--theme-surface-control) !important;
    animation: vmestaStickerIconFloat 2.6s ease-in-out infinite;
}
html:root body .vmesta-sticker-empty > .vmesta-sticker-empty-motion i {
    position: absolute;
    width: .48rem;
    height: .48rem;
    border-radius: 50%;
    background: var(--theme-accent) !important;
    box-shadow: 0 0 .75rem color-mix(in srgb, var(--theme-accent) 65%, transparent);
    animation: vmestaStickerIconOrbit 2.3s linear infinite;
}
@keyframes vmestaStickerIconFloat { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-.28rem) rotate(-3deg); } }
@keyframes vmestaStickerIconOrbit { from { transform: rotate(0) translateX(1.6rem) rotate(0); } to { transform: rotate(360deg) translateX(1.6rem) rotate(-360deg); } }

/* ------------[Отправка набора стикеров]------------ */
html:root body .vmesta-sticker-preview-actions { display: grid; gap: .35rem; min-width: 8.5rem; }
html:root body .vmesta-sticker-preview-share {
    min-height: 2.15rem;
    border: 1px solid var(--theme-border-subtle);
    border-radius: .68rem;
    padding: 0 .8rem;
    background: var(--theme-surface-control) !important;
    color: var(--theme-text-secondary) !important;
    font-size: .5rem;
    font-weight: 950;
    cursor: pointer;
}
html:root body .vmesta-sticker-share-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483614;
    display: grid;
    place-items: center;
    padding: 1rem;
}
html:root body .vmesta-sticker-share-modal.hidden { display: none !important; }
html:root body .vmesta-sticker-share-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgb(7 16 27 / .72) !important; backdrop-filter: blur(.4rem); }
html:root body .vmesta-sticker-share-modal > section { position: relative; display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; width: min(27rem, 94vw); max-height: min(34rem, 88vh); border-radius: 1rem; padding: .85rem; background: var(--theme-surface-elevated, var(--theme-surface-panel)) !important; box-shadow: 0 1.3rem 3.4rem rgb(7 16 27 / .3); }
html:root body .vmesta-sticker-share-modal > section > header { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .65rem; }
html:root body .vmesta-sticker-share-modal h3 { margin: .08rem 0 0; font-size: .9rem; }
html:root body .vmesta-sticker-share-modal header small { color: var(--theme-accent) !important; font-size: .45rem; font-weight: 950; letter-spacing: .12em; }
html:root body .vmesta-sticker-share-modal header button { width: 2.2rem; height: 2.2rem; border: 0; border-radius: .65rem; background: var(--theme-surface-control) !important; color: var(--theme-text-secondary) !important; font-size: 1.1rem; cursor: pointer; }
html:root body .vmesta-sticker-share-search { display: flex; align-items: center; gap: .45rem; min-height: 2.55rem; border-radius: .75rem; padding: 0 .75rem; background: var(--theme-surface-control) !important; color: var(--theme-accent); }
html:root body .vmesta-sticker-share-search input { width: 100%; border: 0; outline: 0; background: transparent !important; color: var(--theme-text-primary) !important; font: inherit; }
html:root body .vmesta-sticker-share-targets { min-height: 8rem; margin-top: .55rem; overflow: auto; }
html:root body .vmesta-sticker-share-targets > button { display: grid; grid-template-columns: 2.35rem minmax(0,1fr) auto; align-items: center; gap: .55rem; width: 100%; min-height: 3.15rem; border: 0; border-radius: .75rem; padding: .42rem .55rem; background: transparent !important; color: var(--theme-text-primary) !important; text-align: left; cursor: pointer; }
html:root body .vmesta-sticker-share-targets > button:hover { background: var(--theme-surface-control) !important; }
html:root body .vmesta-sticker-share-targets > button > :is(img,span) { display: grid; width: 2.35rem; height: 2.35rem; place-items: center; border-radius: .72rem; background: var(--theme-surface-control) !important; object-fit: cover; color: var(--theme-accent); font-weight: 950; }
html:root body .vmesta-sticker-share-targets button div { display: grid; gap: .08rem; min-width: 0; }
html:root body .vmesta-sticker-share-targets button strong { overflow: hidden; font-size: .6rem; text-overflow: ellipsis; white-space: nowrap; }
html:root body .vmesta-sticker-share-targets button small { color: var(--theme-text-muted) !important; font-size: .46rem; }
html:root body .vmesta-sticker-share-targets button b { color: var(--theme-accent); font-size: .48rem; }
html:root body .vmesta-sticker-share-status { min-height: .8rem; margin: .35rem 0 0; color: var(--theme-danger, #d55) !important; font-size: .48rem; }

html:root body .messenger-sticker-pack-card { display: grid; gap: .55rem; width: min(18rem, 72vw); border-radius: .9rem; padding: .75rem; background: var(--theme-surface-control) !important; }
html:root body .messenger-sticker-pack-card > small { color: var(--theme-accent) !important; font-size: .43rem; font-weight: 950; letter-spacing: .12em; }
html:root body .messenger-sticker-pack-card > div { display: grid; grid-template-columns: 3.4rem minmax(0,1fr); align-items: center; gap: .65rem; }
html:root body .messenger-sticker-pack-card > div > span { display: grid; gap: .16rem; }
html:root body .messenger-sticker-pack-card strong { font-size: .72rem; font-weight: 950; }
html:root body .messenger-sticker-pack-card em { color: var(--theme-text-muted) !important; font-size: .48rem; font-style: normal; }
html:root body .messenger-sticker-pack-cover { display: block; width: 3.4rem; height: 3.4rem; border-radius: .78rem; object-fit: contain; background: transparent !important; }
html:root body .messenger-sticker-pack-cover.is-builtin { background-image: url('/assets/stickers/iskra-kometa-sheet-v2.png') !important; background-repeat: no-repeat !important; background-size: 500% 400% !important; background-position: 0 0 !important; }
html:root body .messenger-sticker-pack-cover.is-fallback { display: grid; place-items: center; color: var(--theme-accent); font-size: 1.8rem; }
html:root body .messenger-sticker-pack-card > button { min-height: 2.15rem; border: 0; border-radius: .65rem; background: var(--theme-accent) !important; color: var(--theme-accent-contrast, #fff) !important; font-size: .52rem; font-weight: 950; cursor: pointer; }

@media (max-width: 620px) {
    html:root body .vmesta-sticker-preview-actions { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
    html:root body .vmesta-sticker-library-modal > section > header > span,
    html:root body .vmesta-sticker-empty > .vmesta-sticker-empty-motion,
    html:root body .vmesta-sticker-empty > .vmesta-sticker-empty-motion i { animation: none !important; }
}

/* ------------[V2.0.59: окончательный каскад стикеров]------------ */
html:root body .messenger-message .messenger-bubble.is-sticker-only,
html:root body .messenger-message:hover .messenger-bubble.is-sticker-only,
html:root body .messenger-message.is-incoming .messenger-bubble.is-sticker-only,
html:root body .messenger-message.is-outgoing .messenger-bubble.is-sticker-only {
    --message-shape-fill: transparent !important;
    --msg-bubble-in: transparent !important;
    --msg-bubble-out: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}
html:root body .vmesta-sticker-library-card { grid-template-columns: 3.5rem minmax(0, 1fr) auto auto auto; }
html:root body .vmesta-sticker-library-share { display: grid; width: 2rem; height: 2rem; place-items: center; border: 0; border-radius: .62rem; padding: 0; background: var(--theme-surface-panel) !important; color: var(--theme-accent) !important; cursor: pointer; transition: transform .16s ease, background .16s ease; }
html:root body .vmesta-sticker-library-share:hover { transform: translateY(-.08rem); background: var(--theme-surface-active) !important; }
html:root body .vmesta-sticker-library-share svg { width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
html:root body .vmesta-sticker-share-modal > section { width: min(25rem, 94vw); max-height: min(32rem, 86vh); border: 0; border-radius: 1.15rem; padding: .8rem; background: var(--theme-surface-panel) !important; }
html:root body .vmesta-sticker-share-modal > section > header { display: grid; grid-template-columns: 2.8rem minmax(0, 1fr) 2.2rem; align-items: center; gap: .65rem; margin: 0 0 .65rem; padding: .2rem; }
html:root body .vmesta-sticker-share-brand { display: grid; width: 2.8rem; height: 2.8rem; place-items: center; border-radius: .82rem; background: var(--theme-surface-control) !important; color: var(--theme-accent); }
html:root body .vmesta-sticker-share-brand svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.75; }
html:root body .vmesta-sticker-share-modal h3 { margin: .06rem 0; color: var(--theme-text-primary) !important; font-size: .85rem; font-weight: 950; }
html:root body .vmesta-sticker-share-modal header p { margin: 0; color: var(--theme-text-muted) !important; font-size: .46rem; line-height: 1.35; }
html:root body .vmesta-sticker-share-search { min-height: 2.7rem; border: 0; border-radius: .78rem; background: var(--theme-surface-control) !important; }
html:root body .vmesta-sticker-share-search > span { display: grid; width: 1.25rem; place-items: center; }
html:root body .vmesta-sticker-share-search svg { width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
html:root body .vmesta-sticker-share-targets { display: grid; gap: .3rem; padding-top: .25rem; }
html:root body .vmesta-sticker-share-targets > button { min-height: 3.35rem; border-radius: .78rem; padding: .45rem .55rem; background: var(--theme-surface-elevated, var(--theme-surface-control)) !important; }
html:root body .vmesta-sticker-share-targets > button:hover { background: var(--theme-surface-active) !important; }
html:root body .vmesta-sticker-share-targets > button > b { display: grid; width: 1.8rem; height: 1.8rem; place-items: center; border-radius: .56rem; background: var(--theme-accent) !important; color: var(--theme-accent-contrast, #fff) !important; font-size: .8rem; }
html:root body .vmesta-sticker-share-targets > button:disabled { opacity: .65; cursor: wait; }
@media (max-width: 620px) {
    html:root body .vmesta-sticker-library-card { grid-template-columns: 3.4rem minmax(0, 1fr) auto auto; }
    html:root body .vmesta-sticker-library-archive { grid-column: auto; }
}

/* ------------[V2.0.60: управление импортированными наборами]------------ */
html:root body :is(.vmesta-sticker-grid,.vmesta-sticker-preview-grid) > article,
html:root body .messenger-message .messenger-bubble.is-sticker-only {
    contain: layout paint;
}
html:root body .vmesta-sticker-pack-actions { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; }
html:root body .vmesta-sticker-delete-action { display: inline-flex; min-height: 2.15rem; align-items: center; gap: .35rem; border: 0; border-radius: .68rem; padding: 0 .7rem; background: color-mix(in srgb, var(--theme-danger, #d84d64) 12%, var(--theme-surface-control)) !important; color: var(--theme-danger, #d84d64) !important; font-size: .5rem; font-weight: 950; cursor: pointer; }
html:root body .vmesta-sticker-delete-action:hover { background: color-mix(in srgb, var(--theme-danger, #d84d64) 20%, var(--theme-surface-control)) !important; }
html:root body .vmesta-sticker-delete-action svg { width: .86rem; height: .86rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html:root body .vmesta-sticker-delete-modal { position: fixed; inset: 0; z-index: 2147483616; display: grid; place-items: center; padding: 1rem; }
html:root body .vmesta-sticker-delete-modal.hidden { display: none !important; }
html:root body .vmesta-sticker-delete-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgb(7 16 27 / .74) !important; backdrop-filter: blur(.45rem); }
html:root body .vmesta-sticker-delete-modal > section { position: relative; display: grid; grid-template-columns: 3.25rem minmax(0,1fr); gap: .8rem; width: min(30rem, 94vw); border: 1px solid var(--theme-divider) !important; border-radius: 1.05rem; padding: 1.1rem; background: var(--theme-surface-panel) !important; color: var(--theme-text-primary) !important; box-shadow: 0 1.4rem 4rem rgb(7 16 27 / .3); }
html:root body .vmesta-sticker-delete-icon { display: grid; width: 3.25rem; height: 3.25rem; place-items: center; border-radius: .9rem; background: color-mix(in srgb, var(--theme-danger, #d84d64) 13%, var(--theme-surface-control)) !important; color: var(--theme-danger, #d84d64); }
html:root body .vmesta-sticker-delete-icon svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html:root body .vmesta-sticker-delete-modal small { color: var(--theme-danger, #d84d64) !important; font-size: .54rem; font-weight: 950; letter-spacing: .12em; }
html:root body .vmesta-sticker-delete-modal h3 { margin: .18rem 0 .38rem; color: var(--theme-text-primary) !important; font-size: 1rem; font-weight: 950; }
html:root body .vmesta-sticker-delete-modal p { margin: 0; color: var(--theme-text-secondary) !important; font-size: .62rem; line-height: 1.5; }
html:root body .vmesta-sticker-delete-name { display: block; margin-top: .6rem; color: var(--theme-text-primary) !important; font-size: .72rem; font-weight: 900; }
html:root body .vmesta-sticker-delete-modal footer { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: .5rem; margin-top: .4rem; }
html:root body .vmesta-sticker-delete-modal footer button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.5rem; border: 0; border-radius: .68rem; padding: .5rem .9rem; background: var(--theme-surface-control) !important; color: var(--theme-text-primary) !important; -webkit-text-fill-color: var(--theme-text-primary) !important; font-size: .64rem !important; font-weight: 900; line-height: 1.2; white-space: nowrap; opacity: 1 !important; cursor: pointer; }
html:root body .vmesta-sticker-delete-modal footer button.is-danger { min-width: 8.5rem; background: #c92d43 !important; color: #fff !important; -webkit-text-fill-color: #fff !important; }
html:root body .vmesta-sticker-delete-modal footer button.is-danger:hover { background: #ad2035 !important; color: #fff !important; -webkit-text-fill-color: #fff !important; }
html:root body .vmesta-sticker-delete-modal footer button.is-danger > span { display: inline-block !important; color: #fff !important; -webkit-text-fill-color: #fff !important; visibility: visible !important; opacity: 1 !important; }
html:root body .vmesta-sticker-delete-modal footer button:disabled { cursor: wait; opacity: .65 !important; }
html:root body .vmesta-sticker-delete-status { grid-column: 1 / -1; min-height: .85rem; color: var(--theme-danger, #d84d64) !important; font-size: .6rem !important; font-weight: 800; }
html:root body .vmesta-sticker-delete-modal footer button:focus-visible { outline: 2px solid var(--theme-accent); outline-offset: 2px; }
@media (max-width: 620px) {
    html:root body .vmesta-sticker-pack-actions { grid-column: 1 / -1; justify-content: stretch; }
    html:root body .vmesta-sticker-pack-actions > button { flex: 1; }
}

/* ------------[V2.0.61: фирменные стикеры «Искра и Комета»]------------ */
html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media,.vmesta-sticker-pack-cover,.messenger-sticker-pack-cover).is-sprite {
    background-color: transparent !important;
    background-repeat: no-repeat !important;
    background-size: 580% 460% !important;
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).is-sprite::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-color: transparent;
    background-image: var(--sticker-motion-image);
    background-position: inherit;
    background-repeat: no-repeat;
    background-size: 580% 460%;
    opacity: 0;
    animation: vmestaMascotFrameBlend 2.8s ease-in-out infinite alternate;
    animation-play-state: paused;
}
html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).vmesta-sprite-motion { animation-play-state: paused !important; }
html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).vmesta-sprite-motion.is-sprite-visible.motion-1 { animation: vmesta-sticker-wave 2.4s ease-in-out infinite alternate !important; animation-play-state: running !important; }
html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).vmesta-sprite-motion.is-sprite-visible.motion-2 { animation: vmesta-sticker-hop 2.1s ease-in-out infinite alternate !important; animation-play-state: running !important; }
html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).vmesta-sprite-motion.is-sprite-visible.motion-3 { animation: vmesta-sticker-laugh 1.8s ease-in-out infinite alternate !important; animation-play-state: running !important; }
html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).vmesta-sprite-motion.is-sprite-visible.motion-4 { animation: vmesta-sticker-heart 2.3s ease-in-out infinite alternate !important; animation-play-state: running !important; }
html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).vmesta-sprite-motion.is-sprite-visible.motion-5 { animation: vmesta-sticker-float 2.7s ease-in-out infinite alternate !important; animation-play-state: running !important; }

html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).is-sprite.sticker-reaction-4,
html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).is-sprite.sticker-reaction-19 {
    position: relative;
    isolation: isolate;
}
html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).is-sprite.sticker-reaction-4::after {
    content: '';
    position: absolute;
    top: 9%;
    right: 9%;
    z-index: 2;
    width: 21%;
    aspect-ratio: 1;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop stop-color='%23ff7898'/%3E%3Cstop offset='1' stop-color='%23e73361'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M32 55C18 44 7 35 7 21 7 10 20 5 28 14l4 5 4-5c8-9 21-4 21 7 0 14-11 23-25 34Z' fill='url(%23g)' stroke='white' stroke-width='4'/%3E%3Cpath d='M18 18c3-4 7-4 10-1' fill='none' stroke='%23ffd7e1' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
    filter: drop-shadow(0 .1rem .2rem rgb(171 24 67 / .24));
    animation: vmestaMascotVectorPulse .78s ease-in-out infinite alternate;
    animation-play-state: paused;
}
html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).is-sprite.sticker-reaction-19::after {
    content: '';
    position: absolute;
    top: 8%;
    right: 8%;
    z-index: 2;
    width: 22%;
    aspect-ratio: 1;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='m32 5 7.4 15 16.6 2.4-12 11.7L46.8 51 32 43.2 17.2 51 20 34.1 8 22.4 24.6 20Z' fill='%23ffd84d' stroke='white' stroke-width='4' stroke-linejoin='round'/%3E%3Cpath d='m32 13 4.5 9.1' stroke='%23fff2a8' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
    animation: vmestaMascotVectorSpin 1.8s ease-in-out infinite;
    animation-play-state: paused;
}
html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).is-sprite-visible::after { animation-play-state: running; }
html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).is-sprite-visible::before { animation-play-state: running; }
@keyframes vmestaMascotFrameBlend { 0%,15% { opacity: 0; } 85%,100% { opacity: 1; } }
@keyframes vmestaMascotVectorPulse { to { transform: scale(1.22) rotate(6deg); } }
@keyframes vmestaMascotVectorSpin { 0%,100% { transform: scale(.9) rotate(-8deg); } 50% { transform: scale(1.12) rotate(8deg); } }
@media (prefers-reduced-motion: reduce) {
    html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).vmesta-sprite-motion,
    html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).is-sprite::before,
    html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).is-sprite::after { animation: none !important; }
}

/* ------------[V2.0.66: компактная навигация и пиктограммы коллекций]------------ */
html:root body #profile-left-rail .profile-sidebar-navigation-frame {
    padding: .3rem !important;
}
html:root body #profile-left-rail .profile-sidebar-navigation {
    gap: .06rem !important;
}
html:root body #profile-left-rail .profile-sidebar-navigation > .nav-item {
    min-height: 2.22rem !important;
    gap: .54rem !important;
    padding: .4rem .62rem !important;
    border-radius: .64rem !important;
}
html:root body #profile-left-rail .profile-sidebar-more {
    gap: .08rem !important;
    margin-top: .08rem !important;
    padding-top: .18rem !important;
}
html:root body .vmesta-market-tabs [data-market-tab] svg {
    color: var(--theme-accent) !important;
    stroke: currentColor !important;
}
html:root body .vmesta-sticker-library-modal > section > nav button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .38rem;
}
html:root body .vmesta-sticker-library-modal > section > nav button svg,
html:root body :is(.vmesta-sticker-library-archive,.vmesta-sticker-library-restore) svg,
html:root body .vmesta-sticker-preview-share svg {
    width: .86rem;
    height: .86rem;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
html:root body .vmesta-sticker-library-modal > section > nav button:not(.is-active):not(.is-shop) svg {
    color: var(--theme-accent) !important;
}
html:root body :is(.vmesta-sticker-library-archive,.vmesta-sticker-library-restore),
html:root body .vmesta-sticker-preview-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .32rem;
}
html:root body .vmesta-sticker-library-card small {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
}
html:root body .vmesta-sticker-origin-badge {
    display: inline-grid;
    width: 1.05rem;
    height: 1.05rem;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, #229ed9 14%, transparent);
    color: #229ed9 !important;
    vertical-align: middle;
}
html:root body .vmesta-sticker-origin-badge svg {
    width: .72rem !important;
    height: .72rem !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.8 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
}
html:root body .vmesta-sticker-origin-label {
    color: var(--theme-text-muted) !important;
}

/* Статичный фирменный набор: четыре прозрачных листа по десять кадров. */
html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media,.vmesta-sticker-pack-cover,.messenger-sticker-pack-cover,.emoji-sticker-packs span).is-static-sprite {
    display: block;
    background-color: transparent !important;
    background-repeat: no-repeat !important;
    background-size: 500% 200% !important;
    animation: none !important;
    transform: none !important;
    clip-path: inset(2% 5%);
}
html:root body .vmesta-sticker-pack-cover.is-static-sprite,
html:root body .messenger-sticker-pack-cover.is-static-sprite {
    background-image: url('/assets/stickers/cosmic-static-01-v2.png') !important;
    background-position: 0 0 !important;
}
html:root body .emoji-sticker-packs .is-static-sprite { width: 1.8rem; height: 1.8rem; }
html:root body .vmesta-sticker-origin-badge.is-vmesta {
    width: 1.16rem;
    height: 1.16rem;
    overflow: hidden;
    border-radius: .32rem;
    background: transparent !important;
}
html:root body .vmesta-sticker-origin-badge.is-vmesta img { display: block; width: 100%; height: 100%; object-fit: contain; }
html:root body .vmesta-coin-icon .vmesta-coin-inner { stroke-width: .9; opacity: .65; }
html:root body .vmesta-coin-icon .vmesta-coin-v { stroke-width: 2.2; }
html:root body .vmesta-coin-icon .vmesta-coin-node { fill: currentColor; stroke: none; }
html:root body .achievements-dialog-body.is-empty-scope { display: flex; flex-direction: column; }
html:root body .achievements-dialog-body.is-empty-scope > .achievement-scope-empty { flex: 1 0 auto; width: 100%; min-height: 16rem; }

/* ------------[V2.0.63: спокойное движение и безопасная нарезка]------------ */
html:root body .vmesta-sticker-grid article:hover .motion-1,
html:root body .emoji-sticker-grid > button:hover .motion-1 { animation-duration: 2.4s !important; animation-timing-function: ease-in-out !important; }
html:root body .vmesta-sticker-grid article:hover .motion-2,
html:root body .emoji-sticker-grid > button:hover .motion-2 { animation-duration: 2.1s !important; animation-timing-function: ease-in-out !important; }
html:root body .vmesta-sticker-grid article:hover .motion-3,
html:root body .emoji-sticker-grid > button:hover .motion-3 { animation-duration: 1.8s !important; animation-timing-function: ease-in-out !important; }
html:root body .vmesta-sticker-grid article:hover .motion-4,
html:root body .emoji-sticker-grid > button:hover .motion-4 { animation-duration: 2.3s !important; animation-timing-function: ease-in-out !important; }
html:root body .vmesta-sticker-grid article:hover .motion-5,
html:root body .emoji-sticker-grid > button:hover .motion-5 { animation-duration: 2.7s !important; animation-timing-function: ease-in-out !important; }

/* ------------[V2.0.67: информативные превью ссылок в сообщениях]------------ */
html:root body .messenger-inline-link {
    color: var(--msg-accent, var(--theme-accent)) !important;
    font-weight: 750;
    overflow-wrap: anywhere;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 48%, transparent);
    text-underline-offset: .12rem;
}
html:root body .messenger-inline-link:hover {
    text-decoration-color: currentColor;
}
html:root body .messenger-link-preview {
    position: relative;
    display: grid;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: .4rem;
    margin: .3rem 0 .1rem;
    padding: .42rem .42rem .42rem .76rem;
    border: 0 !important;
    border-radius: .58rem;
    background: color-mix(in srgb, var(--msg-accent, var(--theme-accent)) 9%, transparent) !important;
    color: var(--msg-text, var(--theme-text-primary)) !important;
    overflow: hidden;
    text-align: left;
    text-decoration: none !important;
}
html:root body .messenger-link-preview::before {
    position: absolute;
    top: .34rem;
    bottom: .34rem;
    left: .12rem;
    width: .13rem;
    border-radius: 999px;
    background: var(--msg-accent, var(--theme-accent));
    content: "";
}
html:root body .messenger-link-preview::after {
    position: absolute;
    top: .34rem;
    left: .02rem;
    width: .34rem;
    height: .34rem;
    border: .11rem solid var(--msg-panel, var(--theme-surface-panel));
    border-radius: 50%;
    background: var(--msg-accent, var(--theme-accent));
    content: "";
}
html:root body .messenger-link-preview-copy {
    display: grid;
    min-width: 0;
    gap: .1rem;
    padding-right: .08rem;
    text-align: left;
}
html:root body .messenger-link-preview-copy small {
    color: var(--msg-accent, var(--theme-accent)) !important;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .015em;
    line-height: 1.2;
}
html:root body .messenger-link-preview-copy strong {
    display: -webkit-box;
    color: inherit !important;
    font-size: .77rem;
    font-weight: 850;
    letter-spacing: -.01em;
    line-height: 1.24;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
html:root body .messenger-link-preview-copy em {
    display: -webkit-box;
    color: var(--msg-muted, var(--theme-text-secondary)) !important;
    font-size: .65rem;
    font-style: normal;
    line-height: 1.34;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}
html:root body .messenger-link-preview-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: .48rem;
    overflow: hidden;
}
html:root body .messenger-link-preview-media > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
html:root body .messenger-link-preview-media > i {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 2.7rem;
    height: 2.7rem;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, #0d1724 72%, transparent);
    color: #fff;
    transform: translate(-50%, -50%);
}
html:root body .messenger-link-preview-media > i svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
    stroke: currentColor;
}
html:root body .messenger-link-preview.is-loading {
    min-height: 3rem;
}
html:root body .messenger-link-preview.is-loading .messenger-link-preview-copy strong {
    opacity: .62;
}
html:root body .messenger-link-preview:is(:hover,:focus-visible) {
    background: color-mix(in srgb, var(--msg-accent, var(--theme-accent)) 14%, transparent) !important;
    outline: none;
}
@media (max-width: 620px) {
    html:root body .messenger-link-preview { width: 100%; }
    html:root body .messenger-link-preview-media { max-height: 10rem; }
}

/* Панель выбора: заметный активный режим/набор и запасная SVG-обложка. */
html:root body .emoji-picker-expanded :is(.emoji-picker-mode-button,.emoji-picker-tab,.emoji-sticker-packs button).is-active {
    background: color-mix(in srgb,var(--theme-accent) 24%,var(--theme-surface-control)) !important;
    color: var(--theme-accent) !important;
    box-shadow: inset 0 0 0 2px var(--theme-accent) !important;
}
html:root body .emoji-picker-expanded :is(.emoji-picker-mode-button,.emoji-picker-tab,.emoji-sticker-packs button):focus-visible {
    box-shadow: inset 0 0 0 2px var(--theme-accent) !important;
}
html:root body .emoji-sticker-packs .emoji-sticker-pack-icon { display:grid;width:1.8rem;height:1.8rem;place-items:center;overflow:hidden; }
html:root body .emoji-sticker-pack-icon img { display:block;width:100%;height:100%;object-fit:contain; }
html:root body .emoji-sticker-pack-icon img[hidden] { display:none; }
html:root body .emoji-sticker-pack-icon svg { display:none;width:1.2rem;height:1.2rem;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round; }
html:root body .emoji-sticker-pack-icon.is-fallback svg { display:block; }
html:root body .emoji-picker-sticker-view { grid-template-rows:auto auto auto minmax(0,1fr); }
html:root body .emoji-sticker-search-wrap { display:flex;align-items:center;gap:.4rem;min-height:2.2rem;margin:.3rem .48rem .18rem;padding:0 .65rem;border-radius:.62rem;background:var(--theme-surface-control);color:var(--theme-accent); }
html:root body .emoji-sticker-search-wrap svg { flex:none;width:.9rem;height:.9rem;fill:none;stroke:currentColor;stroke-width:1.8; }
html:root body .emoji-sticker-search { min-width:0;width:100%;height:2.2rem;border:0;outline:0;background:transparent;color:var(--theme-text-primary);font:inherit;font-size:.62rem; }
html:root body .emoji-sticker-search::placeholder { color:var(--theme-text-muted);opacity:.9; }
html:root body .emoji-sticker-search-wrap:focus-within { box-shadow:inset 0 0 0 2px var(--theme-accent); }
html:root body .emoji-sticker-grid.is-empty { grid-template-columns:minmax(0,1fr);grid-auto-rows:minmax(0,1fr);align-content:stretch;place-items:stretch; }
html:root body .emoji-sticker-grid.is-empty > .emoji-sticker-recent-empty { box-sizing:border-box;width:100%;max-width:none;min-height:100%;align-content:center;justify-items:center;padding:.7rem; }
html:root body .emoji-sticker-recent-empty.is-search-empty svg { width:4.4rem;height:4.4rem;overflow:visible;fill:none;stroke:var(--theme-accent);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;animation:vmesta-sticker-search-float 3s ease-in-out infinite; }
html:root body .emoji-sticker-recent-empty.is-search-empty .empty-sticker-sheet { fill:var(--theme-surface-control); }
html:root body .emoji-sticker-recent-empty.is-search-empty .empty-sticker-lens { fill:var(--theme-surface-panel); }
html:root body .emoji-sticker-recent-empty.is-search-empty .empty-sticker-spark { fill:color-mix(in srgb,var(--theme-accent) 24%,var(--theme-surface-panel)); }
@keyframes vmesta-sticker-search-float { 50% { transform:translateY(-.24rem) rotate(-3deg); } }
@media (prefers-reduced-motion:reduce) { html:root body .emoji-sticker-recent-empty.is-search-empty svg { animation:none; } }
/* Подсказка отправки стикера по введённому смайлику живёт над полем чата. */
html:root body .messenger-sticker-suggestions[hidden] { display:none !important; }
html:root body .messenger-sticker-suggestions:not([hidden]) { --sticker-suggest-surface:color-mix(in srgb,var(--msg-panel,var(--theme-surface-panel)) 68%,var(--msg-accent,var(--theme-accent)) 32%);position:absolute;z-index:91;left:3.15rem;bottom:calc(100% + .55rem);display:flex;align-items:center;gap:.32rem;width:max-content;max-width:calc(100% - 3.8rem);padding:.42rem;border:0 !important;border-radius:1rem;background:var(--sticker-suggest-surface) !important;box-shadow:none !important;filter:none !important;animation:vmesta-sticker-suggest-in .18s ease-out; }
html:root body .messenger-sticker-suggestions::after { content:"";position:absolute;bottom:-.48rem;left:1.3rem;width:.9rem;height:.55rem;clip-path:polygon(0 0,100% 0,50% 100%);border:0;background:var(--sticker-suggest-surface); }
html:root body .messenger-sticker-suggestions > button { position:relative;z-index:1;display:grid;flex:0 0 4.1rem;width:4.1rem;height:4.1rem;place-items:center;border:0 !important;border-radius:.75rem;padding:.16rem;background:color-mix(in srgb,var(--msg-panel,var(--theme-surface-panel)) 86%,var(--msg-accent,var(--theme-accent)) 14%) !important;cursor:pointer;transition:background .15s ease,transform .15s ease; }
html:root body .messenger-sticker-suggestions > button:is(:hover,:focus-visible) { outline:0;background:color-mix(in srgb,var(--msg-panel,var(--theme-surface-panel)) 72%,var(--msg-accent,var(--theme-accent)) 28%) !important;transform:translateY(-.12rem); }
html:root body .messenger-sticker-suggestions > button:disabled { opacity:.55;cursor:wait; }
html:root body .messenger-sticker-suggestions .emoji-sticker-media { width:100%;height:100%;aspect-ratio:1;object-fit:contain; }
@keyframes vmesta-sticker-suggest-in { from { opacity:0;transform:translateY(.3rem) scale(.97); } to { opacity:1;transform:translateY(0) scale(1); } }
@media (max-width:560px) { html:root body .messenger-sticker-suggestions:not([hidden]) { left:.7rem;max-width:calc(100% - 1.4rem); } html:root body .messenger-sticker-suggestions > button { flex-basis:3.55rem;width:3.55rem;height:3.55rem; } }
@media (prefers-reduced-motion:reduce) { html:root body .messenger-sticker-suggestions:not([hidden]) { animation:none; } html:root body .messenger-sticker-suggestions > button { transition:none; } }

/* Фирменные реакции: один прозрачный лист на четыре независимых стикера. */
html:root body :is(.vmesta-sticker-media,.emoji-sticker-media,.messenger-sticker-media).is-four-sprite {
    display:block;
    background-color:transparent !important;
    background-repeat:no-repeat !important;
    background-size:200% 200% !important;
    animation:none !important;
}
html:root body .vmesta-sticker-pack-subtitle {
    display:block;
    margin:.12rem 0;
    color:var(--theme-text-muted) !important;
    font-size:.45rem;
    font-weight:900;
    letter-spacing:.12em;
    line-height:1.25;
}
html:root body .vmesta-sticker-origin-badge.is-vmesta { display:grid; place-items:center; }
html:root body .vmesta-sticker-origin-badge.is-vmesta img { width:.78rem; height:.78rem; }

/* Окно просмотра остаётся поверх личной библиотеки; действия не перекрывают полосу прокрутки. */
html:root body .vmesta-sticker-preview-modal { z-index:2147483613; }
html:root body .vmesta-sticker-preview-close {
    top:.78rem;
    right:1.1rem;
    width:2rem;
    height:2rem;
}
html:root body .vmesta-sticker-preview-content > header {
    padding-right:3.4rem;
}
html:root body .vmesta-sticker-preview-actions {
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:.35rem;
    min-width:0;
}
html:root body :is(.vmesta-sticker-preview-share,.vmesta-sticker-preview-add) {
    display:inline-grid;
    width:2rem;
    height:2rem;
    min-height:2rem;
    flex:0 0 2rem;
    place-items:center;
    border-radius:.62rem;
    padding:0;
    font-size:.9rem;
    line-height:1;
}
html:root body :is(.vmesta-sticker-preview-share,.vmesta-sticker-preview-add) svg {
    width:.93rem;
    height:.93rem;
}
@media (max-width:620px) {
    html:root body .vmesta-sticker-preview-content > header {
        grid-template-columns:3.6rem minmax(0,1fr) auto;
    }
    html:root body .vmesta-sticker-preview-actions { grid-column:auto; }
}

/* Трофеи: закрытая витрина, настройки условия и полученные находки. */
html:root body .vmesta-trophy-lock { display:grid;justify-items:center;gap:.3rem;margin:.6rem 0;padding:1.6rem .8rem;border:1px dashed var(--theme-border-subtle);border-radius:.85rem;background:var(--theme-surface-control);text-align:center;color:var(--theme-text-primary); }
html:root body .vmesta-sticker-pack-card.is-trophy-locked .vmesta-sticker-pack-cover { filter:grayscale(.75);opacity:.72; }
html:root body .vmesta-trophy-lock > span { font-size:1.8rem; }
html:root body .vmesta-trophy-lock strong { font-size:.72rem; }
html:root body .vmesta-trophy-lock small { color:var(--theme-text-muted);font-size:.55rem; }
html:root body .level-trophy-grid { display:grid;gap:.55rem; }
html:root body .level-trophy-rule { display:grid;gap:.45rem;padding:.65rem .75rem;border-radius:.85rem;background:var(--theme-surface-nested); }
html:root body .level-trophy-rule-head { display:flex;align-items:center;gap:.65rem; }
html:root body .level-trophy-rule-head > :is(img,span) { width:3rem;height:3rem;flex:none;object-fit:contain;border-radius:.65rem;background:var(--theme-surface-control); }
html:root body .level-trophy-rule-head > span { display:grid;place-items:center;font-size:1.2rem; }
html:root body .level-trophy-rule-head div { display:grid;gap:.12rem; }
html:root body .level-trophy-rule-head strong { font-size:.68rem; }
html:root body .level-trophy-rule-head small { color:var(--theme-text-muted);font-size:.52rem; }
html:root body .level-trophy-rule-fields { display:grid;grid-template-columns:minmax(0,1.2fr) minmax(5rem,.55fr) minmax(0,1fr);gap:.5rem;align-items:end; }
html:root body .level-trophy-rule-fields label,html:root body .level-trophy-grant > label { display:grid;gap:.22rem;min-width:0;font-size:.55rem;font-weight:800; }
/* Поля трофея не наследуют двухколоночную карточку общих настроек. */
html:root body .level-settings-group .level-trophy-rule-fields > label { display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch;gap:.22rem;min-width:0;border:0 !important;border-radius:0;padding:0;background:transparent !important; }
html:root body .level-settings-group .level-trophy-rule-fields > label > span:first-child { display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
html:root body .level-trophy-rule-fields :is(input,select),html:root body .level-trophy-grant select { width:100%;min-height:2.3rem;border:1px solid var(--theme-border-subtle);border-radius:.65rem;padding:0 .6rem;background:var(--theme-surface-control);color:var(--theme-text-primary); }
html:root body .level-settings-group .level-trophy-rule-fields > label.level-trophy-admin-access { position:relative;display:flex;align-items:center;justify-content:space-between;gap:.5rem;min-height:2.8rem;border:1px solid var(--theme-border-subtle) !important;border-radius:.68rem;padding:.4rem .55rem;background:var(--theme-surface-control) !important;color:var(--theme-text-primary);cursor:pointer; }
html:root body .level-settings-group .level-trophy-rule-fields > label.level-trophy-admin-access > span:first-child { display:grid;gap:.1rem;overflow:visible;white-space:normal; }
html:root body .level-trophy-admin-access > span { display:grid;gap:.1rem;min-width:0; }
html:root body .level-trophy-admin-access strong { font-size:.53rem;line-height:1.3; }
html:root body .level-trophy-admin-access small { color:var(--theme-text-muted);font-size:.45rem;font-weight:650;line-height:1.3; }
html:root body .level-trophy-rule-fields .level-trophy-admin-access input { position:absolute;width:1px;height:1px;min-height:0;padding:0;opacity:0; }
html:root body .level-trophy-admin-access i { position:relative;flex:0 0 2.1rem;width:2.1rem;height:1.2rem;border-radius:999px;background:color-mix(in srgb,var(--theme-text-muted) 36%,var(--theme-surface-panel));transition:background .18s ease; }
html:root body .level-trophy-admin-access i::after { content:"";position:absolute;top:.15rem;left:.15rem;width:.9rem;height:.9rem;border-radius:50%;background:var(--theme-surface-panel);box-shadow:0 1px 3px #0002;transition:transform .18s ease; }
html:root body .level-trophy-admin-access input:checked + i { background:var(--theme-accent); }
html:root body .level-trophy-admin-access input:checked + i::after { transform:translateX(.9rem); }
html:root body .level-trophy-admin-access input:focus-visible + i { outline:2px solid var(--theme-accent);outline-offset:2px; }
html:root body .level-trophy-rule:not([data-trigger-type="level"]):not([data-trigger-type="signals"]) [data-trophy-for="threshold"],
html:root body .level-trophy-rule:not([data-trigger-type="achievement"]) [data-trophy-for="achievement"],
html:root body .level-trophy-rule:not([data-trigger-type="manual"]) [data-trophy-for="manual"],
html:root body [data-level-settings-tab="trophy"][hidden],
html:root body #level-settings-form > footer[hidden] { display:none !important; }
html:root body .level-trophy-rule > button,html:root body .level-trophy-grant > button { width:max-content;min-height:2.25rem;border:0;border-radius:.65rem;padding:0 .8rem;background:var(--theme-accent);color:var(--theme-accent-contrast,#fff);font-size:.55rem;font-weight:900; }
html:root body .level-trophy-status,html:root body .level-trophy-grant-status { margin:0;color:var(--theme-text-secondary);font-size:.52rem; }
html:root body .level-trophy-status:empty,html:root body .level-trophy-grant-status:empty { display:none; }
html:root body .level-trophy-grant { display:grid;gap:.6rem; }
html:root body .level-settings-group .level-trophy-grant > label { grid-template-columns:minmax(5.5rem,7rem) minmax(0,1fr);gap:.65rem;padding:.55rem .7rem; }
html:root body .level-trophy-grant > .level-market-user-picker > input { box-sizing:border-box;width:100%;min-width:0;min-height:2.3rem;border:1px solid var(--theme-border-subtle) !important;border-radius:.65rem;outline:0;padding:0 .7rem;background:var(--theme-surface-control) !important;color:var(--theme-text-primary) !important;font-size:.65rem;font-weight:750; }
html:root body .level-trophy-grant > .level-market-user-picker > input::placeholder { color:var(--theme-text-muted);opacity:1; }
html:root body .level-trophy-grant > .level-market-user-picker > input:focus { border-color:var(--theme-accent) !important;box-shadow:0 0 0 .16rem color-mix(in srgb,var(--theme-accent) 13%,transparent); }
html:root body .level-trophy-grant > .level-market-user-picker > .level-market-user-selected { grid-column:2; }
@media (max-width:640px) { html:root body .level-settings-group .level-trophy-grant > label { grid-template-columns:minmax(0,1fr); } html:root body .level-trophy-grant > .level-market-user-picker > .level-market-user-selected { grid-column:1; } }
html:root body .vmesta-sticker-gift-panel.is-trophy .vmesta-space-market-compose { grid-template-columns:minmax(10rem,.8fr) minmax(11rem,1fr) auto; }
@media (max-width:800px) { html:root body .vmesta-sticker-gift-panel.is-trophy .vmesta-space-market-compose { grid-template-columns:1fr; } }
html:root body .signal-trophy-card { display:grid;grid-template-columns:3.5rem minmax(0,1fr) auto;align-items:center;gap:.75rem;min-height:5.5rem;border-radius:1rem;padding:.75rem;background:var(--theme-surface-panel);color:var(--theme-text-primary); }
html:root body .signal-trophy-art { display:grid;width:3.5rem;height:3.5rem;place-items:center;border-radius:.8rem;background:var(--theme-surface-control);color:var(--theme-accent); }
html:root body .signal-trophy-art img { width:100%;height:100%;object-fit:contain; }
html:root body .signal-trophy-art svg { width:1.5rem;height:1.5rem;fill:none;stroke:currentColor;stroke-width:1.7; }
html:root body .signal-trophy-card > div { display:grid;gap:.16rem;min-width:0; }
html:root body .signal-trophy-card :is(small,p) { margin:0;color:var(--theme-text-muted);font-size:.52rem; }
html:root body .signal-trophy-card strong { font-size:.7rem; }
html:root body .signal-trophy-card > button { min-height:2.1rem;border:0;border-radius:.6rem;padding:0 .7rem;background:var(--theme-accent);color:var(--theme-accent-contrast,#fff);font-size:.55rem;font-weight:900; }
html:root body .signal-trophy-claimed { color:var(--theme-accent);font-size:.55rem;font-weight:900; }

/* Равная высота окна отправки во время загрузки, пустого состояния и списка. */
html:root body .vmesta-sticker-share-modal > section { height:min(30rem,88vh);min-height:min(26rem,88vh); }
html:root body .vmesta-sticker-share-brand { display:grid;width:2.5rem;height:2.5rem;place-items:center;border-radius:.7rem;background:var(--theme-surface-control);color:var(--theme-accent); }
html:root body .vmesta-sticker-share-brand svg { width:1.6rem;height:1.6rem;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round; }
html:root body .vmesta-sticker-share-targets { min-height:0; }
html:root body .vmesta-sticker-share-empty { display:grid;align-content:center;justify-items:center;gap:.5rem;min-height:100%;padding:1.4rem;text-align:center;color:var(--theme-text-primary); }
html:root body .vmesta-sticker-share-empty > span { display:grid;width:4rem;height:4rem;place-items:center;border-radius:1rem;background:var(--theme-surface-control);color:var(--theme-accent); }
html:root body .vmesta-sticker-share-empty svg { width:2.4rem;height:2.4rem;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round; }
html:root body .vmesta-sticker-share-empty strong { font-size:.75rem; }
html:root body .vmesta-sticker-share-empty small { color:var(--theme-text-muted);font-size:.55rem; }
/* Эмоциональные метки фирменных стикеров — будущие ключи рекомендаций. */
html:root body .vmesta-sticker-preview-grid article.has-emoji { aspect-ratio:auto;grid-template-rows:auto auto;align-content:start;justify-items:center;gap:.2rem; }
html:root body .vmesta-sticker-preview-grid article.has-emoji > .vmesta-sticker-media { width:100%;aspect-ratio:1; }
html:root body .vmesta-sticker-grid article > .vmesta-sticker-emoji,
html:root body .vmesta-sticker-preview-grid article > .vmesta-sticker-emoji { display:block;min-height:1rem;max-width:100%;overflow:hidden;color:var(--theme-text-secondary) !important;font-size:.78rem;font-weight:400;line-height:1.1;text-align:center;text-overflow:ellipsis;white-space:nowrap; }
/* Белка и Стрелка: прогресс виден в магазине, а закрытые кадры остаются в витрине под замком. */
html:root body .vmesta-sticker-stage-info { display:grid;gap:.3rem;margin:.55rem 0;padding:.7rem .8rem;border-radius:.8rem;background:var(--theme-surface-control);color:var(--theme-text-primary); }
html:root body .vmesta-sticker-stage-info strong { font-size:.64rem; }
html:root body .vmesta-sticker-stage-info span { color:var(--theme-text-muted);font-size:.53rem;line-height:1.5; }
html:root body :is(.vmesta-sticker-grid,.vmesta-sticker-preview-grid) article.is-sticker-locked { position:relative; }
html:root body :is(.vmesta-sticker-grid,.vmesta-sticker-preview-grid) article.is-sticker-locked > .vmesta-sticker-media { filter:grayscale(.9) blur(1.5px);opacity:.35; }
html:root body .vmesta-sticker-stage-lock { position:absolute;left:50%;top:43%;display:grid;width:1.7rem;height:1.7rem;place-items:center;transform:translate(-50%,-50%);border-radius:.52rem;background:var(--theme-surface-panel);box-shadow:0 2px 10px #0002;font-size:.85rem; }
html:root body .level-trophy-fixed-note { margin:0;color:var(--theme-text-secondary);font-size:.55rem;line-height:1.5; }
html:root body .level-trophy-stage-list { display:flex;flex-wrap:wrap;gap:.35rem; }
html:root body .level-trophy-stage-list span { padding:.35rem .5rem;border-radius:.5rem;background:var(--theme-surface-control);color:var(--theme-text-primary);font-size:.52rem;font-weight:850; }
/* Вкладки журнала остаются в одну строку и прокручиваются при нехватке ширины. */
html:root body .signals-scope-tabs { display:flex;flex-wrap:nowrap;max-width:100%;gap:.4rem;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:var(--theme-accent) transparent;overscroll-behavior-inline:contain; }
html:root body .signals-scope-tabs > button { flex:0 0 auto;white-space:nowrap;padding-inline:.65rem; }
html:root body .signals-scope-tabs > button > span { white-space:nowrap; }
/* Основная кнопка импульса не должна получать белый фон от общей карточки. */
html:root body .signals-journal .signal-action.primary:not(.archive-restore):not(.share-discovery) { border-color:var(--theme-accent) !important;background:var(--theme-accent) !important;color:var(--theme-accent-contrast,#fff) !important;-webkit-text-fill-color:var(--theme-accent-contrast,#fff) !important; }
html:root body .signals-journal .signal-action.secondary { border-color:color-mix(in srgb,var(--theme-accent) 30%,var(--theme-divider)) !important;background:color-mix(in srgb,var(--theme-accent) 12%,var(--theme-surface-control)) !important;color:var(--theme-text-primary) !important;-webkit-text-fill-color:var(--theme-text-primary) !important; }
html:root body .signals-journal .signal-action.secondary > span { color:var(--theme-text-primary) !important;-webkit-text-fill-color:var(--theme-text-primary) !important;opacity:1 !important;visibility:visible !important; }
html:root body .signals-journal .signal-action.share-discovery { border-color:var(--theme-accent) !important;background:var(--theme-accent) !important;color:var(--theme-accent-contrast,#fff) !important;-webkit-text-fill-color:var(--theme-accent-contrast,#fff) !important; }
html:root body .signals-journal .signal-action.share-discovery > span { color:inherit !important;-webkit-text-fill-color:var(--theme-accent-contrast,#fff) !important;opacity:1 !important; }
html:root body .signals-journal .signal-action.archive:not(.archive-restore) { border-color:color-mix(in srgb,var(--theme-accent) 35%,var(--theme-border-subtle)) !important;background:color-mix(in srgb,var(--theme-accent) 12%,var(--theme-surface-control)) !important;color:var(--theme-accent) !important;-webkit-text-fill-color:var(--theme-accent) !important; }
html:root body .signals-journal .signal-action.archive:not(.archive-restore):hover { border-color:var(--theme-accent) !important;background:var(--theme-accent) !important;color:var(--theme-accent-contrast,#fff) !important;-webkit-text-fill-color:var(--theme-accent-contrast,#fff) !important; }
html:root body .signals-journal .signal-action.archive-restore { border-color:var(--theme-accent) !important;background:var(--theme-accent) !important;color:var(--theme-accent-contrast,#fff) !important;-webkit-text-fill-color:var(--theme-accent-contrast,#fff) !important; }
@media (max-width:620px) {
    html:root body .level-trophy-rule-fields { grid-template-columns:1fr; }
    html:root body .signal-trophy-card { grid-template-columns:3rem minmax(0,1fr); }
    html:root body .signal-trophy-card > :is(button,.signal-trophy-claimed) { grid-column:2;justify-self:start; }
}

/* Создание общего чата: поля и выбор людей различимы в светлой и тёмной темах. */
html:root body #messenger-new-modal > section { background:var(--theme-surface-panel) !important;color:var(--theme-text-primary) !important; }
html:root body #messenger-new-modal > section > header { border:0 !important;background:var(--theme-surface-nested) !important; }
html:root body #messenger-new-modal .messenger-room-create-form { gap:.65rem;background:var(--theme-surface-panel) !important; }
html:root body #messenger-new-modal .messenger-room-create-form > :is(label,fieldset) { border:0 !important;border-radius:.85rem;padding:.7rem;background:var(--theme-surface-nested) !important; }
html:root body #messenger-new-modal .messenger-room-create-form > label > span,
html:root body #messenger-new-modal .messenger-room-members-trigger b { color:var(--theme-text-primary) !important; }
html:root body #messenger-new-modal .messenger-room-create-form > label :is(input,textarea,select),
html:root body #messenger-new-modal .messenger-room-members-trigger,
html:root body #messenger-new-modal .messenger-room-candidate-search { border:0 !important;background:var(--theme-surface-control) !important;color:var(--theme-text-primary) !important;box-shadow:none !important; }
html:root body #messenger-new-modal .messenger-room-create-form > label :is(input,textarea,select)::placeholder,
html:root body #messenger-new-modal .messenger-room-candidate-search input::placeholder { color:var(--theme-text-muted) !important;opacity:1; }
html:root body #messenger-new-modal .messenger-room-members-fieldset .messenger-room-members { border:0 !important;background:var(--theme-surface-nested) !important; }
html:root body #messenger-new-modal .messenger-room-candidate-list > label { color:var(--theme-text-primary); }
html:root body #messenger-new-modal .messenger-room-candidate-list > label:has(input:checked) { background:var(--theme-surface-active) !important; }
html:root body #messenger-new-modal .messenger-room-candidate-list > label > i { display:grid;place-items:center;flex:none;width:1.05rem;height:1.05rem;border:1px solid var(--theme-divider) !important;border-radius:.32rem;background:var(--theme-surface-panel);font-size:.75rem;font-style:normal;font-weight:900;line-height:1; }
html:root body #messenger-new-modal .messenger-room-candidate-list > label:has(input:checked) > i { border:0 !important;background:var(--theme-accent) !important;box-shadow:none !important; }
html:root body #messenger-new-modal .messenger-room-candidate-list > label:has(input:checked) > i::after { content:"✓";color:var(--theme-accent-contrast,#fff); }
html:root body #messenger-new-modal .messenger-room-candidate-list > label:focus-within { outline:2px solid var(--theme-accent);outline-offset:2px; }
html:root body #messenger-new-modal .messenger-room-create-form > footer { background:var(--theme-surface-panel) !important; }

/* Компактная карточка прокручивается целиком: профиль уходит вверх, вкладки остаются видны. */
html:root body .messenger-room-panel-layer { inset:4.55rem 0 0 !important;align-items:flex-start;padding:.7rem; }
html:root body .messenger-room-panel-layer .messenger-room-panel { display:flex;flex-direction:column;width:min(26rem,calc(100vw - 1rem));height:min(31rem,calc(100% - .2rem));max-height:calc(100% - .2rem);overflow-x:hidden !important;overflow-y:auto !important;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--theme-accent) transparent; }
html:root body .messenger-room-panel > :is(header,nav) { flex:0 0 auto; }
html:root body .messenger-room-panel > nav { position:sticky;top:0;z-index:3;margin-top:.4rem !important;overflow-x:auto;overflow-y:hidden; }
html:root body .messenger-room-panel > section { flex:1 0 auto;min-height:7rem;overflow:visible !important; }
html:root body .messenger-room-panel > section .messenger-shared-attachments { grid-template-columns:repeat(3,minmax(0,1fr));max-height:none;min-height:0;overflow:visible; }

/* Вкладки остаются узкой лентой без полосы прокрутки; колесо листает их по горизонтали. */
html:root body .messenger-room-panel-layer .messenger-room-panel { padding-right:.16rem !important;scrollbar-color:color-mix(in srgb,var(--theme-accent) 72%,transparent) transparent; }
html:root body .messenger-room-panel-layer .messenger-room-panel::-webkit-scrollbar { width:.24rem;height:.24rem; }
html:root body .messenger-room-panel-layer .messenger-room-panel::-webkit-scrollbar-track { background:transparent; }
html:root body .messenger-room-panel-layer .messenger-room-panel::-webkit-scrollbar-thumb { border-radius:999px;background:color-mix(in srgb,var(--theme-accent) 72%,transparent); }
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .messenger-room-panel-layer .messenger-room-panel > nav { gap:.2rem;padding:.24rem .3rem !important;margin-top:.24rem !important;overflow-x:auto;overflow-y:hidden;scrollbar-width:none !important;-ms-overflow-style:none;scroll-snap-type:x proximity; }
html:root body .messenger-room-panel-layer .messenger-room-panel > nav::-webkit-scrollbar { display:none !important;width:0;height:0; }
html:root body .messenger-room-panel-layer .messenger-room-panel > nav button { min-width:0;min-height:1.78rem;padding:.26rem .38rem;border-radius:.5rem;white-space:nowrap;font-size:.53rem; }
html:root body .messenger-room-panel-layer .messenger-room-panel > nav .messenger-icon { width:.7rem;height:.7rem; }

/* В карточке комнаты участники используют общий скролл; в настройках полоса появляется только при длинном списке. */
html:root body .messenger-room-panel-layer .messenger-room-panel-members { max-height:none !important;overflow:visible !important;scrollbar-gutter:auto !important; }
html:root body .messenger-room-settings-modal .messenger-room-member-list { overflow-y:auto !important;scrollbar-gutter:auto !important; }

/* Панель действий вынесена из области прокрутки настроек: ползунок заканчивается ровно над ней. */
html:root body .messenger-room-settings-modal .messenger-room-settings-form { display:grid;grid-template-rows:minmax(0,1fr) auto;gap:0;min-height:0;overflow:hidden !important;padding:0 !important; }
html:root body .messenger-room-settings-modal .messenger-room-settings-scroll { display:grid;align-content:start;gap:.58rem;min-height:0;overflow-x:hidden;overflow-y:auto;padding:.72rem .82rem .75rem;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--theme-accent) 68%,transparent) transparent; }
html:root body .messenger-room-settings-modal .messenger-room-settings-scroll::-webkit-scrollbar { width:.26rem; }
html:root body .messenger-room-settings-modal .messenger-room-settings-scroll::-webkit-scrollbar-track { background:transparent; }
html:root body .messenger-room-settings-modal .messenger-room-settings-scroll::-webkit-scrollbar-thumb { border-radius:999px;background:color-mix(in srgb,var(--theme-accent) 68%,transparent); }
html:root body .messenger-room-settings-modal .messenger-room-settings-scroll > label { display:grid;gap:.32rem; }
html:root body .messenger-room-settings-modal .messenger-room-settings-scroll > label > span { color:var(--msg-muted);font-size:.66rem;font-weight:850; }
html:root body .messenger-room-settings-modal .messenger-room-settings-form > footer { position:relative !important;bottom:auto !important;box-sizing:border-box;width:100% !important;margin:0 !important;padding:.55rem .82rem .68rem !important;border-top:1px solid color-mix(in srgb,var(--theme-accent) 13%,transparent) !important;border-radius:0 !important;box-shadow:none !important; }

/* Приветственное письмо пользуется теми же инструментами, что и описание. */
html:root body .messenger-room-welcome-settings > label:not(.messenger-room-welcome-picker) { display:grid;min-width:0;align-content:start;gap:.3rem; }
html:root body .messenger-room-welcome-settings > label:not(.messenger-room-welcome-picker) > span:first-child { color:var(--msg-text);font-size:.68rem;font-weight:900; }
html:root body .messenger-room-welcome-field textarea { resize:none !important; }

/* Участники открываются отдельной плоскостью поверх настроек, с одной прокруткой на весь список. */
html:root body .messenger-room-settings-modal > section { position:relative; }
html:root body .messenger-room-settings-modal .messenger-room-members-trigger { display:grid;grid-template-columns:1.7rem minmax(0,1fr) auto .9rem;align-items:center;gap:.55rem;width:100%;min-height:3.3rem;margin:.15rem 0 0;padding:.6rem .75rem;border:0;border-radius:.85rem;background:var(--room-tone-2,var(--theme-surface-nested));color:var(--theme-text-primary);text-align:left;cursor:pointer; }
html:root body .messenger-room-settings-modal .messenger-room-members-trigger:hover { background:var(--room-tone-3,var(--theme-surface-control)); }
html:root body .messenger-room-members-trigger > .messenger-icon { width:1rem;height:1rem;color:var(--theme-accent); }
html:root body .messenger-room-members-trigger > span { display:grid;gap:.1rem;min-width:0; }
html:root body .messenger-room-members-trigger b { font-size:.68rem; }
html:root body .messenger-room-members-trigger small { overflow:hidden;color:var(--theme-text-muted);font-size:.55rem;text-overflow:ellipsis;white-space:nowrap; }
html:root body .messenger-room-members-trigger em { display:grid;min-width:1.4rem;height:1.4rem;place-items:center;border-radius:999px;background:var(--room-tone-4,var(--theme-surface-control));color:var(--theme-accent);font-size:.57rem;font-style:normal;font-weight:900; }
html:root body .messenger-room-settings-modal .messenger-room-members-overlay { position:absolute;z-index:10;inset:0;display:grid;grid-template-rows:auto minmax(0,1fr);min-width:0;min-height:0;background:var(--room-tone-1,var(--theme-surface-panel)); }
html:root body .messenger-room-settings-modal .messenger-room-members-overlay[hidden] { display:none !important; }
html:root body .messenger-room-members-overlay > header { display:grid;grid-template-columns:2.2rem minmax(0,1fr) 2.2rem;align-items:center;gap:.65rem;padding:.75rem 1rem;border-bottom:1px solid color-mix(in srgb,var(--theme-accent) 13%,transparent);background:var(--room-tone-2,var(--theme-surface-nested)); }
html:root body .messenger-room-members-overlay > header > span { display:grid;gap:.12rem;min-width:0; }
html:root body .messenger-room-members-overlay > header small { color:var(--theme-accent);font-size:.48rem;font-weight:900;letter-spacing:.12em; }
html:root body .messenger-room-members-overlay > header strong { color:var(--theme-text-primary);font-size:.86rem; }
html:root body .messenger-room-members-overlay > header em { margin-left:.2rem;color:var(--theme-accent);font-size:.65rem;font-style:normal; }
html:root body .messenger-room-members-overlay > header > button { display:grid;width:2.2rem;height:2.2rem;place-items:center;border:0;border-radius:.65rem;background:var(--room-tone-3,var(--theme-surface-control));color:var(--theme-accent);cursor:pointer; }
html:root body .messenger-room-members-overlay > header > button .messenger-icon { width:.82rem;height:.82rem; }
html:root body .messenger-room-members-overlay-body { min-height:0;overflow-x:hidden;overflow-y:auto;padding:.8rem 1rem 1rem;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--theme-accent) 68%,transparent) transparent; }
html:root body .messenger-room-members-overlay-body::-webkit-scrollbar { width:.26rem; }
html:root body .messenger-room-members-overlay-body::-webkit-scrollbar-track { background:transparent; }
html:root body .messenger-room-members-overlay-body::-webkit-scrollbar-thumb { border-radius:999px;background:color-mix(in srgb,var(--theme-accent) 68%,transparent); }
html:root body .messenger-room-members-overlay-body .messenger-room-members-manage { min-height:100%;align-content:start; }
html:root body .messenger-room-members-overlay-body .messenger-room-members-head { grid-template-columns:minmax(0,1fr) !important; }
html:root body .messenger-room-members-overlay-body .messenger-room-members-head h3 { display:none !important; }
html:root body .messenger-room-members-overlay-body .messenger-room-member-search.is-inline { width:100% !important;margin:0 !important; }
html:root body .messenger-room-members-overlay-body .messenger-room-member-list { max-height:none !important;overflow:visible !important;scrollbar-gutter:auto !important; }

/* Настройки комнаты: ровные секции и читаемая ссылка во всех темах. */
html:root body .messenger-room-settings-modal .messenger-room-settings-scroll > .messenger-room-identity,
html:root body .messenger-room-settings-modal .messenger-room-settings-scroll > label {
    min-width:0;
    padding:.72rem .8rem;
    border:0;
    border-radius:.82rem;
    background:var(--room-tone-2,var(--theme-surface-nested));
}
html:root body .messenger-room-settings-modal .messenger-room-settings-scroll > .messenger-room-identity { gap:.55rem; }
html:root body .messenger-room-settings-modal .messenger-room-settings-scroll > label > .messenger-room-field-note { margin:0;line-height:1.4; }
html:root body .messenger-room-settings-modal .messenger-room-invite-settings {
    grid-template-columns:minmax(0,1fr) auto auto;
    gap:.5rem;
    min-width:0;
    padding:.65rem .75rem;
    border:0 !important;
    border-radius:.82rem;
    background:var(--room-tone-2,var(--theme-surface-nested)) !important;
}
html:root body .messenger-room-settings-modal .messenger-room-invite-settings > div { gap:.18rem; }
html:root body .messenger-room-settings-modal .messenger-room-invite-settings strong { display:block;min-width:0;font-size:.59rem;line-height:1.35;text-overflow:ellipsis;white-space:nowrap; }
html:root body .messenger-room-settings-modal .messenger-room-invite-settings button { min-height:1.85rem;padding:.35rem .48rem;border:0;border-radius:.52rem;background:var(--room-tone-3,var(--theme-surface-control));font-size:.55rem; }
html:root body .messenger-room-settings-modal .messenger-room-settings-form .messenger-room-policy { border:0 !important;border-radius:.82rem;background:var(--room-tone-2,var(--theme-surface-nested)) !important; }
html:root body .messenger-room-settings-modal .messenger-room-settings-form .messenger-room-policy-toggle { min-height:3rem !important;padding:.65rem .75rem !important;background:transparent !important; }
html:root body .messenger-room-settings-modal .messenger-room-settings-form .messenger-room-policy-toggle:hover { background:var(--room-tone-3,var(--theme-surface-control)) !important; }
html:root body .messenger-room-settings-modal .messenger-room-policy-content > .messenger-room-permission-rule { margin:.52rem 0 !important;padding:.65rem .7rem !important;border:0 !important;box-shadow:none !important; }
html:root body .messenger-room-settings-modal .messenger-room-policy-content > .messenger-room-permission-rule + label { border-top:0 !important; }
@media (max-width:620px) {
    html:root body .messenger-room-settings-modal .messenger-room-invite-settings { grid-template-columns:repeat(2,minmax(0,1fr)); }
    html:root body .messenger-room-settings-modal .messenger-room-invite-settings > div { grid-column:1/-1; }
    html:root body .messenger-room-settings-modal .messenger-room-invite-settings button { justify-content:center; }
}

/* Опасные действия остаются красными при любой выбранной палитре. */
html:root body .messenger-room-settings-modal .messenger-room-settings-form > footer .messenger-room-delete,
html:root body .messenger-room-settings-modal .messenger-room-member-actions-menu button.is-danger,
html:root body .messenger-room-settings-modal .messenger-room-settings-header-actions > .messenger-room-settings-leave {
    background:color-mix(in srgb,#ef4444 10%,var(--theme-surface-panel)) !important;
    color:#dc2626 !important;
}
html:root.dark body .messenger-room-settings-modal .messenger-room-settings-form > footer .messenger-room-delete,
html:root.dark body .messenger-room-settings-modal .messenger-room-member-actions-menu button.is-danger { color:#fb7185 !important; }
html:root body .messenger-room-settings-modal .messenger-room-settings-form > footer .messenger-room-delete:is(:hover,:focus-visible),
html:root body .messenger-room-settings-modal .messenger-room-member-actions-menu button.is-danger:is(:hover,:focus-visible),
html:root body .messenger-room-delete-confirm .messenger-delete-actions button.is-danger:is(:hover,:focus-visible) { background:#dc2626 !important;color:#fff !important; }
html:root body .messenger-room-settings-modal .messenger-room-member-list article.is-blacklisted { background:color-mix(in srgb,#ef4444 8%,var(--theme-surface-nested)) !important; }
html:root body .messenger-room-settings-modal .messenger-room-member-list article.is-blacklisted small { color:#dc2626 !important; }

/* Полученная ступень трофейного набора видна при открытии стикеров. */
html:root body .vmesta-sticker-stage-achievement { display:flex;align-items:center;gap:.65rem;margin:.55rem 0;padding:.75rem .85rem;border-radius:.82rem;background:color-mix(in srgb,var(--theme-accent) 13%,var(--theme-surface-panel));color:var(--theme-text-primary); }
html:root body .vmesta-sticker-stage-achievement > span { display:grid;flex:none;width:2rem;height:2rem;place-items:center;border-radius:.58rem;background:var(--theme-surface-panel);color:var(--theme-accent);font-size:1.15rem; }
html:root body .vmesta-sticker-stage-achievement > div { display:grid;gap:.15rem;min-width:0; }
html:root body .vmesta-sticker-stage-achievement small { color:var(--theme-accent) !important;font-size:.48rem;font-weight:900;letter-spacing:.08em; }
html:root body .vmesta-sticker-stage-achievement strong { font-size:.69rem;line-height:1.3; }
html:root body .vmesta-sticker-stage-achievement p { margin:0;font-size:.53rem;line-height:1.35; }

/* Голосовые: волна занимает всю доступную ширину пузыря во всех типах чатов. */
html:root body .messenger-voice-note .messenger-voice-note-content { width:100%;min-width:0; }
html:root body .messenger-voice-note .messenger-voice-note-top { width:100%;min-width:0; }
html:root body .messenger-voice-note .messenger-voice-note-top .messenger-voice-wave { width:100% !important;max-width:none !important;min-width:0 !important;flex:1 1 0 !important; }
html:root body .messenger-voice-note .messenger-voice-wave > span { width:100%;justify-content:space-between;gap:.015rem; }
html:root body .messenger-voice-note .messenger-voice-wave i { width:.075rem;min-width:.045rem;max-width:.075rem;flex:0 1 .075rem; }
html:root body .messenger-message:has(.messenger-voice-note.is-uploading) .messenger-bubble,
html:root body .messenger-message:has(.messenger-video-note.is-uploading) .messenger-bubble { animation:none !important; }

/* Запись в группе использует ту же полную строку, что и личный диалог. */
html:root body .messenger-conversation .messenger-composer.is-recording:not(.has-recording-draft) { display:grid !important;grid-template-columns:minmax(0,1fr) !important;align-items:stretch !important; }
html:root body .messenger-conversation .messenger-composer.is-recording:not(.has-recording-draft) > .messenger-recording-panel.is-active { grid-column:1/-1 !important;width:100% !important;max-width:none !important;min-width:0 !important;box-sizing:border-box !important; }
html:root body .messenger-recording-panel.is-active:not(.is-draft) .messenger-recording-status { min-width:0; }
html:root body .messenger-recording-panel.is-active:not(.is-draft) .messenger-recording-status > span { display:none !important; }
html:root body .messenger-recording-panel.is-active:not(.is-draft) .messenger-recording-wave { width:100% !important;max-width:none !important;min-width:0 !important; }

/* Верхний плеер не закрывает дату и первые сообщения; скорость и закрытие разнесены. */
html:root body .messenger-conversation .messenger-inline-media-bar { grid-template-columns:1.8rem minmax(0,1fr) 2.2rem 1.8rem;gap:.58rem;padding:.38rem .58rem !important;border-radius:.85rem !important;box-shadow:0 .2rem .65rem color-mix(in srgb,#020617 9%,transparent) !important; }
html:root body .messenger-conversation .messenger-inline-media-bar > [data-role="speed"] { margin-right:.12rem; }
html:root body .messenger-conversation .messenger-inline-media-bar > .messenger-inline-media-close { margin-left:.12rem; }

/* Редактор голосового и видеокружка: кадр на паузе, видимый курсор и симметричные края. */
html:root body .messenger-recording-panel.is-draft > .messenger-recording-draft.is-video > video { position:absolute;z-index:45;bottom:calc(100% + .75rem);left:50%;display:block !important;width:clamp(8rem,22vw,13rem) !important;height:auto !important;aspect-ratio:1;object-fit:cover;border:.14rem solid var(--theme-accent,var(--msg-accent));border-radius:50%;background:var(--theme-surface-control,var(--msg-panel));box-shadow:0 .35rem 1rem color-mix(in srgb,#020617 13%,transparent);transform:translateX(-50%);pointer-events:none; }
html:root body .messenger-recording-panel.is-draft .messenger-recording-trim > .messenger-recording-playhead { position:absolute !important;z-index:7 !important;top:.1rem !important;bottom:.1rem !important;left:clamp(.28rem,var(--playhead,0%),calc(100% - .28rem)) !important;display:block !important;width:.14rem !important;min-width:.14rem !important;height:auto !important;padding:0 !important;border-radius:.12rem !important;background:#ef4444 !important;box-shadow:0 0 0 .05rem var(--theme-surface-panel,var(--msg-panel));transform:translateX(-50%);pointer-events:none; }
html:root body .messenger-recording-panel.is-draft .messenger-recording-trim > .messenger-recording-playhead::before { content:"";position:absolute;top:-.04rem;left:50%;width:.4rem;height:.4rem;border-radius:50%;background:#ef4444;transform:translateX(-50%); }
html:root body .messenger-recording-panel.is-draft .messenger-recording-trim > input.is-start,
html:root body .messenger-recording-panel.is-draft .messenger-recording-trim > input.is-end { right:.28rem !important;left:.28rem !important;width:calc(100% - .56rem) !important; }
html:root body .messenger-recording-panel.is-draft .messenger-recording-trim > .messenger-recording-draft-play.messenger-recording-draft-play { z-index:8 !important;min-width:5.3rem !important;gap:.2rem !important;border-radius:.55rem !important; }
html:root body .messenger-recording-panel.is-draft .messenger-recording-draft-play-symbol { display:inline-grid !important;flex:none !important; }
html:root body .messenger-recording-panel.is-draft .messenger-recording-draft-play output { display:inline !important;min-width:0 !important;font-variant-numeric:tabular-nums; }
html:root body .messenger-recording-panel.is-draft .messenger-recording-time-separator { color:var(--theme-text-inverse,#fff);opacity:.72;font-size:.55rem; }
@media (max-width:560px) { html:root body .messenger-recording-panel.is-draft > .messenger-recording-draft.is-video > video { width:9rem !important; } }

/* Меню участника: роли сверху, опасные действия вместе снизу; полный пункт
   виден даже у верхней и нижней границы прокручиваемого списка. */
html:root body .messenger-room-members-overlay-body.has-open-member-menu { padding-bottom:max(1rem,var(--room-member-menu-space,1rem)) !important; }
html:root body .messenger-room-members-overlay-body .messenger-room-member-actions-menu {
    top:calc(100% + .32rem);
    bottom:auto;
    width:max-content;
    max-width:min(13.25rem,calc(100vw - 2rem));
    padding:.4rem .34rem;
    gap:.12rem;
    border-radius:.7rem;
}
html:root body .messenger-room-members-overlay-body .messenger-room-member-actions.opens-up .messenger-room-member-actions-menu {
    top:auto;
    bottom:calc(100% + .32rem);
}
html:root body .messenger-room-members-overlay-body .messenger-room-member-actions-menu > button {
    min-height:1.95rem;
    padding:.47rem .55rem;
    white-space:nowrap;
}

/* Реальная форма записи, видимый Play/Pause и цельная правая граница обрезки. */
html:root body .messenger-recording-panel.is-draft .messenger-recording-trim > .messenger-recording-draft-play.messenger-recording-draft-play { min-width:6.1rem !important;gap:.24rem !important; }
html:root body .messenger-recording-panel.is-draft .messenger-recording-draft-play-symbol { width:.78rem !important;min-width:.78rem !important;height:.78rem !important;place-items:center !important;color:#fff !important; }
html:root body .messenger-recording-panel.is-draft .messenger-recording-draft-play-symbol::before { content:"";display:block;width:0;height:0;border-top:.27rem solid transparent;border-bottom:.27rem solid transparent;border-left:.44rem solid currentColor;transform:translateX(.05rem); }
html:root body .messenger-recording-panel.is-draft .messenger-recording-draft-play.is-playing-icon .messenger-recording-draft-play-symbol::before { width:.47rem;height:.58rem;border:0;background:linear-gradient(90deg,currentColor 0 32%,transparent 32% 67%,currentColor 67% 100%);transform:none; }
html:root body .messenger-recording-panel.is-draft .messenger-recording-trim { cursor:pointer; }
html:root body .messenger-recording-panel.is-draft .messenger-recording-trim > .messenger-recording-trim-wave.messenger-recording-trim-wave { pointer-events:none !important; }
html:root body .messenger-recording-panel.is-draft .messenger-recording-trim > i { background:color-mix(in srgb,var(--theme-accent,var(--msg-accent)) 20%,var(--theme-surface-panel,var(--msg-panel))) !important;box-shadow:inset .22rem 0 var(--theme-accent,var(--msg-accent)),inset -.22rem 0 var(--theme-accent,var(--msg-accent)) !important; }
html:root body .messenger-recording-panel.is-draft .messenger-recording-trim > i::after { content:"";position:absolute;top:0;right:0;bottom:0;width:.24rem;border-radius:.12rem;background:var(--theme-accent,var(--msg-accent)); }
html:root body .messenger-recording-panel.is-draft .messenger-recording-trim > input.is-start::-webkit-slider-thumb,
html:root body .messenger-recording-panel.is-draft .messenger-recording-trim > input.is-end::-webkit-slider-thumb { background:var(--theme-accent,var(--msg-accent)) !important;box-shadow:0 0 0 .09rem color-mix(in srgb,var(--theme-accent,var(--msg-accent)) 15%,var(--theme-surface-panel,var(--msg-panel))) !important; }
html:root body .messenger-recording-panel.is-draft .messenger-recording-trim > input.is-start::-moz-range-thumb,
html:root body .messenger-recording-panel.is-draft .messenger-recording-trim > input.is-end::-moz-range-thumb { background:var(--theme-accent,var(--msg-accent)) !important;box-shadow:0 0 0 .09rem color-mix(in srgb,var(--theme-accent,var(--msg-accent)) 15%,var(--theme-surface-panel,var(--msg-panel))) !important; }
html:root body .messenger-recording-panel.is-active:not(.is-draft) .messenger-recording-status > span { display:block !important;max-width:8rem;min-width:0; }
@media (max-width:700px) { html:root body .messenger-recording-panel.is-active:not(.is-draft) .messenger-recording-status > span { max-width:5.5rem;font-size:.48rem; } }

/* Одинаковая компактная дистанция от шапки до ленты и более узкие разделители дней. */
html:root body .messenger-conversation .messenger-message-stream { padding-top:.85rem !important; }
html:root body .messenger-conversation .messenger-day-divider { margin:.5rem 0 !important; }
/* Верхний плеер сдвигает только плавающую дату, не добавляя второй отступ ленте. */
html:root body .messenger-conversation.has-inline-media .messenger-message-stream { padding-top:.85rem !important; }
html:root body .messenger-conversation.has-inline-media .messenger-active-day { top:max(.25rem,var(--inline-media-clearance,.25rem)) !important; }

/* В группе аватар закрывает и собственную пачку сообщений при смене отправителя. */
html:root body .messenger-conversation.is-room-chat .messenger-message.is-outgoing:has(> .messenger-room-message-avatar) { padding-right:2.7rem !important; }
html:root body .messenger-conversation.is-room-chat .messenger-message.is-outgoing > .messenger-room-message-avatar { left:auto !important;right:.18rem;bottom:.22rem;z-index:2; }

/* Иконка редактора — настоящее SVG, видимое в светлой и тёмной палитрах. */
html:root body .messenger-recording-panel.is-draft .messenger-recording-draft-play-symbol::before { content:none !important;display:none !important; }
html:root body .messenger-recording-panel.is-draft .messenger-recording-draft-play-symbol .messenger-icon,
html:root body .messenger-recording-panel.is-draft .messenger-recording-draft-play-symbol svg { display:block !important;width:.78rem !important;height:.78rem !important;color:#fff !important;stroke:currentColor !important;fill:none !important;opacity:1 !important; }

/* Панель смайликов не даёт белого свечения в тёмной палитре. */
html:root:is(.adaptive-theme, :not(.adaptive-theme)):is(.theme-monet-active, :not(.theme-monet-active)) body .emoji-picker-expanded.emoji-picker-expanded { box-shadow:none !important; }

/* Поиск чата — единая поверхность без второго прямоугольника внутри. */
html:root body.messages-route #messages-root .messenger-chat-search .messenger-chat-search-field,
html:root body.messages-route #messages-root .messenger-chat-search .messenger-chat-search-field:focus-within,
html:root body.messages-route #messages-root .messenger-chat-search .messenger-chat-search-field > input { background:transparent !important;box-shadow:none !important; }

/* Месяц и год раскрываются внутри календаря, а не системным выпадающим окном. */
html:root body .messenger-day-calendar { overflow:visible; }
html:root body .messenger-day-calendar > header { position:relative;z-index:2; }
html:root body .messenger-day-calendar > header > div { min-width:0; }
html:root body .messenger-calendar-picker { position:relative;min-width:0; }
html:root body .messenger-calendar-picker > button { display:flex;width:100%;height:2.15rem;align-items:center;justify-content:space-between;gap:.35rem;padding:0 .55rem;border:1px solid var(--msg-line);border-radius:.68rem;background:var(--msg-bg);color:var(--msg-text);font-size:.72rem;font-weight:800;text-align:left;text-transform:capitalize;cursor:pointer; }
html:root body .messenger-calendar-picker > button .messenger-icon { width:.7rem;height:.7rem;flex:none;color:var(--msg-accent); }
html:root body .messenger-calendar-picker-menu { position:absolute;z-index:5;top:calc(100% + .2rem);left:0;right:0;max-height:10.5rem;overflow-y:auto;overscroll-behavior:contain;padding:.2rem;border:1px solid var(--msg-line);border-radius:.7rem;background:var(--msg-panel);box-shadow:0 .55rem 1.4rem rgb(2 6 23/.18);scrollbar-width:thin; }
html:root body .messenger-calendar-picker-menu[hidden] { display:none !important; }
html:root body .messenger-calendar-picker-menu > button { display:block;width:100%;min-height:1.75rem;padding:.35rem .5rem;border:0;border-radius:.45rem;background:transparent;color:var(--msg-text);font:inherit;font-size:.68rem;font-weight:750;text-align:left;text-transform:capitalize;cursor:pointer; }
html:root body .messenger-calendar-picker-menu > button:is(:hover,.is-selected) { background:var(--msg-accent-soft);color:var(--msg-accent); }

/* Живой статус: три точки проявляются поочерёдно, без сдвига строки. */
html:root body :is(#messenger-peer-activity,.messenger-chat-preview.is-activity) .messenger-live-activity { display:inline-flex;max-width:100%;align-items:center;gap:.22rem;vertical-align:middle; }
html:root body .messenger-live-activity .messenger-activity-glyph { display:inline-flex;flex:none;color:var(--msg-accent);animation:messenger-activity-pulse 1.45s ease-in-out infinite; }
html:root body .messenger-live-activity .messenger-activity-glyph .messenger-icon { width:.7rem;height:.7rem; }
html:root body .messenger-live-activity .messenger-activity-text { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
html:root body .messenger-live-activity .messenger-activity-dots { display:inline-block;width:1rem;flex:none;overflow:hidden;color:var(--msg-accent);font-size:.58rem;letter-spacing:.08rem;line-height:1;white-space:nowrap; }
html:root body .messenger-live-activity .messenger-activity-dots::before { content:'•••';display:block;width:100%;animation:messenger-activity-dots 1.35s steps(3,end) infinite; }
@keyframes messenger-activity-dots { 0%{clip-path:inset(0 100% 0 0)} 75%,100%{clip-path:inset(0 0 0 0)} }
@keyframes messenger-activity-pulse { 0%,100%{opacity:.56;transform:translateY(0)} 50%{opacity:1;transform:translateY(-.09rem)} }
@media (prefers-reduced-motion:reduce) { html:root body .messenger-live-activity .messenger-activity-glyph,html:root body .messenger-live-activity .messenger-activity-dots::before { animation:none !important;clip-path:none !important; } }

html:root body .messenger-chat-preview .messenger-preview-icon { display:inline-flex;width:.85rem;height:.85rem;align-items:center;justify-content:center;margin-right:.2rem;color:var(--msg-accent);vertical-align:-.12rem; }
html:root body .messenger-chat-preview .messenger-preview-icon .messenger-icon { width:.8rem;height:.8rem; }

/* Ненайденные публичные адреса остаются самостоятельным экраном, без старой шапки профиля. */
html:root body.vmesta-not-found-route #cover-section,
html:root body.vmesta-not-found-route #profile-left-rail,
html:root body.vmesta-not-found-route #profile-right-rail,
html:root body.vmesta-not-found-route #profile-tabs-container { display:none !important; }
html:root body.vmesta-not-found-route #content-main { grid-column:1 / -1;width:min(100%,54rem);margin-inline:auto; }
html:root body .space-not-found-visual { width:clamp(10rem,20vw,13rem);height:clamp(10rem,20vw,13rem); }
html:root body .space-not-found-visual svg { width:72%;height:72%; }
html:root body .space-not-found-actions { display:flex;align-items:center;justify-content:center;gap:.65rem;flex-wrap:wrap; }
html:root body .space-not-found-actions .space-not-found-action { margin-top:12px; }
html:root body .space-not-found-action { display:inline-flex;align-items:center;justify-content:center;text-decoration:none; }
html:root body .space-not-found-action.is-secondary { background:var(--msg-panel,#fff);color:var(--space-missing-accent,#219653);border:1px solid currentColor; }

/* Одна выразительная SVG-иконка для потерянного профиля и пространства. */
html:root body .space-not-found-visual { width:clamp(11rem,21vw,13.5rem);height:clamp(11rem,21vw,13.5rem);border-radius:2.25rem;color:var(--space-missing-accent);background:linear-gradient(145deg,color-mix(in srgb,var(--space-missing-accent) 15%,var(--adaptive-surface,var(--standard-panel,#fff))),color-mix(in srgb,var(--space-missing-accent) 4%,var(--adaptive-surface,var(--standard-panel,#fff))));box-shadow:inset 0 1px color-mix(in srgb,#fff 55%,transparent),0 1.3rem 3rem color-mix(in srgb,var(--space-missing-accent) 13%,transparent); }
html:root body .space-not-found-visual svg { width:82%;height:82%;overflow:visible; }
html:root body .space-missing-halo { fill:none;stroke:currentColor;stroke-width:1.5;stroke-dasharray:2.5 7;opacity:.36; }
html:root body .space-missing-lens { stroke:currentColor;stroke-width:4; }
html:root body .space-missing-handle { fill:none;stroke:currentColor;stroke-width:13;stroke-linecap:round;opacity:.9; }
html:root body .space-missing-compass { fill:color-mix(in srgb,currentColor 27%,transparent);stroke:currentColor;stroke-width:3.2;stroke-linejoin:round; }
html:root body .space-missing-center { fill:currentColor; }
html:root body .space-missing-spark { fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;opacity:.72; }
html.vmesta-public-handle-loading body #profile-layout-grid > :not(#vmesta-handle-loading),
html.vmesta-public-handle-loading body #cover-section,
html.vmesta-public-handle-loading body #profile-tabs-container { visibility:hidden; }
html:root body #vmesta-handle-loading { display:none; }
html.vmesta-public-handle-loading body #vmesta-handle-loading { position:absolute;inset:5rem 1rem auto;display:flex;min-height:16rem;align-items:center;justify-content:center;flex-direction:column;gap:.75rem;color:var(--vmesta-ui-muted,#7087aa);font-size:.78rem;font-weight:800;text-align:center; }
html.vmesta-known-missing-route body #vmesta-handle-loading { visibility:hidden; }

/* Этапы трофейных наборов: порог и суммарное число открытых кадров. */
html:root body .level-trophy-stage-editor { grid-column:1/-1;display:grid;gap:.45rem;padding:.65rem;border:1px solid var(--theme-border-subtle);border-radius:.75rem;background:var(--theme-surface-panel); }
html:root body .level-trophy-stage-editor > strong { font-size:.68rem;color:var(--theme-text-primary); }
html:root body .level-trophy-stage-editor > small { color:var(--theme-text-muted);font-size:.53rem;line-height:1.4; }
html:root body .level-trophy-stage-editor [data-trophy-stages] { display:grid;gap:.35rem; }
html:root body .level-trophy-stage-row { display:grid;grid-template-columns:1.5rem minmax(0,1fr) minmax(0,1fr) 2rem;align-items:end;gap:.4rem; }
html:root body .level-trophy-stage-row > b { align-self:center;color:var(--theme-accent);font-size:.7rem;text-align:center; }
html:root body .level-settings-group .level-trophy-stage-row > label { display:flex;flex-direction:column;align-items:stretch;gap:.25rem;min-width:0;margin:0;border:0 !important;border-radius:0;padding:0 !important;background:transparent !important;color:var(--theme-text-secondary);font-size:.55rem;font-weight:850;line-height:1.25;white-space:nowrap; }
html:root body .level-trophy-stage-row input { width:100%;min-width:0;min-height:2.1rem;border:1px solid var(--theme-border-subtle);border-radius:.55rem;padding:.3rem .5rem;background:var(--theme-surface-control);color:var(--theme-text-primary);font-size:.62rem; }
html:root body .level-trophy-stage-row > button { min-height:2.1rem;border:0;border-radius:.55rem;background:var(--theme-surface-control);color:var(--theme-accent);font-size:1rem;cursor:pointer; }
html:root body .level-trophy-stage-row > button:disabled { opacity:.4;cursor:default; }
html:root body .level-trophy-add-stage { justify-self:start;min-height:2rem;border:1px solid var(--theme-border-subtle);border-radius:.55rem;padding:.3rem .65rem;background:var(--theme-surface-control);color:var(--theme-accent);font-size:.55rem;font-weight:900;cursor:pointer; }

/* Происхождение набора располагается рядом с названием, а не отдельной пустой строкой. */
html:root body .vmesta-sticker-title-line { display:flex;align-items:center;gap:.3rem;min-width:0; }
html:root body .vmesta-sticker-title-line :is(h3,h4,strong) { min-width:0;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
html:root body .vmesta-sticker-title-line .vmesta-sticker-origin-badge { flex:none; }

/* Убираем декоративные обводки только у отмеченных пользователем элементов. */
html:root body .messenger-chat-menu button.is-active-action,
html:root body .messenger-chat-menu button.is-active-action:hover {
    border: 0 !important;
    box-shadow: none !important;
}
html:root body #settings-dropdown #menu-main-content > button:not([onclick*="logout"]):is(:hover, :focus-visible) {
    border-color: transparent !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
}
html:root body #settings-dropdown #menu-main-content > button:not([onclick*="logout"]):focus-visible {
    color: var(--vmesta-ui-primary) !important;
    text-decoration: underline;
    text-underline-offset: .2rem;
}
html:root body .gift-center-tabs button,
html:root body .gift-center-tabs button:is(:hover, :focus-visible, .is-active, [aria-selected="true"]) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}
html:root body .spaces-index-filter-panel {
    border: 0 !important;
    outline: 0 !important;
}

/* Пустое меню пространств: маленькая живая галактика без связи. */
html:root body #top-spaces-dropdown .top-spaces-empty-scene {
    width: 10rem;
    height: 6.5rem;
    margin: -.35rem auto .35rem;
    color: var(--vmesta-ui-primary, var(--theme-accent));
}
html:root body #top-spaces-dropdown .top-spaces-empty-scene svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}
html:root body #top-spaces-dropdown .top-spaces-empty-halo {
    fill: color-mix(in srgb, currentColor 8%, transparent);
    stroke: color-mix(in srgb, currentColor 20%, transparent);
    stroke-width: 1;
    animation: top-spaces-halo 3s ease-in-out infinite;
}
html:root body #top-spaces-dropdown .top-spaces-empty-orbit {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-dasharray: 90 18;
    opacity: .55;
    animation: top-spaces-orbit 5s linear infinite;
}
html:root body #top-spaces-dropdown .top-spaces-empty-planet {
    animation: top-spaces-float 3s ease-in-out infinite;
}
html:root body #top-spaces-dropdown .top-spaces-empty-planet circle {
    fill: color-mix(in srgb, currentColor 35%, var(--theme-surface-panel));
    stroke: currentColor;
    stroke-width: 1.7;
}
html:root body #top-spaces-dropdown .top-spaces-empty-planet path {
    fill: none;
    stroke: color-mix(in srgb, currentColor 65%, var(--theme-surface-panel));
    stroke-width: 2;
    stroke-linecap: round;
}
html:root body #top-spaces-dropdown .top-spaces-empty-moon {
    fill: var(--theme-warning);
    animation: top-spaces-halo 2.3s ease-in-out infinite reverse;
}
html:root body #top-spaces-dropdown .top-spaces-empty-star {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    animation: top-spaces-stars 2.5s ease-in-out infinite;
}
html:root body #top-spaces-dropdown .top-spaces-empty-signal {
    fill: none;
    stroke: var(--theme-text-muted);
    stroke-width: 2;
    stroke-linecap: round;
    animation: top-spaces-signal 2s ease-in-out infinite;
}
html:root body #top-spaces-dropdown .top-spaces-empty-signal-slash {
    stroke: var(--theme-danger);
    stroke-width: 2.4;
}
@keyframes top-spaces-float { 50% { transform: translateY(-4px); } }
@keyframes top-spaces-halo { 50% { opacity: .4; transform: scale(1.05); transform-origin: 74px 51px; } }
@keyframes top-spaces-orbit { to { stroke-dashoffset: -108; } }
@keyframes top-spaces-stars { 50% { opacity: .35; } }
@keyframes top-spaces-signal { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
    html:root body #top-spaces-dropdown .top-spaces-empty-scene * { animation: none !important; }
}
