        /* --- Auth / install --- */
        body.app-locked .workspace,
        body.app-locked .topbar-shell,
        body.app-locked .topbar,
        body.app-locked .toast,
        body.app-locked .focus-overlay,
        body.app-locked .ai-assist-overlay,
        body.app-locked .ai-bot-root,
        body.app-locked .ai-bot-chat-overlay,
        body.app-locked .voice-parse-overlay,
        body.app-locked .done-detail-overlay,
        body.app-locked .task-sheet-overlay,
        body.app-locked .modal-backdrop,
        body.app-locked .capture-panel,
        body.app-locked #taskSchedulePop,
        body.app-locked .session-end-overlay,
        body.app-locked .mobile-add-fab,
        body.app-locked .voice-capture-overlay,
        body.app-booting .workspace,
        body.app-booting .topbar-shell,
        body.app-booting .topbar,
        body.app-booting .toast,
        body.app-booting .focus-overlay,
        body.app-booting .ai-assist-overlay,
        body.app-booting .ai-bot-root,
        body.app-booting .ai-bot-chat-overlay,
        body.app-booting .voice-parse-overlay,
        body.app-booting .done-detail-overlay,
        body.app-booting .task-sheet-overlay,
        body.app-booting .modal-backdrop,
        body.app-booting .capture-panel,
        body.app-booting #taskSchedulePop,
        body.app-booting .session-end-overlay,
        body.app-booting .mobile-add-fab,
        body.app-booting .voice-capture-overlay {
            display: none !important;
        }
        .boot-overlay {
            position: fixed;
            inset: 0;
            z-index: 450;
            background: var(--bg-app);
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
            opacity: 1;
            transition: opacity 0.28s ease;
        }
        html:not([data-theme="dark"]) .boot-overlay {
            background: linear-gradient(165deg, #e8eef7 0%, #f1f5f9 45%, #dbeafe 100%);
        }
        body.app-booting .boot-overlay { display: flex; }
        body.boot-fadeout .boot-overlay { opacity: 0; pointer-events: none; }
        .boot-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 14px;
            text-align: center;
        }
        .boot-mark {
            width: 64px;
            height: 64px;
            border-radius: 18px;
            background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
            border: none;
            box-shadow: 0 8px 22px rgba(37, 99, 235, 0.32);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            animation: boot-pulse 1.4s ease-in-out infinite;
        }
        .boot-mark::after {
            content: "";
            width: 22px;
            height: 22px;
            border-radius: 50%;
            border: 4px solid #fff;
            box-sizing: border-box;
        }
        .boot-mark svg { display: none; }
        .boot-icon {
            width: 64px;
            height: 64px;
            border-radius: 18px;
            display: block;
            box-shadow: 0 8px 22px rgba(9, 24, 60, 0.28);
            animation: boot-pulse 1.4s ease-in-out infinite;
        }
        /* Brand wordmark (TaskDay) — light/dark variants */
        .brand-word {
            display: inline-flex;
            align-items: center;
        }
        .brand-word img {
            display: block;
            width: auto;
            height: 20px;
        }
        .brand-word-dark { display: none !important; }
        html[data-theme="dark"] .brand-word-light { display: none !important; }
        html[data-theme="dark"] .brand-word-dark { display: inline-block !important; }
        .boot-spinner {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: 2.5px solid rgba(37, 99, 235, 0.18);
            border-top-color: var(--accent);
            animation: boot-spin 0.7s linear infinite;
        }
        .boot-title {
            font-size: var(--fs-xl);
            font-weight: 800;
            letter-spacing: -0.02em;
            color: var(--text-primary);
        }
        .boot-sub-brand {
            font-size: var(--fs-sm);
            font-weight: 600;
            color: var(--text-secondary, #64748b);
            margin-top: -8px;
        }
        .boot-sub {
            font-size: var(--fs-sm);
            color: var(--text-muted);
            margin-top: -2px;
        }
        @keyframes boot-spin {
            to { transform: rotate(360deg); }
        }
        @keyframes boot-pulse {
            0%, 100% { transform: scale(1); box-shadow: var(--shadow-sm); }
            50% { transform: scale(1.04); box-shadow: var(--shadow-lg); }
        }
        .auth-overlay {
            position: fixed;
            inset: 0;
            z-index: 400;
            background: #f6f8fb;
            display: none;
            align-items: stretch;
            justify-content: center;
            padding: 0;
            overflow-y: auto;
        }
        html:not([data-theme="dark"]) .auth-overlay { background: #f6f8fb; }
        body.app-locked:not(.app-booting) .auth-overlay { display: flex; }
        body.app-booting .auth-overlay { display: none !important; }
        .auth-shell {
            width: min(1440px, 100%);
            margin: 0 auto;
            min-height: 100%;
            display: flex;
            flex-direction: column;
            padding: 0 48px 32px;
            box-sizing: border-box;
        }
        .auth-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 72px;
            border-bottom: 1px solid #e3e8f0;
            flex-shrink: 0;
        }
        .auth-logo {
            font-size: 22px;
            font-weight: 800;
            letter-spacing: -0.03em;
            color: #1a2433;
            display: flex;
            align-items: center;
            gap: 9px;
        }
        .auth-logo-mark {
            width: 26px;
            height: 24px;
            display: block;
            flex-shrink: 0;
        }
        .auth-logo .brand-word img { height: 23px; }
        .auth-top-note { font-size: 12px; font-weight: 600; color: #667387; }
        .auth-body {
            flex: 1;
            display: grid;
            grid-template-columns: minmax(0, 1.1fr) minmax(320px, 400px);
            gap: 48px;
            align-items: center;
            padding: 48px 0 24px;
        }
        .auth-headline {
            margin: 0;
            font-size: clamp(36px, 5vw, 56px);
            font-weight: 800;
            letter-spacing: -0.03em;
            line-height: 1.08;
            color: #1a2433;
        }
        .auth-headline span { color: #2963e8; }
        .auth-lead {
            margin: 16px 0 0;
            max-width: 420px;
            font-size: 16px;
            line-height: 1.45;
            color: #667387;
        }
        .auth-card {
            width: 100%;
            background: transparent;
            border: 0;
            border-radius: 0;
            box-shadow: none;
            padding: 0;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        .auth-card-head h2 {
            margin: 0;
            font-size: 28px;
            font-weight: 800;
            letter-spacing: -0.02em;
            color: #1a2433;
        }
        .auth-card .auth-sub {
            margin: 6px 0 0;
            font-size: 14px;
            color: #667387;
        }
        .auth-tabs {
            display: none;
        }
        .auth-tabs button {
            border: none;
            background: transparent;
            padding: 10px;
            border-radius: 8px;
            font-weight: 700;
            color: var(--text-secondary);
            cursor: pointer;
        }
        .auth-tabs button.active {
            background: #fff;
            color: #2963e8;
            box-shadow: var(--shadow-sm);
        }
        .auth-form { display: none; flex-direction: column; gap: 14px; }
        .auth-form.active { display: flex; }
        .auth-form label {
            font-size: 12px;
            font-weight: 650;
            color: #667387;
            display: block;
            margin-bottom: 6px;
        }
        .auth-label-row {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 12px;
        }
        .auth-label-row label { margin-bottom: 6px; }
        .auth-form input {
            width: 100%;
            height: 54px;
            padding: 0 16px;
            border: 1px solid #dee5f0;
            border-radius: 12px;
            font-size: 15px;
            background: #fff;
            color: #1a2433;
            box-sizing: border-box;
        }
        .auth-submit {
            width: 100%;
            height: 56px;
            margin-top: 4px;
            border: 0;
            border-radius: 12px;
            background: #2963e8;
            color: #fff;
            font: inherit;
            font-size: 15px;
            font-weight: 700;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
        }
        .auth-submit:hover { background: #1f54d0; }
        .auth-switch {
            margin: 0;
            text-align: center;
            font-size: 13px;
            color: #667387;
        }
        .auth-link {
            border: 0;
            background: none;
            padding: 0;
            color: #2963e8;
            font: inherit;
            font-size: 13px;
            font-weight: 650;
            cursor: pointer;
        }
        .auth-back { display: inline-block; margin-top: 4px; }
        @media (max-width: 860px) {
            .auth-shell { padding: 0 20px 28px; }
            .auth-body {
                grid-template-columns: 1fr;
                gap: 28px;
                padding-top: 28px;
                align-items: start;
            }
            .auth-headline { font-size: 34px; }
        }
        .pw-wrap { position: relative; display: block; }
        .pw-wrap > input { padding-right: 40px !important; }
        .pw-eye {
            position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
            width: 32px; height: 32px; padding: 0; margin: 0; border: 0; border-radius: 8px;
            background: transparent; color: var(--text-muted); cursor: pointer;
            display: flex; align-items: center; justify-content: center; box-shadow: none;
        }
        .pw-eye:hover { color: var(--text-primary); background: var(--bg-subtle); }
        .account-note { font-size: var(--fs-xs); color: var(--text-muted); margin: 2px 0 0; line-height: 1.35; }
        .account-logout-all {
            align-self: flex-start; border: 0; background: none; padding: 4px 0; margin: 0;
            color: var(--danger); font-size: var(--fs-sm); font-weight: 650; cursor: pointer;
        }
        .account-logout-all:hover { text-decoration: underline; text-underline-offset: 2px; }
        /* ---- Пустые состояния ---- */
        .es {
            display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box;
            padding: 8px 10px; min-height: 0;
            border: 1px dashed var(--border); border-radius: 10px; background: var(--bg-subtle);
            color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.35;
        }
        .es.is-plain { border: 0; background: none; padding: 4px 2px; }
        .es-ico { flex: 0 0 auto; opacity: .75; }
        .es-text { flex: 1 1 auto; min-width: 0; }
        .es-act {
            flex: 0 0 auto; border: 0; background: none; box-shadow: none; margin: 0;
            padding: 3px 6px; border-radius: 6px; cursor: pointer; white-space: nowrap;
            color: var(--accent); font-size: var(--fs-sm); font-weight: 650;
        }
        .es-act:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
        .es-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
        .es-inline { font-size: var(--fs-xs); color: var(--text-muted); }
        .aifn-sum.is-empty { display: flex; align-items: center; gap: 7px; color: var(--text-secondary); }
        .aifn-sum.is-empty .es-ico { color: var(--text-muted); }
        @media (max-width: 420px) {
            .es { flex-wrap: wrap; row-gap: 2px; }
            .es .es-text { flex-basis: calc(100% - 26px); }
            .es .es-act { margin-left: 18px; padding-left: 6px; }
        }

        /* ---- Подсказка «выбери задачу» в чате Дейли ---- */
        .ai-task-hint {
            display: flex; align-items: flex-start; gap: 7px; margin: 8px 12px 2px; padding: 6px 6px 6px 9px;
            border: 1px solid var(--border); border-radius: 10px; background: var(--bg-subtle);
            font-size: 12px; line-height: 1.4; color: var(--text-muted);
        }
        .ai-task-hint[hidden] { display: none; }
        .ai-task-hint-ico { display: flex; flex-shrink: 0; margin-top: 1px; color: var(--accent); opacity: .8; }
        .ai-task-hint-ico svg { width: 13px; height: 13px; }
        .ai-task-hint-text { flex: 1; min-width: 0; }
        .ai-task-hint-link {
            border: 0; background: none; box-shadow: none; padding: 0; margin: 0 0 0 2px; cursor: pointer;
            font: inherit; font-weight: 700; color: var(--accent); text-decoration: underline; text-underline-offset: 2px;
        }
        .ai-task-hint-link:hover, .ai-task-hint-link:active { background: none; color: var(--accent); text-decoration-thickness: 2px; }
        .ai-task-hint-x {
            flex-shrink: 0; width: 20px; height: 20px; padding: 0; margin: 0; border: 0; border-radius: 6px; box-shadow: none;
            background: transparent; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
        }
        .ai-task-hint-x:hover { background: color-mix(in srgb, var(--text-muted) 16%, transparent); color: var(--text-primary); }
        .ai-task-hint-x:active { background: color-mix(in srgb, var(--text-muted) 26%, transparent); }
        .ai-task-hint-link:focus-visible, .ai-task-hint-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

        /* ---- Онбординг ---- */
        .onb { position: fixed; inset: 0; z-index: 10040; }
        .onb[hidden] { display: none; }
        .onb.is-dim { background: rgba(15, 23, 42, .45); }
        .onb-ring {
            position: fixed; border-radius: 12px; pointer-events: none;
            box-shadow: 0 0 0 9999px rgba(15, 23, 42, .45), 0 0 0 2px var(--accent);
        }
        .onb-ring[hidden] { display: none; }
        .onb-pop {
            position: fixed; width: min(320px, calc(100vw - 24px)); box-sizing: border-box;
            background: var(--bg-panel); color: var(--text-primary);
            border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px 10px;
            box-shadow: 0 12px 32px rgba(15, 23, 42, .22);
        }
        .onb-pop.is-in { animation: onbIn .18s ease-out; }
        .onb-pop.is-docked { box-shadow: 0 -6px 28px rgba(15, 23, 42, .25); }
        .onb-arrow {
            position: absolute; width: 10px; height: 10px; box-sizing: border-box;
            background: var(--bg-panel); border: 1px solid var(--border); transform: rotate(45deg); pointer-events: none;
        }
        .onb-arrow[hidden] { display: none; }
        .onb-arrow.at-left { left: -6px; top: calc(var(--ap, 20px) - 5px); border-top: 0; border-right: 0; }
        .onb-arrow.at-right { right: -6px; top: calc(var(--ap, 20px) - 5px); border-bottom: 0; border-left: 0; }
        .onb-arrow.at-top { top: -6px; left: calc(var(--ap, 20px) - 5px); border-right: 0; border-bottom: 0; }
        .onb-arrow.at-bottom { bottom: -6px; left: calc(var(--ap, 20px) - 5px); border-left: 0; border-top: 0; }
        @keyframes onbIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
        .onb-dots { display: flex; gap: 5px; margin-bottom: 7px; }
        .onb-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
        .onb-dot.is-on { background: var(--accent); width: 16px; border-radius: 3px; }
        .onb-title { font-size: var(--fs-ml); font-weight: 700; line-height: 1.3; }
        .onb-text { margin-top: 4px; font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.4; }
        .onb-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
        .onb-list li { position: relative; padding-left: 12px; }
        .onb-list li::before {
            content: ''; position: absolute; left: 1px; top: .58em; width: 5px; height: 5px; border-radius: 50%;
            background: var(--accent); opacity: .7;
        }
        .onb-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 10px; }
        .onb-skip {
            border: 0; background: none; box-shadow: none; cursor: pointer; margin-right: auto;
            color: var(--text-muted); font-size: var(--fs-sm); font-weight: 600; padding: 5px 4px;
        }
        .onb-skip[hidden] { display: none; }
        .onb-skip:hover { color: var(--text-primary); background: var(--bg-subtle); border-radius: 6px; }
        .onb-skip:active { background: color-mix(in srgb, var(--text-muted) 18%, transparent); }
        .onb-next {
            border: 0; cursor: pointer; border-radius: 8px; padding: 6px 14px;
            background: var(--accent); color: #fff; font-size: var(--fs-sm); font-weight: 700;
        }
        .onb-next:hover { background: color-mix(in srgb, var(--accent) 86%, #000); color: #fff; }
        .onb-next:active { background: color-mix(in srgb, var(--accent) 76%, #000); color: #fff; transform: translateY(1px); }
        .onb-next:focus-visible { background: var(--accent); color: #fff; }
        .onb-pop button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

        /* Глобальный button:hover (0,1,1) перебивает одноклассовые кнопки — задаём состояния явно */
        .auth-link:hover, .auth-link:active,
        .account-logout-all:hover, .account-logout-all:active,
        .aifn-more:hover, .aifn-more:active,
        .aifn-link:hover, .aifn-link:active,
        .tz-use:hover, .tz-use:active { background: none; }
        .auth-link:hover { color: color-mix(in srgb, var(--accent) 85%, #000); }
        .auth-back:hover { color: var(--text-primary); }
        html[data-theme="dark"] .auth-link:hover { color: color-mix(in srgb, var(--accent) 75%, #fff); }
        html[data-theme="dark"] .auth-back:hover { color: var(--text-primary); }
        .aitp-trigger:hover { background: none; }
        .ww-day:hover { background: #e0e7ff; border-color: #a5b4fc; color: #3730a3; }
        .ww-row.is-off .ww-day:hover { background: var(--bg-subtle); border-color: var(--border, #e2e8f0); color: var(--text-secondary); }
        html[data-theme="dark"] .ww-day:hover { background: rgba(99, 102, 241, 0.3); border-color: rgba(129, 140, 248, 0.6); color: #e0e7ff; }
        html[data-theme="dark"] .ww-row.is-off .ww-day:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(82, 82, 91, 0.95); color: #a1a1aa; }
        .es-act:active { background: color-mix(in srgb, var(--accent) 18%, transparent); }

        .auth-forgot-row { display: flex; justify-content: flex-end; margin-top: 4px; }
        .auth-link {
            border: 0; background: none; padding: 2px 0; margin: 0; cursor: pointer;
            color: var(--accent); font-size: var(--fs-sm); font-weight: 600; box-shadow: none;
        }
        .auth-link:hover { text-decoration: underline; text-underline-offset: 2px; }
        .auth-back { align-self: center; color: var(--text-secondary); }
        .auth-step-title { font-size: var(--fs-ml); font-weight: 700; color: var(--text-primary); }
        .auth-step-hint { margin: -4px 0 0; font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.4; }
        .auth-ok {
            font-size: var(--fs-sm); line-height: 1.4; color: var(--text-primary);
            background: var(--bg-subtle); border-radius: 8px; padding: 8px 10px;
        }
        .auth-tabs[hidden], .forgot-body[hidden], .auth-sent[hidden], .auth-link[hidden] { display: none; }
        .forgot-body { display: flex; flex-direction: column; gap: 10px; }
        .forgot-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
        .auth-sent {
            display: flex; gap: 10px; align-items: flex-start;
            padding: 12px; border-radius: 10px;
            background: color-mix(in srgb, var(--success, #16a34a) 10%, var(--bg-panel));
            border: 1px solid color-mix(in srgb, var(--success, #16a34a) 35%, transparent);
            animation: authSentIn .22s ease-out;
        }
        .auth-sent-ico {
            flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            background: var(--success, #16a34a); color: #fff;
        }
        .auth-sent-title { font-size: var(--fs-ml); font-weight: 650; color: var(--text-primary); line-height: 1.3; word-break: break-word; }
        .auth-sent-sub { margin-top: 3px; font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.4; }
        @keyframes authSentIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
        #forgotSubmit.is-loading { opacity: .8; cursor: progress; }
        #forgotSubmit.is-loading::before {
            content: ''; width: 14px; height: 14px; margin-right: 8px; border-radius: 50%;
            border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: authSpin .7s linear infinite;
        }
        #forgotSubmit:disabled:not(.is-loading) { opacity: .6; cursor: default; }
        @keyframes authSpin { to { transform: rotate(360deg); } }
        .auth-error {
            color: var(--danger);
            font-size: var(--fs-sm);
            min-height: 1.2em;
        }
        .auth-install-hint {
            font-size: var(--fs-xs);
            color: var(--text-muted);
            line-height: 1.4;
            border-top: 1px solid var(--border-subtle);
            padding-top: 10px;
            margin-top: 4px;
        }
        .account-modal .modal-dialog { max-width: 400px; gap: 14px; }
        .account-profile {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            background: var(--bg-subtle);
            border: 1px solid var(--border-subtle);
            border-radius: 12px;
        }
        .account-profile .topbar-user-avatar {
            width: 44px;
            height: 44px;
            font-size: var(--fs-md);
        }
        .account-profile-text {
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .account-profile-name {
            font-size: var(--fs-md);
            font-weight: 700;
            color: var(--text-primary);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .account-profile-email {
            font-size: var(--fs-sm);
            color: var(--text-muted);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .account-section-title {
            font-size: var(--fs-sm);
            font-weight: 700;
            color: var(--text-secondary);
            letter-spacing: 0.02em;
            margin: 2px 0 0;
        }
        .account-form {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .account-form label {
            font-size: var(--fs-xs);
            font-weight: 600;
            color: var(--text-secondary);
            display: block;
            margin-bottom: 4px;
        }
        .account-form input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-size: var(--fs-ml);
            font-family: inherit;
            background: var(--bg-panel);
            color: var(--text-primary);
            box-sizing: border-box;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }
        .account-form input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-soft);
        }
        .account-form .btn-primary {
            width: 100%;
            justify-content: center;
            min-height: 44px;
            margin-top: 2px;
        }
        .topbar-user-avatar {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: linear-gradient(145deg, #3b82f6, #1d4ed8);
            color: #fff;
            font-size: var(--fs-xs);
            font-weight: 800;
            letter-spacing: 0.02em;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .topbar-menu-user {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            padding: 10px;
            margin-bottom: 4px;
            border: none;
            border-bottom: 1px solid var(--border-subtle);
            border-radius: 8px 8px 0 0;
            background: transparent;
            cursor: pointer;
            text-align: left;
            font-family: inherit;
            color: inherit;
        }
        .topbar-menu-user:hover {
            background: var(--accent-soft);
        }
        .topbar-menu-user:focus-visible {
            outline: none;
            box-shadow: inset 0 0 0 2px var(--accent-soft);
        }
        .topbar-menu-user .topbar-user-avatar {
            width: 36px;
            height: 36px;
            font-size: var(--fs-sm);
        }
        .topbar-menu-user-text {
            min-width: 0;
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .topbar-menu-user-name {
            font-size: var(--fs-base);
            font-weight: 700;
            color: var(--text-primary);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .topbar-menu-user-email {
            font-size: var(--fs-xs);
            color: var(--text-muted);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .topbar-menu-user-hint {
            font-size: var(--fs-xs);
            font-weight: 600;
            color: var(--accent);
            flex-shrink: 0;
        }

        .session-end-overlay {
            position: fixed;
            inset: 0;
            z-index: 380;
            background: rgba(15, 23, 42, 0.55);
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .session-end-overlay.active { display: flex; }
        .session-end-card {
            width: min(420px, 100%);
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-lg);
            padding: 20px 18px 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .session-end-card h3 {
            font-size: var(--fs-xl);
            font-weight: 800;
            color: var(--danger);
        }
        .session-end-card p {
            font-size: var(--fs-base);
            color: var(--text-secondary);
            line-height: 1.45;
        }
        .session-end-card .session-end-task {
            font-size: var(--fs-md);
            font-weight: 700;
            color: var(--text-primary);
            background: var(--bg-subtle);
            border-radius: 10px;
            padding: 10px 12px;
        }
        .session-end-actions {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-top: 4px;
        }
        .session-end-actions button {
            width: 100%;
            min-height: 44px;
            justify-content: center;
        }
        /* ===== Этап 5: шапка, баннер загрузки, понятность ===== */
        @media (min-width: 1025px) {
            .workday-widget,
            .shift-capsule { height: 36px; }
            /* «Новая задача» — вторичная кнопка */
            .split-capture-btn,
            .add-task-group {
                height: 34px;
                background: var(--bg-panel);
                border: 1px solid var(--border);
            }
            .split-capture-btn:hover,
            .add-task-group:hover {
                border-color: var(--border-strong, #cbd5e1);
                box-shadow: none;
            }
            .btn-add-task,
            .split-main-action { color: var(--text-primary); }
            .btn-add-task:hover,
            .split-main-action:hover { background: var(--bg-subtle); color: var(--text-primary); }
            .btn-add-task.is-open { background: var(--accent); color: #fff; }
            .btn-add-mic,
            .split-mic-action {
                width: 32px;
                background: transparent;
                border-left: 1px solid var(--border);
                color: var(--text-secondary);
            }
            .btn-add-mic:hover,
            .split-mic-action:hover { background: var(--bg-subtle); color: var(--accent); }
            /* «Быстрый старт» — основная акцентная кнопка */
            .btn-quick-start,
            .work-state-pill { height: 34px; }
            .btn-quick-start.is-idle {
                background: var(--accent);
                border-color: var(--accent);
                color: #fff;
                box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
            }
            .btn-quick-start.is-idle:hover {
                background: var(--accent-hover);
                border-color: var(--accent-hover);
                color: #fff;
            }
            .btn-quick-start.is-idle .work-live-dot { animation: none; opacity: 0.85; }
            .topbar-menu-btn,
            .topbar-icon-btn { width: 34px; height: 34px; }
        }
        /* таймер в шапке: «⏱ 25:00» без вертикальной черты */
        .btn-quick-start.is-active-work .work-state-timer {
            border-left: 0;
            padding-left: 0;
        }
        /* баннер загрузки дня — компактная строка */
        .day-load-banner {
            padding: 4px 6px 4px 12px;
            font-size: 13px;
            line-height: 1.3;
            min-height: 32px;
            box-sizing: border-box;
        }
        .day-load-banner .dlb-text {
            flex: 1;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .day-load-banner .dlb-action {
            flex-shrink: 0;
            padding: 3px 10px;
            min-height: 24px;
            font-size: 12px;
            font-weight: 650;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.7);
            border: 1px solid rgba(217, 119, 6, 0.35);
            color: inherit;
        }
        .day-load-banner .dlb-action:hover { background: #fff; border-color: rgba(217, 119, 6, 0.6); }
        .day-load-banner .dlb-close {
            flex-shrink: 0;
            width: 24px;
            height: 24px;
            min-height: 24px;
            padding: 0;
            border: 0;
            background: transparent;
            color: inherit;
            font-size: 16px;
            line-height: 1;
            opacity: 0.7;
        }
        .day-load-banner .dlb-close:hover { opacity: 1; background: rgba(217, 119, 6, 0.12); }
        html[data-theme="dark"] .day-load-banner .dlb-action { background: transparent; }
        .day-load-banner .dlb-short { display: none; }
        @media (max-width: 1024px) {
            .day-load-banner .dlb-full { display: none; }
            .day-load-banner .dlb-short { display: inline; }
        }
        /* счётчик приоритетов сверх лимита */
        .slot-load-pill.is-over {
            background: var(--warning-soft);
            border-color: rgba(217, 119, 6, 0.35);
            color: #92400e;
        }
        html[data-theme="dark"] .slot-load-pill.is-over { color: #fcd34d; }
        /* выполненные в буфере — отдельной спокойной группой */
        .backlog-group.is-done .backlog-group-head { color: var(--text-muted); }
        /* меню: подзаголовок «ИИ» и отделённый «Выйти» */
        .topbar-menu-sub {
            padding: 8px 10px 2px;
            font-size: var(--fs-xs);
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: var(--text-muted);
            border-top: 1px solid var(--border);
            margin-top: 4px;
        }
        .topbar-menu-item.is-logout {
            border-top: 1px solid var(--border);
            border-radius: 0 0 8px 8px;
            margin-top: 4px;
        }
        /* ИИ-функции в чате Дейли */
        .ai-bot-chat-quick.ai-bot-fn-row { border-top: 0; padding-top: 0; }
        .ai-bot-chat-quick.ai-bot-fn-row[hidden] { display: none; }
        .ai-bot-chat-quick button.is-open { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
        /* Задача для разбора: компактный выбор */
        .ai-bot-chat-task { padding: 8px 12px; }
        .aitp {
            display: flex; align-items: center; gap: 2px;
            background: #fff; border: 1px solid rgba(226, 232, 240, 0.95); border-radius: 12px;
            padding-right: 4px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }
        .aitp:hover { border-color: #c7d2fe; }
        .aitp.is-open { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14); }
        .aitp-trigger {
            flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
            padding: 6px 4px 6px 10px; min-height: 34px; background: none; border: 0; border-radius: 12px;
            cursor: pointer; text-align: left; color: inherit; font: inherit; box-shadow: none; margin: 0;
        }
        .aitp-ico, .aitp-chev { display: flex; flex-shrink: 0; }
        .aitp-ico { color: #6366f1; }
        .aitp-ico svg, .aitp-chev svg { width: 15px; height: 15px; }
        .aitp-chev { color: #94a3b8; transition: transform 0.18s ease, color 0.15s ease; }
        .aitp.is-open .aitp-chev { transform: rotate(180deg); color: #6366f1; }
        .aitp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
        .aitp-ph { font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .aitp-title { font-size: 13px; font-weight: 700; line-height: 1.25; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .aitp-meta { display: flex; gap: 4px; min-width: 0; overflow: hidden; }
        .aitp-m {
            display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
            font-size: 11px; font-weight: 650; line-height: 16px; padding: 0 6px; border-radius: 6px;
            background: #f1f5f9; color: #64748b; white-space: nowrap;
        }
        .aitp-m.is-slot { background: #eef2ff; color: #4338ca; }
        .aitp-m.is-work { background: #ecfdf5; color: #047857; }
        .aitp-m.is-done { color: #94a3b8; }
        .aitp-dot { width: 6px; height: 6px; border-radius: 50%; background: #6366f1; display: inline-block; flex-shrink: 0; }
        .aitp-dot.is-life { background: #10b981; }
        .aitp-clear {
            width: 26px; height: 26px; padding: 0; margin: 0; border: 0; border-radius: 8px; flex-shrink: 0;
            background: transparent; color: #94a3b8; cursor: pointer; display: flex; align-items: center; justify-content: center;
        }
        .aitp-clear:hover { background: #f1f5f9; color: #475569; }
        .aitp-clear[hidden] { display: none; }
        .aitp-pop {
            position: absolute; left: 12px; right: 12px; top: calc(100% - 4px); z-index: 40;
            background: #fff; border: 1px solid rgba(226, 232, 240, 0.95); border-radius: 12px;
            box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14); padding: 6px;
            animation: taskDropIn 0.16s ease;
        }
        .aitp-pop[hidden] { display: none !important; }
        .aitp-search-wrap {
            display: flex; align-items: center; gap: 6px; padding: 0 8px; margin-bottom: 2px;
            border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; color: #94a3b8;
        }
        .aitp-search-wrap:focus-within { border-color: #6366f1; }
        .aitp-search-wrap svg { width: 14px; height: 14px; flex-shrink: 0; }
        .aitp-search {
            flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important;
            outline: none; font-size: 13px; padding: 6px 0 !important; color: inherit; margin: 0;
        }
        .aitp-list { max-height: min(300px, 46vh); overflow-y: auto; scrollbar-width: thin; }
        .aitp-group {
            font-size: 10.5px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.05em;
            color: #94a3b8; padding: 7px 8px 2px;
        }
        .aitp-group span { font-weight: 600; opacity: 0.8; }
        .aitp-opt {
            width: 100%; display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 8px; margin: 0;
            border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left;
            color: #334155; font: inherit; box-shadow: none;
        }
        .aitp-opt:hover, .aitp-opt.is-active, .aitp-opt:focus-visible { background: #f1f5ff; }
        .aitp-opt.is-sel { background: #eef2ff; color: #3730a3; }
        .aitp-opt-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .aitp-opt .aitp-meta { flex-shrink: 0; overflow: visible; }
        .aitp-opt .aitp-m { background: transparent; padding: 0 2px; font-weight: 600; }
        .aitp-opt .aitp-m.is-slot { background: #eef2ff; padding: 0 5px; }
        .aitp-opt .aitp-m.is-work { background: #ecfdf5; padding: 0 5px; }
        .aitp-empty { font-size: 12px; color: var(--text-muted); padding: 10px 8px; text-align: center; }
        .aitp-add {
            width: 100%; margin: 4px 0 0; padding: 6px; border: 1px dashed rgba(129, 140, 248, 0.5); border-radius: 8px;
            background: transparent; color: #4f46e5; font-size: 12px; font-weight: 700; cursor: pointer;
        }
        .aitp-add:hover { background: rgba(238, 242, 255, 0.7); }
        html[data-theme="dark"] .aitp,
        html[data-theme="dark"] .aitp-pop { background: var(--bg-card, #121212); border-color: rgba(56, 56, 56, 0.95); }
        html[data-theme="dark"] .aitp:hover { border-color: rgba(129, 140, 248, 0.5); }
        html[data-theme="dark"] .aitp.is-open { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); }
        html[data-theme="dark"] .aitp-pop { box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55); }
        html[data-theme="dark"] .aitp-ico { color: #a5b4fc; }
        html[data-theme="dark"] .aitp-title { color: #f1f5f9; }
        html[data-theme="dark"] .aitp-m { background: rgba(148, 163, 184, 0.13); color: #a1a1aa; }
        html[data-theme="dark"] .aitp-m.is-slot { background: rgba(99, 102, 241, 0.22); color: #c7d2fe; }
        html[data-theme="dark"] .aitp-m.is-work { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; }
        html[data-theme="dark"] .aitp-opt .aitp-m { background: transparent; }
        html[data-theme="dark"] .aitp-opt .aitp-m.is-slot { background: rgba(99, 102, 241, 0.22); }
        html[data-theme="dark"] .aitp-opt .aitp-m.is-work { background: rgba(16, 185, 129, 0.16); }
        html[data-theme="dark"] .aitp-clear:hover { background: rgba(148, 163, 184, 0.13); color: #e2e8f0; }
        html[data-theme="dark"] .aitp-search-wrap { background: var(--bg-panel, #0c0c0c); border-color: rgba(56, 56, 56, 0.95); }
        html[data-theme="dark"] .aitp-search-wrap:focus-within { border-color: #6366f1; }
        html[data-theme="dark"] .aitp-search { color: #f5f5f5; }
        html[data-theme="dark"] .aitp-opt { color: #d4d4d8; }
        html[data-theme="dark"] .aitp-opt:hover,
        html[data-theme="dark"] .aitp-opt.is-active,
        html[data-theme="dark"] .aitp-opt:focus-visible { background: rgba(99, 102, 241, 0.12); }
        html[data-theme="dark"] .aitp-opt.is-sel { background: rgba(99, 102, 241, 0.22); color: #e0e7ff; }
        html[data-theme="dark"] .aitp-group { color: #71717a; }
        html[data-theme="dark"] .aitp-add { color: #c7d2fe; border-color: rgba(129, 140, 248, 0.4); }
        html[data-theme="dark"] .aitp-add:hover { background: rgba(99, 102, 241, 0.14); }
        /* Действия с задачей: ряд выезжает плавно только при выбранной задаче */
        .ai-bot-task-acts { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.2s ease; flex-shrink: 0; }
        .ai-bot-task-acts.is-shown { grid-template-rows: 1fr; }
        .ai-bot-task-acts > .ai-bot-chat-quick {
            min-height: 0; overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap;
            padding-top: 0; padding-bottom: 0; border-top-color: transparent; opacity: 0;
            transition: opacity 0.18s ease, padding 0.2s ease;
        }
        .ai-bot-task-acts.is-shown > .ai-bot-chat-quick { opacity: 1; padding-top: 8px; padding-bottom: 2px; border-top-color: #f1f5f9; }
        .ai-bot-task-acts.is-shown + .ai-bot-chat-quick { border-top-color: transparent; padding-top: 6px; }
        html[data-theme="dark"] .ai-bot-task-acts.is-shown > .ai-bot-chat-quick { border-top-color: rgba(42, 42, 42, 0.9); }
        .ai-bot-task-acts > .ai-bot-chat-quick { gap: 5px; padding-left: 12px; padding-right: 12px; }
        .ai-bot-task-acts .ai-bot-chat-quick button { padding: 5px 9px; }
        html[data-theme="dark"] .ai-bot-task-acts.is-shown + .ai-bot-chat-quick { border-top-color: transparent; }
        @media (prefers-reduced-motion: reduce) {
            .ai-bot-task-acts, .ai-bot-task-acts > .ai-bot-chat-quick { transition: none; }
        }
        /* Чипы, которым нужна выбранная задача: неактивны без задачи */
        .ai-bot-chat-quick button[aria-disabled="true"] {
            opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; filter: grayscale(0.6);
        }
        /* Клавиатурный фокус: видимая рамка, по клику мышью — без рамки */
        :focus:not(:focus-visible) { outline: none; }
        button:focus-visible,
        a:focus-visible,
        select:focus-visible,
        summary:focus-visible,
        [role="button"]:focus-visible,
        [role="tab"]:focus-visible,
        [tabindex]:not([tabindex="-1"]):focus-visible,
        input[type="checkbox"]:focus-visible,
        input[type="radio"]:focus-visible,
        input[type="range"]:focus-visible,
        .ai-bot-fab:focus-visible {
            outline: 2px solid var(--accent) !important;
            outline-offset: 2px;
        }
    