        .chat-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        }
        .unread {
            border-left: 4px solid #3b82f6;
        }
        /* Название объявления — ссылка без «браузерного» синего/подчёркивания */
        #chatHeaderProduct a {
            color: inherit;
            text-decoration: none;
        }
        #chatHeaderProduct a:hover,
        #chatHeaderProduct a:visited {
            color: inherit;
            text-decoration: none;
        }
        .chat-preview {
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: auto;
        }
        .messenger-layout {
            display: flex;
            align-items: stretch;
            flex: 1 1 0;
            min-height: 0;
            height: calc(100vh - var(--zeno-chats-viewport-offset));
            height: calc(100dvh - var(--zeno-chats-viewport-offset));
            max-height: calc(100vh - var(--zeno-chats-viewport-offset));
            max-height: calc(100dvh - var(--zeno-chats-viewport-offset));
            gap: 0;
            width: 100%;
            overflow-x: hidden;
        }

        .messenger-panel.chat-list-column {
            width: var(--zeno-chat-list-width, 460px);
            flex: 0 0 auto;
            min-width: 280px;
            max-width: 720px;
            height: 100%;
        }
        .messenger-panel.chat-main-column {
            flex: 1 1 0;
            min-width: 280px;
            height: 100%;
        }
        .layout-resizer {
            flex-shrink: 0;
            z-index: 5;
            touch-action: none;
            user-select: none;
            background: transparent;
            transition: background 0.15s ease;
        }
        .layout-resizer-v {
            width: 6px;
            margin: 0 -1px;
            cursor: col-resize;
        }
        .layout-resizer-v:hover,
        .layout-resizer-v.layout-resizer-active {
            background: rgba(88, 104, 242, 0.35);
        }
        .layout-resizer-h {
            height: 6px;
            width: 100%;
            cursor: row-resize;
            flex-shrink: 0;
        }
        .layout-resizer-h:hover,
        .layout-resizer-h.layout-resizer-active {
            background: rgba(88, 104, 242, 0.35);
        }
        .layout-resizer-drawer {
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 8px;
            margin-left: -4px;
            cursor: col-resize;
            z-index: 30;
        }
        .layout-resizer-drawer:hover,
        .layout-resizer-drawer.layout-resizer-active {
            background: rgba(88, 104, 242, 0.4);
        }
        body.layout-resizing {
            cursor: col-resize;
            user-select: none;
        }
        body.layout-resizing.layout-resizing-row {
            cursor: row-resize;
        }
        body.layout-resizing * {
            cursor: inherit !important;
        }
        #messageInput {
            height: var(--zeno-message-input-height, 72px);
            min-height: 52px;
            max-height: 320px;
            resize: none;
            overflow-y: auto;
        }
        .chat-compose-input,
        #messageInput,
        #dealCompactInput {
            font-size: 1rem;
            line-height: 1.5;
            color: #000;
        }
        #dealCompactInput {
            min-height: 52px;
            max-height: 160px;
            resize: none;
            overflow-y: auto;
        }
        .message-input-shell,
        .deal-compact-input-shell {
            flex-shrink: 0;
        }
        .deal-compact-chat-panel {
            display: flex;
            flex-direction: column;
            min-height: 280px;
            max-height: min(560px, 58vh);
            overflow: hidden;
            background: #fff;
            border-radius: 12px;
            box-shadow: var(--zeno-shadow, 0 1px 3px rgba(0, 0, 0, 0.08));
        }
        .deal-compact-chat-panel.hidden {
            display: none !important;
        }
        .deal-compact-chat-panel .chat-compose-popover {
            z-index: 80;
        }
        #dealCompactChat.chat-preview {
            flex: 1 1 auto;
            min-height: 180px;
            max-height: none;
        }
        #dealCompactHint.deal-compact-hint-banner {
            flex-shrink: 0;
        }
        /* Отступ только у колонки чата: список слева не сжимается, кнопки шапки не ломаются */
        #chatPreviewColumn {
            transition: padding-right 260ms ease;
            min-height: 0;
            overflow: hidden;
        }
        body.chats-body-lock #chatPreviewColumn {
            min-height: min(420px, 55vh);
        }

        #chatPreview {
            border-radius: 0 0 12px 12px;
        }

        /* Текст сообщений: чёрный, слегка крупнее стандартного body */
        #chatPreview .chat-message-bubble,
        #dealCompactChat .chat-message-bubble,
        #aiTestChatPreview .chat-message-bubble {
            color: #000;
            font-size: 1rem;
            line-height: 1.5;
            max-width: 100%;
            min-width: 0;
            overflow-wrap: anywhere;
            word-break: break-word;
        }

        #chatPreview .chat-message-bubble .voice-transcript,
        #dealCompactChat .chat-message-bubble .voice-transcript {
            color: #000;
            font-size: 0.875rem;
            max-width: 100%;
            min-width: 0;
            overflow-wrap: anywhere;
            word-break: break-word;
        }

        #chatPreviewColumn > .border-b.border-gray-200,
        #assigneeBanner,
        #chatDataWarningBanner {
            flex-shrink: 0;
        }

        #messageInputContainer {
            flex-shrink: 0;
            position: sticky;
            bottom: 0;
            z-index: 15;
            padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
        }
        body.chats-body-lock #messageInputContainer {
            position: static;
            bottom: auto;
            margin-top: 0;
        }
        .chat-preview-header-actions {
            align-items: center;
            padding-top: 2px;
            gap: 0.375rem;
        }
        .chat-preview-header-actions > button:not(#claimBtn):not(#convertBtn):not(#markUnreadBtn),
        .chat-preview-header-actions > .relative > button {
            width: 2rem;
            height: 2rem;
            min-width: 2rem;
            min-height: 2rem;
            margin: 0;
            padding: 0;
            flex-shrink: 0;
        }
        .chat-preview-header-actions > button:not(#claimBtn):not(#convertBtn):not(#markUnreadBtn) > svg,
        .chat-preview-header-actions > .relative > button > svg {
            width: 20px;
            height: 20px;
            display: block;
        }
        #chatPreviewColumn #markUnreadBtn {
            width: 2.25rem;
            height: 2.25rem;
            min-width: 2.25rem;
            min-height: 2.25rem;
            margin: 0;
            padding: 0;
            flex-shrink: 0;
        }
        #chatPreviewColumn #markUnreadBtn > svg {
            width: 22px;
            height: 22px;
            display: block;
        }
        #chatPreviewColumn #claimBtn {
            width: auto;
            height: auto;
            margin-top: 2.5px;
            margin-right: -4px;
            align-self: center;
        }
        body.contact-card-open #chatPreviewColumn {
            padding-right: calc(var(--contact-drawer-width, 340px) + 2px);
        }
        .contact-card-drawer {
            width: var(--contact-drawer-width, 340px);
            transform: translateX(100%);
            opacity: 0;
            transition: transform 260ms ease, opacity 260ms ease;
            pointer-events: auto;
        }
        .contact-card-drawer.contact-card-drawer-open {
            transform: translateX(0);
            opacity: 1;
        }
        #contactCardBtn {
            transition: transform 260ms ease, left 260ms ease, right 260ms ease, top 260ms ease;
        }
        @keyframes contact-card-tab-in {
            from { transform: translate(110%, -50%); }
            to { transform: translate(0, -50%); }
        }
        @keyframes contact-card-tab-nudge {
            0%, 100% { transform: translate(0, -50%); }
            35% { transform: translate(-7px, -50%); }
            55% { transform: translate(0, -50%); }
            70% { transform: translate(-4px, -50%); }
        }
        @media (prefers-reduced-motion: reduce) {
            #contactCardBtn,
            #contactCardBtn.contact-card-btn-placed,
            body.messenger-chat-open #contactCardBtn.contact-card-btn-placed {
                animation: none;
                transition: none;
            }
        }
        #contactCardBtn.contact-card-btn-placed {
            position: fixed;
            right: auto;
            top: auto;
            transform: translateY(-50%);
            z-index: 90;
        }
        body.contact-card-open #contactCardBtn {
            position: fixed;
            left: calc(var(--contact-drawer-left, 0px) - 16px);
            right: auto;
            top: calc(var(--contact-drawer-top, 0px) + (var(--contact-drawer-height, 0px) / 2));
            transform: translateY(-50%);
            z-index: 90;
        }
        .contact-card-disclosure summary {
            list-style: none;
        }
        .contact-card-disclosure summary::-webkit-details-marker {
            display: none;
        }
        /* Создание контакта из сделки: та же «большая карточка», что в разделе Контакты */
        #contactModal.contact-detail-fullpage-mode {
            display: flex !important;
            align-items: flex-start;
            justify-content: center;
            padding: 5rem 1rem 2rem;
            background: #EEF1F4;
            z-index: 71;
        }
        #contactModal.contact-detail-fullpage-mode > div {
            width: 100%;
            max-width: 72rem;
            max-height: calc(100vh - 7rem);
            border-radius: 1rem;
        }
        .contact-card-disclosure[open] summary .cc-chevron {
            transform: rotate(180deg);
        }
        .contact-card-section-title {
            color: #374151;
            font-weight: 600;
            font-size: 1rem;
            letter-spacing: 0.01em;
            line-height: 1.35;
        }
        .contacts-list-ch-row {
            display: inline-flex;
            flex-wrap: wrap;
            gap: 0.35rem;
            align-items: center;
        }
        .contacts-list-ch-row .cc-ch-svg {
            display: inline-flex;
            vertical-align: middle;
        }
        .contact-card-section-panel {
            border-radius: 0.75rem;
            border: 1px solid #e5e7eb;
            background: #fff;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
        }
        .contact-card-section-summary {
            padding: 0.125rem 0.25rem 0.5rem 0.25rem;
            list-style: none;
            background: transparent;
        }
        .contact-card-section-summary::-webkit-details-marker {
            display: none;
        }
        .cc-ch-svg {
            width: 22px;
            height: 22px;
            min-width: 22px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            line-height: 0;
        }
        .cc-ch-svg svg {
            width: 22px;
            height: 22px;
            display: block;
        }
        .chat-list-source-badge .cc-ch-svg {
            width: 44px;
            height: 44px;
            min-width: 44px;
        }
        .chat-list-source-badge .cc-ch-svg svg {
            width: 44px;
            height: 44px;
        }
        .contact-card-add-channel-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            width: 100%;
            margin-top: 0.75rem;
            padding: 0.5rem 0.25rem;
            font-size: 0.875rem;
            font-weight: 500;
            color: #2563eb;
            border-radius: 0.5rem;
            border: none;
            background: transparent;
            cursor: pointer;
        }
        .contact-card-add-channel-row:hover {
            background: rgba(59, 130, 246, 0.08);
            color: #1d4ed8;
        }
        #contactDetailAddChannelBtn.contact-card-add-channel-row {
            justify-content: flex-start;
        }
        .contact-card-remove-channel {
            width: 2rem;
            height: 2rem;
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: none;
            background: transparent;
            color: #9ca3af;
            border-radius: 0.375rem;
            cursor: pointer;
            opacity: 0.55;
            transition: color 0.15s, background 0.15s, opacity 0.15s;
        }
        .contact-card-channel-row:hover .contact-card-remove-channel,
        .contact-card-remove-channel:focus-visible {
            opacity: 1;
        }
        .contact-card-remove-channel:hover {
            color: #dc2626;
            background: rgba(239, 68, 68, 0.08);
        }
        .contact-card-remove-channel:disabled {
            opacity: 0.35;
            cursor: wait;
        }
        .contact-card-channel-wrap {
            position: relative;
            flex: 1 1 auto;
            min-width: 0;
        }
        .contact-card-channel-trigger {
            display: block;
            width: 100%;
            text-align: left;
            padding: 0;
            border: none;
            background: transparent;
            cursor: pointer;
            color: inherit;
        }
        .contact-card-channel-trigger:hover .contact-card-channel-label {
            color: #2563eb;
        }
        .contact-card-channel-menu {
            position: absolute;
            left: 0;
            right: auto;
            min-width: 11rem;
            top: calc(100% + 4px);
            z-index: 60;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
            padding: 0.25rem 0;
        }
        .contact-card-channel-menu.hidden {
            display: none;
        }
        .contact-card-channel-menu-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            width: 100%;
            text-align: left;
            padding: 0.5rem 0.75rem;
            font-size: 0.875rem;
            line-height: 1.25rem;
            color: #374151;
            background: transparent;
            border: none;
            cursor: pointer;
        }
        .contact-card-channel-menu-item:hover {
            background: #f3f4f6;
            color: #2563eb;
        }
        .contact-card-about-input {
            width: 100%;
            border: 0;
            border-radius: 0.25rem;
            padding: 0.35rem 0;
            font-size: 0.875rem;
            line-height: 1.4;
            background: transparent;
            color: #111827;
            outline: none;
        }
        .contact-card-about-input::placeholder {
            color: #9ca3af;
        }
        .contact-card-about-input:focus {
            box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.35);
        }
        textarea.contact-card-about-input {
            resize: vertical;
            min-height: 4.25rem;
        }
        @media (max-width: 768px) {
            body.contact-card-open #chatPreviewColumn {
                padding-right: 0;
            }
            #contactCardDrawer {
                top: var(--zeno-topbar-height, 80px);
                height: calc(100vh - var(--zeno-topbar-height, 80px));
                height: calc(100dvh - var(--zeno-topbar-height, 80px));
                left: 0;
                right: 0;
                width: 100%;
            }
            .contact-card-drawer {
                width: 100%;
            }
            #contactCardBody {
                padding-top: 16px;
            }
            body.contact-card-open #contactCardBtn {
                position: fixed;
                left: 0;
                top: calc(var(--contact-drawer-top, var(--zeno-topbar-height, 80px)) + 28px);
                right: auto;
                transform: translateY(-50%) scaleX(-1);
                animation: none;
            }
        }
        @media (max-width: 768px) {
            .chat-grid {
                grid-template-columns: 1fr;
            }
        }
        /* Добавьте эти стили в раздел style */
        .bg-\[#E6F6FF\] {
            background-color: #E6F6FF;
        }
        
        .rounded-tr-none {
            border-top-right-radius: 0 !important;
        }
        
        .rounded-tl-none {
            border-top-left-radius: 0 !important;
        }
        
        /* Для анимации аватарок */
        @keyframes fadeIn {
            from { opacity: 0; transform: scale(0.8); }
            to { opacity: 1; transform: scale(1); }
        }
        
        img.avatar {
            animation: fadeIn 0.3s ease-out;
            object-fit: cover;
        }
        
        /* Планшеты и узкие экраны: колонка чата на всю доступную высоту, ввод всегда внизу экрана */
        @media (max-width: 1024px) {
            body.chats-body-lock .messenger-layout {
                display: flex;
                flex-direction: row;
                flex-wrap: nowrap;
                flex: 1 1 0;
                min-height: 0;
                height: auto;
                max-height: none;
            }

            body.chats-body-lock #chatPreviewColumn {
                flex: 1 1 0;
                min-width: 0;
                min-height: 0;
            }

            body.chats-body-lock #chatListColumn {
                flex: 0 0 auto;
                min-height: 0;
            }

            body.chats-body-lock .messenger-panel {
                height: auto;
                max-height: 100%;
            }

            body.messenger-chat-open #chatListColumn,
            body.messenger-chat-open #layoutResizerList {
                display: none !important;
            }

            body.messenger-chat-open .messenger-layout {
                flex-direction: column;
            }

            body.messenger-chat-open #chatPreviewColumn {
                flex: 1 1 0;
                width: 100% !important;
                max-width: none;
                min-width: 0;
                min-height: 0;
                overflow: hidden;
            }

            /* Список: колонка чата не должна торчать справа и оставлять кнопки «Сделка» поверх списка */
            body.chats-body-lock:not(.messenger-chat-open) #chatPreviewColumn,
            body:not(.messenger-chat-open) #chatPreviewColumn {
                display: none !important;
            }

            body.messenger-chat-open #contactCardBtn.contact-card-btn-placed {
                left: auto !important;
                right: 0;
                top: 50%;
                transform: translateY(-50%);
                animation: contact-card-tab-in 320ms ease-out, contact-card-tab-nudge 2.4s ease-in-out 0.5s 2;
            }
            body.messenger-chat-open.contact-card-open #contactCardBtn {
                left: 0 !important;
                right: auto;
                top: calc(var(--contact-drawer-top, var(--zeno-topbar-height, 80px)) + 28px);
                transform: translateY(-50%) scaleX(-1);
                animation: none;
            }

            body.chats-body-lock #messageInput {
                max-height: 120px;
            }

            body.messenger-chat-open .chat-mobile-back-btn {
                display: inline-flex !important;
                align-items: center;
                justify-content: center;
                width: 2.25rem;
                height: 2.25rem;
                min-width: 2.25rem;
                flex-shrink: 0;
                margin: 0;
                padding: 0;
                border: 0;
                border-radius: 9999px;
                background: #EFF6FF;
                color: #2563EB;
            }
            body.messenger-chat-open .chat-mobile-back-btn:hover,
            body.messenger-chat-open .chat-mobile-back-btn:active {
                background: #DBEAFE;
            }
            .chat-preview-header {
                display: flex;
                flex-wrap: wrap !important;
                align-items: center;
                gap: 0.375rem 0.5rem;
                padding: 0.5rem 0.75rem;
            }
            body.messenger-chat-open .chat-mobile-back-btn {
                order: 1;
            }
            .chat-preview-header-actions {
                order: 2;
                flex: 1 1 0 !important;
                flex-shrink: 1 !important;
                width: auto;
                max-width: none !important;
                min-width: 0;
                flex-wrap: nowrap !important;
                justify-content: flex-end;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none;
            }
            .chat-preview-header-actions::-webkit-scrollbar {
                display: none;
            }
            .chat-preview-header-main {
                order: 3;
                flex: 1 1 100% !important;
                flex-shrink: 0 !important;
                width: 100% !important;
                max-width: 100% !important;
                min-width: 0;
            }
            #chatPreviewColumn #chatHeaderTitle {
                font-size: 1rem;
                line-height: 1.3;
                max-width: 100%;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }
            #chatPreviewColumn #chatHeaderProduct,
            #chatPreviewColumn #chatHeaderMeta {
                font-size: 0.75rem;
                line-height: 1.3;
                max-width: 100%;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }
            #chatPreviewColumn #convertBtn {
                height: 2rem;
                padding-left: 0.625rem;
                padding-right: 0.625rem;
                font-size: 0.75rem;
            }
        }

        @media (max-width: 768px) {
            .messenger-panel.chat-list-column {
                width: 100% !important;
                max-width: none;
                min-width: 0;
            }
            .layout-resizer-v,
            .layout-resizer-h,
            .layout-resizer-drawer {
                display: none !important;
            }
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .animate-fade-in {
            animation: fadeIn 0.3s ease-out forwards;
        }

        #assigneeBanner {
            min-height: 36px;
        }
        #assigneeBanner.hidden {
            display: block !important;
            visibility: hidden;
        }
        
        /* Стили для счётчиков непрочитанных сообщений */
        .unread-counter {
            background-color: #16a34a;
            color: white;
            font-size: 0.75rem;
            padding: 2px 6px;
            border-radius: 9999px;
            margin-left: 4px;
            min-width: 18px;
            text-align: center;
            font-weight: 600;
        }

        .chat-list-unread-badge {
            background-color: #16a34a;
            color: #fff;
            font-size: 0.7rem;
            font-weight: 700;
            min-width: 1.25rem;
            height: 1.25rem;
            padding: 0 5px;
            border-radius: 9999px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }

        #chatList .chat-item .flex.flex-col.items-end.justify-center.gap-1.flex-shrink-0,
        #chatList .chat-item .flex.flex-col.items-end.flex-shrink-0.self-center {
            min-width: 1.25rem;
        }

        /* Группа чатов одного контакта (несколько каналов) */
        .contact-chat-group-block {
            position: relative;
            margin-bottom: 10px;
        }
        /* «Стопка» карточек — только в свёрнутом виде */
        .contact-chat-group-block.has-stack:not(.is-expanded)::before,
        .contact-chat-group-block.has-stack:not(.is-expanded)::after {
            content: '';
            position: absolute;
            left: 10px;
            right: 10px;
            top: 6px;
            bottom: 6px;
            border-radius: 12px;
            background: var(--chat-selected-bg);
            border: 1px solid #c5d9f7;
            pointer-events: none;
            z-index: 0;
        }
        .contact-chat-group-block.has-stack:not(.is-expanded)::after {
            left: 14px;
            right: 14px;
            top: 10px;
            bottom: 2px;
            background: var(--chat-selected-bg);
            border-color: #c5d9f7;
            z-index: 1;
        }
        .contact-chat-group-block.has-stack:not(.is-expanded) {
            padding-bottom: 12px;
        }
        .contact-chat-group-block.has-stack:not(.is-expanded) .contact-chat-group-primary {
            position: relative;
            z-index: 2;
        }
        .contact-chat-group-block.has-stack:not(.is-expanded) .contact-chat-group-primary .chat-item {
            padding-bottom: 4px;
            border: 1px solid #c5d9f7;
            box-shadow: 0 1px 2px rgba(37, 99, 235, 0.06);
        }
        .contact-chat-group-block.is-expanded .contact-chat-group-primary .chat-item {
            border-bottom-left-radius: 8px;
            border-bottom-right-radius: 8px;
        }
        .contact-chat-group-primary {
            position: relative;
        }
        .contact-chat-group-expand {
            position: absolute;
            right: 48px;
            bottom: 0;
            z-index: 5;
            width: 28px;
            height: 28px;
            border-radius: 9999px;
            background: #fff;
            border: 1px solid #c5d9f7;
            box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #2563eb;
            cursor: pointer;
        }
        .contact-chat-group-block.is-expanded .contact-chat-group-expand {
            bottom: auto;
            top: auto;
            position: relative;
            margin: -10px 10px 0 auto;
            display: flex;
        }
        .contact-chat-group-expand:hover {
            background: var(--chat-selected-bg);
        }
        .contact-chat-group-children {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-top: 2px;
            padding: 2px 0 4px;
        }
        .contact-chat-group-children .chat-item {
            margin: 0 8px 0 20px;
            border-radius: 10px;
            border: 1px solid #e2e8f0;
            box-shadow: none;
        }
        .contact-chat-group-children .chat-item.bg-white {
            background-color: #f8fafc !important;
        }
        .contact-chat-group-children .chat-item.bg-gray-50 {
            background-color: #f1f5f9 !important;
        }
        .contact-chat-group-children .chat-item.bg-sky-50 {
            background-color: var(--chat-selected-bg) !important;
        }

        #chatList .chat-item.bg-sky-50 {
            background-color: var(--chat-selected-bg) !important;
        }

        #chatList .chat-item.chat-item--pinned:not(.bg-sky-50) {
            background-color: var(--chat-pinned-bg) !important;
        }
        .contact-chat-group-children .chat-item.chat-item--pinned:not(.bg-sky-50) {
            background-color: var(--chat-pinned-bg) !important;
        }
        
        .unread-counter.hidden {
            display: none;
        }

        /* Бейдж на вкладках: только когда не .hidden (иначе display:inline-flex перебивал бы hidden) */
        .unread-counter.filter-tab-unread:not(.hidden) {
            margin-left: 0;
            padding: 0 5px;
            min-width: 18px;
            height: 18px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            box-sizing: border-box;
        }

        /* Стили для цветовой схемы чатов */
        .chat-item {
            border: 1px solid transparent;
            transition: background-color 0.15s ease, border-color 0.15s ease;
        }
        
        .chat-item:hover {
            border-color: #e5e7eb;
            transform: translateY(-1px);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .chat-item.active,
        .chat-item.active:hover {
            transform: none;
            box-shadow: none;
        }

        /* Custom Select Styles */
        .custom-select-container {
            position: relative;
            display: inline-block;
            vertical-align: middle;
            box-sizing: border-box;
        }
        .custom-select-trigger {
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            user-select: none;
            transition: all 0.2s;
            box-sizing: border-box;
            background-color: white; /* Default background */
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        /* Default styles if no classes are copied (fallback) */
        .custom-select-trigger:not([class*="px-"]) {
            padding: 0.5rem 0.75rem;
            min-height: 38px;
        }
        .custom-select-trigger:not([class*="border-"]) {
            border: 1px solid #d1d5db;
            border-radius: 0.5rem;
        }
        
        .custom-select-options {
            position: fixed; /* Force fixed to avoid parent context issues */
            z-index: 9999;
            background: white;
            border: 1px solid #d1d5db;
            border-radius: 0.5rem;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            max-height: 300px;
            overflow-y: auto;
            display: none;
            box-sizing: border-box;
        }
        .custom-select-options.open {
            display: block;
        }
        .custom-option {
            padding: 0.5rem 0.75rem;
            cursor: pointer;
            font-size: 0.875rem;
            color: #1f2937; /* Default text color */
            transition: filter 0.2s;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .custom-option:hover {
            filter: brightness(90%);
        }
        /* Выпадающий список статусов сделки — пункты как пилюли (цвета из опций) */
        .custom-select-options.custom-select-options--deal-meta-pills.open {
            display: flex;
            flex-wrap: wrap;
            align-items: flex-start;
            align-content: flex-start;
            gap: 6px 8px;
            padding: 10px 12px;
            max-width: min(92vw, 420px);
        }
        .custom-select-options.custom-select-options--deal-meta-pills .custom-option.custom-option--pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            width: auto;
            max-width: 100%;
            padding: 5px 12px;
            border-radius: 9999px;
            font-size: 0.8125rem;
            font-weight: 500;
            line-height: 1.25;
            white-space: normal;
            box-sizing: border-box;
        }
        .custom-select-options.custom-select-options--deal-meta-pills .custom-option.custom-option--pill:hover {
            filter: brightness(0.94);
        }
        
        .chat-item.active {
            border-color: #3b82f6 !important;
        }

        #chatList .chat-list-last-message,
        .contact-detail-open-chat .chat-list-last-message {
            color: #000;
            font-size: 1rem;
            line-height: 1.45;
        }
        
        /* Стили для счётчика сообщений в чатах */
        .message-counter {
            background-color: #ef4444;
            color: white;
            font-size: 0.75rem;
            padding: 2px 6px;
            border-radius: 9999px;
            font-weight: 600;
            min-width: 20px;
            text-align: center;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        :root {
            --chat-selected-bg: #ddeaff;
            --chat-pinned-bg: #f4f5f7;
            --zeno-primary: #5865F2;
            --zeno-primary-dark: #4B56CE;
            --zeno-text-main: #0E1117;
            --zeno-text-secondary: #445371;
            --zeno-text-muted: #858FA3;
            --zeno-border: #E0E0E0;
            --zeno-bg: #FFFFFF;
            --zeno-bg-soft: #F9FAFB;
            --zeno-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
            --font-body: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            --font-heading: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        }

        html, body {
            font-family: var(--font-body);
        }

        * {
            font-family: inherit;
        }

        h1, h2, h3, h4, h5, h6,
        .zeno-page-title {
            font-family: var(--font-heading);
        }

        body {
            font-size: 14px;
            color: var(--zeno-text-secondary);
            background: var(--zeno-bg-soft);
        }

        :root {
            --zeno-safe-top: env(safe-area-inset-top, 0px);
            --zeno-topbar-content-height: 80px;
            --zeno-topbar-height: calc(var(--zeno-topbar-content-height) + var(--zeno-safe-top));
            /* topbar + отступ контейнера */
            --zeno-chats-viewport-offset: calc(var(--zeno-topbar-height) + 12px);
        }

        html:has(body.chats-body-lock) {
            overflow: hidden;
            overflow-x: hidden;
            height: 100%;
        }

        body.chats-body-lock {
            overflow: hidden;
            overflow-x: hidden;
            overscroll-behavior: none;
            height: 100vh;
            height: 100dvh;
            max-height: 100vh;
            max-height: 100dvh;
            display: flex;
            flex-direction: column;
            padding-top: 0;
        }

        body.chats-body-lock > .container.mx-auto {
            display: flex;
            flex-direction: column;
            flex: 1 1 0;
            min-height: 0;
            max-height: 100%;
            width: 100%;
            overflow: hidden;
        }

        body.chats-body-lock #chatsContent {
            flex: 1 1 0;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        body.chats-body-lock #chatsContent.hidden {
            display: none !important;
        }

        body.chats-body-lock .zeno-topbar {
            flex-shrink: 0;
        }

        body.chats-body-lock .messenger-layout {
            flex: 1 1 0;
            min-height: 0;
            height: auto;
            max-height: none;
            display: flex;
            align-items: stretch;
        }

        body.chats-body-lock .messenger-panel {
            height: auto;
            max-height: 100%;
            min-height: 0;
        }

        body.chats-body-lock .messenger-panel.chat-main-column {
            flex: 1 1 0;
        }

        body.chats-body-lock .messenger-panel.chat-list-column {
            flex: 0 0 auto;
        }

        body.chats-body-lock #chatListColumn,
        body.chats-body-lock #chatPreviewColumn {
            display: flex;
            flex-direction: column;
            min-height: 0;
            max-height: 100%;
        }

        body.chats-body-lock #chatListColumn {
            overflow: hidden;
        }

        body.chats-body-lock #chatPreviewColumn {
            overflow: hidden;
        }

        body.chats-body-lock #chatListColumn > .sticky,
        body.chats-body-lock #chatPreviewColumn > .border-b.border-gray-200 {
            position: static;
            top: auto;
            flex-shrink: 0;
        }

        body.chats-body-lock #assigneeBanner,
        body.chats-body-lock #chatDataWarningBanner,
        body.chats-body-lock #layoutResizerMessage {
            flex-shrink: 0;
        }

        body.chats-body-lock #chatList,
        body.chats-body-lock #chatPreview {
            flex: 1 1 0;
            overflow-y: auto !important;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
            touch-action: pan-y;
            min-height: 0;
        }

        .zeno-topbar {
            position: sticky;
            top: 0;
            z-index: 80;
            box-sizing: border-box;
            height: var(--zeno-topbar-height, 80px);
            padding-top: var(--zeno-safe-top, 0px);
            background: var(--zeno-bg);
            border-bottom: 1px solid rgba(68,83,113,0.15);
            min-width: 0;
        }
        .zeno-topbar-brand {
            min-width: 0;
            flex: 1 1 auto;
        }
        .zeno-topbar-tabs {
            min-width: 0;
        }
        .zeno-topbar-actions {
            flex-shrink: 0;
            padding-left: 12px;
            margin-left: 4px;
            border-left: 1px solid rgba(68, 83, 113, 0.14);
        }
        .zeno-topbar-logo {
            flex-shrink: 0;
        }
        .chat-mobile-back-btn {
            display: none;
        }
        @media (max-width: 1024px) {
            body.messenger-chat-open .chat-mobile-back-btn {
                display: inline-flex !important;
            }
        }

        /* Модалки поверх шапки (80); ниже баннера сети (110) */
        .zeno-modal-overlay {
            z-index: 100;
        }
        .zeno-modal-overlay > div {
            max-height: min(90vh, calc(100dvh - 2rem));
        }
        body.scenario-modal-open {
            overflow: hidden;
        }

        /* Сеть: баннер fixed сверху; body получает padding, шапка sticky top:0 */
        #connection-error-banner {
            z-index: 110;
        }
        #connection-overlay {
            z-index: 85;
        }
        body.connection-banner-active {
            padding-top: var(--connection-banner-height, 40px);
            box-sizing: border-box;
        }
        body.connection-banner-active .zeno-topbar {
            top: 0;
        }
        body.chats-body-lock.connection-banner-active {
            height: 100vh;
            height: 100dvh;
            max-height: 100vh;
            max-height: 100dvh;
        }
        body.connection-banner-active #dealsContent.deals-content-overlay,
        body.connection-banner-active #dealsContent.fixed.inset-0 {
            top: calc(var(--connection-banner-height, 40px) + var(--zeno-topbar-height, 80px));
        }

        .zeno-page-title {
            font-size: 24px;
            font-weight: 700;
            line-height: 32px;
            color: var(--zeno-text-main);
        }

        .zeno-tab {
            padding: 10px 12px;
            font-size: 14px;
            font-weight: 500;
            color: var(--zeno-text-secondary);
            border-bottom: 2px solid transparent;
            transition: all 0.15s ease;
        }

        .zeno-tab:hover {
            color: var(--zeno-text-main);
        }

        .zeno-tab-active {
            color: var(--zeno-primary);
            border-bottom-color: var(--zeno-primary);
        }

        @media (max-width: 768px) {
            :root {
                --zeno-topbar-content-height: 52px;
                --zeno-chats-viewport-offset: calc(var(--zeno-topbar-height) + 4px);
            }
            .zeno-topbar {
                padding-left: 8px;
                padding-right: 8px;
                gap: 8px;
                border-bottom: none;
            }
            .zeno-topbar-logo {
                height: 36px !important;
            }
            .zeno-topbar-tabs,
            .zeno-cabinet-menu,
            #logoutBtn {
                display: none !important;
            }
            .zeno-mobile-nav {
                display: inline-flex !important;
                position: relative;
            }
            body.chats-body-lock > .container.mx-auto {
                padding-left: 0;
                padding-right: 0;
            }
            body.chats-body-lock .messenger-panel.chat-list-column,
            body.chats-body-lock .messenger-panel.chat-main-column {
                border-radius: 0;
            }
        }

        .zeno-seg {
            display: inline-flex;
            gap: 4px;
            padding: 4px;
            background: var(--zeno-bg);
            border: 1px solid var(--zeno-border);
            border-radius: 9999px;
            box-shadow: var(--zeno-shadow);
        }

        .zeno-seg-btn {
            height: 36px;
            padding: 0 16px;
            border-radius: 9999px;
            font-size: 14px;
            font-weight: 600;
            color: var(--zeno-text-muted);
            background: transparent;
            transition: all 0.15s ease;
        }

        .zeno-seg-btn:hover {
            background: rgba(88,101,242,0.08);
            color: var(--zeno-text-main);
        }

        .zeno-seg-btn-active {
            background: var(--zeno-primary);
            color: #fff;
        }

        .zeno-seg-btn-active:hover {
            background: var(--zeno-primary-dark);
            color: #fff;
        }

        .zeno-seg-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .zeno-btn {
            height: 40px;
            padding: 0 16px;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.15s ease;
            user-select: none;
            white-space: nowrap;
        }

        .zeno-btn-primary {
            background: var(--zeno-primary);
            color: #fff;
        }

        .zeno-btn-primary:hover {
            background: var(--zeno-primary-dark);
        }

        .zeno-btn-outline {
            background: var(--zeno-bg);
            color: var(--zeno-text-main);
            border: 1px solid var(--zeno-border);
        }

        .zeno-btn-outline:hover {
            background: var(--zeno-bg-soft);
        }

        .zeno-btn:disabled {
            opacity: 0.55;
            cursor: not-allowed;
        }

        .zeno-btn-success {
            background: #22C55E;
            color: #fff;
        }

        .zeno-btn-success:hover {
            background: #16A34A;
        }

        .zeno-icon-btn {
            width: 40px;
            padding: 0;
        }

        .zeno-menu-anchor {
            position: relative;
            display: inline-flex;
            align-items: center;
        }

        .zeno-gear-btn {
            width: 32px;
            height: 32px;
            padding: 0;
            border: 0;
            background: transparent;
            border-radius: 10px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: background 0.15s ease;
        }

        .zeno-gear-btn:hover {
            background: var(--zeno-bg-soft);
        }

        .zeno-gear-btn:focus {
            outline: none;
            box-shadow: none;
        }

        .zeno-multi-btn {
            height: 36px;
            padding: 0 12px;
            border: 1px solid var(--zeno-border);
            background: var(--zeno-bg);
            border-radius: 12px;
            color: var(--zeno-text-main);
            font-size: 14px;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: background 0.15s ease;
            white-space: nowrap;
        }

        .zeno-multi-btn:hover {
            background: var(--zeno-bg-soft);
        }

        .zeno-multi-btn:focus {
            outline: none;
            box-shadow: none;
        }

        #dealFiltersControls .zeno-input,
        #dealFiltersControls .zeno-multi-btn,
        #contactsFiltersControls .zeno-input,
        #contactsFiltersControls select.zeno-input {
            height: 30px;
            border-radius: 8px;
            border: 1px solid var(--zeno-border);
            background: var(--zeno-bg);
            font-size: 12px;
            padding: 0 10px;
        }

        #dealFiltersControls .zeno-multi-btn {
            position: relative;
            padding-right: 28px;
        }

        #dealFiltersControls .zeno-multi-btn::after {
            content: '';
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            width: 14px;
            height: 14px;
            background: url('assets/svg/icon_chevron_down.svg') no-repeat center / contain;
            opacity: 0.7;
            pointer-events: none;
        }

        #dealFiltersControls .zeno-input:hover,
        #dealFiltersControls .zeno-multi-btn:hover,
        #contactsFiltersControls .zeno-input:hover,
        #contactsFiltersControls select.zeno-input:hover {
            background: var(--zeno-bg-soft);
        }

        #dealFiltersControls .zeno-input::placeholder {
            color: var(--zeno-text-muted);
            opacity: 0.9;
        }

        #dealFiltersControls .zeno-input:focus {
            background: var(--zeno-bg);
            border-color: var(--zeno-primary);
            box-shadow: 0 0 0 3px rgba(88,101,242,0.08);
        }

        #contactsFiltersControls .zeno-input:focus,
        #contactsFiltersControls select.zeno-input:focus {
            background: var(--zeno-bg);
            border-color: var(--zeno-primary);
            box-shadow: 0 0 0 3px rgba(88,101,242,0.08);
        }

        #dealFiltersActionsRow .zeno-gear-btn {
            width: 30px;
            height: 30px;
            border-radius: 8px;
            border: 1px solid var(--zeno-border);
            background: var(--zeno-bg);
        }

        #dealFiltersActionsRow .zeno-gear-btn:hover {
            background: var(--zeno-bg-soft);
        }

        .zeno-deals-toolbar #dealsEditMenuBtn {
            height: 30px;
            padding: 0;
            font-size: 12px;
            font-weight: 600;
            border: 0;
            background: transparent;
            color: var(--zeno-primary);
            display: inline-flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
        }

        .zeno-deals-toolbar #dealsEditMenuBtn:hover {
            text-decoration: underline;
        }

        .zeno-deals-toolbar #dealsEditMenuBtn:focus {
            outline: none;
        }

        .zeno-deals-toolbar #dealsCreateMenuBtn,
        .zeno-deals-toolbar #contactsCreateMenuBtn,
        .zeno-deals-toolbar #contactsEditMenuBtn,
        .zeno-deals-toolbar #chatsCreateMenuBtn,
        .zeno-deals-toolbar #chatsEditMenuBtn {
            height: 30px;
            padding: 0;
            font-size: 12px;
            font-weight: 600;
            border: 0;
            background: transparent;
            color: var(--zeno-primary);
            display: inline-flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
        }

        .zeno-deals-toolbar #contactsCreateMenuBtn:hover,
        .zeno-deals-toolbar #contactsEditMenuBtn:hover {
            text-decoration: underline;
        }

        .zeno-deals-toolbar #contactsCreateMenuBtn:focus,
        .zeno-deals-toolbar #contactsEditMenuBtn:focus {
            outline: none;
        }

        .zeno-deals-toolbar #contactsSelectedWrap {
            font-size: 12px;
            color: var(--zeno-text-muted);
        }

        .zeno-deals-toolbar #contactsSelectedCount {
            font-weight: 600;
            color: var(--zeno-text-main);
        }

        .zeno-deals-toolbar #dealsSelectedWrap {
            font-size: 12px;
            color: var(--zeno-text-muted);
        }

        .zeno-deals-toolbar #dealsSelectedCount {
            font-weight: 600;
            color: var(--zeno-text-main);
        }

        .zeno-deals-toolbar #chatsSelectedWrap {
            font-size: 12px;
            color: var(--zeno-text-muted);
        }

        .zeno-deals-toolbar #chatsSelectedCount {
            font-weight: 600;
            color: var(--zeno-text-main);
        }

        .zeno-deals-toolbar .zeno-gear-btn {
            width: 30px;
            height: 30px;
            border-radius: 8px;
            border: 1px solid var(--zeno-border);
            background: var(--zeno-bg);
        }

        .zeno-deals-toolbar .zeno-gear-btn:hover {
            background: var(--zeno-bg-soft);
        }

        .zeno-filter-label {
            font-size: 12px;
            font-weight: 600;
            color: var(--zeno-text-muted);
            margin-right: 2px;
            white-space: nowrap;
        }

        .zeno-filter-field-label {
            font-size: 12px;
            font-weight: 600;
            color: var(--zeno-text-muted);
            line-height: 1.25;
        }

        .deal-filter-item {
            display: inline-flex;
            flex-direction: column;
            align-items: stretch;
            gap: 4px;
            max-width: 100%;
        }

        .deal-filter-item .zeno-multi-btn {
            align-self: flex-start;
            min-width: 11rem;
        }

        .zeno-filter-label-row {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 4px 8px;
        }

        .zeno-quick-sep {
            color: var(--zeno-text-muted);
            font-size: 12px;
            font-weight: 600;
            user-select: none;
        }

        #dealCustomFiltersControls {
            display: contents;
        }

        #dealFiltersControls .zeno-quick-chip {
            color: var(--zeno-primary);
        }

        #dealFiltersControls .zeno-quick-chip:hover {
            opacity: 0.85;
        }

        .zeno-date-wrap {
            position: relative;
            display: inline-flex;
            align-items: center;
        }

        .zeno-date-prefix {
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 12px;
            font-weight: 600;
            color: var(--zeno-text-muted);
            pointer-events: none;
        }

        .zeno-date-wrap .zeno-input[type="date"] {
            padding-left: 22px;
        }

        .zeno-date-wrap-to .zeno-input[type="date"] {
            padding-left: 32px;
        }

        #dealFiltersControls .zeno-date-prefix {
            left: 8px;
            font-size: 11px;
        }

        #dealFiltersControls .zeno-date-wrap .zeno-input[type="date"] {
            padding-left: 28px;
        }

        #dealFiltersControls .zeno-date-wrap-to .zeno-input[type="date"] {
            padding-left: 38px;
        }

        #contactsFiltersControls .zeno-date-prefix {
            left: 8px;
            font-size: 11px;
        }

        #contactsFiltersControls .zeno-date-wrap .zeno-input[type="date"] {
            padding-left: 28px;
        }

        #contactsFiltersControls .zeno-date-wrap-to .zeno-input[type="date"] {
            padding-left: 38px;
        }

        #contactsFiltersControls select.zeno-input {
            cursor: pointer;
            line-height: 1.2;
        }

        .zeno-quick-range {
            display: inline-flex;
            align-items: center;
            gap: 0;
            white-space: nowrap;
            margin-left: 2px;
        }

        .zeno-quick-chip {
            height: auto;
            padding: 0;
            border-radius: 0;
            border: none;
            background: transparent;
            color: var(--zeno-text-muted);
            font-size: 12px;
            font-weight: 600;
            line-height: 1.2;
            cursor: pointer;
            transition: color 0.15s ease;
        }

        .zeno-quick-chip:hover {
            color: var(--zeno-text);
        }

        .zeno-menu {
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            min-width: 320px;
            background: var(--zeno-bg);
            border: 1px solid var(--zeno-border);
            border-radius: 12px;
            box-shadow: var(--zeno-shadow);
            padding: 10px;
            z-index: 60;
        }

        .zeno-menu-title {
            font-size: 12px;
            font-weight: 600;
            color: var(--zeno-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.04em;
            margin: 6px 0 8px;
        }

        .zeno-menu-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            border-radius: 10px;
            cursor: pointer;
            user-select: none;
        }

        .deals-columns-modal-drag-handle {
            cursor: grab;
            color: var(--zeno-text-muted);
            padding: 0 2px;
            flex-shrink: 0;
            line-height: 1;
            font-size: 12px;
            letter-spacing: 0.02em;
        }

        .deals-columns-modal-drag-handle:active {
            cursor: grabbing;
        }

        .zeno-menu-item:hover {
            background: var(--zeno-bg-soft);
        }

        .zeno-menu-item:focus-visible,
        .zeno-gear-btn:focus-visible {
            outline: 2px solid var(--zeno-primary);
            outline-offset: 2px;
        }

        .zeno-print-menu {
            min-width: 230px;
            padding: 6px;
        }

        .zeno-print-menu-right {
            right: 0;
            left: auto;
        }

        .zeno-print-format-menu {
            border-top: 1px solid var(--zeno-border);
            margin-top: 6px;
            padding-top: 6px;
        }

        .zeno-menu-item input[type="checkbox"] {
            width: 16px;
            height: 16px;
            accent-color: var(--zeno-primary);
        }

        .zeno-menu-item span {
            color: var(--zeno-text-main);
            font-size: 14px;
            font-weight: 500;
        }

        #chatListColumn .filter-btn.active {
            border-bottom-color: #5865F2;
        }

        .chat-search-wrap {
            position: relative;
            display: block;
            width: 100%;
            margin-top: 12px;
            min-width: 0;
        }

        .chat-search-input {
            display: block;
            width: 100%;
            height: 40px;
            border-radius: 10px;
            border: 1px solid transparent;
            background: var(--zeno-bg-soft, #F9FAFB);
            box-shadow: none;
            padding-right: 36px;
            font-size: 16px;
        }

        .chat-search-input:hover {
            background: #f3f4f6;
        }

        .chat-search-input:focus {
            background: #fff;
            border-color: var(--zeno-primary, #5865F2);
            box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.12);
        }

        .chat-search-input::-webkit-search-decoration,
        .chat-search-input::-webkit-search-cancel-button {
            -webkit-appearance: none;
            appearance: none;
        }

        .chat-search-clear {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            width: 22px;
            height: 22px;
            border: none;
            border-radius: 999px;
            background: #e5e7eb;
            color: #6b7280;
            font-size: 16px;
            line-height: 1;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            z-index: 2;
        }

        .chat-search-clear:hover {
            background: #d1d5db;
            color: #374151;
        }

        .chat-search-results {
            position: absolute;
            left: 0;
            right: 0;
            top: calc(100% + 6px);
            background: #fff;
            border: 1px solid var(--zeno-border, #e5e7eb);
            border-radius: 12px;
            box-shadow: 0 10px 28px rgba(17, 24, 39, 0.12);
            max-height: 16rem;
            overflow-y: auto;
            z-index: 30;
        }

        .chat-search-empty {
            padding: 12px 14px;
            font-size: 13px;
            color: var(--zeno-text-muted, #858FA3);
        }

        .chat-search-result {
            padding: 10px 12px;
            cursor: pointer;
            border-bottom: 1px solid #f3f4f6;
        }

        .chat-search-result:last-child {
            border-bottom: none;
        }

        .chat-search-result:hover,
        .chat-search-result:focus-visible {
            background: #f8fafc;
            outline: none;
        }

        .chat-search-result-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--zeno-text-main, #0E1117);
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .chat-search-result-badge {
            flex-shrink: 0;
            font-size: 11px;
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 999px;
            background: rgba(88, 101, 242, 0.1);
            color: var(--zeno-primary, #5865F2);
        }

        .chat-search-result-match {
            margin-top: 3px;
            font-size: 12px;
            color: var(--zeno-text-muted, #858FA3);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        @media (max-width: 768px) {
            .chat-search-input {
                height: 38px;
                border-radius: 12px;
            }
        }

        .chat-close-menu-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 20px;
            height: 20px;
            flex-shrink: 0;
        }

        .chat-close-menu-icon svg {
            display: block;
        }

        .zeno-menu-divider {
            height: 1px;
            background: var(--zeno-border);
            margin: 10px 6px;
        }

        .deal-filter-item.hidden {
            display: none !important;
        }

        .zeno-view-toggle {
            display: inline-flex;
            padding: 4px;
            gap: 4px;
            border-radius: 9999px;
            background: var(--zeno-bg);
            border: 1px solid var(--zeno-border);
        }

        .zeno-view-toggle.is-disabled {
            pointer-events: none;
        }

        .zeno-view-btn {
            height: 32px;
            padding: 0 14px;
            border-radius: 9999px;
            font-size: 14px;
            font-weight: 600;
            color: var(--zeno-text-muted);
            transition: all 0.15s ease;
            background: transparent;
            white-space: nowrap;
        }

        .zeno-view-btn:hover {
            background: rgba(88,101,242,0.08);
            color: var(--zeno-text-main);
        }

        .zeno-view-btn-active {
            background: var(--zeno-primary);
            color: #fff;
        }

        .zeno-view-btn-active:hover {
            background: var(--zeno-primary-dark);
            color: #fff;
        }

        .zeno-view-btn-muted {
            opacity: 0.6;
        }

        .deals-kanban-board {
            display: flex;
            gap: 12px;
            padding: 12px;
            overflow-x: auto;
            overscroll-behavior-x: contain;
            min-height: 520px;
            background: var(--zeno-bg);
        }

        .deals-kanban-col {
            flex: 0 0 320px;
            display: flex;
            flex-direction: column;
            border: 1px solid var(--zeno-border);
            border-radius: 12px;
            background: #fff;
            overflow: hidden;
            min-height: 520px;
        }

        .deals-kanban-col-head {
            padding: 10px 12px;
            border-bottom: 1px solid var(--zeno-border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            background: #fff;
            position: sticky;
            top: 0;
            z-index: 1;
        }

        .deals-kanban-col-title {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
        }

        .deals-kanban-dot {
            width: 10px;
            height: 10px;
            border-radius: 9999px;
            flex: 0 0 auto;
        }

        .deals-kanban-col-name {
            font-size: 14px;
            font-weight: 700;
            color: var(--zeno-text-main);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .deals-kanban-col-meta {
            font-size: 12px;
            font-weight: 700;
            color: var(--zeno-text-muted);
            background: rgba(88,101,242,0.10);
            padding: 4px 8px;
            border-radius: 9999px;
            flex: 0 0 auto;
        }

        .deals-kanban-col-body {
            padding: 10px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            overflow: auto;
            flex: 1 1 auto;
            background: rgba(88,101,242,0.04);
        }

        .deals-kanban-col.is-drop-target .deals-kanban-col-body {
            outline: 2px dashed rgba(88,101,242,0.55);
            outline-offset: -6px;
        }

        .deals-kanban-card {
            border: 1px solid var(--zeno-border);
            border-radius: 12px;
            background: #fff;
            padding: 10px;
            cursor: pointer;
            user-select: none;
            box-shadow: 0 1px 0 rgba(0,0,0,0.02);
        }

        .deals-kanban-card:active {
            cursor: grabbing;
        }

        .deals-kanban-card.is-dragging {
            opacity: 0.55;
        }

        .deals-kanban-card.deals-kanban-card-recent {
            box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.45);
            background: rgba(224, 242, 254, 0.65);
        }

        .deals-kanban-card-top {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 10px;
        }

        .deals-kanban-card-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--zeno-text-main);
            line-height: 1.25;
            overflow: hidden;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }

        .deals-kanban-card-number {
            font-size: 12px;
            font-weight: 800;
            color: var(--zeno-text-muted);
            white-space: nowrap;
            flex: 0 0 auto;
        }

        .deals-kanban-card-meta {
            margin-top: 8px;
            display: flex;
            flex-wrap: wrap;
            gap: 6px 10px;
            font-size: 12px;
            color: var(--zeno-text-muted);
        }

        .deals-kanban-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 8px;
            border-radius: 9999px;
            background: rgba(0,0,0,0.04);
        }

        .zeno-user-btn {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            background: rgba(88,101,242,0.1);
            color: var(--zeno-primary);
            font-size: 14px;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            user-select: none;
            transition: background-color 0.15s ease, color 0.15s ease;
            border: none;
            cursor: pointer;
        }

        .zeno-user-btn .zeno-icon {
            width: 1.125rem;
            height: 1.125rem;
        }

        .zeno-user-btn:hover {
            background: rgba(88,101,242,0.16);
        }

        .zeno-user-btn-notif {
            background: transparent;
            color: #4B5670;
        }

        .zeno-user-btn-notif .zeno-icon {
            width: 1.25rem;
            height: 1.25rem;
        }

        .zeno-user-btn-notif:hover {
            background: rgba(75, 86, 112, 0.08);
            color: #2F384C;
        }

        .zeno-cabinet-menu {
            position: relative;
            display: inline-flex;
        }

        .zeno-cabinet-menu.hidden {
            display: none;
        }

        .zeno-cabinet-menu-dropdown {
            position: absolute;
            top: calc(100% + 4px);
            right: 0;
            min-width: 196px;
            padding: 6px;
            background: var(--zeno-bg, #fff);
            border: 1px solid var(--zeno-border, #e5e7eb);
            border-radius: 12px;
            box-shadow: 0 10px 28px rgba(17, 24, 39, 0.12);
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transform: translateY(4px);
            transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
            z-index: 90;
        }

        .zeno-cabinet-menu-dropdown::before {
            content: '';
            position: absolute;
            top: -10px;
            left: 0;
            right: 0;
            height: 10px;
        }

        .zeno-cabinet-menu:hover .zeno-cabinet-menu-dropdown,
        .zeno-cabinet-menu:focus-within .zeno-cabinet-menu-dropdown,
        .zeno-cabinet-menu.is-open .zeno-cabinet-menu-dropdown {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transform: translateY(0);
        }

        .zeno-cabinet-menu-item {
            display: block;
            padding: 9px 12px;
            border-radius: 8px;
            color: var(--zeno-text-main, #111827);
            font-size: 14px;
            font-weight: 500;
            line-height: 1.3;
            text-decoration: none;
            white-space: nowrap;
        }

        .zeno-cabinet-menu-item:hover,
        .zeno-cabinet-menu-item:focus {
            background: rgba(88, 101, 242, 0.08);
            color: var(--zeno-primary, #5865F2);
            outline: none;
        }

        .zeno-cabinet-menu-sep {
            height: 1px;
            margin: 4px 6px;
            background: var(--zeno-border, #e5e7eb);
        }

        button.zeno-cabinet-menu-item {
            width: 100%;
            border: 0;
            background: transparent;
            cursor: pointer;
            text-align: left;
            font: inherit;
        }

        .zeno-cabinet-menu-logout {
            color: #dc2626;
        }

        .zeno-cabinet-menu-logout:hover,
        .zeno-cabinet-menu-logout:focus {
            background: #FEF2F2;
            color: #b91c1c;
        }

        .zeno-mobile-nav {
            display: none;
        }
        .zeno-mobile-nav-dropdown {
            position: absolute;
            top: calc(100% + 4px);
            right: 0;
            min-width: 220px;
            max-height: min(70vh, 28rem);
            overflow-y: auto;
            padding: 6px;
            background: var(--zeno-bg, #fff);
            border: 1px solid var(--zeno-border, #e5e7eb);
            border-radius: 12px;
            box-shadow: 0 10px 28px rgba(17, 24, 39, 0.12);
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transform: translateY(4px);
            transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
            z-index: 95;
        }
        .zeno-mobile-nav.is-open .zeno-mobile-nav-dropdown {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transform: translateY(0);
        }
        .zeno-mobile-nav-tab.is-active {
            background: rgba(88, 101, 242, 0.08);
            color: var(--zeno-primary, #5865F2);
        }

        .zeno-card {
            background: var(--zeno-bg);
            border: 1px solid var(--zeno-border);
            border-radius: 12px;
            box-shadow: var(--zeno-shadow);
        }

        .zeno-input {
            height: 40px;
            border-radius: 8px;
            border: 1px solid var(--zeno-border);
            padding: 0 12px;
            font-size: 14px;
            color: var(--zeno-text-main);
            background: var(--zeno-bg);
            outline: none;
            transition: all 0.15s ease;
        }

        .zeno-input::placeholder {
            color: var(--zeno-text-muted);
        }

        .zeno-input:focus {
            border-color: var(--zeno-primary);
            box-shadow: 0 0 0 3px rgba(88,101,242,0.1);
        }

        .zeno-input-wrap {
            position: relative;
            display: inline-flex;
            align-items: center;
        }

        .zeno-input-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            width: 16px;
            height: 16px;
            opacity: 0.65;
            pointer-events: none;
        }

        .zeno-input-has-icon {
            padding-left: 36px;
        }

        .zeno-table thead th {
            font-size: 12px;
            font-weight: 600;
            color: var(--zeno-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.04em;
            border-bottom: 1px solid var(--zeno-border);
        }

        .zeno-table tbody tr {
            height: 56px;
            border-bottom: 1px solid var(--zeno-border);
        }

        .zeno-table tbody tr:hover {
            background: var(--zeno-bg-soft);
        }

        .zeno-deals-table thead th {
            text-transform: none;
            letter-spacing: normal;
        }

        .zeno-deals-table tbody tr.deals-table-row-recent {
            background: rgba(224, 242, 254, 0.85);
            box-shadow: inset 3px 0 0 0 rgba(14, 165, 233, 0.75);
        }

        .zeno-deals-table tbody tr.deals-table-row-recent:hover {
            background: rgba(186, 230, 253, 0.95);
        }

        .zeno-deals-table th.zeno-deals-th-resizable {
            position: relative;
        }

        #dealFiltersToggleBtn .deal-filters-chevron {
            transition: transform 0.22s ease;
            transform-origin: center center;
        }

        #dealFiltersToggleBtn.is-deals-filters-collapsed .deal-filters-chevron {
            transform: rotate(180deg);
        }

        .deals-table-scroll {
            overflow-x: visible;
            max-width: none;
            width: max-content;
            min-width: 100%;
        }

        #dealsListCard {
            overflow: visible;
            width: max-content;
            min-width: calc(100% - 2rem);
            max-width: none;
        }

        #dealsList {
            overflow: visible;
            width: max-content;
            min-width: 100%;
        }

        .zeno-deals-table {
            table-layout: fixed;
            width: max-content;
            max-width: none;
            background: var(--zeno-bg);
        }

        .zeno-deals-table thead th,
        .zeno-deals-table tbody td {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            box-sizing: border-box;
            background: var(--zeno-bg);
        }

        .zeno-deals-table tbody tr:hover td {
            background: var(--zeno-bg-soft);
        }

        .zeno-deals-table tbody tr.deals-table-row-recent td {
            background: rgba(224, 242, 254, 0.85);
        }

        .zeno-deals-table tbody tr.deals-table-row-recent:hover td {
            background: rgba(186, 230, 253, 0.95);
        }

        body.deals-col-resizing,
        body.deals-col-resizing * {
            cursor: col-resize !important;
            user-select: none !important;
        }

        body.deal-products-col-resizing,
        body.deal-products-col-resizing * {
            cursor: col-resize !important;
            user-select: none !important;
        }

        .zeno-deals-col-resize-handle {
            position: absolute;
            top: 0;
            right: -4px;
            width: 12px;
            height: 100%;
            cursor: col-resize;
            user-select: none;
            touch-action: none;
            z-index: 6;
        }

        .zeno-deals-col-resize-handle::after {
            content: '';
            position: absolute;
            top: 20%;
            bottom: 20%;
            right: 3px;
            width: 2px;
            border-radius: 1px;
            background: rgba(100, 116, 139, 0.35);
        }

        .zeno-deals-col-resize-handle:hover::after {
            background: rgba(79, 70, 229, 0.65);
        }

        .zeno-pager {
            background: var(--zeno-bg-soft);
            border-top: 1px solid var(--zeno-border);
        }

        .zeno-page-btn {
            height: 32px;
            min-width: 32px;
            padding: 0 10px;
            border-radius: 8px;
            border: 1px solid var(--zeno-border);
            background: var(--zeno-bg);
            color: var(--zeno-text-secondary);
            font-size: 14px;
            transition: all 0.15s ease;
        }

        .zeno-page-btn:hover {
            background: var(--zeno-bg-soft);
        }

        .zeno-page-btn-active {
            border-color: var(--zeno-primary);
            background: var(--zeno-primary);
            color: #fff;
        }

        .zeno-page-btn-active:hover {
            background: var(--zeno-primary);
            color: #fff;
        }

        .zeno-page-btn-disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* Шапка карточки сделки */
        .deal-page-header-wrap {
            background: transparent;
        }
        .deal-page-header-main {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: center;
            gap: 12px 20px;
            padding: 6px 0 8px;
        }
        .deal-page-header-actions {
            margin-top: 6px;
        }
        .deal-page-header-titleline {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            column-gap: 10px;
            row-gap: 8px;
        }
        .deal-page-header-titleline .deal-page-header-number-input {
            margin-right: 4px;
        }
        @media (max-width: 900px) {
            .deal-page-header-main {
                grid-template-columns: 1fr;
                justify-items: stretch;
            }
            .deal-page-header-actions {
                margin-top: 0;
                align-items: flex-end;
                width: 100%;
            }
        }
        .deal-page-header-title-prefix {
            font-size: 1.375rem;
            font-weight: 700;
            color: #111827;
            line-height: 1.25;
        }
        .deal-page-header-number-input {
            font-size: 1.375rem;
            font-weight: 700;
            color: #111827;
            line-height: 1.25;
            border: none;
            border-bottom: 1px dashed #d1d5db;
            background: transparent;
            min-width: 7rem;
            max-width: min(28rem, 100%);
            padding: 0 0 3px 0;
            margin: 0;
        }
        .deal-page-header-number-input::placeholder {
            color: #9ca3af;
            font-weight: 600;
        }
        .deal-page-header-number-input:focus {
            outline: none;
            border-bottom-color: #3b82f6;
        }
        .deal-page-header-sub {
            font-size: 0.8125rem;
            color: #6b7280;
            line-height: 1.4;
            margin: 0;
        }
        .deal-mock-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 5px 12px;
            border-radius: 9999px;
            font-size: 0.8125rem;
            font-weight: 500;
            white-space: nowrap;
        }
        .deal-mock-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            flex-shrink: 0;
        }
        .deal-mock-pill-warn {
            background: #ffedd5;
            color: #c2410c;
        }
        .deal-mock-dot-warn {
            background: #ea580c;
        }
        .deal-mock-pill-new {
            background: #e0e7ff;
            color: #4338ca;
        }
        /* Статусы сделки: как «Проведено» / «Не оплачено» — пилюля + шарик слева (оттенки из цвета статуса в JS) */
        .deal-status-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 5px 12px;
            border-radius: 9999px;
            font-size: 0.8125rem;
            font-weight: 500;
            line-height: 1.25;
            white-space: nowrap;
            box-sizing: border-box;
        }
        .deal-status-pill-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            flex-shrink: 0;
        }
        .deal-status-pill-label {
            min-width: 0;
        }
        .deal-status-pill-trigger.deal-status-pill {
            display: inline-flex !important;
            justify-content: flex-start;
            border: none !important;
            box-shadow: none !important;
            cursor: pointer;
            min-height: 0 !important;
        }
        #deal-meta-status-cs .deal-status-pill-trigger .custom-select-chevron {
            display: none !important;
        }
        .deal-mock-pill-done {
            background: #dcfce7;
            color: #166534;
        }
        .deal-mock-dot-done {
            background: #16a34a;
        }
        /* Печать в шапке сделки — как кнопка печати в тулбаре списка сделок */
        #dealPageMeta .deal-header-print.zeno-gear-btn {
            width: 30px;
            height: 30px;
            border-radius: 8px;
            border: 1px solid var(--zeno-border);
            background: var(--zeno-bg);
            cursor: pointer;
            flex-shrink: 0;
        }
        #dealPageMeta .deal-header-print.zeno-gear-btn:hover {
            background: var(--zeno-bg-soft);
        }
        #dealHeaderPrintWrap .zeno-print-menu {
            left: 0;
            right: auto;
        }
        .deal-managed-field-link {
            display: flex;
            align-items: center;
            box-sizing: border-box;
            min-height: 40px;
            color: var(--zeno-primary);
            font-size: 14px;
            font-weight: 500;
            line-height: 1.25;
            text-decoration: none;
            cursor: pointer;
        }
        .deal-managed-field-link:hover,
        .deal-managed-field-link:focus {
            color: var(--zeno-primary);
            text-decoration: none;
        }
        .deal-managed-field-link.is-disabled {
            color: var(--zeno-text-muted);
            cursor: default;
        }
        .deal-header-ms-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 5px 12px;
            border-radius: 9999px;
            font-size: 0.8125rem;
            font-weight: 500;
            line-height: 1.25;
            white-space: nowrap;
            background: #dbeafe;
            color: #1d4ed8;
            text-decoration: none;
            transition: background 0.15s ease, color 0.15s ease;
        }
        .deal-header-ms-pill:hover {
            background: #bfdbfe;
            color: #1e3a8a;
        }
        .deal-header-btn {
            padding: 9px 20px;
            border-radius: 12px;
            font-size: 0.875rem;
            font-weight: 600;
            transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
        }
        .deal-header-btn-close {
            border: 1px solid #d1d5db;
            background: #fff;
            color: #111827;
            font-weight: 600;
        }
        .deal-header-btn-close:hover {
            background: #f9fafb;
        }
        .deal-header-btn-save {
            border: none;
            background: #5e66f1;
            color: #fff;
            font-weight: 600;
        }
        .deal-header-btn-save:hover {
            background: #5058e0;
        }
        .deal-header-btn-save:disabled {
            opacity: 0.65;
            cursor: not-allowed;
        }
        .deal-header-btn-delete {
            border: none;
            background: #ef4444;
            color: #fff;
            font-weight: 600;
        }
        .deal-header-btn-delete:hover {
            background: #dc2626;
        }
        .deal-field-label {
            display: block;
            font-size: 0.75rem;
            font-weight: 500;
            color: #6b7280;
            margin-bottom: 0.25rem;
        }
        .deal-products-wrap {
            min-width: 0;
            max-width: 100%;
            overflow-x: auto;
        }
        .deal-products-summary-card {
            box-shadow: none;
        }
        #dealProducts {
            width: 100%;
            max-width: 100%;
            min-width: 0;
            --deal-col-num: 44px;
            --deal-col-name: 320px;
            --deal-col-qty: 88px;
            --deal-col-reserve: 76px;
            --deal-col-price: 96px;
            --deal-col-vat: 82px;
            --deal-col-discount: 92px;
            --deal-col-total: 104px;
            --deal-products-track-width: 100%;
            --deal-name-avito: 120px;
            --deal-name-title: 96px;
            --deal-grid-template: var(--deal-col-num) var(--deal-col-name) var(--deal-col-qty) var(--deal-col-reserve) var(--deal-col-price) var(--deal-col-vat) var(--deal-col-discount) var(--deal-col-total);
        }
        #dealProducts.deal-products-hide-vat {
            --deal-grid-template: var(--deal-col-num) var(--deal-col-name) var(--deal-col-qty) var(--deal-col-reserve) var(--deal-col-price) var(--deal-col-discount) var(--deal-col-total);
        }
        #dealProducts.deal-products-hide-discount {
            --deal-grid-template: var(--deal-col-num) var(--deal-col-name) var(--deal-col-qty) var(--deal-col-reserve) var(--deal-col-price) var(--deal-col-vat) var(--deal-col-total);
        }
        #dealProducts.deal-products-hide-vat.deal-products-hide-discount {
            --deal-grid-template: var(--deal-col-num) var(--deal-col-name) var(--deal-col-qty) var(--deal-col-reserve) var(--deal-col-price) var(--deal-col-total);
        }
        #dealProducts.deal-products-hide-vat .deal-col-vat,
        #dealProducts.deal-products-hide-vat .deal-vat {
            display: none !important;
        }
        #dealProducts.deal-products-hide-discount .deal-col-discount,
        #dealProducts.deal-products-hide-discount .deal-discount {
            display: none !important;
        }
        .deal-products-table-head {
            display: grid;
            grid-template-columns: var(--deal-grid-template);
            gap: 4px 6px;
            align-items: center;
            padding: 8px 0 10px;
            font-size: 0.75rem;
            font-weight: 600;
            color: #6b7280;
            border-bottom: 1px solid #e5e7eb;
            width: var(--deal-products-track-width, 100%);
            min-width: var(--deal-products-track-width, auto);
            box-sizing: border-box;
        }
        .deal-products-table-head .deal-col-right {
            text-align: right;
            justify-content: flex-end;
        }
        .deal-products-head-cell {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 4px;
            min-height: 1.75rem;
            min-width: 0;
            user-select: none;
            padding-right: 10px;
        }
        .deal-products-head-cell .deal-products-col-resizer,
        .deal-products-head-name .deal-products-col-resizer {
            position: absolute;
            top: 0;
            right: -4px;
            width: 12px;
            height: 100%;
            cursor: col-resize;
            user-select: none;
            touch-action: none;
            z-index: 6;
        }
        .deal-products-head-cell .deal-products-col-resizer::after,
        .deal-products-head-name .deal-products-col-resizer::after {
            content: '';
            position: absolute;
            top: 20%;
            bottom: 20%;
            right: 3px;
            width: 2px;
            border-radius: 1px;
            background: rgba(100, 116, 139, 0.35);
            transition: background-color 0.12s ease;
        }
        .deal-products-head-cell .deal-products-col-resizer:hover::after,
        .deal-products-head-cell .deal-products-col-resizer.is-resizing::after,
        .deal-products-head-name .deal-products-col-resizer:hover::after,
        .deal-products-head-name .deal-products-col-resizer.is-resizing::after {
            background: rgba(79, 70, 229, 0.65);
        }
        .deal-products-table-head [data-col-key] {
            min-width: 0;
        }
        .deal-products-table-head .deal-head-draggable {
            cursor: move;
        }
        .deal-products-table-head .deal-head-drag-over {
            background: rgba(88, 104, 242, 0.08);
            border-radius: 6px;
        }
        .deal-products-head-num {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 1.75rem;
            padding: 0;
        }
        .deal-products-head-name {
            display: grid;
            grid-template-columns: var(--deal-name-avito, 120px) var(--deal-name-title, 1fr);
            gap: 4px;
            align-items: center;
            text-align: left;
            min-width: 0;
            justify-content: flex-start;
            margin-left: 0;
            padding-left: 0;
            position: relative;
            padding-right: 10px;
        }
        .deal-name-head-part {
            position: relative;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            min-width: 0;
            overflow: hidden;
            padding-right: 6px;
        }
        .deal-name-head-label {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .deal-name-part-resizer {
            position: absolute;
            top: 0;
            right: -4px;
            width: 12px;
            height: 100%;
            cursor: col-resize;
            user-select: none;
            touch-action: none;
            z-index: 7;
        }
        .deal-name-part-resizer::after {
            content: '';
            position: absolute;
            top: 15%;
            bottom: 15%;
            left: 50%;
            width: 2px;
            margin-left: -1px;
            border-radius: 1px;
            background: transparent;
            transition: background-color 0.12s ease;
        }
        .deal-name-part-resizer:hover::after,
        .deal-name-part-resizer.is-resizing::after {
            background: #5868F2;
        }
        body.deal-name-part-resizing {
            cursor: col-resize !important;
            user-select: none !important;
        }
        body.deal-name-part-resizing * {
            cursor: col-resize !important;
        }
        .deal-products-bulk-delete {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.125rem;
            margin-left: 0.125rem;
            border: none;
            background: transparent;
            color: #dc2626;
            border-radius: 0.25rem;
            cursor: pointer;
            transition: background-color 0.12s ease, color 0.12s ease;
        }
        .deal-products-bulk-delete:hover {
            background: #fef2f2;
            color: #b91c1c;
        }
        .deal-products-bulk-delete:focus {
            outline: none;
            box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.35);
        }
        .deal-reserve-head-inner {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: flex-end;
            max-width: 100%;
        }
        .deal-reserve-menu-trigger {
            border: none;
            background: transparent;
            font: inherit;
            font-size: 0.75rem;
            font-weight: 600;
            color: #6b7280;
            cursor: pointer;
            padding: 0 2px 0 0;
            display: inline-flex;
            align-items: center;
            gap: 2px;
            white-space: nowrap;
        }
        .deal-reserve-menu-trigger:hover {
            color: #374151;
        }
        .deal-reserve-menu-trigger:focus {
            outline: none;
            box-shadow: 0 0 0 2px rgba(88, 104, 242, 0.25);
            border-radius: 4px;
        }
        .deal-reserve-chevron {
            font-size: 0.65rem;
            line-height: 1;
            opacity: 0.75;
        }
        .deal-reserve-bulk-menu {
            position: absolute;
            right: 0;
            top: calc(100% + 6px);
            min-width: 188px;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 0.375rem;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
            z-index: 45;
            padding: 4px 0;
        }
        .deal-reserve-bulk-menu button {
            display: block;
            width: 100%;
            text-align: left;
            padding: 8px 12px;
            font-size: 0.8125rem;
            border: none;
            background: none;
            cursor: pointer;
            color: #374151;
        }
        .deal-reserve-bulk-menu button:hover {
            background: #f9fafb;
        }
        .deal-product-grid-row {
            display: grid;
            grid-template-columns: var(--deal-grid-template);
            gap: 4px 6px;
            align-items: center;
            padding: 8px 0;
            border-bottom: 1px solid #f3f4f6;
            width: var(--deal-products-track-width, 100%);
            min-width: var(--deal-products-track-width, auto);
            box-sizing: border-box;
        }
        .deal-product-grid-row:last-child {
            border-bottom: none;
        }
        .deal-product-name-cell {
            display: grid;
            grid-template-columns: var(--deal-name-avito, 120px) var(--deal-name-title, minmax(0, 1fr));
            align-items: center;
            gap: 4px;
            min-width: 0;
        }
        .deal-product-name-cell .deal-avito {
            width: 100%;
            min-width: 0;
        }
        .deal-product-name-cell .deal-title {
            width: 100%;
            min-width: 0;
        }
        .deal-detail-tabs {
            margin: 0;
        }
        .deal-detail-tabs-row {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 1rem 1.5rem;
            padding: 0.25rem 0;
        }
        .deal-detail-tabs-row button.deal-detail-tab {
            margin: 0;
            padding: 0.125rem 0;
            background: none;
            border: none;
            border-bottom: 2px solid transparent;
            cursor: pointer;
            font: inherit;
            color: #9ca3af;
        }
        .deal-detail-tabs-row button.deal-detail-tab.deal-detail-tab-active {
            color: #5868F2;
            border-bottom-color: #5868F2;
        }
        .deal-detail-tabs-row button.deal-detail-tab:hover {
            color: #4b5563;
        }
        .deal-detail-tabs-row button.deal-detail-tab.deal-detail-tab-active:hover {
            color: #5868F2;
        }
        .deal-detail-tabs-row button.deal-detail-tab:focus {
            outline: none;
            box-shadow: 0 0 0 2px rgba(88, 104, 242, 0.25);
            border-radius: 4px;
        }
        .deal-related-flow {
            display: flex;
            align-items: center;
            flex-wrap: nowrap;
            gap: 0;
            padding: 4px 0 8px;
            overflow-x: auto;
        }
        .deal-related-node {
            flex: 0 0 auto;
            min-width: 0;
        }
        .deal-related-connector {
            flex: 0 0 auto;
            display: flex;
            align-items: center;
            width: 52px;
            padding: 0 2px;
            align-self: center;
        }
        .deal-related-link-line {
            flex: 1 1 auto;
            height: 2px;
            background: #c5cdd3;
        }
        .deal-related-link-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #9aa5ad;
            flex-shrink: 0;
        }
        .deal-related-card {
            display: flex;
            flex-direction: column;
            width: 200px;
            min-height: 118px;
            border-radius: 4px;
            overflow: hidden;
            text-align: left;
            box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
        }
        .deal-related-card--clickable {
            margin: 0;
            padding: 0;
            border: none;
            cursor: pointer;
            font: inherit;
            transition: transform 0.12s ease, box-shadow 0.12s ease;
        }
        .deal-related-card--clickable:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
        }
        .deal-related-card--clickable:focus {
            outline: none;
            box-shadow: 0 0 0 2px rgba(88, 104, 242, 0.35), 0 1px 3px rgba(15, 23, 42, 0.12);
        }
        .deal-related-card--dark {
            background: #3d4a52;
            color: #fff;
        }
        .deal-related-card--light {
            background: #fff;
            color: #111827;
            border: 1px solid #d1d5db;
        }
        .deal-related-card-head {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.625rem 0.75rem 0.375rem;
            min-height: 2rem;
        }
        .deal-related-card-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            line-height: 0;
        }
        .deal-related-card-icon .cc-ch-svg svg {
            width: 1.125rem;
            height: 1.125rem;
            display: block;
        }
        .deal-related-card-title {
            font-size: 0.8125rem;
            font-weight: 700;
            line-height: 1.25;
        }
        .deal-related-card-body {
            padding: 0 0.75rem 0.5rem;
            flex: 1 1 auto;
        }
        .deal-related-card-line-main {
            font-size: 0.8125rem;
            font-weight: 600;
            line-height: 1.35;
            word-break: break-word;
        }
        .deal-related-card--dark .deal-related-card-line-main {
            color: #fff;
        }
        .deal-related-card--light .deal-related-card-line-main {
            color: #111827;
        }
        .deal-related-card-line-sub {
            margin-top: 0.25rem;
            font-size: 0.75rem;
            line-height: 1.35;
            word-break: break-word;
        }
        .deal-related-card--dark .deal-related-card-line-sub {
            color: rgba(255, 255, 255, 0.72);
        }
        .deal-related-card--light .deal-related-card-line-sub {
            color: #6b7280;
        }
        .deal-related-card-foot {
            padding: 0.4375rem 0.75rem;
            font-size: 0.6875rem;
            font-weight: 600;
            line-height: 1.2;
            text-align: center;
            letter-spacing: 0.01em;
        }
        .deal-related-card--light .deal-related-card-foot {
            background: #9ca3af;
            color: #fff;
        }
        .deal-related-card--chat.deal-related-card--light .deal-related-card-foot {
            background: #5868F2;
        }
        .deal-related-card--contact.deal-related-card--light .deal-related-card-foot {
            background: #9ca3af;
        }
        .deal-related-chat-icon-fallback {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 1.125rem;
            height: 1.125rem;
            font-size: 0.875rem;
            color: #fff;
        }
        .deal-related-card--light .deal-related-chat-icon-fallback {
            color: #5868F2;
        }
        @media (max-width: 520px) {
            .deal-related-flow {
                flex-direction: column;
                align-items: stretch;
            }
            .deal-related-node {
                width: 100%;
            }
            .deal-related-card {
                width: 100%;
                max-width: 280px;
            }
            .deal-related-connector {
                width: auto;
                height: 36px;
                flex-direction: column;
                padding: 2px 0;
                align-self: center;
            }
            .deal-related-link-line {
                width: 2px;
                height: 100%;
                flex: 1 1 auto;
            }
        }
        .deal-order-cols-icon-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.375rem;
            border: 1px solid #e5e7eb;
            border-radius: 0.375rem;
            background: #fff;
            color: #5868F2;
            cursor: pointer;
            transition: background-color 0.12s ease, border-color 0.12s ease;
        }
        .deal-order-cols-icon-btn:hover {
            background: #f9fafb;
            border-color: #d1d5db;
        }
        .deal-order-cols-icon-btn:focus {
            outline: none;
            box-shadow: 0 0 0 2px rgba(88, 104, 242, 0.35);
        }
        input.deal-products-select-all {
            width: 1rem;
            height: 1rem;
            margin: 0;
            flex-shrink: 0;
            border-radius: 9999px;
            border: 2px solid #d1d5db;
            background: #fff;
            appearance: none;
            cursor: pointer;
            transition: border-color 0.12s ease, background-color 0.12s ease;
        }
        input.deal-products-select-all:checked {
            background-color: #5868F2;
            border-color: #5868F2;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 6l2.5 2.5L9.5 3.5'/%3E%3C/svg%3E");
            background-size: 10px 10px;
            background-position: center;
            background-repeat: no-repeat;
        }
        input.deal-products-select-all:focus-visible {
            outline: 2px solid rgba(88, 104, 242, 0.45);
            outline-offset: 1px;
        }
        .deal-line-num-cell {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 1.75rem;
        }
        .deal-line-num-cell .deal-index {
            transition: opacity 0.12s ease;
        }
        .deal-line-num-cell:hover .deal-index,
        .deal-line-num-cell:focus-within .deal-index,
        .deal-line-num-cell:has(.deal-row-select:checked) .deal-index {
            opacity: 0;
            pointer-events: none;
        }
        .deal-line-select-wrap {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            display: flex;
            align-items: center;
            justify-content: center;
            width: 1rem;
            height: 1rem;
            cursor: pointer;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.12s ease;
        }
        .deal-line-num-cell:hover .deal-line-select-wrap,
        .deal-line-num-cell:focus-within .deal-line-select-wrap,
        .deal-line-num-cell:has(.deal-row-select:checked) .deal-line-select-wrap {
            opacity: 1;
            pointer-events: auto;
        }
        .deal-row-select {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            margin: 0;
            opacity: 0;
            cursor: pointer;
        }
        .deal-line-check-ui {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 1rem;
            height: 1rem;
            border-radius: 9999px;
            border: 2px solid #d1d5db;
            background: #fff;
            pointer-events: none;
            color: #fff;
            box-sizing: border-box;
        }
        .deal-line-num-cell:has(.deal-row-select:checked) .deal-line-check-ui {
            background-color: #5868F2;
            border-color: #5868F2;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 6l2.5 2.5L9.5 3.5'/%3E%3C/svg%3E");
            background-size: 10px 10px;
            background-position: center;
            background-repeat: no-repeat;
        }
        .deal-line-check-ui .fa-check {
            display: none;
        }
        .deal-product-grid-row .deal-avito,
        .deal-product-grid-row .deal-title,
        .deal-product-grid-row .deal-qty,
        .deal-product-grid-row .deal-reserve,
        .deal-product-grid-row .deal-price,
        .deal-product-grid-row .deal-vat,
        .deal-product-grid-row .deal-discount,
        .deal-product-grid-row .deal-total {
            border: none !important;
            border-radius: 0;
            box-shadow: none;
            background: transparent;
            padding-left: 0;
            padding-right: 0;
        }
        .deal-product-grid-row .deal-avito:focus,
        .deal-product-grid-row .deal-title:focus,
        .deal-product-grid-row .deal-qty:focus,
        .deal-product-grid-row .deal-reserve:focus,
        .deal-product-grid-row .deal-price:focus,
        .deal-product-grid-row .deal-vat:focus,
        .deal-product-grid-row .deal-discount:focus {
            outline: none;
            box-shadow: 0 0 0 1px rgba(88, 104, 242, 0.35);
            border-radius: 0.25rem;
        }
        .deal-product-grid-row .deal-total {
            color: #111827;
        }
        .deal-product-grid-row .deal-qty,
        .deal-product-grid-row .deal-reserve,
        .deal-product-grid-row .deal-price,
        .deal-product-grid-row .deal-vat,
        .deal-product-grid-row .deal-discount,
        .deal-product-grid-row .deal-total {
            text-align: right !important;
            direction: ltr;
        }
        .deal-product-grid-row input.deal-qty::-webkit-outer-spin-button,
        .deal-product-grid-row input.deal-qty::-webkit-inner-spin-button,
        .deal-product-grid-row input.deal-reserve::-webkit-outer-spin-button,
        .deal-product-grid-row input.deal-reserve::-webkit-inner-spin-button,
        .deal-product-grid-row input.deal-price::-webkit-outer-spin-button,
        .deal-product-grid-row input.deal-price::-webkit-inner-spin-button,
        .deal-product-grid-row input.deal-vat::-webkit-outer-spin-button,
        .deal-product-grid-row input.deal-vat::-webkit-inner-spin-button,
        .deal-product-grid-row input.deal-discount::-webkit-outer-spin-button,
        .deal-product-grid-row input.deal-discount::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        .deal-product-grid-row input.deal-qty,
        .deal-product-grid-row input.deal-reserve,
        .deal-product-grid-row input.deal-price,
        .deal-product-grid-row input.deal-vat,
        .deal-product-grid-row input.deal-discount {
            -moz-appearance: textfield;
        }
        .deal-order-cols-menu {
            position: absolute;
            right: 0;
            top: calc(100% + 8px);
            z-index: 40;
            width: min(280px, 92vw);
            padding: 10px 12px;
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            background: #fff;
            box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
        }
        .deal-order-cols-menu-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 4px 0;
            font-size: 13px;
            color: #374151;
        }
        .deal-order-cols-menu-hint {
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid #f3f4f6;
            font-size: 12px;
            color: #6b7280;
        }
        .deal-ms-ctr-suggest {
            z-index: 30;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
        }
        .deal-ms-ctr-suggest button:last-child {
            border-bottom: none !important;
        }
        .deal-ms-ctr-input-row {
            display: flex;
            align-items: center;
            gap: 0.375rem;
            width: 100%;
            max-width: 100%;
        }
        .deal-ms-ctr-input-wrap {
            position: relative;
            flex: 1;
            min-width: 0;
        }
        .deal-ms-ctr-add-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 2.25rem;
            height: 2.5rem;
            border-radius: 0.375rem;
            border: 1px solid #d1d5db;
            background: #fff;
            color: #2563eb;
            font-size: 1.125rem;
            line-height: 1;
            font-weight: 600;
            flex-shrink: 0;
        }
        .deal-ms-ctr-add-btn:hover {
            background: #eff6ff;
            border-color: #93c5fd;
        }
        .deal-ms-ctr-add-btn svg {
            width: 1rem;
            height: 1rem;
            display: block;
        }
        .deal-ms-ctr-add-btn.hidden {
            display: none !important;
        }
        /* Карточка контакта поверх оверлея сделки (сделка z-100, карточка по умолчанию z-70) */
        #contactDetailView.contact-detail-from-deal {
            z-index: 130 !important;
            pointer-events: auto !important;
        }
        #contactsContent.contact-detail-from-deal-host {
            position: fixed;
            inset: 0;
            z-index: 130;
            overflow: hidden;
            background: transparent;
            pointer-events: none;
        }
        #contactsContent.contact-detail-from-deal-host #contactDetailView.contact-detail-from-deal {
            pointer-events: auto;
        }
        body.contact-from-deal-overlay #contactModal {
            z-index: 140;
        }
        /* Модалка «Новый контрагент» — в стиле «Настройки аккаунта МойСклад» (admin_panel) */
        #msCtrCreateModal.sc-modal-overlay {
            position: fixed;
            inset: 0;
            z-index: 10050;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            background: rgba(17, 24, 39, 0.55);
        }
        #msCtrCreateModal.sc-modal-overlay.hidden {
            display: none;
        }
        #msCtrCreateModal .sc-modal-wrap {
            position: relative;
            width: 100%;
            max-width: 720px;
        }
        #msCtrCreateModal .sc-modal.ms-settings-modal {
            max-width: 720px;
            max-height: min(90vh, 860px);
            display: flex;
            flex-direction: column;
            padding: 24px 20px 20px;
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
        }
        #msCtrCreateModal .ms-ctr-modal-head {
            flex-shrink: 0;
            padding-right: 28px;
        }
        #msCtrCreateModal .sc-modal-title {
            margin: 0 0 12px;
            font-size: 18px;
            font-weight: 700;
            text-align: left;
            color: var(--zeno-text-main);
        }
        #msCtrCreateModal #msCtrCreateError {
            flex-shrink: 0;
        }
        #msCtrCreateModal .sc-modal-close {
            position: absolute;
            top: 12px;
            right: 12px;
            width: 32px;
            height: 32px;
            border: none;
            border-radius: 8px;
            background: transparent;
            color: var(--zeno-text-muted, #6B7280);
            cursor: pointer;
            font-size: 20px;
            line-height: 1;
            z-index: 2;
        }
        #msCtrCreateModal .sc-modal-close:hover {
            background: #f3f4f6;
            color: var(--zeno-text-main);
        }
        #msCtrCreateModal .ms-settings-body {
            overflow-y: auto;
            flex: 1;
            min-height: 0;
            padding-right: 2px;
        }
        #msCtrCreateModal .ms-settings-section {
            margin-bottom: 22px;
            padding-bottom: 22px;
            border-bottom: 1px solid var(--zeno-border);
        }
        #msCtrCreateModal .ms-settings-section:last-child {
            margin-bottom: 0;
            padding-bottom: 0;
            border-bottom: none;
        }
        #msCtrCreateModal .ms-settings-section-title {
            margin: 0;
            font-size: 15px;
            font-weight: 700;
            color: var(--zeno-text-main);
        }
        #msCtrCreateModal .ms-ctr-section-head-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 0;
        }
        #msCtrCreateModal .ms-ctr-create-section.is-open .ms-ctr-section-head-row {
            margin-bottom: 12px;
        }
        #msCtrCreateModal .ms-ctr-section-toggle-btn {
            display: inline-flex;
            align-items: center;
            justify-content: flex-start;
            gap: 6px;
            flex: 0 1 auto;
            min-width: 0;
            margin: 0;
            padding: 0;
            border: none;
            background: none;
            cursor: pointer;
            text-align: left;
            font: inherit;
            color: inherit;
        }
        #msCtrCreateModal .ms-ctr-section-toggle-btn:hover .ms-settings-section-title {
            color: #4338CA;
        }
        #msCtrCreateModal .ms-ctr-section-toggle-btn:focus-visible {
            outline: none;
            box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.35);
            border-radius: 6px;
        }
        #msCtrCreateModal .ms-ctr-section-chevron {
            flex-shrink: 0;
            width: 16px;
            height: 16px;
            opacity: 0.55;
            transition: transform 0.2s ease, opacity 0.15s ease;
        }
        #msCtrCreateModal .ms-ctr-create-section.is-open .ms-ctr-section-chevron {
            transform: rotate(180deg);
            opacity: 0.85;
        }
        #msCtrCreateModal .ms-ctr-section-head-extra {
            flex-shrink: 0;
            margin-left: auto;
        }
        #msCtrCreateModal .ms-settings-error {
            margin: 0 0 12px;
            padding: 10px 12px;
            border-radius: 8px;
            font-size: 13px;
            line-height: 1.4;
            color: #B91C1C;
            background: #FEE2E2;
            border: 1px solid #fecaca;
        }
        #msCtrCreateModal .ms-settings-error.hidden {
            display: none;
        }
        #msCtrCreateModal .sc-field {
            margin-bottom: 16px;
        }
        #msCtrCreateModal .sc-field:last-child {
            margin-bottom: 0;
        }
        #msCtrCreateModal .sc-field label {
            display: block;
            margin-bottom: 6px;
            font-size: 13px;
            font-weight: 500;
            color: var(--zeno-text-main);
        }
        #msCtrCreateModal .sc-field input:not([type="checkbox"]),
        #msCtrCreateModal .sc-field select,
        #msCtrCreateModal .sc-field textarea {
            width: 100%;
            box-sizing: border-box;
            padding: 12px 14px;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            font-size: 14px;
            color: var(--zeno-text-main);
            background: #fff;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }
        #msCtrCreateModal .sc-field input:focus,
        #msCtrCreateModal .sc-field select:focus,
        #msCtrCreateModal .sc-field textarea:focus {
            outline: none;
            border-color: #5865F2;
            box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
        }
        #msCtrCreateModal .sc-field-req {
            color: #DC2626;
        }
        #msCtrCreateModal .sc-field--inline {
            margin-bottom: 0;
        }
        #msCtrCreateModal .sc-field--inline label {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            margin: 0;
            font-weight: 500;
            cursor: pointer;
        }
        #msCtrCreateModal .ms-ctr-field-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0 12px;
        }
        @media (max-width: 640px) {
            #msCtrCreateModal .ms-ctr-field-grid {
                grid-template-columns: 1fr;
            }
        }
        #msCtrCreateModal .ms-ctr-field-grid-3 {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }
        @media (max-width: 768px) {
            #msCtrCreateModal .ms-ctr-field-grid-3 {
                grid-template-columns: 1fr;
            }
        }
        #msCtrCreateModal .ms-ctr-field-grid-4 {
            grid-template-columns: repeat(4, minmax(0, 1fr));
        }
        @media (max-width: 900px) {
            #msCtrCreateModal .ms-ctr-field-grid-4 {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }
        @media (max-width: 480px) {
            #msCtrCreateModal .ms-ctr-field-grid-4 {
                grid-template-columns: 1fr;
            }
        }
        #msCtrCreateModal .ms-settings-section-hint {
            margin: 0 0 12px;
            font-size: 12px;
            line-height: 1.45;
            color: var(--zeno-text-muted, #6B7280);
        }
        #msCtrCreateModal .ms-ctr-create-row-item {
            margin-top: 8px;
            padding: 10px 12px;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
        }
        #msCtrCreateModal .ms-settings-action-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            height: 28px;
            padding: 0 10px;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            background: #fff;
            color: #4338CA;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
        }
        #msCtrCreateModal .ms-settings-action-btn:hover {
            background: #EEF2FF;
            border-color: #c7d2fe;
        }
        #msCtrCreateModal .ms-settings-action-btn--danger {
            color: #B91C1C;
        }
        #msCtrCreateModal .ms-settings-action-btn--danger:hover {
            background: #FEE2E2;
            border-color: #fecaca;
        }
        #msCtrCreateModal .ms-ctr-create-actions {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 16px;
            padding-top: 4px;
            flex-shrink: 0;
            border-top: 1px solid var(--zeno-border);
        }
        #msCtrCreateModal .connections-btn-primary {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            height: 44px;
            padding: 0 20px;
            border: none;
            border-radius: 8px;
            background: #5865F2;
            color: #fff;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.15s ease;
        }
        #msCtrCreateModal .connections-btn-primary:hover {
            background: #4752C4;
        }
        #msCtrCreateModal .connections-btn-primary:disabled {
            opacity: 0.65;
            cursor: not-allowed;
        }
        #msCtrCreateModal .connections-btn-secondary {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            height: 44px;
            padding: 0 20px;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            background: #fff;
            color: var(--zeno-text-main);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
        }
        #msCtrCreateModal .connections-btn-secondary:hover {
            background: #f9fafb;
        }
        .deal-basic-fields-layout {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
        }
        @media (min-width: 768px) {
            .deal-basic-fields-layout {
                grid-template-columns: minmax(0, 1fr) minmax(10rem, 26%);
                align-items: stretch;
            }
            .deal-basic-fields-comment {
                display: flex;
                flex-direction: column;
                min-height: 0;
            }
            .deal-basic-fields-comment textarea {
                flex: 1 1 auto;
                min-height: 7.5rem;
            }
        }
        .deal-custom-fields-block {
            margin-top: 1rem;
        }
        @media (min-width: 768px) {
            .deal-custom-fields-block {
                display: grid;
                grid-template-columns: minmax(0, 1fr) minmax(10rem, 26%);
                gap: 1rem;
            }
        }
        #dealDetailsBodyCard {
            background: transparent;
            box-shadow: none;
        }
        /* Единый фон раздела сделок (#F9FAFB), без полосы другого оттенка по краям и в центре */
        #dealsContent {
            background-color: #F9FAFB;
        }
        .deals-content-overlay {
            background-color: #F9FAFB !important;
        }
        #dealsContent.deals-detail-scroll-host {
            position: fixed;
            left: 0;
            right: 0;
            bottom: 0;
            top: var(--zeno-topbar-height, 80px);
            z-index: 50;
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
            background-color: #F9FAFB;
            touch-action: pan-y;
        }
        body.connection-banner-active #dealsContent.deals-detail-scroll-host {
            top: calc(var(--connection-banner-height, 40px) + var(--zeno-topbar-height, 80px));
        }
        /* Фон скролла на весь экран, но шапка и тело сделки — в ширине .container.mx-auto */
        #dealsContent.deals-detail-scroll-host #dealDetailsPage,
        #dealsContent.deals-content-overlay #dealDetailsPage {
            box-sizing: border-box;
            width: 100%;
            margin-left: auto;
            margin-right: auto;
            padding-left: 0.5rem;
            padding-right: 0.5rem;
        }
        @media (min-width: 640px) {
            #dealsContent.deals-detail-scroll-host #dealDetailsPage,
            #dealsContent.deals-content-overlay #dealDetailsPage {
                max-width: 640px;
            }
        }
        @media (min-width: 768px) {
            #dealsContent.deals-detail-scroll-host #dealDetailsPage,
            #dealsContent.deals-content-overlay #dealDetailsPage {
                max-width: 768px;
            }
        }
        @media (min-width: 1024px) {
            #dealsContent.deals-detail-scroll-host #dealDetailsPage,
            #dealsContent.deals-content-overlay #dealDetailsPage {
                max-width: 1024px;
            }
        }
        @media (min-width: 1280px) {
            #dealsContent.deals-detail-scroll-host #dealDetailsPage,
            #dealsContent.deals-content-overlay #dealDetailsPage {
                max-width: 1280px;
            }
        }
        @media (min-width: 1536px) {
            #dealsContent.deals-detail-scroll-host #dealDetailsPage,
            #dealsContent.deals-content-overlay #dealDetailsPage {
                max-width: 1536px;
            }
        }
        #contactDetailView.hidden,
        #contactDetailView[aria-hidden="true"] {
            pointer-events: none !important;
        }
        #contactDetailView:not(.hidden)[aria-hidden="false"] {
            pointer-events: auto;
        }
        #aiAuditRunsBody tr.ai-audit-run-row {
            cursor: pointer;
            transition: background-color 0.12s ease;
        }

        #aiAuditRunsBody tr.ai-audit-run-row:hover {
            background: var(--zeno-bg-soft);
        }

        #aiAuditRunsBody tr.ai-audit-run-row-active {
            background: rgba(88, 101, 242, 0.1);
        }

        #aiAuditRunsBody tr.ai-audit-run-row-active:hover {
            background: rgba(88, 101, 242, 0.14);
        }

        #aiAssistantsHubSection {
            max-width: 840px;
            width: 100%;
        }

        .ai-hub-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
            align-items: start;
            width: 100%;
        }
        .ai-hub-card {
            background: #fff;
            border-radius: 12px;
            box-shadow: var(--zeno-shadow);
            overflow: hidden;
        }
        .ai-hub-card-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            padding: 1rem 1.25rem;
            border-bottom: 1px solid rgba(68, 83, 113, 0.12);
        }
        .ai-hub-card-title {
            font-size: 1rem;
            font-weight: 700;
            color: var(--zeno-text-main);
        }
        .ai-hub-add-btn {
            border: 0;
            background: transparent;
            padding: 0;
            cursor: pointer;
            line-height: 0;
        }
        .ai-hub-add-btn:hover {
            opacity: 0.85;
        }
        .ai-hub-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.875rem;
        }
        .ai-hub-table th {
            text-align: left;
            font-weight: 600;
            color: var(--zeno-text-secondary);
            padding: 0.65rem 1rem;
            border-bottom: 1px solid rgba(68, 83, 113, 0.1);
            white-space: nowrap;
        }
        .ai-hub-table td {
            padding: 0.75rem 1rem;
            border-bottom: 1px solid rgba(68, 83, 113, 0.08);
            vertical-align: middle;
            color: var(--zeno-text-main);
        }
        .ai-hub-table tr:last-child td {
            border-bottom: 0;
        }
        .ai-hub-channels {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            flex-wrap: wrap;
        }
        .ai-hub-empty {
            padding: 2rem 1rem;
            text-align: center;
            color: var(--zeno-text-secondary);
            font-size: 0.875rem;
        }
        .ai-hub-card--audit .ai-hub-card-head {
            justify-content: flex-start;
            border-bottom: none;
            padding-bottom: 0.35rem;
        }
        .ai-hub-card--audit .ai-hub-card-head-title {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
        }
        .ai-hub-card--audit .ai-hub-table-wrap {
            overflow: visible;
            padding: 0 1rem 1rem;
        }
        .ai-hub-card--audit .ai-hub-table {
            table-layout: fixed;
        }
        .ai-hub-card--audit .ai-hub-table th,
        .ai-hub-card--audit .ai-hub-table td {
            border-bottom: none;
            white-space: normal;
            word-break: break-word;
        }
        .ai-hub-card--audit .ai-hub-table th {
            padding-top: 0.25rem;
            padding-bottom: 0.5rem;
            font-size: 0.8125rem;
        }
        .ai-hub-card--audit .ai-hub-table th:nth-child(1),
        .ai-hub-card--audit .ai-hub-table td:nth-child(1) {
            width: 34%;
            padding-left: 0;
        }
        .ai-hub-card--audit .ai-hub-table th:nth-child(2),
        .ai-hub-card--audit .ai-hub-table td:nth-child(2) {
            width: 16%;
        }
        .ai-hub-card--audit .ai-hub-table th:nth-child(3),
        .ai-hub-card--audit .ai-hub-table td:nth-child(3) {
            width: 18%;
        }
        .ai-hub-card--audit .ai-hub-table th:nth-child(4),
        .ai-hub-card--audit .ai-hub-table td:nth-child(4) {
            width: 26%;
        }
        .ai-hub-card--audit .ai-hub-table th:nth-child(5),
        .ai-hub-card--audit .ai-hub-table td:nth-child(5) {
            width: 14%;
            text-align: right;
            padding-right: 0;
            white-space: nowrap;
        }
        .ai-audit-config-row {
            cursor: pointer;
        }
        .ai-hub-card--audit .ai-audit-config-row td {
            background: transparent;
            transition: background 0.12s ease;
        }
        .ai-hub-card--audit .ai-audit-config-row:hover td {
            background: rgba(68, 83, 113, 0.06);
        }
        .ai-audit-config-row:focus-visible {
            outline: none;
        }
        .ai-audit-config-row:focus-visible td {
            background: rgba(37, 99, 235, 0.06);
        }
        .ai-audit-last-run-btn {
            border: 0;
            background: none;
            padding: 0;
            margin: 0;
            color: inherit;
            font: inherit;
            line-height: 1.35;
            text-align: left;
            cursor: pointer;
            text-decoration: underline;
            text-decoration-color: rgba(37, 99, 235, 0.35);
            text-underline-offset: 2px;
        }
        .ai-audit-last-run-btn:hover {
            color: #2563eb;
        }
        #aiAuditResultsModal .ai-audit-results-modal-panel {
            max-height: min(90vh, calc(100dvh - 2rem));
            min-height: 0;
            overflow: hidden;
        }
        #aiAuditResultsModal .ai-audit-results-modal-body {
            overflow-y: auto;
            flex: 1 1 auto;
            min-height: 0;
            -webkit-overflow-scrolling: touch;
        }
        #aiAuditResultsModal .ai-audit-chat-link {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 2px;
            border: 0;
            background: transparent;
            cursor: pointer;
            border-radius: 8px;
            line-height: 0;
            transition: background 0.12s ease;
        }
        #aiAuditResultsModal .ai-audit-chat-link:hover {
            background: rgba(68, 83, 113, 0.08);
        }
        #aiAuditResultsModal .ai-audit-chat-link:focus-visible {
            outline: 2px solid rgba(37, 99, 235, 0.45);
            outline-offset: 2px;
        }
        #aiAuditResultsModal .ai-audit-chat-link .cc-ch-svg {
            width: 24px;
            height: 24px;
            min-width: 24px;
        }
        #aiAuditResultsModal .ai-audit-chat-link .cc-ch-svg svg {
            width: 24px;
            height: 24px;
            display: block;
        }
        .ai-audit-config-name {
            font-weight: 600;
            line-height: 1.35;
        }
        .ai-audit-run-btn {
            white-space: nowrap;
            font-size: 0.75rem;
            line-height: 1.2;
            padding: 0.35rem 0.65rem;
        }
        .ai-audit-actions-cell {
            text-align: right;
            vertical-align: middle;
        }

        .bulk-send-modal-overlay.zeno-modal-overlay {
            padding: 1rem;
        }
        .bulk-send-modal-panel {
            display: flex;
            flex-direction: column;
            max-height: min(90vh, calc(100dvh - 2rem));
            overflow: visible;
        }
        .bulk-send-modal-body {
            overflow: visible;
        }
        .bulk-send-compose {
            overflow: visible;
        }
        .bulk-send-popover {
            z-index: 120;
        }
        .bulk-send-modal-close-btn {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            border: 1px solid var(--zeno-border, #e5e7eb);
            background: #fff;
            color: #6b7280;
            font-size: 1.5rem;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .bulk-send-modal-close-btn:hover {
            background: var(--zeno-bg-soft, #f3f4f6);
            color: #374151;
        }
        .bulk-send-modal-cancel-btn {
            height: 38px;
            padding: 0 1rem;
            border-radius: 8px;
            border: 1px solid var(--zeno-border, #e5e7eb);
            background: #fff;
            color: var(--zeno-text-main, #111827);
            font-size: 0.875rem;
            font-weight: 600;
        }
        .bulk-send-modal-cancel-btn:hover {
            background: var(--zeno-bg-soft, #f3f4f6);
        }
        .bulk-send-modal-send-btn {
            height: 38px;
            padding: 0 1.25rem;
            border-radius: 8px;
            border: 0;
            background: #5865F2;
            color: #fff;
            font-size: 0.875rem;
            font-weight: 600;
        }
        .bulk-send-modal-send-btn:hover {
            background: #4752c4;
        }
        .bulk-send-modal-send-btn:disabled {
            opacity: 0.55;
            cursor: not-allowed;
        }
        .bulk-send-compose {
            min-height: 140px;
        }
        .bulk-send-compose textarea {
            min-height: 88px;
            max-height: 200px;
        }
        .bulk-send-compose-toolbar {
            justify-content: flex-end;
        }
        .bulk-send-modal-head--v2 {
            border-bottom: none;
        }
        .bulk-send-modal-foot {
            border-top: none;
        }
        .bulk-send-channel-picker {
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding: 10px 12px;
            border: 1px solid var(--zeno-border, #e5e7eb);
            border-radius: 10px;
            background: var(--zeno-bg-soft, #f9fafb);
        }
        .bulk-send-channel-picker-title {
            font-size: 12px;
            font-weight: 600;
            color: var(--zeno-text-muted, #6b7280);
        }
        .bulk-send-channel-picker-row {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px;
        }
        .bulk-send-channel-option {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            padding: 0;
            border: 2px solid transparent;
            border-radius: 10px;
            background: #fff;
            cursor: pointer;
            user-select: none;
            transition: border-color 0.15s, background-color 0.15s, opacity 0.15s;
        }
        .bulk-send-channel-option input {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }
        .bulk-send-channel-option:has(input:checked) {
            border-color: #5865F2;
            background: #eef2ff;
        }
        .bulk-send-channel-option.is-disabled {
            opacity: 0.38;
            cursor: not-allowed;
            pointer-events: none;
        }
        .bulk-send-channel-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            pointer-events: none;
        }
        .bulk-send-channel-icon .cc-ch-svg {
            display: inline-flex;
            width: 26px;
            height: 26px;
        }
        .bulk-send-channel-icon .cc-ch-svg svg {
            width: 26px;
            height: 26px;
            display: block;
        }
        .bulk-send-recipients-hint {
            font-size: 12px;
            color: var(--zeno-text-muted, #6b7280);
        }
        #aiAuditConfigModal .ai-audit-channel-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            pointer-events: none;
        }
        #aiAuditConfigModal .ai-audit-channel-icon .cc-ch-svg {
            width: 20px;
            height: 20px;
            min-width: 20px;
        }
        #aiAuditConfigModal .ai-audit-channel-icon .cc-ch-svg svg {
            width: 20px;
            height: 20px;
            display: block;
        }
        .ai-audit-status {
            display: inline-block;
            padding: 0.2rem 0.55rem;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 600;
            line-height: 1.3;
            white-space: nowrap;
        }
        .ai-audit-status--completed {
            background: #dcfce7;
            color: #15803d;
        }
        .ai-audit-status--running {
            background: #fef9c3;
            color: #a16207;
        }
        .ai-audit-status--created,
        .ai-audit-status--pending {
            background: #e0e7ff;
            color: #4338ca;
        }
        .ai-audit-status--stopped {
            background: #f3f4f6;
            color: #4b5563;
        }
        .ai-audit-status--error {
            background: #fee2e2;
            color: #b91c1c;
        }
        .ai-audit-status--none {
            color: var(--zeno-text-secondary);
            font-weight: 500;
            padding: 0;
        }
        .ai-audit-last-run {
            font-size: 0.8125rem;
            line-height: 1.35;
            color: var(--zeno-text-main);
        }
        .ai-hub-card--assistants .ai-hub-card-head {
            justify-content: flex-start;
            border-bottom: none;
            padding-bottom: 0.35rem;
        }
        .ai-hub-card--assistants .ai-hub-card-head-title {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
        }
        .ai-hub-card--assistants .ai-hub-table-wrap {
            overflow: visible;
            padding: 0 1rem 1rem;
        }
        .ai-hub-card--assistants .ai-hub-table {
            table-layout: fixed;
        }
        .ai-hub-card--assistants .ai-hub-table th,
        .ai-hub-card--assistants .ai-hub-table td {
            border-bottom: none;
            white-space: normal;
            word-break: break-word;
        }
        .ai-hub-card--assistants .ai-hub-table th {
            padding-top: 0.25rem;
            padding-bottom: 0.5rem;
            font-size: 0.8125rem;
        }
        .ai-hub-card--assistants .ai-hub-table th:nth-child(1),
        .ai-hub-card--assistants .ai-hub-table td:nth-child(1) { width: 30%; padding-left: 0; }
        .ai-hub-card--assistants .ai-hub-table th:nth-child(2),
        .ai-hub-card--assistants .ai-hub-table td:nth-child(2) { width: 18%; }
        .ai-hub-card--assistants .ai-hub-table th:nth-child(3),
        .ai-hub-card--assistants .ai-hub-table td:nth-child(3) { width: 16%; }
        .ai-hub-card--assistants .ai-hub-table th:nth-child(4),
        .ai-hub-card--assistants .ai-hub-table td:nth-child(4) { width: 22%; }
        .ai-hub-card--assistants .ai-hub-table th:nth-child(5),
        .ai-hub-card--assistants .ai-hub-table td:nth-child(5) {
            width: 14%;
            text-align: right;
            padding-right: 0;
            white-space: nowrap;
        }
        .ai-assistant-row {
            cursor: pointer;
        }
        .ai-hub-card--assistants .ai-assistant-row td {
            background: transparent;
            transition: background 0.12s ease;
        }
        .ai-hub-card--assistants .ai-assistant-row:hover td {
            background: rgba(68, 83, 113, 0.06);
        }
        .ai-assistant-row:focus-visible {
            outline: none;
        }
        .ai-hub-card--assistants .ai-assistant-row:focus-visible td {
            background: rgba(37, 99, 235, 0.06);
        }
        .ai-assistant-delete-btn {
            border: 0;
            background: transparent;
            padding: 0.35rem;
            color: #9ca3af;
            cursor: pointer;
            line-height: 1;
            border-radius: 6px;
        }
        .ai-assistant-delete-btn:hover {
            color: #dc2626;
            background: rgba(220, 38, 38, 0.08);
        }
        .ai-hub-model-select {
            max-width: 100%;
            width: 100%;
            font-size: 0.8125rem;
            padding: 0.35rem 0.5rem;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            background: #fff;
            color: #374151;
        }
        .ai-hub-model-select:focus {
            outline: 2px solid rgba(37, 99, 235, 0.25);
            border-color: #2563eb;
        }

        .ai-assistant-modal-layout {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 0.75rem;
            width: 100%;
            max-width: 64rem; /* как раньше max-w-5xl — на узких экранах только форма */
            max-height: 92vh;
            min-height: 0;
        }
        @media (min-width: 1200px) {
            .ai-assistant-modal-layout {
                flex-direction: row;
                align-items: stretch;
                max-width: min(1560px, 100%); /* форма 1024px + чат ~460px + gap */
                gap: 1rem;
            }
        }
        .ai-assistant-modal-shell {
            width: 100%;
            max-width: 64rem; /* исходный размер окна редактирования */
            flex: 1 1 auto;
            min-width: 0;
            min-height: 0;
            max-height: 92vh;
        }
        @media (min-width: 1200px) {
            .ai-assistant-modal-shell {
                flex: 0 0 64rem;
                width: 64rem;
                max-width: 64rem;
            }
        }
        .ai-assistant-form-pane {
            min-height: 0;
            max-height: calc(92vh - 72px);
        }
        /* Тестовый чат — те же токены/паттерны, что у #chatPreviewColumn */
        .ai-assistant-test-chat {
            display: flex;
            flex-direction: column;
            width: 100%;
            min-height: 360px;
            max-height: calc(92vh - 72px);
            background: var(--zeno-bg, #fff);
            border-radius: 0.75rem;
            box-shadow: var(--zeno-shadow, 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04));
            border: 0;
        }
        @media (min-width: 1200px) {
            .ai-assistant-test-chat {
                flex: 0 0 460px;
                width: 460px;
                max-width: 460px;
                min-height: 0;
                max-height: 92vh;
                align-self: stretch;
            }
        }
        .ai-test-chat-header {
            flex-shrink: 0;
            padding: 1rem;
            background: var(--zeno-bg, #fff);
            border-bottom: 1px solid #e5e7eb;
            position: sticky;
            top: 0;
            z-index: 10;
        }
        .ai-test-chat-header-top {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 0.75rem;
            margin-bottom: 0.75rem;
        }
        .ai-test-chat-title {
            margin: 0;
            font-family: var(--font-heading, Inter, system-ui, sans-serif);
            font-size: 1.25rem;
            line-height: 1.25;
            font-weight: 600;
            color: #111827;
        }
        .ai-test-chat-subtitle {
            margin-top: 0.25rem;
            font-size: 0.875rem;
            line-height: 1.35;
            color: #8A94A6;
        }
        .ai-test-chat-clear-btn {
            flex: 0 0 auto;
            flex-shrink: 0;
            width: auto;
            min-width: max-content;
            height: auto;
            white-space: nowrap;
            border: 1px solid var(--zeno-border, #E0E0E0);
            background: var(--zeno-bg, #fff);
            color: var(--zeno-text-secondary, #445371);
            border-radius: 0.5rem;
            padding: 0.4rem 0.75rem;
            font-size: 0.8125rem;
            font-weight: 600;
            line-height: 1.25;
            cursor: pointer;
            transition: background-color 0.15s ease, color 0.15s ease;
        }
        .ai-test-chat-clear-btn:hover {
            background: var(--zeno-bg-soft, #F9FAFB);
            color: var(--zeno-text-main, #0E1117);
        }
        .ai-test-chat-listing {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 110px;
            gap: 0.5rem;
        }
        .ai-test-chat-listing-field {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
            min-width: 0;
        }
        .ai-test-chat-listing-field > span {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--zeno-text-muted, #858FA3);
        }
        .ai-test-chat-listing-field input {
            width: 100%;
            border: 1px solid #d1d5db;
            border-radius: 0.5rem;
            padding: 0.5rem 0.75rem;
            font-size: 0.875rem;
            line-height: 1.35;
            color: var(--zeno-text-main, #0E1117);
            background: var(--zeno-bg-soft, #F9FAFB);
        }
        .ai-test-chat-listing-field input:focus {
            outline: none;
            border-color: var(--zeno-primary, #5865F2);
            background: var(--zeno-bg, #fff);
            box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15);
        }
        .ai-test-chat-meta {
            margin-top: 0.5rem;
            font-size: 0.875rem;
            color: #8A94A6;
            line-height: 1.35;
        }
        .ai-test-chat-meta.hidden {
            display: none;
        }
        #aiTestChatPreview.ai-test-chat-preview {
            background: var(--zeno-bg, #fff);
        }
        .ai-test-chat-compose {
            flex-shrink: 0;
            padding: 1rem;
            background: var(--zeno-bg, #fff);
            border-top: 1px solid #e5e7eb;
        }
        .ai-test-chat-compose-shell {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            border: 1px solid #d1d5db;
            border-radius: 0.75rem;
            background: #f9fafb;
            padding: 0.5rem 0.75rem;
        }
        #aiTestChatInput {
            min-height: 44px;
            max-height: 120px;
            overflow-y: auto;
        }
        #aiTestChatSendBtn {
            background: transparent;
            padding: 0;
        }
        #aiTestChatSendBtn:hover:not(:disabled) path[fill="#5865F2"] {
            fill: var(--zeno-primary-dark, #4B56CE);
        }
        .ai-test-chat-status {
            margin-top: 0.5rem;
            min-height: 1rem;
            font-size: 0.75rem;
            color: var(--zeno-text-muted, #858FA3);
        }
        .ai-test-chat-status.is-error {
            color: #b91c1c;
        }
        .ai-test-chat-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            min-height: 220px;
            padding: 2rem 1.25rem;
            text-align: center;
            color: #9ca3af;
        }
        .ai-test-chat-empty-icon {
            margin-bottom: 1rem;
            font-size: 2.75rem;
            line-height: 1;
            color: #c4c9d4;
        }
        .ai-test-chat-empty-title {
            margin: 0 0 0.35rem;
            font-size: 1.05rem;
            font-weight: 600;
            color: var(--zeno-text-secondary, #445371);
        }
        .ai-test-chat-empty-text {
            margin: 0;
            font-size: 0.875rem;
            line-height: 1.45;
            color: #9ca3af;
            max-width: 16rem;
        }
        .ai-test-chat-typing {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.35rem 0.25rem;
            color: var(--zeno-text-muted, #858FA3);
            font-size: 0.8125rem;
        }

        .ai-assistant-section {
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
            padding: 1.25rem 1.5rem;
        }
        .ai-assistant-section-title {
            font-size: 1.125rem;
            font-weight: 600;
            color: #1f2937;
            margin-bottom: 1rem;
            padding-bottom: 0.625rem;
            border-bottom: 1px solid #e5e7eb;
        }
        .ai-assistant-toggle-row {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 0.625rem;
            padding: 0.375rem 0;
        }
        .ai-assistant-toggle-row:last-child {
            border-bottom: none;
        }
        .ai-assistant-toggle-label {
            font-size: 0.875rem;
            font-weight: 500;
            color: #374151;
            flex: 0 1 auto;
        }
        #aiAssistantBehaviorSection .ai-assistant-section-title {
            border-bottom: none;
            padding-bottom: 0;
            margin-bottom: 0.75rem;
        }
        #aiAssistantAdvancedSection .ai-assistant-section-title {
            border-bottom: none;
            padding-bottom: 0;
            margin-bottom: 0.75rem;
        }
        .ai-catalog-rules-block {
            border-top: 1px solid #f3f4f6;
            padding-top: 1rem;
            margin-top: 0.25rem;
        }
        .ai-catalog-rule-field + .ai-catalog-rule-field {
            margin-top: 0.875rem;
        }
        .ai-catalog-rule-label {
            display: flex;
            align-items: center;
            gap: 0.375rem;
            font-size: 0.8125rem;
            font-weight: 500;
            color: #374151;
            margin-bottom: 0.375rem;
        }
        .ai-bot-deal-card {
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
            padding: 1.25rem 1.5rem;
            margin-top: 0.75rem;
        }
        .ai-bot-deal-card-title {
            font-size: 0.9375rem;
            font-weight: 600;
            color: #1f2937;
            margin: 0 0 1rem;
        }
        .ai-bot-deal-section-label {
            font-size: 0.8125rem;
            font-weight: 600;
            color: #374151;
            margin: 0 0 0.5rem;
        }
        .ai-bot-deal-field-row {
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            padding: 0.75rem;
            background: #fafafa;
        }
        .ai-bot-deal-field-row + .ai-bot-deal-field-row {
            margin-top: 0.625rem;
        }
        .ai-bot-deal-field-row--ms {
            background: #f8fafc;
            border-color: #dbeafe;
        }
        .ai-bot-deal-field-head {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex-wrap: wrap;
            margin-bottom: 0.5rem;
        }
        .ai-bot-deal-field-head select,
        .ai-bot-deal-field-head input[type="text"] {
            font-size: 0.8125rem;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            padding: 0.375rem 0.5rem;
            background: #fff;
        }
        .ai-bot-deal-field-mode {
            min-width: 9.5rem;
        }
        .ai-bot-deal-field-extra {
            margin-top: 0.5rem;
        }
        .ai-bot-deal-field-extra textarea {
            width: 100%;
            min-height: 4.5rem;
            font-size: 0.8125rem;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            padding: 0.5rem;
            resize: vertical;
        }
        .ai-bot-deal-list-items {
            display: flex;
            flex-direction: column;
            gap: 0.375rem;
        }
        .ai-bot-deal-list-item {
            display: flex;
            gap: 0.375rem;
            align-items: center;
        }
        .ai-bot-deal-list-item input {
            flex: 1;
            font-size: 0.8125rem;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            padding: 0.375rem 0.5rem;
        }
        .ai-bot-deal-remove-btn {
            font-size: 0.75rem;
            color: #dc2626;
            background: none;
            border: none;
            cursor: pointer;
            padding: 0.125rem 0.25rem;
        }
        .ai-bot-deal-add-field-btn {
            margin-top: 0.625rem;
            font-size: 0.8125rem;
            font-weight: 500;
            color: #2563eb;
            background: none;
            border: none;
            cursor: pointer;
            padding: 0;
        }
        .ai-bot-deal-ms-block {
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid #e5e7eb;
        }
        .ai-bot-deal-hint {
            margin-top: 0.75rem;
            font-size: 0.75rem;
            color: #6b7280;
            line-height: 1.45;
        }
        .bot-deal-ms-ctr-picker {
            position: relative;
            width: 100%;
        }
        .bot-deal-ms-ctr-search {
            width: 100%;
            font-size: 0.8125rem;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            padding: 0.375rem 0.5rem;
            background: #fff;
        }
        .bot-deal-ms-ctr-search:focus {
            outline: 2px solid rgba(37, 99, 235, 0.2);
            border-color: #2563eb;
        }
        .bot-deal-ms-ctr-suggest {
            position: absolute;
            left: 0;
            right: 0;
            top: 100%;
            margin-top: 0.25rem;
            max-height: 14rem;
            overflow-y: auto;
            z-index: 40;
        }
        .ai-assistant-toggle-row--disabled {
            opacity: 0.55;
        }
        .ai-assistant-toggle-row--disabled .ai-assistant-toggle-label {
            color: #9ca3af;
        }
        .ai-assistant-toggle-switch--disabled {
            opacity: 0.65;
            cursor: not-allowed;
        }
        .ai-phrase-group + .ai-phrase-group {
            margin-top: 1.25rem;
        }
        .ai-phrase-group-head {
            display: flex;
            align-items: center;
            gap: 0.375rem;
            margin-bottom: 0.375rem;
        }
        .ai-phrase-group-title {
            font-size: 0.875rem;
            font-weight: 500;
            color: #374151;
        }
        .ai-phrase-add-btn,
        .ai-phrase-remove-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: none;
            background: transparent;
            padding: 0;
            cursor: pointer;
            flex-shrink: 0;
            line-height: 0;
        }
        .ai-phrase-add-btn:hover,
        .ai-phrase-remove-btn:hover {
            opacity: 0.85;
        }
        .ai-phrase-remove-btn:disabled {
            opacity: 0.35;
            cursor: not-allowed;
        }
        .ai-phrase-list {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
            align-items: flex-start;
        }
        .ai-phrase-row {
            display: inline-flex;
            align-items: center;
            gap: 0.375rem;
            max-width: 100%;
        }
        .ai-phrase-input {
            flex: 0 1 auto;
            width: 18rem;
            max-width: 100%;
            min-width: 0;
            border: none;
            background: transparent;
            padding: 0.25rem 0;
            font-size: 0.875rem;
            color: #64748b;
            outline: none;
        }
        .ai-phrase-input:focus {
            color: #1f2937;
        }
        .ai-phrase-input::placeholder {
            color: #94a3b8;
        }
        .ai-hub-toggle {
            display: inline-block;
            width: 44px;
            height: 24px;
            border-radius: 9999px;
            background: #2563eb;
            position: relative;
            flex-shrink: 0;
            vertical-align: middle;
        }
        .ai-hub-toggle::after {
            content: '';
            position: absolute;
            top: 3px;
            right: 3px;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #fff;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
        }
        .ai-hub-toggle-off {
            background: #d1d5db;
        }
        .ai-hub-toggle-off::after {
            right: auto;
            left: 3px;
        }
        .scenarios-hub-card .ai-hub-table-wrap {
            overflow: visible;
            padding: 0 1rem 1rem;
        }
        .scenarios-hub-card .ai-hub-table {
            table-layout: fixed;
        }
        .scenarios-hub-card .ai-hub-table th,
        .scenarios-hub-card .ai-hub-table td {
            border-bottom: none;
            white-space: normal;
            word-break: break-word;
        }
        .scenarios-hub-card .ai-hub-table th {
            padding-top: 0.25rem;
            padding-bottom: 0.5rem;
            font-size: 0.8125rem;
        }
        .scenarios-hub-card .ai-hub-table th:nth-child(1),
        .scenarios-hub-card .ai-hub-table td:nth-child(1) { width: 32%; padding-left: 0; }
        .scenarios-hub-card .ai-hub-table th:nth-child(2),
        .scenarios-hub-card .ai-hub-table td:nth-child(2) { width: 28%; }
        .scenarios-hub-card .ai-hub-table th:nth-child(3),
        .scenarios-hub-card .ai-hub-table td:nth-child(3) { width: 14%; }
        .scenarios-hub-card .ai-hub-table th:nth-child(4),
        .scenarios-hub-card .ai-hub-table td:nth-child(4) { width: 18%; }
        .scenarios-hub-card .ai-hub-table th:nth-child(5),
        .scenarios-hub-card .ai-hub-table td:nth-child(5) {
            width: 8%;
            text-align: right;
            padding-right: 0;
            white-space: nowrap;
        }
        .scenario-row {
            cursor: pointer;
        }
        .scenarios-hub-card .scenario-row td {
            background: transparent;
            transition: background 0.12s ease;
        }
        .scenarios-hub-card .scenario-row:hover td {
            background: rgba(68, 83, 113, 0.06);
        }
        .scenario-row:focus-visible {
            outline: none;
        }
        .scenarios-hub-card .scenario-row:focus-visible td {
            background: rgba(37, 99, 235, 0.06);
        }
        .scenario-toggle-btn {
            border: 0;
            background: transparent;
            padding: 0;
            cursor: pointer;
            line-height: 0;
        }
        .scenario-toggle-btn:focus-visible {
            outline: 2px solid rgba(37, 99, 235, 0.45);
            outline-offset: 2px;
            border-radius: 9999px;
        }
        #notifSettingsModal {
            z-index: 120;
        }
        #notifSettingsModal .notif-volume-range {
            height: 6px;
            accent-color: var(--zeno-primary, #2563eb);
            cursor: pointer;
        }
        #notifSettingsModal .notif-volume-block--disabled {
            opacity: 0.45;
            pointer-events: none;
        }
        .scenario-delete-btn {
            border: 0;
            background: transparent;
            padding: 0.35rem;
            color: #9ca3af;
            cursor: pointer;
            line-height: 1;
            border-radius: 6px;
        }
        .scenario-delete-btn:hover {
            color: #dc2626;
            background: rgba(220, 38, 38, 0.08);
        }
        .zeno-seg-btn-disabled {
            opacity: 0.45;
            cursor: not-allowed;
            pointer-events: none;
        }

        .app-update-warning {
            position: fixed;
            left: 16px;
            right: 16px;
            top: 72px;
            z-index: 58;
            background: #fff7ed;
            border: 1px solid #fdba74;
            color: #7c2d12;
            border-radius: 12px;
            padding: 10px 14px;
            box-shadow: var(--zeno-shadow);
            font-size: 14px;
            line-height: 1.4;
        }

        .app-update-warning.hidden,
        .app-update-modal.hidden {
            display: none !important;
        }

        .app-update-modal {
            position: fixed;
            inset: 0;
            z-index: 9999;
            background: rgba(17, 24, 39, 0.72);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
        }

        .app-update-modal-card {
            width: min(640px, 100%);
            background: #ffffff;
            border-radius: 16px;
            border: 1px solid #d1d5db;
            box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
            padding: 22px 20px;
            text-align: center;
        }

        .contact-tag-dd {
            position: absolute;
            left: 0;
            right: 0;
            top: 100%;
            margin-top: 4px;
            max-height: min(360px, 52vh);
            overflow-y: auto;
            background: #fff;
            border: 1px solid rgba(68, 83, 113, 0.18);
            border-radius: 10px;
            box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
            z-index: 95;
        }
        .contact-tag-dd-item {
            padding: 9px 12px;
            cursor: pointer;
            font-size: 14px;
            line-height: 1.35;
            color: #111827;
            border-bottom: 1px solid rgba(241, 245, 249, 0.9);
        }
        .contact-tag-dd-item.contact-tag-dd-item--row {
            display: flex;
            align-items: flex-start;
            gap: 6px;
            padding-right: 6px;
        }
        .contact-tag-dd-item-text {
            flex: 1;
            min-width: 0;
        }
        .contact-tag-dd-del {
            flex-shrink: 0;
            width: 28px;
            height: 28px;
            margin: -2px 0 0;
            padding: 0;
            border: none;
            border-radius: 6px;
            background: transparent;
            color: #94a3b8;
            font-size: 20px;
            line-height: 1;
            cursor: pointer;
        }
        .contact-tag-dd-del:hover {
            color: #b91c1c;
            background: #fef2f2;
        }
        .contact-tag-dd-item:last-child {
            border-bottom: 0;
        }
        .contact-tag-dd-item:hover,
        .contact-tag-dd-item.contact-tag-dd-item-active {
            background: #f1f5f9;
        }
        .contact-tag-dd-desc {
            font-size: 12px;
            color: #64748b;
            margin-top: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .contact-tag-dd-create {
            color: #1d4ed8;
            font-weight: 600;
        }
        /* Успешные уведомления (тост) */
        .app-success-toast {
            position: fixed;
            bottom: 1rem;
            right: 1rem;
            left: 1rem;
            z-index: 220;
            max-width: 28rem;
            margin-left: auto;
            margin-right: auto;
            display: flex;
            align-items: flex-start;
            gap: 0.875rem;
            padding: 1rem 1.125rem;
            background: #fff;
            border-radius: 0.75rem;
            box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
            pointer-events: none;
        }
        @media (min-width: 640px) {
            .app-success-toast {
                left: auto;
                margin-left: 0;
                margin-right: 0;
            }
        }
        .app-success-toast-icon {
            flex-shrink: 0;
            width: 3rem;
            height: 3rem;
            line-height: 0;
        }
        .app-success-toast-icon svg {
            display: block;
            width: 3rem;
            height: 3rem;
        }
        .app-success-toast-body {
            min-width: 0;
            flex: 1 1 auto;
            padding-top: 0.125rem;
        }
        .app-success-toast-title {
            font-size: 0.9375rem;
            font-weight: 600;
            line-height: 1.35;
            color: #111827;
        }
        .app-success-toast-subtitle {
            margin-top: 0.25rem;
            font-size: 0.875rem;
            font-weight: 400;
            line-height: 1.4;
            color: #6B7A90;
        }

        /* Уведомление с ручным закрытием (тариф и т.п.) */
        .app-notice-toast {
            position: fixed;
            bottom: 1rem;
            right: 1rem;
            left: 1rem;
            z-index: 220;
            max-width: 28rem;
            margin-left: auto;
            margin-right: auto;
            display: flex;
            align-items: flex-start;
            gap: 0.875rem;
            padding: 1rem 1.125rem;
            background: #fff;
            border-radius: 0.75rem;
            box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
            /* Информационный toast не должен блокировать ввод и кнопку отправки под ним. */
            pointer-events: none;
        }
        @media (min-width: 640px) {
            .app-notice-toast {
                left: auto;
                margin-left: 0;
                margin-right: 0;
            }
        }
        .app-notice-toast-icon {
            flex-shrink: 0;
            width: 3rem;
            height: 3rem;
            line-height: 0;
        }
        .app-notice-toast-icon svg {
            display: block;
            width: 3rem;
            height: 3rem;
        }
        .app-notice-toast-body {
            min-width: 0;
            flex: 1 1 auto;
            padding-top: 0.125rem;
        }
        .app-notice-toast-title {
            font-size: 0.9375rem;
            font-weight: 600;
            line-height: 1.35;
            color: #111827;
        }
        .app-notice-toast-subtitle {
            margin-top: 0.25rem;
            font-size: 0.875rem;
            font-weight: 400;
            line-height: 1.4;
            color: #6B7A90;
        }
        .app-notice-toast-close {
            flex-shrink: 0;
            margin: -0.25rem -0.35rem 0 0;
            width: 2rem;
            height: 2rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: none;
            border-radius: 0.5rem;
            background: transparent;
            color: #9CA3AF;
            cursor: pointer;
            padding: 0;
            line-height: 0;
            pointer-events: auto;
        }
        .app-notice-toast-close:hover {
            background: #F3F4F6;
            color: #4B5563;
        }
        .app-notice-toast-close:focus-visible {
            outline: 2px solid #5865F2;
            outline-offset: 1px;
        }

        #zenoTariffGate {
            position: fixed;
            inset: 0;
            top: 0 !important;
            left: 0;
            right: 0;
            bottom: 0;
            /* Выше шапки (80) и #contactCardBtn (90); ниже баннера сети (110) */
            z-index: 105;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(15, 23, 42, 0.45);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
        }

        body.zeno-tariff-gate-open {
            overflow: hidden;
        }

        /* Приложение остаётся видимым под оверлеем; клики блокирует #zenoTariffGate */
        body.zeno-tariff-gate-open > .container {
            pointer-events: none;
        }

        #zenoTariffGate.hidden {
            display: none !important;
        }

        body.zeno-tariff-gate-open #contactCardBtn {
            display: none !important;
            visibility: hidden;
            pointer-events: none;
        }

        .zeno-tariff-gate-card {
            width: 100%;
            max-width: 440px;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 16px;
            box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
            padding: 28px 24px;
            text-align: center;
        }

        .zeno-tariff-gate-title {
            font-size: 1.35rem;
            font-weight: 700;
            color: #111827;
            margin-bottom: 10px;
        }

        .zeno-tariff-gate-text {
            font-size: 0.95rem;
            line-height: 1.55;
            color: #4b5563;
            margin-bottom: 20px;
        }

        .zeno-tariff-gate-actions {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .zeno-tariff-gate-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 44px;
            padding: 0 20px;
            border-radius: 10px;
            background: #5865F2;
            color: #fff;
            font-weight: 600;
            text-decoration: none;
            border: none;
            cursor: pointer;
            width: 100%;
            font-size: 0.95rem;
        }

        .zeno-tariff-gate-btn:hover {
            background: #4752c4;
        }

        .zeno-tariff-gate-btn-secondary {
            background: #fff;
            color: #374151;
            border: 1px solid #e5e7eb;
        }

        .zeno-tariff-gate-btn-secondary:hover {
            background: #f9fafb;
        }

        @media (max-width: 640px) {
            .zeno-print-menu {
                min-width: 210px;
                max-width: calc(100vw - 24px);
            }

            #dealHeaderPrintWrap .zeno-print-menu {
                position: fixed;
                top: auto;
                right: 12px;
                bottom: 12px;
                left: 12px;
                width: auto;
            }
        }
