        /* Дейли — ассистент (макет ai.tsx) */
        @keyframes dailyBotFloatFab {
            0%, 100% { transform: translateY(0) rotate(-1deg); }
            35% { transform: translateY(-5px) rotate(2deg); }
            70% { transform: translateY(-2px) rotate(0.5deg); }
        }
        @keyframes dailyBotFloatHead {
            0%, 100% { transform: scale(1) translateY(0); }
            50% { transform: scale(1.04) translateY(-2px); }
        }
        @keyframes dailyBotFloatMsg {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-1.5px); }
        }
        @keyframes dailyBotThinkFab {
            0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
            50% { transform: translateY(-4px) rotate(-3deg) scale(1.06); }
        }
        @keyframes dailyBotThinkHead {
            0%, 100% { transform: translateX(0) scale(1); }
            25% { transform: translateX(-2px) scale(1.03); }
            75% { transform: translateX(2px) scale(1.03); }
        }
        @keyframes dailyBotThinkMsg {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.08); }
        }
        @keyframes dailyBotBlinkFab {
            0%, 38%, 42%, 88%, 92%, 100% { transform: scaleY(1); }
            40%, 90% { transform: scaleY(0.08); }
        }
        @keyframes dailyBotBlinkHead {
            0%, 55%, 60%, 100% { transform: scaleY(1); }
            57% { transform: scaleY(0.1); }
        }
        @keyframes dailyBotBlinkMsg {
            0%, 70%, 76%, 100% { transform: scaleY(1); }
            73% { transform: scaleY(0.12); }
        }
        @keyframes dailySpinSlow {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        @keyframes dailySpinReverse {
            from { transform: rotate(360deg); }
            to { transform: rotate(0deg); }
        }
        @keyframes dailyChatPop {
            0% { opacity: 0; transform: translateY(20px) scale(0.94); }
            100% { opacity: 1; transform: translateY(0) scale(1); }
        }
        @keyframes dailyFabPing {
            0% { transform: scale(1); opacity: 0.45; }
            75%, 100% { transform: scale(1.55); opacity: 0; }
        }
        /* Уважаем системную настройку «уменьшить анимации» и слабые мобильные GPU */
        @media (prefers-reduced-motion: reduce) {
            .daily-avatar svg,
            .daily-avatar .daily-blink,
            .daily-avatar .daily-orbit,
            .ai-bot-tip-ping {
                animation: none !important;
            }
        }
        @media (max-width: 1024px) {
            /* на телефонах покачивание бота выключаем — плавность важнее декора */
            .daily-avatar.role-fab svg {
                animation: none;
            }
            .ai-bot-tip-ping {
                animation-duration: 2.2s;
            }
        }
        .daily-avatar {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            user-select: none;
            flex-shrink: 0;
        }
        .daily-avatar.size-sm { width: 32px; height: 32px; }
        .daily-avatar.size-md { width: 44px; height: 44px; }
        .daily-avatar.size-lg { width: 56px; height: 56px; }
        .daily-avatar-glow { display: none; }
        .daily-avatar svg {
            width: 100%;
            height: 100%;
            position: relative;
            z-index: 1;
            overflow: visible;
        }
        /* статичная тень вместо filter: drop-shadow — iOS Safari лагает от фильтра на анимации */
        .daily-avatar.role-fab svg,
        .daily-avatar.role-head svg {
            border-radius: 25%;
            box-shadow: 0 10px 18px rgba(79, 70, 229, 0.35);
            will-change: transform;
        }
        /* FAB в углу — заметное покачивание */
        .daily-avatar.role-fab svg {
            animation: dailyBotFloatFab 4.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
        }
        .daily-avatar.role-fab.is-thinking svg {
            animation: dailyBotThinkFab 0.85s ease-in-out infinite;
        }
        .daily-avatar.role-fab .daily-blink {
            transform-origin: 50px 50px;
            animation: dailyBotBlinkFab 6.2s infinite;
            animation-delay: 0.4s;
        }
        .daily-avatar.role-fab .daily-orbit.is-spin {
            transform-origin: 50px 54px;
            animation: dailySpinSlow 5.5s linear infinite;
        }
        /* Шапка чата — мягкое «дыхание» */
        .daily-avatar.role-head svg {
            animation: dailyBotFloatHead 5.6s ease-in-out infinite;
            animation-delay: 1.1s;
        }
        .daily-avatar.role-head.is-thinking svg {
            animation: dailyBotThinkHead 1.15s ease-in-out infinite;
        }
        .daily-avatar.role-head .daily-blink {
            transform-origin: 50px 50px;
            animation: dailyBotBlinkHead 7.4s infinite;
            animation-delay: 2.2s;
        }
        .daily-avatar.role-head .daily-orbit.is-spin {
            transform-origin: 50px 54px;
            animation: dailySpinReverse 7s linear infinite;
        }
        /* В сообщениях — едва заметный кивок, свой delay у каждого */
        .daily-avatar.role-msg svg {
            animation: dailyBotFloatMsg 7.2s ease-in-out infinite;
        }
        .daily-avatar.role-msg.is-thinking svg {
            animation: dailyBotThinkMsg 1.05s ease-in-out infinite;
        }
        .daily-avatar.role-msg .daily-blink {
            transform-origin: 50px 50px;
            animation: dailyBotBlinkMsg 8.5s infinite;
        }
        .daily-avatar.role-msg .daily-orbit.is-spin {
            transform-origin: 50px 54px;
            animation: dailySpinSlow 3.2s linear infinite;
        }
        /* Современный маркер: искра пульсирует при размышлении */
        .daily-avatar .daily-orbit { transform-origin: 50px 50px; }
        .daily-avatar .daily-mark { transform-origin: 50px 50px; }
        .daily-avatar.is-thinking .daily-mark {
            animation: dailySparkPulse 1.5s ease-in-out infinite;
        }
        @keyframes dailySparkPulse {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(0.82); opacity: 0.75; }
        }
        .daily-avatar-dot {
            position: absolute;
            bottom: -2px;
            right: -2px;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            border: 2px solid #fff;
            background: #10b981;
            z-index: 2;
        }
        .daily-avatar.is-thinking .daily-avatar-dot { background: #fbbf24; }

        .ai-bot-root {
            position: fixed;
            right: max(16px, env(safe-area-inset-right));
            bottom: max(20px, env(safe-area-inset-bottom));
            z-index: 255;
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 12px;
            pointer-events: none;
        }
        .ai-bot-root > * { pointer-events: auto; }
        .ai-bot-tip {
            display: none;
            align-items: center;
            gap: 10px;
            max-width: min(280px, 72vw);
            padding: 10px 12px 10px 14px;
            border-radius: 16px;
            background: #fff;
            color: #0f172a;
            border: 1px solid #e0e7ff;
            box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
            cursor: pointer;
            opacity: 0;
            transform: translateY(8px) scale(0.96);
            transition: opacity 0.28s ease, transform 0.28s ease;
            position: relative;
        }
        .ai-bot-tip.visible {
            display: flex;
            opacity: 1;
            transform: translateY(0) scale(1);
        }
        .ai-bot-tip-ping {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #10b981;
            flex-shrink: 0;
            animation: dailyFabPing 1.4s ease-out infinite;
        }
        .ai-bot-tip-body { min-width: 0; flex: 1; }
        .ai-bot-tip strong {
            display: block;
            font-size: var(--fs-sm);
            font-weight: 750;
            color: #0f172a;
        }
        .ai-bot-tip .ai-bot-tip-sub {
            display: block;
            font-size: var(--fs-xs);
            color: #64748b;
            margin-top: 2px;
            line-height: 1.3;
        }
        .ai-bot-tip-close {
            flex-shrink: 0;
            width: 26px;
            height: 26px;
            border: none;
            border-radius: 8px;
            background: transparent;
            color: #94a3b8;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            appearance: none;
            -webkit-appearance: none;
            -webkit-tap-highlight-color: transparent;
        }
        .ai-bot-tip-close:hover,
        .ai-bot-tip-close:focus,
        .ai-bot-tip-close:active {
            background: #f1f5f9;
            color: #475569;
            outline: none;
            box-shadow: none;
        }
        .ai-bot-tip-close svg { width: 14px; height: 14px; }
        .ai-bot-fab {
            position: relative;
            width: 64px;
            height: 64px;
            border-radius: 0;
            border: none !important;
            outline: none !important;
            cursor: pointer;
            background: transparent !important;
            box-shadow: none !important;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            margin: 0;
            transition: transform 0.25s ease;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            -webkit-tap-highlight-color: transparent;
            color: inherit;
        }
        .ai-bot-fab:hover,
        .ai-bot-fab:focus,
        .ai-bot-fab:focus-visible,
        .ai-bot-fab:active {
            background: transparent !important;
            border: none !important;
            outline: none !important;
            box-shadow: none !important;
        }
        .ai-bot-fab:hover { transform: scale(1.06); }
        .ai-bot-fab:active { transform: scale(0.95); }
        .ai-bot-fab-halo { display: none; }
        .ai-bot-fab::-moz-focus-inner { border: 0; padding: 0; }
        .ai-bot-fab-badge {
            position: absolute;
            top: 0;
            right: 0;
            min-width: 22px;
            height: 22px;
            padding: 0 6px;
            border-radius: 999px;
            font-size: var(--fs-xs);
            font-weight: 800;
            display: none;
            align-items: center;
            justify-content: center;
            border: 2px solid #fff;
            background: #6366f1;
            color: #fff;
            z-index: 3;
            box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
        }
        .ai-bot-fab-badge.has-unread { display: flex; }
        body.ai-bot-chat-open .ai-bot-fab-badge { display: none !important; }
        body.ai-bot-chat-open .ai-bot-root { visibility: hidden; pointer-events: none; }
        body.focus-open .ai-bot-root,
        body.voice-capture-open .ai-bot-root,
        body.voice-parse-open .ai-bot-root,
        body:has(#captureModal.active) .ai-bot-root,
        body:has(#settingsModal.active) .ai-bot-root,
        body:has(#taskSheetOverlay.active) .ai-bot-root,
        body:has(#doneDetailOverlay.active) .ai-bot-root,
        body:has(#focusOverlay.active) .ai-bot-root {
            opacity: 0;
            pointer-events: none;
            visibility: hidden;
        }
        @media (max-width: 1024px) {
            /* Дейли — правый нижний угол, над полосой «Добавить задачу» */
            .ai-bot-root {
                top: auto;
                left: auto;
                right: max(var(--mobile-dock-side), env(safe-area-inset-right, 0px));
                bottom: calc(
                    var(--mobile-bottom-inset)
                    + var(--mobile-dock-h)
                    + 10px
                );
                z-index: 261;
            }
            .ai-bot-fab {
                width: 44px;
                height: 44px;
            }
            .ai-bot-fab:hover { transform: scale(1.05); }
            .ai-bot-fab .daily-avatar,
            .ai-bot-fab .daily-avatar.role-fab,
            .ai-bot-fab .daily-avatar.size-md,
            .ai-bot-fab .daily-avatar.size-lg {
                width: 44px !important;
                height: 44px !important;
            }
            .ai-bot-fab-badge {
                top: -2px;
                right: -2px;
                min-width: 18px;
                height: 18px;
                padding: 0 5px;
                font-size: 10px;
                border-width: 1.5px;
            }
            .ai-bot-tip { display: none !important; }
            /* dock на всю ширину — Дейли выше, не сбоку */
            .mobile-add-fab {
                left: max(var(--mobile-dock-side), env(safe-area-inset-left, 0px));
                right: max(var(--mobile-dock-side), env(safe-area-inset-right, 0px));
            }
            body.ai-bot-chat-open .mobile-add-fab {
                display: none !important;
            }
        }

        .ai-bot-chat-overlay {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 290;
            background: rgba(15, 23, 42, 0.35);
            align-items: flex-end;
            justify-content: flex-end;
            padding: 0;
        }
        .ai-bot-chat-overlay.active { display: flex; }
        .ai-bot-chat-grab {
            display: none;
            flex-shrink: 0;
            padding: 8px 16px 2px;
            touch-action: none;
            cursor: grab;
            user-select: none;
            background: #fff;
        }
        .ai-bot-chat-grab .task-sheet-handle { margin: 0 auto; }
        .ai-bot-chat-grab-hint { display: none; }
        .ai-bot-chat-panel {
            width: min(420px, calc(100vw - 2rem));
            height: min(680px, calc(100vh - 7.5rem));
            max-height: calc(100vh - 5rem);
            background: #fff;
            color: #0f172a;
            border-radius: 28px;
            border: 1px solid rgba(226, 232, 240, 0.9);
            display: flex;
            flex-direction: column;
            box-shadow: 0 25px 70px -15px rgba(0, 0, 0, 0.65);
            overflow: hidden;
            margin: 0;
        }
        .ai-bot-chat-panel.is-dragging {
            transition: none !important;
            animation: none !important;
        }
        @media (min-width: 1025px) {
            /* Десктоп: панель у нижнего края справа, не «над» FAB */
            .ai-bot-chat-overlay {
                align-items: flex-end;
                justify-content: flex-end;
                padding: 0 20px 0 0;
                background: rgba(15, 23, 42, 0.28);
            }
            .ai-bot-chat-panel {
                width: min(480px, calc(100vw - 40px));
                height: min(720px, calc(100vh - 24px));
                max-height: calc(100vh - 16px);
                margin: 0;
                border-radius: 20px 20px 0 0;
                border-bottom: none;
                box-shadow: 0 -16px 48px rgba(15, 23, 42, 0.22);
                animation: dailyChatSlideUp 0.34s cubic-bezier(0.32, 0.72, 0, 1) forwards;
            }
            .ai-bot-chat-input {
                padding-bottom: max(14px, env(safe-area-inset-bottom));
            }
        }
        @keyframes dailyChatSlideUp {
            from { opacity: 0.85; transform: translateY(110%); }
            to { opacity: 1; transform: translateY(0); }
        }
        @media (max-width: 1024px) {
            /* Как task-sheet: выезд снизу, не «карточка» поверх dock */
            .ai-bot-chat-overlay {
                display: flex;
                align-items: flex-end;
                justify-content: stretch;
                padding: 0;
                background: rgba(11, 15, 25, 0.72);
                opacity: 0;
                visibility: hidden;
                pointer-events: none;
                transition: opacity 0.28s ease, visibility 0.28s ease;
            }
            .ai-bot-chat-overlay.active {
                display: flex;
                opacity: 1;
                visibility: visible;
                pointer-events: auto;
            }
            .ai-bot-chat-grab { display: block; }
            .ai-bot-chat-panel {
                width: 100%;
                max-width: none;
                height: min(92dvh, 92vh, var(--app-height, 100dvh));
                max-height: min(92dvh, 92vh, calc(var(--app-height, 100dvh) - 8px));
                margin: 0;
                border-radius: 20px 20px 0 0;
                border: none;
                border-top: 1px solid rgba(226, 232, 240, 0.95);
                box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.28);
                animation: none;
                transform: translateY(110%);
                transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1);
                touch-action: pan-y;
            }
            .ai-bot-chat-overlay.active .ai-bot-chat-panel {
                transform: translateY(0);
            }
            .ai-bot-chat-panel.is-dragging {
                transition: none !important;
            }
            .ai-bot-chat-head {
                border-radius: 0;
            }
            .ai-bot-chat-input {
                padding-bottom: max(12px, env(safe-area-inset-bottom));
            }
        }
        .ai-bot-chat-head {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 10px;
            padding: 8px 10px 8px 14px;
            background: var(--bg-panel, #fff);
            color: var(--text-primary, #0f172a);
            border-bottom: 1px solid var(--border-subtle, rgba(226, 232, 240, 0.9));
            flex-shrink: 0;
        }
        .ai-bot-chat-head::before { display: none; }
        .ai-bot-chat-head-main {
            display: flex;
            align-items: center;
            gap: 10px;
            position: relative;
            z-index: 1;
            min-width: 0;
            flex: 1;
        }
        .ai-bot-chat-head-av { width: 26px; height: 26px; flex-shrink: 0; display: inline-flex; }
        .ai-bot-chat-head .daily-avatar.size-sm { width: 26px; height: 26px; }
        .ai-bot-chat-head .daily-avatar-dot { display: none; }
        .ai-bot-chat-head .daily-avatar.role-head svg { box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25); }
        .ai-bot-chat-head-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
        .ai-bot-chat-head h3 {
            margin: 0;
            font-size: var(--fs-base);
            font-weight: 700;
            line-height: 1.2;
            letter-spacing: -0.01em;
            color: var(--text-primary, #0f172a);
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .ai-bot-chat-badge {
            display: inline-flex;
            align-items: center;
            font-size: 11px;
            font-weight: 600;
            line-height: 16px;
            padding: 0 5px;
            border-radius: 6px;
            border: 1px solid var(--border-subtle, rgba(226, 232, 240, 0.9));
            color: var(--text-muted, #64748b);
            background: transparent;
        }
        .ai-bot-chat-status {
            margin: 0;
            font-size: var(--fs-xs);
            line-height: 1.2;
            color: var(--text-muted, #64748b);
            display: flex;
            align-items: center;
            gap: 5px;
            min-width: 0;
        }
        .ai-bot-chat-status #aiBotChatStatusText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
        .ai-bot-chat-status .dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--success, #34d399);
            flex-shrink: 0;
        }
        .ai-bot-chat-status.is-thinking .dot {
            background: #fbbf24;
            animation: dailyFabPing 1s ease-out infinite;
        }
        .ai-bot-chat-status.is-offline { color: var(--warning, #d97706); }
        .ai-bot-chat-status.is-offline .dot { background: var(--warning, #d97706); animation: none; }
        .ai-bot-chat-close { display: none !important; }
        html[data-theme="dark"] .ai-bot-chat-grab { background: var(--bg-panel, #0a0a0a); }
        .ai-bot-chat-clear {
            margin-left: auto;
            width: 32px;
            height: 32px;
            padding: 0;
            border-radius: var(--radius-sm, 8px);
            border: 1px solid transparent;
            background: transparent;
            color: var(--text-muted, #64748b);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            flex-shrink: 0;
            transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
        }
        .ai-bot-chat-clear svg { width: 17px; height: 17px; flex-shrink: 0; }
        .ai-bot-chat-clear:hover,
        .ai-bot-chat-clear:focus-visible {
            background: var(--bg-subtle, #f1f5f9);
            border-color: var(--border-subtle, rgba(226, 232, 240, 0.9));
            color: var(--danger, #dc2626);
        }

        .ai-bot-chat-task {
            padding: 12px 16px;
            background: rgba(248, 250, 252, 0.95);
            border-bottom: 1px solid rgba(226, 232, 240, 0.85);
            flex-shrink: 0;
            position: relative;
            z-index: 30;
        }
        .ai-bot-chat-task-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 6px;
            padding: 0 2px;
        }
        .ai-bot-chat-task-row label {
            font-size: var(--fs-xs);
            font-weight: 750;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: #64748b;
            margin: 0;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .ai-bot-chat-task-row label svg {
            width: 14px;
            height: 14px;
            color: #4f46e5;
        }
        .ai-bot-chat-task-meta {
            font-size: var(--fs-xs);
            font-weight: 600;
            color: #4f46e5;
        }
        .ai-bot-chat-task select { display: none; }
        .ai-bot-task-shell {
            position: relative;
            display: flex;
            flex-direction: column;
            background: #fff;
            border: 1px solid rgba(226, 232, 240, 0.95);
            border-radius: 16px;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
            overflow: hidden;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }
        .ai-bot-task-shell:hover { border-color: #a5b4fc; }
        .ai-bot-task-shell.is-open {
            border-color: #6366f1;
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 14px 28px rgba(15, 23, 42, 0.1);
            z-index: 35;
        }
        .ai-bot-task-trigger {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            background: #fff;
            border: none;
            border-radius: 0;
            margin: 0;
            padding: 10px 12px;
            text-align: left;
            cursor: pointer;
            box-shadow: none;
            appearance: none;
            -webkit-appearance: none;
        }
        .ai-bot-task-shell.is-open .ai-bot-task-trigger {
            border-bottom: 1px solid #eef2ff;
            border-radius: 0;
        }
        .ai-bot-task-trigger.is-open {
            border-color: transparent;
            box-shadow: none;
        }
        html[data-theme="dark"] .ai-bot-task-shell {
            background: var(--bg-panel, #0a0a0a);
            border-color: #2a2a2a;
        }
        html[data-theme="dark"] .ai-bot-task-shell:hover { border-color: #3b82f6; }
        html[data-theme="dark"] .ai-bot-task-shell.is-open {
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
        }
        html[data-theme="dark"] .ai-bot-task-trigger,
        html[data-theme="dark"] .ai-bot-task-dropdown {
            background: transparent;
            color: #e5e5e5;
        }
        html[data-theme="dark"] .ai-bot-task-shell.is-open .ai-bot-task-trigger {
            border-bottom-color: #2a2a2a;
        }
        html[data-theme="dark"] .ai-bot-task-ico {
            background: rgba(59, 130, 246, 0.18);
            border-color: rgba(59, 130, 246, 0.35);
            color: #93c5fd;
        }
        html[data-theme="dark"] .ai-bot-task-chevron {
            background: #1a1a1a;
            color: #a3a3a3;
        }
        html[data-theme="dark"] .ai-bot-task-trigger.is-open .ai-bot-task-chevron {
            background: rgba(59, 130, 246, 0.22);
            color: #bfdbfe;
        }
        html[data-theme="dark"] .ai-bot-task-option { color: #d4d4d4; }
        html[data-theme="dark"] .ai-bot-task-option:hover {
            background: #141414;
            border-color: #333333;
        }
        html[data-theme="dark"] .ai-bot-task-option.is-active {
            background: rgba(59, 130, 246, 0.16);
            border-color: rgba(59, 130, 246, 0.4);
            color: #f5f5f5;
        }
        html[data-theme="dark"] .ai-bot-task-add {
            background: rgba(59, 130, 246, 0.1);
            border-color: rgba(59, 130, 246, 0.4);
            color: #bfdbfe;
        }
        html[data-theme="dark"] .ai-bot-task-add:hover {
            background: rgba(59, 130, 246, 0.18);
        }
        .ai-bot-task-trigger-main {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
            flex: 1;
        }
        .ai-bot-task-ico {
            width: 32px;
            height: 32px;
            border-radius: 12px;
            background: #eef2ff;
            border: 1px solid #e0e7ff;
            color: #4f46e5;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .ai-bot-task-ico svg { width: 16px; height: 16px; }
        .ai-bot-task-trigger-text { min-width: 0; }
        .ai-bot-task-trigger-title {
            font-size: var(--fs-base);
            font-weight: 700;
            color: #0f172a;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .ai-bot-task-trigger-sub {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 2px;
            font-size: var(--fs-xs);
            color: #64748b;
        }
        .ai-bot-task-trigger-sub .est {
            color: #4f46e5;
            font-weight: 650;
            display: inline-flex;
            align-items: center;
            gap: 3px;
        }
        .ai-bot-task-chevron {
            width: 28px;
            height: 28px;
            border-radius: 10px;
            background: #f1f5f9;
            color: #475569;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: transform 0.2s ease, background 0.15s ease, color 0.15s ease;
        }
        .ai-bot-task-trigger.is-open .ai-bot-task-chevron {
            transform: rotate(180deg);
            background: #eef2ff;
            color: #4f46e5;
        }
        .ai-bot-task-chevron svg { width: 16px; height: 16px; }
        .ai-bot-task-dropdown {
            display: none;
            position: static !important;
            left: auto !important;
            right: auto !important;
            top: auto !important;
            margin: 0 !important;
            background: #fafbff;
            border: none;
            border-radius: 0;
            box-shadow: none !important;
            padding: 6px 8px 8px;
            z-index: 1;
            width: 100%;
            box-sizing: border-box;
        }
        .ai-bot-task-dropdown.is-open {
            display: block;
            animation: taskDropIn 0.22s cubic-bezier(0.32, 0.72, 0, 1);
        }
        @keyframes taskDropIn {
            from { opacity: 0; transform: translateY(-6px); }
            to { opacity: 1; transform: translateY(0); }
        }
        }
        .ai-bot-task-dropdown.is-open { display: block; }
        .ai-bot-task-dropdown[hidden] { display: none !important; }
        .ai-bot-task-dropdown-list {
            max-height: 220px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 3px;
            padding: 2px;
            scrollbar-width: thin;
        }
        .ai-bot-task-dropdown-list::-webkit-scrollbar { width: 5px; }
        .ai-bot-task-dropdown-list::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.35);
            border-radius: 999px;
        }
        .ai-bot-task-dropdown-list::-webkit-scrollbar-track { background: transparent; }
        .ai-bot-task-option {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 9px 12px;
            border: 1px solid transparent;
            border-radius: 12px;
            background: transparent;
            text-align: left;
            cursor: pointer;
            color: #334155;
            transition: background 0.14s ease, border-color 0.14s ease;
        }
        .ai-bot-task-option:hover {
            background: #f6f8ff;
            border-color: rgba(199, 210, 254, 0.6);
        }
        .ai-bot-task-option.is-active {
            background: linear-gradient(135deg, rgba(238, 242, 255, 0.95), rgba(224, 231, 255, 0.75));
            border-color: rgba(129, 140, 248, 0.5);
            color: #1e1b4b;
            font-weight: 650;
        }
        .ai-bot-task-option-main { min-width: 0; flex: 1; }
        .ai-bot-task-option-title {
            font-size: var(--fs-base);
            font-weight: 650;
            display: flex;
            align-items: center;
            gap: 8px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .ai-bot-task-option.is-active .ai-bot-task-option-title::before {
            content: '';
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #4f46e5;
            flex-shrink: 0;
        }
        .ai-bot-task-option-sub {
            margin-top: 3px;
            font-size: var(--fs-xs);
            color: var(--text-muted);
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            align-items: center;
        }
        .ai-bot-task-option-sub .steps-ok {
            color: #059669;
            font-weight: 650;
        }
        .ai-bot-prio {
            font-size: var(--fs-xs);
            font-weight: 700;
            padding: 3px 9px;
            border-radius: 999px;
            border: 1px solid transparent;
            flex-shrink: 0;
            letter-spacing: 0.02em;
        }
        .ai-bot-prio.high {
            color: #e11d48;
            background: #fff1f2;
            border-color: #fecdd3;
        }
        .ai-bot-prio.mid {
            color: #4f46e5;
            background: #eef2ff;
            border-color: #c7d2fe;
        }
        .ai-bot-prio.low {
            color: #059669;
            background: #ecfdf5;
            border-color: #a7f3d0;
        }
        .ai-bot-task-add {
            width: 100%;
            margin-top: 6px;
            padding: 10px;
            border: 1px dashed rgba(129, 140, 248, 0.5);
            border-radius: 12px;
            background: rgba(238, 242, 255, 0.4);
            color: #4f46e5;
            font-size: var(--fs-xs);
            font-weight: 700;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: background 0.14s ease, border-color 0.14s ease;
        }
        .ai-bot-task-add:hover {
            background: rgba(238, 242, 255, 0.85);
            border-color: #818cf8;
        }
        .ai-bot-task-add:hover { background: rgba(238, 242, 255, 0.7); }
        .ai-bot-task-add-form {
            display: none;
            gap: 6px;
            margin-top: 6px;
            padding-top: 8px;
            border-top: 1px solid #f1f5f9;
        }
        .ai-bot-task-add-form.is-open { display: flex; }
        .ai-bot-task-add-form input {
            flex: 1;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 8px 12px;
            font-size: var(--fs-xs);
            outline: none;
        }
        .ai-bot-task-add-form input:focus { border-color: #6366f1; }
        .ai-bot-task-add-form button {
            border: none;
            border-radius: 12px;
            padding: 8px 12px;
            background: #4f46e5;
            color: #fff;
            font-size: var(--fs-xs);
            font-weight: 700;
            cursor: pointer;
        }

        .ai-bot-chat-msgs {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 14px;
            background: linear-gradient(180deg, rgba(248,250,252,0.4) 0%, #fff 45%, rgba(248,250,252,0.6) 100%);
        }
        .ai-bot-chat-msgs::-webkit-scrollbar { width: 5px; }
        .ai-bot-chat-msgs::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.35);
            border-radius: 999px;
        }
        .ai-bot-msg-row {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .ai-bot-msg-row.user { align-items: flex-end; }
        .ai-bot-msg-row.bot {
            align-items: flex-start;
            flex-direction: row;
            gap: 10px;
        }
        .ai-bot-msg {
            max-width: 88%;
            padding: 12px 14px;
            border-radius: 16px;
            font-size: var(--fs-base);
            line-height: 1.45;
            white-space: pre-wrap;
            font-weight: 500;
        }
        .ai-bot-msg.bot {
            background: #fff;
            border: 1px solid #dee5f0;
            border-radius: 14px;
            color: #1a2433;
            box-shadow: none;
            white-space: normal;
            overflow-wrap: anywhere;
            word-break: break-word;
            position: relative;
            overflow: visible;
        }
        .ai-bot-msg.bot.is-fn,
        .ai-bot-msg.bot.is-card-v2 {
            padding: 18px 16px 14px;
            max-width: 100%;
        }
        .ai-bot-msg-row.bot.is-fn .ai-bot-msg-col,
        .ai-bot-msg-row.bot.is-rich .ai-bot-msg-col {
            max-width: 100%;
        }
        .ai-bot-msg.bot.is-card-v2 {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .ai-bot-msg.bot.is-card-v2 > .aifn-kind {
            align-self: flex-end;
            margin: -2px 0 0;
        }
        .ai-bot-msg.user {
            background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
            color: #fff;
            border-radius: 16px 16px 4px 16px;
            box-shadow: 0 4px 14px rgba(79, 70, 229, 0.28);
            width: fit-content;
            min-width: 2.5em;
            padding: 8px 12px;
            text-align: left;
            word-break: normal;
            overflow-wrap: break-word;
        }
        /* колонка сообщения задаёт предел ширины; пузырь внутри — по контенту, до 100% колонки
           (раньше % max-width пузыря считался от колонки, которая сама сжата под контент → «В / работу») */
        .ai-bot-msg-col {
            display: flex;
            flex-direction: column;
            min-width: 0;
        }
        .ai-bot-msg-col > .ai-bot-msg { max-width: 100%; box-sizing: border-box; }
        .ai-bot-msg-row.user .ai-bot-msg-col { max-width: 85%; align-items: flex-end; }
        .ai-bot-msg-row.bot .ai-bot-msg-col { flex: 1; max-width: 88%; align-items: stretch; }
        .ai-bot-md {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .ai-bot-md > :first-child { margin-top: 0; }
        .ai-bot-md > :last-child { margin-bottom: 0; }
        .ai-bot-md-h {
            margin: 2px 0 0;
            font-size: 15px;
            font-weight: 650;
            letter-spacing: -0.01em;
            color: #1a2433;
            line-height: 1.3;
        }
        .ai-bot-md-h.is-sub {
            font-size: 11px;
            font-weight: 700;
            color: #5b5bd6;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        .ai-bot-md-p {
            margin: 0;
            color: #1a2433;
            font-weight: 500;
            font-size: 14px;
            line-height: 1.45;
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .ai-bot-md-p.is-foot {
            margin-top: 2px;
            padding-top: 10px;
            border-top: 1px solid #eef2f7;
            font-size: 12px;
            color: #637082;
            font-weight: 500;
            font-style: italic;
        }
        .ai-bot-md strong { font-weight: 650; color: #1a2433; }
        .ai-bot-md em { font-style: italic; color: #637082; }
        .ai-bot-md-ul,
        .ai-bot-md-ol {
            margin: 0;
            padding: 0;
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .ai-bot-md-li {
            position: relative;
            padding: 8px 12px 8px 28px;
            border-radius: 8px;
            background: #fff;
            border: 1px solid #dee5f0;
            line-height: 1.35;
            color: #1a2433;
            font-size: 13px;
            font-weight: 600;
        }
        .ai-bot-md-ul > .ai-bot-md-li::before {
            content: '';
            position: absolute;
            left: 12px;
            top: 13px;
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: #2963e8;
        }
        .ai-bot-md-ol { counter-reset: ai-bot-ol; }
        .ai-bot-md-ol > .ai-bot-md-li {
            counter-increment: ai-bot-ol;
            padding-left: 30px;
        }
        .ai-bot-md-ol > .ai-bot-md-li::before {
            content: counter(ai-bot-ol);
            position: absolute;
            left: 8px;
            top: 7px;
            width: 16px;
            height: 16px;
            border-radius: 6px;
            background: #e0e7ff;
            color: #4338ca;
            font-size: var(--fs-xs);
            font-weight: 800;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }
        .ai-bot-md-li.is-nested {
            margin-left: 10px;
            padding: 4px 10px 4px 24px;
            background: rgba(248, 250, 252, 0.9);
            border-color: rgba(226, 232, 240, 0.95);
            font-size: var(--fs-sm);
            color: #475569;
        }
        .ai-bot-md-ul > .ai-bot-md-li.is-nested::before {
            top: 10px;
            width: 4px;
            height: 4px;
            background: #94a3b8;
        }
        .ai-bot-md-time {
            display: inline-block;
            margin-left: 4px;
            padding: 1px 6px;
            border-radius: 999px;
            background: rgba(99, 102, 241, 0.12);
            color: #4338ca;
            font-size: var(--fs-xs);
            font-weight: 750;
            vertical-align: 1px;
            white-space: nowrap;
        }
        html[data-theme="dark"] .ai-bot-msg.bot {
            background: #111111;
            border-color: #2a2a2a;
            color: #e5e5e5;
        }
        html[data-theme="dark"] .ai-bot-md-h { color: #f5f5f5; }
        html[data-theme="dark"] .ai-bot-md-h.is-sub { color: #93c5fd; }
        html[data-theme="dark"] .ai-bot-md-p { color: #d4d4d4; }
        html[data-theme="dark"] .ai-bot-md-p.is-foot {
            border-top-color: #2a2a2a;
            color: #8a8a8a;
        }
        html[data-theme="dark"] .ai-bot-md strong { color: #f5f5f5; }
        html[data-theme="dark"] .ai-bot-md em { color: #a3a3a3; }
        html[data-theme="dark"] .ai-bot-md-li {
            background: #0a0a0a;
            border-color: #2a2a2a;
            color: #e5e5e5;
        }
        html[data-theme="dark"] .ai-bot-md-li.is-nested {
            background: #000000;
            border-color: #222222;
            color: #a3a3a3;
        }
        html[data-theme="dark"] .ai-bot-md-ol > .ai-bot-md-li::before {
            background: rgba(59, 130, 246, 0.22);
            color: #bfdbfe;
        }
        html[data-theme="dark"] .ai-bot-md-time {
            background: rgba(59, 130, 246, 0.2);
            color: #bfdbfe;
        }
        .ai-bot-task-cards {
            display: flex;
            flex-direction: column;
            gap: 5px;
            margin-top: 8px;
        }
        .ai-bot-task-card {
            display: flex;
            flex-direction: column;
            padding: 6px 8px;
            border-radius: 10px;
            border: 1px solid rgba(199, 210, 254, 0.9);
            background: rgba(255, 255, 255, 0.9);
        }
        .ai-bot-task-card-title {
            margin: 0;
            color: #0f172a;
            font-size: var(--fs-sm);
            font-weight: 700;
            line-height: 1.3;
        }
        .ai-bot-task-card-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            margin-top: 4px;
        }
        .ai-bot-task-card-meta span {
            padding: 1px 6px;
            border-radius: 999px;
            background: #eef2ff;
            color: #4f46e5;
            font-size: var(--fs-xs);
            font-weight: 700;
        }
        .ai-bot-task-card-start {
            align-self: flex-start;
            width: auto;
            padding: 4px 12px;
            margin-top: 5px;
            border: 0;
            border-radius: 999px;
            background: #2563eb;
            color: #fff;
            font-size: var(--fs-xs);
            font-weight: 750;
            line-height: 1.2;
            cursor: pointer;
        }
        .ai-bot-task-card-start:hover { background: #1d4ed8; }
        .ai-bot-task-card-start:disabled {
            background: #94a3b8;
            cursor: default;
        }
        html[data-theme="dark"] .ai-bot-task-card {
            background: #111111;
            border-color: #2a2a2a;
        }
        html[data-theme="dark"] .ai-bot-task-card-title { color: #f5f5f5; }
        html[data-theme="dark"] .ai-bot-task-card-meta span {
            background: rgba(59, 130, 246, 0.18);
            color: #93c5fd;
        }
        /* Тёмная тема: панель чата — чёрный фон, серые линии */
        html[data-theme="dark"] .ai-bot-chat-panel {
            background: var(--bg-panel, #0a0a0a);
            border-color: var(--border, #333333);
        }
        html[data-theme="dark"] .ai-bot-chat-task {
            background: var(--bg-panel, #0a0a0a);
            border-bottom-color: var(--border-subtle, #2a2a2a);
        }
        html[data-theme="dark"] .ai-bot-chat-msgs {
            background: var(--bg-app, #000000);
        }
        html[data-theme="dark"] .ai-bot-msg.user {
            background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
        }
        html[data-theme="dark"] .ai-bot-chat-quick {
            background: var(--bg-panel, #0a0a0a);
            border-top-color: var(--border-subtle, #2a2a2a);
        }
        html[data-theme="dark"] .ai-bot-chat-quick button {
            background: var(--bg-card, #111111);
            border-color: var(--border, #333333);
            color: #d4d4d4;
            box-shadow: none;
        }
        html[data-theme="dark"] .ai-bot-chat-quick button:not([aria-disabled="true"]):hover {
            background: rgba(59, 130, 246, 0.16);
            border-color: rgba(59, 130, 246, 0.4);
            color: #bfdbfe;
        }
        html[data-theme="dark"] .ai-bot-chat-input {
            background: var(--bg-panel, #0a0a0a);
        }
        html[data-theme="dark"] .ai-bot-chat-input input[type="text"],
        html[data-theme="dark"] .ai-bot-chat-input input,
        html[data-theme="dark"] .ai-bot-chat-input textarea {
            background: var(--bg-card, #111111);
            border-color: var(--border, #333333);
            color: #f5f5f5;
        }
        html[data-theme="dark"] .ai-bot-chat-input input[type="text"]:focus,
        html[data-theme="dark"] .ai-bot-chat-input input:focus,
        html[data-theme="dark"] .ai-bot-chat-input textarea:focus {
            background: var(--bg-card, #111111);
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
        }
        .ai-bot-msg-time {
            font-size: 11px;
            line-height: 1.2;
            color: var(--text-muted);
            padding: 0 4px;
            white-space: nowrap;
            font-variant-numeric: tabular-nums;
        }
        .ai-bot-msg-row.user .ai-bot-msg-time { margin-top: -1px; }
        .ai-bot-av-col {
            display: flex; flex-direction: column; align-items: center; gap: 3px;
            flex-shrink: 0; width: 32px;
        }
        .ai-bot-av-col .ai-bot-msg-time { padding: 0; opacity: 0.85; }
        .ai-bot-day-sep {
            display: flex; justify-content: center; margin: 2px 0 -4px;
        }
        .ai-bot-day-sep span {
            padding: 2px 10px; border-radius: 999px;
            background: rgba(148, 163, 184, 0.14); color: var(--text-muted);
            font-size: 11px; font-weight: 650; line-height: 1.5;
        }
        html[data-theme="dark"] .ai-bot-day-sep span { background: #1a1a1a; color: #8a8a8a; }
        .ai-bot-steps {
            margin-top: 12px;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .ai-bot-step {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 10px;
            border-radius: 12px;
            border: 1px solid rgba(224, 231, 255, 0.9);
            background: #fff;
            cursor: pointer;
            transition: border-color 0.15s ease;
        }
        .ai-bot-step:hover { border-color: #a5b4fc; }
        .ai-bot-step.is-checked {
            background: rgba(236, 253, 245, 0.7);
            border-color: rgba(167, 243, 208, 0.85);
            color: #64748b;
        }
        .ai-bot-step-num {
            width: 16px;
            height: 16px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: var(--fs-xs);
            font-weight: 800;
            flex-shrink: 0;
            margin-top: 2px;
            background: #e0e7ff;
            color: #4338ca;
        }
        .ai-bot-step.is-checked .ai-bot-step-num {
            background: #10b981;
            color: #fff;
        }
        .ai-bot-step span {
            font-size: var(--fs-xs);
            line-height: 1.4;
            font-weight: 550;
        }
        .ai-bot-step.is-checked span { text-decoration: line-through; color: var(--text-muted); }
        html[data-theme="dark"] .ai-bot-step {
            background: #111111;
            border-color: #2a2a2a;
            color: #e5e5e5;
        }
        html[data-theme="dark"] .ai-bot-step:hover { border-color: #3b82f6; }
        html[data-theme="dark"] .ai-bot-step.is-checked {
            background: rgba(52, 211, 153, 0.08);
            border-color: rgba(52, 211, 153, 0.35);
            color: #a3a3a3;
        }
        html[data-theme="dark"] .ai-bot-step-num {
            background: rgba(59, 130, 246, 0.2);
            color: #93c5fd;
        }
        html[data-theme="dark"] .ai-bot-msg-actions {
            border-top-color: #2a2a2a;
        }
        html[data-theme="dark"] .ai-bot-thinking-bubble {
            background: #111111;
            border-color: #2a2a2a;
            color: #d4d4d4;
        }
        .ai-bot-msg-actions {
            margin-top: 12px;
            padding-top: 10px;
            border-top: 1px solid rgba(224, 231, 255, 0.85);
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }
        .ai-bot-msg-actions button {
            border: none;
            border-radius: 999px;
            padding: 8px 14px;
            font-size: var(--fs-xs);
            font-weight: 700;
            cursor: pointer;
            background: #2563eb;
            color: #fff;
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
        }
        .ai-bot-msg-actions button:hover { background: #1d4ed8; }
        .ai-bot-msg-actions button.is-done {
            background: #059669;
            cursor: default;
        }
        .ai-bot-msg-actions .steps-count {
            font-size: var(--fs-xs);
            color: var(--text-muted);
        }
        .ai-bot-thinking {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .ai-bot-thinking-bubble {
            background: rgba(238, 242, 255, 0.9);
            border: 1px solid #e0e7ff;
            border-radius: 16px 16px 16px 4px;
            padding: 12px 14px;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: var(--fs-xs);
            font-weight: 600;
            color: #312e81;
        }
        .ai-bot-thinking-dots {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            margin-left: 6px;
            vertical-align: middle;
        }
        .ai-bot-thinking-dots span {
            display: inline-block;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #6366f1;
            margin: 0;
            animation: aiBotThinkDot 1.05s ease-in-out infinite;
        }
        .ai-bot-thinking-dots span:nth-child(2) { animation-delay: 0.18s; }
        .ai-bot-thinking-dots span:nth-child(3) { animation-delay: 0.36s; }
        @keyframes aiBotThinkDot {
            0%, 80%, 100% { opacity: 0.25; transform: translateY(0) scale(0.85); }
            40% { opacity: 1; transform: translateY(-4px) scale(1); }
        }

        .ai-bot-chat-quick {
            display: flex;
            gap: 6px;
            padding: 10px 14px 8px;
            border-top: 1px solid #f1f5f9;
            flex-wrap: wrap;
            overflow: visible;
            background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
            flex-shrink: 0;
            scrollbar-width: none;
        }
        .ai-bot-chat-quick::-webkit-scrollbar { display: none; }
        .ai-bot-chat-quick button {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            border: 1px solid rgba(226, 232, 240, 0.95);
            background: #fff;
            color: #334155;
            border-radius: 999px;
            padding: 6px 11px;
            font-size: var(--fs-xs);
            font-weight: 650;
            cursor: pointer;
            white-space: nowrap;
            flex-shrink: 0;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
            transition: all 0.15s ease;
        }
        .ai-bot-chat-quick button:not([aria-disabled="true"]):hover {
            background: #eef2ff;
            border-color: #c7d2fe;
            color: #4338ca;
            transform: translateY(-1px);
            border-color: #c7d2fe;
        }
        .ai-bot-chat-quick button:disabled { opacity: 0.5; cursor: wait; }
        .ai-bot-chat-quick button svg {
            width: 14px;
            height: 14px;
            color: #4f46e5;
            flex-shrink: 0;
        }
        .ai-bot-chat-input {
            display: flex;
            gap: 8px;
            padding: 4px 14px max(14px, env(safe-area-inset-bottom));
            background: #fff;
            flex-shrink: 0;
            align-items: flex-end;
        }
        .ai-bot-chat-input .ai-bot-input-wrap {
            position: relative;
            flex: 1;
            min-width: 0;
        }
        .ai-bot-chat-input input[type="text"],
        .ai-bot-chat-input input,
        .ai-bot-chat-input textarea {
            width: 100%;
            box-sizing: border-box;
            min-height: 46px;
            max-height: 90px;
            resize: none;
            border-radius: 16px;
            border: 1px solid rgba(226, 232, 240, 0.9);
            /* справа запас под микрофон (глобальный input[type=text] иначе сбрасывает padding) */
            padding: 12px 48px 12px 16px !important;
            font: inherit;
            font-size: var(--fs-md);
            background: rgba(241, 245, 249, 0.95);
            color: #0f172a;
            outline: none;
        }
        .ai-bot-chat-input input[type="text"]:focus,
        .ai-bot-chat-input input:focus,
        .ai-bot-chat-input textarea:focus {
            background: #fff;
            border-color: #6366f1;
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
        }
        .ai-bot-chat-input .input-mic-btn {
            position: absolute;
            right: 6px;
            top: 50%;
            transform: translateY(-50%);
            width: 34px;
            height: 34px;
            z-index: 2;
            border-radius: 10px;
            border: none;
            background: transparent;
            color: #64748b;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            padding: 0;
            appearance: none;
            -webkit-tap-highlight-color: transparent;
        }
        .ai-bot-chat-input .input-mic-btn:hover {
            background: #eef2ff;
            color: #4f46e5;
        }
        /* textarea чата: 1–5 строк, растёт по мере ввода; микрофон прижат к низу */
        .ai-bot-chat-input textarea#aiBotChatInput {
            display: block;
            line-height: 1.35;
            max-height: 128px;
            overflow-y: hidden;
        }
        .ai-bot-chat-input .ai-bot-input-wrap .input-mic-btn {
            top: auto;
            bottom: 6px;
            transform: none;
        }
        .ai-bot-msg-row.is-queued .ai-bot-msg { opacity: 0.6; }

        /* 7.6: потоковый ответ Дейли — мигающий курсор */
        .ai-bot-caret {
            display: inline-block;
            width: 2px;
            height: 1.05em;
            margin-left: 2px;
            vertical-align: -0.18em;
            border-radius: 1px;
            background: currentColor;
            opacity: 0.75;
            animation: aiBotCaretBlink 1s steps(1, end) infinite;
        }
        @keyframes aiBotCaretBlink {
            50% { opacity: 0; }
        }
        @media (prefers-reduced-motion: reduce) {
            .ai-bot-caret { animation: none; }
        }
