        /* ИИ-функции: карточка в стиле Daily (Figma 69 / dayplan) · v2 2026-10-27 */
        .ai-bot-msg-row.bot.is-fn .ai-bot-msg-col { max-width: 100%; }
        .ai-bot-msg.bot.is-fn {
            padding: 18px 16px 14px;
            background: #fff !important;
            border: 1px solid #dee5f0 !important;
            border-radius: 14px !important;
            box-shadow: none !important;
            position: relative;
            overflow: visible;
        }
        .aifn {
            display: flex;
            flex-direction: column;
            gap: 10px;
            font-size: 13px;
            line-height: 1.4;
            color: #1a2433;
            position: relative;
        }
        .aifn-kind {
            align-self: flex-end;
            margin: -2px 0 2px;
            height: 26px;
            padding: 0 12px;
            border-radius: 13px;
            background: #ebf2ff;
            color: #2963e8;
            font-size: 11px;
            font-weight: 650;
            display: inline-flex;
            align-items: center;
            white-space: nowrap;
            flex-shrink: 0;
        }
        .aifn-sum {
            font-size: 15px;
            font-weight: 650;
            color: #1a2433;
            letter-spacing: -0.01em;
        }
        .aifn-sum.is-empty {
            display: flex;
            gap: 8px;
            align-items: flex-start;
            font-weight: 600;
            color: #637082;
        }
        .aifn-line {
            font-size: 12px; color: #637082;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .aifn-line b { font-weight: 650; color: #1a2433; }
        .aifn-line.is-in { padding: 8px 12px; }
        .aifn-card {
            border: 1px solid #dee5f0;
            border-radius: 12px;
            background: #fff;
            overflow: hidden;
        }
        .aifn-card-v2 {
            border: none !important;
            border-radius: 0 !important;
            background: transparent !important;
            overflow: visible;
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding: 0;
        }
        .aifn-card-v2 .aifn-row {
            border: 1px solid #dee5f0;
            border-radius: 8px;
            min-height: 40px;
            padding: 8px 12px;
            background: #fff;
        }
        /* у v2 у каждой строки свой бордер — не склеиваем через border-top */
        .aifn-card-v2 .aifn-row + .aifn-row { border-top: 1px solid #dee5f0; }
        .aifn-card-v2 .aifn-line.is-in {
            border: 1px solid #dee5f0;
            border-radius: 8px;
            padding: 10px 12px;
            background: #f7faff;
        }
        .aifn-card-v2 .aifn-glabel {
            padding: 2px 2px 0;
        }
        .aifn-card-v2 .aifn-picker {
            border: 1px solid #eef2f7;
            border-radius: 8px;
            margin-top: -4px;
            background: #f7faff;
        }
        .aifn-v2 .aifn-advice {
            margin-top: 2px;
            padding-top: 10px;
            border-top: 1px solid #eef2f7;
            font-style: italic;
        }
        .aifn-glabel {
            padding: 10px 12px 4px;
            font-size: 11px; font-weight: 700; color: #5b5bd6;
            text-transform: uppercase; letter-spacing: 0.04em;
        }
        .aifn-sec {
            margin: 0;
            padding: 0;
            font-size: 11px; font-weight: 700; color: #5b5bd6;
            text-transform: uppercase; letter-spacing: 0.04em;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .aifn-sec.is-done { color: #1a9166; }
        .aifn-dlist { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
        .aifn-drow { display: flex; align-items: center; gap: 8px; padding: 4px 2px; min-height: 24px; font-size: 13px; }
        .aifn-drow .aifn-t { color: #637082; font-weight: 500; }
        .aifn-dcheck { flex-shrink: 0; width: 16px; text-align: center; color: #1a9166; font-weight: 800; font-size: 12px; }
        .aifn-dlist.is-collapsed .aifn-drow.is-extra { display: none; }
        .aifn-more {
            align-self: flex-start; margin: 2px 0 0 24px; padding: 0;
            border: none; background: none; cursor: pointer;
            font-size: 12px; font-weight: 650; color: #2963e8;
        }
        .aifn-more:hover { text-decoration: underline; }
        .aifn-day {
            flex-shrink: 0; padding: 2px 8px; border-radius: 999px; cursor: pointer;
            border: 1px solid rgba(91, 91, 214, 0.35); background: rgba(91, 91, 214, 0.08);
            color: #5b5bd6; font-size: 11px; font-weight: 700; white-space: nowrap; line-height: 1.5;
        }
        .aifn-day:hover, .aifn-day.is-open { background: rgba(91, 91, 214, 0.16); }
        .aifn-day.is-static { cursor: default; }
        .aifn-day.is-buffer { color: #637082; border-color: #dee5f0; background: transparent; }
        .aifn-day.is-soon {
            color: #c2410c;
            border-color: rgba(234, 88, 12, 0.35);
            background: rgba(255, 237, 213, 0.9);
        }
        .aifn-day.is-over { color: #b45309; border-color: rgba(217, 119, 6, 0.5); background: rgba(245, 158, 11, 0.1); }
        .aifn-picker {
            display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
            padding: 8px 12px 10px 40px; background: #f7faff;
            border-top: 1px solid #eef2f7;
        }
        .aifn-opt {
            padding: 4px 10px; border-radius: 999px; cursor: pointer;
            border: 1px solid #dee5f0; background: #fff; color: #1a2433;
            font-size: 11px; font-weight: 600; white-space: nowrap;
        }
        .aifn-opt:hover { border-color: #5b5bd6; }
        .aifn-opt.is-on { background: #5b5bd6; border-color: #5b5bd6; color: #fff; }
        .aifn-opt.is-full:not(.is-on) { color: #b45309; }
        .aifn-date {
            height: 28px; max-width: 140px; padding: 0 8px; box-sizing: border-box;
            border: 1px solid #dee5f0; border-radius: 8px;
            background: #fff; color: #1a2433; font-size: 12px;
        }
        .aifn-link { border: none; background: none; padding: 0; font: inherit; font-weight: 650; color: #2963e8; cursor: pointer; text-decoration: underline; }
        /* календарь даты переноса — на базе .date-picker-pop / .cal-* приложения */
        #aifnCalPop.aifn-cal {
            position: fixed; z-index: 340; width: 272px; padding: 10px;
            top: 0; left: 0; box-sizing: border-box;
        }
        #aifnCalPop .cal-month-head .btn-icon-only:disabled { opacity: 0.35; cursor: default; }
        #aifnCalPop .cal-day { height: 30px; aspect-ratio: auto; }
        #aifnCalPop .cal-day.is-weekend:not(.is-peek):not(.is-past) { color: var(--text-muted); background: transparent; }
        #aifnCalPop .cal-day.is-past:disabled { opacity: 0.35; background: transparent; color: var(--text-muted); }
        #aifnCalPop .cal-day.is-part::after,
        #aifnCalPop .cal-day.is-full::after {
            content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
            width: 4px; height: 4px; border-radius: 50%; background: #94a3b8;
        }
        #aifnCalPop .cal-day.is-full::after { background: #f59e0b; }
        #aifnCalPop .cal-day.is-full:not(.is-peek) { color: #b45309; }
        #aifnCalPop .cal-day.is-peek::after { background: #fff; }
        #aifnCalPop .cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
        .aifn-cal-legend {
            display: flex; align-items: center; gap: 6px; margin-top: 6px;
            font-size: var(--fs-xs); color: var(--text-muted);
        }
        .aifn-cal-legend i { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; display: inline-block; }
        .aifn-cal-legend i.is-full { background: #f59e0b; margin-left: 6px; }
        #aifnCalPop .date-picker-actions { margin-top: 8px; padding-top: 8px; }
        #aifnCalPop .date-picker-actions button { padding: 5px 10px; font-size: var(--fs-xs); }
        html[data-theme="dark"] #aifnCalPop .cal-day.is-full:not(.is-peek) { color: #fbbf24; }
        html[data-theme="dark"] #aifnCalPop .cal-day.is-weekend:not(.is-peek):not(.is-past) { color: #8a8a8a; background: transparent; }
        .aifn-row {
            display: flex; align-items: center; gap: 10px;
            padding: 10px 12px; min-height: 40px; box-sizing: border-box;
            background: #fff;
        }
        label.aifn-row { cursor: pointer; }
        .aifn-row + .aifn-row { border-top: 1px solid #eef2f7; }
        .aifn-row:hover { background: #f7faff; }
        .aifn-row input[type="checkbox"] {
            margin: 0; width: 16px; height: 16px; flex-shrink: 0;
            accent-color: #5b5bd6; cursor: pointer;
        }
        .aifn-row input:disabled { cursor: default; }
        .aifn-tw { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
        .aifn-t {
            flex: 1; min-width: 0; color: #1a2433; font-weight: 600; font-size: 13px;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .aifn-row input:not(:checked) ~ .aifn-t { color: #637082; font-weight: 500; }
        .aifn-row.is-gone .aifn-t { text-decoration: line-through; color: #919eb0; }
        .aifn-why { font-size: 11px; color: #637082; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .aifn-meta {
            flex-shrink: 0; padding: 2px 8px; border-radius: 999px;
            background: rgba(91, 91, 214, 0.1); color: #5b5bd6;
            font-size: 11px; font-weight: 700; white-space: nowrap;
        }
        .aifn-meta.is-off { background: transparent; color: #919eb0; }
        .aifn-num {
            flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px;
            background: #ebf2ff; color: #2963e8; font-size: 11px; font-weight: 800;
            display: inline-flex; align-items: center; justify-content: center;
        }
        .aifn-go,
        .aifn-foot button,
        .aifn-apply {
            flex-shrink: 0;
            height: 34px;
            border: 1px solid #2963e8 !important;
            border-radius: 10px !important;
            cursor: pointer;
            padding: 0 14px !important;
            font: inherit;
            font-size: 13px !important;
            font-weight: 600 !important;
            background: #2963e8 !important;
            color: #fff !important;
            white-space: nowrap;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        .aifn-go:hover,
        .aifn-go:focus-visible,
        .aifn-foot button:hover,
        .aifn-foot button:focus-visible,
        .aifn-apply:hover,
        .aifn-apply:focus-visible {
            background: #1f54d0 !important;
            border-color: #1f54d0 !important;
            color: #fff !important;
            filter: none;
            opacity: 1 !important;
        }
        .aifn-foot button.is-secondary {
            background: #fff !important;
            color: #1a2433 !important;
            border: 1px solid #dee5f0 !important;
        }
        .aifn-foot button.is-secondary:hover,
        .aifn-foot button.is-secondary:focus-visible {
            background: #f7faff !important;
            border-color: #c9d4e6 !important;
            color: #1a2433 !important;
        }
        .aifn-foot button:disabled {
            opacity: 0.5 !important;
            cursor: default;
        }
        .aifn-foot {
            display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px;
            padding: 12px;
            border-top: 1px solid #eef2f7;
            background: #fafbfd;
        }
        .aifn-foot-v2 {
            padding: 4px 0 0;
            border-top: none;
            background: transparent;
            gap: 10px;
        }
        .aifn-hint {
            flex: 1 1 100%; min-width: 0;
            font-size: 12px; color: #b45309; order: 2;
        }
        .aifn-foot-v2 .aifn-hint { order: 0; flex: 1 1 auto; }
        .aifn-hint:empty { display: none; }
        .aifn-btns { display: flex; gap: 8px; flex-shrink: 0; order: 1; margin-left: auto; }
        .aifn-foot-v2 .aifn-btns { order: 1; }
        .aifn-state { font-size: 12px; font-weight: 700; color: #1a9166; }
        .aifn-state.is-off { color: #637082; }
        .aifn-advice {
            font-size: 12px;
            line-height: 1.45;
            color: #637082;
            padding: 2px 0 0;
        }
        .aifn-note { font-size: 12px; color: #637082; }
        .aifn-foot-v2 .is-secondary,
        .aifn-v2 .aifn-foot button.is-secondary {
            height: 34px;
            padding: 0 14px !important;
            border: 1px solid #dee5f0 !important;
            border-radius: 10px !important;
            background: #fff !important;
            color: #1a2433 !important;
            font: inherit;
            font-size: 13px !important;
            font-weight: 600 !important;
        }
        .aifn-foot-v2 .is-secondary:hover,
        .aifn-v2 .aifn-foot button.is-secondary:hover {
            background: #f7faff !important;
            border-color: #c9d4e6 !important;
            color: #1a2433 !important;
        }

        /* Карточка «Предлагаю такой план» + все aifn-v2 в том же каркасе */
        .aifn-dayplan { gap: 10px; }
        .aifn-dayplan-row.is-pick {
            display: flex;
            align-items: center;
            gap: 10px;
            grid-template-columns: none;
            cursor: pointer;
        }
        .aifn-dayplan-row.is-pick input[type="checkbox"] {
            margin: 0;
            width: 16px;
            height: 16px;
            flex-shrink: 0;
            accent-color: #5b5bd6;
            cursor: pointer;
        }
        .aifn-dayplan-row.is-pick .aifn-dayplan-title { flex: 1; min-width: 0; }
        .aifn-dayplan-row.is-pick .aifn-dayplan-meta {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-left: auto;
        }
        .aifn-dayplan-row.is-focus,
        .aifn-dayplan-row.is-info {
            display: flex;
            align-items: center;
            gap: 10px;
            grid-template-columns: none;
        }
        .aifn-dayplan-row.is-focus .aifn-tw { flex: 1; min-width: 0; }
        .aifn-dayplan .aifn-hint {
            margin: 0;
            font-size: 12px;
            color: #b45309;
        }
        .aifn-dayplan .aifn-picker {
            border: 1px solid #eef2f7;
            border-radius: 8px;
            margin-top: -4px;
        }
        .aifn-dayplan-sub {
            margin: -4px 0 0;
            font-size: 12px;
            line-height: 1.45;
            color: #637082;
        }
        .aifn-dayplan-empty {
            margin: 0;
            font-size: 13px;
            color: #637082;
        }
        .aifn-dayplan-rows {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .aifn-dayplan-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 10px 12px;
            align-items: center;
            min-height: 34px;
            padding: 7px 12px;
            border-radius: 8px;
            border: 1px solid #dee5f0;
            background: #fff;
            box-sizing: border-box;
        }
        .aifn-dayplan-row.is-alt { background: #f7faff; }
        .aifn-dayplan-row.is-edit {
            grid-template-columns: 18px minmax(0, 1fr) 108px 88px auto;
            cursor: grab;
        }
        .aifn-dayplan-row.is-dragging { opacity: 0.55; }
        .aifn-dayplan-drag {
            color: #9aa6b8;
            font-size: 12px;
            letter-spacing: -2px;
            user-select: none;
        }
        .aifn-dayplan-title {
            font-size: 13px;
            font-weight: 600;
            color: #1a2433;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .aifn-dayplan-meta {
            font-size: 12px;
            color: #637082;
            text-align: right;
            white-space: nowrap;
        }
        .aifn-dayplan-time input,
        .aifn-dayplan-dur input {
            width: 100%;
            height: 28px;
            border: 1px solid #dee5f0;
            border-radius: 8px;
            padding: 0 6px;
            font: inherit;
            font-size: 12px;
            color: #1a2433;
            background: #fff;
            box-sizing: border-box;
        }
        .aifn-dayplan-dur {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 11px;
            color: #637082;
        }
        .aifn-dayplan-dur input { width: 56px; }
        .aifn-dayplan-tag {
            font-size: 12px;
            color: #637082;
            white-space: nowrap;
        }
        .aifn-dayplan-acts {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }
        .aifn-dayplan-acts .is-secondary {
            height: 34px;
            padding: 0 14px !important;
            border: 1px solid #dee5f0 !important;
            border-radius: 10px !important;
            background: #fff !important;
            color: #1a2433 !important;
            font: inherit;
            font-size: 13px !important;
            font-weight: 600 !important;
            cursor: pointer;
        }
        .aifn-dayplan-acts .is-secondary:hover,
        .aifn-dayplan-acts .is-secondary:focus-visible {
            background: #f7faff !important;
            border-color: #c9d4e6 !important;
            color: #1a2433 !important;
        }
        html[data-theme="dark"] .ai-bot-msg.bot.is-fn { background: #111111; border-color: #2a2a2a; }
        html[data-theme="dark"] .aifn-sum, html[data-theme="dark"] .aifn-t { color: #e5e5e5; }
        html[data-theme="dark"] .aifn-card { background: #111111; border-color: #2a2a2a; }
        html[data-theme="dark"] .aifn-row { background: #111111; }
        html[data-theme="dark"] .aifn-row:hover { background: #161616; }
        html[data-theme="dark"] .aifn-row + .aifn-row { border-top-color: #2a2a2a; }
        html[data-theme="dark"] .aifn-foot { background: #0a0a0a; border-top-color: #2a2a2a; }
        html[data-theme="dark"] .aifn-advice, html[data-theme="dark"] .aifn-note { color: #a3a3a3; }
        html[data-theme="dark"] .aifn-meta { background: rgba(129, 140, 248, 0.18); color: #a5b4fc; }
        html[data-theme="dark"] .aifn-num { background: rgba(59, 130, 246, 0.2); color: #bfdbfe; }
        html[data-theme="dark"] .aifn-glabel, html[data-theme="dark"] .aifn-more { color: #a5b4fc; }
        html[data-theme="dark"] .aifn-sec { color: #a5b4fc; }
        html[data-theme="dark"] .aifn-go,
        html[data-theme="dark"] .aifn-foot button,
        html[data-theme="dark"] .aifn-apply {
            background: #2963e8 !important;
            border-color: #2963e8 !important;
            color: #fff !important;
        }
        html[data-theme="dark"] .aifn-foot button.is-secondary {
            background: #111111 !important;
            color: #e5e5e5 !important;
            border-color: #333333 !important;
        }
        html[data-theme="dark"] .aifn-day { color: #bfdbfe; border-color: rgba(59, 130, 246, 0.4); background: rgba(59, 130, 246, 0.14); }
        html[data-theme="dark"] .aifn-day.is-buffer { color: #a3a3a3; border-color: #333333; background: transparent; }
        html[data-theme="dark"] .aifn-day.is-soon {
            color: #fdba74;
            border-color: rgba(251, 146, 60, 0.45);
            background: rgba(154, 52, 18, 0.28);
        }
        html[data-theme="dark"] .aifn-day.is-over { color: #fbbf24; border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.12); }
        html[data-theme="dark"] .aifn-kind { background: rgba(41, 99, 232, 0.22); color: #93c5fd; }
        html[data-theme="dark"] .aifn-v2 .aifn-advice { border-top-color: #2a2a2a; }
        html[data-theme="dark"] .aifn-card-v2 .aifn-row { background: #111111; border-color: #2a2a2a; }
        html[data-theme="dark"] .aifn-picker { background: #141414; }
        html[data-theme="dark"] .aifn-opt, html[data-theme="dark"] .aifn-date { background: #0a0a0a; color: #e5e5e5; border-color: #333333; color-scheme: dark; }
        html[data-theme="dark"] .aifn-opt.is-on { background: #3b82f6; border-color: #3b82f6; color: #fff; }
        html[data-theme="dark"] .aifn-opt.is-full:not(.is-on) { color: #fbbf24; }
        html[data-theme="dark"] .aifn-link { color: #93c5fd; }
        html[data-theme="dark"] .aifn-sec.is-done, html[data-theme="dark"] .aifn-dcheck { color: #34d399; }
        html[data-theme="dark"] .aifn-hint { color: #fbbf24; }
        /* Журнал «Что Дейли изменил» */
        .aifn-changes .aifn-dlist { margin-top: 0; gap: 0; }
        .aifn-changes .aifn-card-v2 { gap: 8px; }
        .aifn-changes .aifn-card-v2 .aifn-row + .aifn-row { border-top: 1px solid #dee5f0; }
        .aifn-dlist.is-collapsed .aifn-chg.is-extra { display: none; }
        .aifn-chg-time { flex-shrink: 0; min-width: 32px; font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
        .aifn-chg-undo {
            flex-shrink: 0; border: 1px solid rgba(148, 163, 184, 0.45); border-radius: 999px; cursor: pointer;
            padding: 2px 9px; background: transparent; color: #4338ca;
            font-size: var(--fs-xs); font-weight: 700; white-space: nowrap;
        }
        .aifn-chg-undo:hover { background: rgba(99, 102, 241, 0.08); border-color: rgba(99, 102, 241, 0.45); }
        .aifn-chg.is-undone .aifn-t { color: var(--text-muted); font-weight: 500; text-decoration: line-through; }
        .aifn-changes .aifn-more { margin: 3px 10px 6px; }
        html[data-theme="dark"] .aifn-chg-undo { color: #93c5fd; border-color: rgba(59, 130, 246, 0.4); }
        html[data-theme="dark"] .aifn-chg-undo:hover { background: rgba(59, 130, 246, 0.14); }
        html[data-theme="dark"] .aifn-chg.is-undone .aifn-t { color: #8a8a8a; }
        @media (max-width: 1024px) {
            .aifn-row { min-height: 36px; }
        }
        .ai-bot-confirm-list {
            flex-basis: 100%;
            margin: 0;
            padding: 0;
            list-style: none;
            font-size: var(--fs-xs);
            color: var(--text-muted);
            display: grid;
            gap: 3px;
        }
        .ai-bot-confirm-list b { color: inherit; font-weight: 700; }
        .ai-bot-confirm-btns { display: flex; gap: 6px; }
        .ai-bot-msg-actions button.is-secondary {
            background: transparent;
            color: var(--text-muted);
            box-shadow: none;
            border: 1px solid rgba(148, 163, 184, 0.45);
        }
        .ai-bot-msg-actions button.is-secondary:hover { background: rgba(148, 163, 184, 0.12); }
        .ai-bot-msg-actions button.is-cancelled { background: #94a3b8; box-shadow: none; cursor: default; }
        .ai-bot-chat-input .input-mic-btn.is-listening {
            background: #fee2e2;
            color: #dc2626;
        }
        .ai-bot-chat-input .input-mic-btn .icon,
        .ai-bot-chat-input .input-mic-btn svg {
            width: 18px;
            height: 18px;
        }
        .ai-bot-chat-input button.send {
            height: 46px;
            width: 46px;
            border: none;
            border-radius: 16px;
            min-width: 46px;
            padding: 0;
            background: linear-gradient(90deg, #2563eb, #4f46e5);
            color: #fff;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
            flex-shrink: 0;
            appearance: none;
            -webkit-tap-highlight-color: transparent;
        }
        .ai-bot-chat-input button.send:disabled {
            background: #e2e8f0;
            color: #94a3b8;
            box-shadow: none;
            cursor: wait;
        }
        .ai-bot-chat-input button.send svg { width: 18px; height: 18px; }

        /* Pull-to-refresh (мобильный / PWA) */
        .ptr-indicator {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 440;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: flex-end;
            pointer-events: none;
            padding-top: env(safe-area-inset-top);
            transform: translateY(-100%);
            transition: transform 0.18s ease;
        }
        .ptr-indicator.visible {
            display: flex;
        }
        .ptr-indicator.pulling,
        .ptr-indicator.refreshing {
            transform: translateY(0);
        }
        .ptr-indicator-inner {
            display: inline-flex;
            align-items: center;
            gap: 12px;
            margin: 8px 12px 0;
            padding: 10px 16px 10px 12px;
            border-radius: 999px;
            background: rgba(15, 23, 42, 0.92);
            color: #fff;
            box-shadow: var(--shadow-lg);
            font-size: var(--fs-sm);
            font-weight: 600;
        }
        .ptr-logo {
            width: 28px;
            height: 28px;
            flex-shrink: 0;
            position: relative;
        }
        .ptr-logo-svg {
            width: 100%;
            height: 100%;
            display: block;
            overflow: visible;
        }
        .ptr-logo-bg {
            fill: url(#ptrLogoGrad);
            opacity: 0;
            transform-origin: 18px 18px;
            transform: scale(0.55);
        }
        .ptr-logo-track {
            fill: none;
            stroke: rgba(255, 255, 255, 0.22);
            stroke-width: 3;
            opacity: 0;
        }
        .ptr-logo-arc {
            fill: none;
            stroke: #fff;
            stroke-width: 3;
            stroke-linecap: round;
            stroke-dasharray: 100;
            stroke-dashoffset: 100;
            transform-origin: 18px 18px;
            transform: rotate(-90deg);
            opacity: 0;
        }
        /* Потянули: сначала пусто → появляется плитка → рисуется круг */
        .ptr-indicator.pulling .ptr-logo-bg {
            opacity: min(1, calc(var(--ptr-progress, 0) * 2.2));
            transform: scale(calc(0.55 + min(0.45, var(--ptr-progress, 0) * 0.9)));
            transition: none;
        }
        .ptr-indicator.pulling .ptr-logo-track {
            opacity: min(1, calc((var(--ptr-progress, 0) - 0.2) * 2.5));
        }
        .ptr-indicator.pulling .ptr-logo-arc {
            opacity: min(1, calc((var(--ptr-progress, 0) - 0.15) * 2.8));
            stroke-dashoffset: calc(100 - var(--ptr-progress, 0) * 100);
        }
        /* Обновление: появление иконки → дорисовка круга → лёгкое вращение дуги */
        .ptr-indicator.refreshing .ptr-logo-bg {
            animation: ptrLogoIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        }
        .ptr-indicator.refreshing .ptr-logo-track {
            animation: ptrFadeIn 0.25s ease 0.22s forwards;
        }
        .ptr-indicator.refreshing .ptr-logo-arc {
            animation: ptrRingDraw 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.28s forwards;
        }
        .ptr-indicator.refreshing .ptr-logo-svg {
            animation: ptrLogoSpin 1.1s linear 1s infinite;
        }
        @keyframes ptrLogoIn {
            0% { opacity: 0; transform: scale(0.45); }
            100% { opacity: 1; transform: scale(1); }
        }
        @keyframes ptrFadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        @keyframes ptrRingDraw {
            0% { opacity: 1; stroke-dashoffset: 100; }
            100% { opacity: 1; stroke-dashoffset: 28; }
        }
        @keyframes ptrLogoSpin {
            to { transform: rotate(360deg); }
        }

        .text-capture-form {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 14px;
            width: 100%;
        }

        .text-capture-row {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .text-capture-row select,
        .capture-meta-select {
            width: auto;
            min-width: 0;
            flex: 1 1 140px;
            padding: 7px 10px;
            font-size: var(--fs-sm);
            font-weight: 600;
            border-radius: 10px;
            border: 1px solid var(--border-subtle);
            background: var(--bg-subtle);
            color: var(--text-primary);
        }

        .input-group {
            flex: 1;
            min-width: 220px;
            position: relative;
            display: flex;
            align-items: center;
        }

        input[type="text"], select {
            background: var(--bg-subtle);
            border: 1px solid var(--border);
            color: var(--text-primary);
            padding: 9px 12px;
            border-radius: var(--radius-sm);
            font-size: var(--fs-base);
            width: 100%;
            outline: none;
            transition: border-color 0.15s;
        }

        input[type="text"]:focus, select:focus {
            border-color: var(--accent);
        }

        .input-group input {
            padding-right: 36px;
        }

        .input-mic-btn {
            background: transparent;
            border: none;
            color: var(--text-secondary);
            padding: 6px;
            cursor: pointer;
        }
        .input-mic-btn:hover {
            color: var(--accent);
            background: var(--accent-soft);
        }

        /* Двухколоночная сетка: акцент на Сегодня (шире), буфер уже */
        .board-grid {
            display: grid;
            grid-template-columns: 1.45fr 0.9fr;
            gap: 18px;
            align-items: start;
            flex: 1;
            min-height: 0;
            overflow: hidden;
        }

        .realm-switch {
            display: inline-flex;
            flex-shrink: 0;
            align-items: stretch;
            gap: 2px;
            padding: 3px;
            margin: 0;
            background: var(--bg-subtle);
            border: 1px solid var(--border-subtle);
            border-radius: 10px;
            width: auto;
            min-width: 168px;
        }
        .realm-switch button {
            flex: 1;
            min-height: 30px;
            min-width: 76px;
            border: none;
            background: transparent;
            color: var(--text-secondary);
            border-radius: 8px;
            font-size: var(--fs-sm);
            font-weight: 700;
            padding: 4px 12px;
            cursor: pointer;
            font-family: inherit;
            line-height: 1.2;
            transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
        }
        .realm-switch button.active {
            background: var(--bg-panel);
            color: var(--accent);
            box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
        }
        body.realm-life .realm-switch button.active {
            color: #0f766e;
        }
        .capture-realm-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: var(--fs-xs);
            font-weight: 650;
            padding: 7px 10px;
            border-radius: 10px;
            background: var(--bg-subtle);
            color: var(--text-secondary);
            border: 1px solid var(--border-subtle);
        }
        body.realm-life .capture-realm-pill {
            background: rgba(15, 118, 110, 0.08);
            color: #0f766e;
            border-color: rgba(15, 118, 110, 0.18);
        }
        body:not(.realm-life) .capture-realm-pill {
            color: var(--accent);
        }
        #workTodaySections {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }
        #lifeTodaySection { display: none; flex-direction: column; gap: 10px; }
        body.realm-life #workTodaySections { display: none; }
        body.realm-life #lifeTodaySection { display: flex; }
        /* Пустой сегодня: один hero вместо секций и «Завершить день» */
        .today-empty-hero {
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            gap: 10px;
            padding: 28px 16px;
            min-height: 180px;
            border: 1px dashed var(--border);
            border-radius: 14px;
            background: var(--bg-subtle);
            box-sizing: border-box;
        }
        .today-empty-hero[hidden] { display: none !important; }
        #colToday.is-today-empty .today-empty-hero:not([hidden]) {
            display: flex;
        }
        #colToday.is-today-empty #workTodaySections,
        #colToday.is-today-empty #lifeTodaySection {
            display: none !important;
        }
        #colToday.is-today-empty .done-summary-bar {
            display: none !important;
        }
        .today-empty-title {
            margin: 0;
            font-size: var(--fs-md);
            font-weight: 750;
            color: var(--text-primary);
            line-height: 1.35;
        }
        .today-empty-hint {
            margin: 0;
            max-width: 22em;
            font-size: var(--fs-sm);
            color: var(--text-muted);
            line-height: 1.4;
        }
        .today-empty-actions {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 8px;
            width: 100%;
            max-width: 260px;
            margin-top: 6px;
        }
        .today-empty-actions .btn-primary,
        .today-empty-actions .btn-ghost {
            min-height: 44px;
            width: 100%;
            justify-content: center;
            box-sizing: border-box;
        }
        body.realm-life #mainSlotCounter { display: none; }
        /* у Жизни нет лимита 3 ключевых приоритета — бейдж только для Работы */
        body.realm-life #mainSlotLoadPill { display: none !important; }
        /* Настройка «только Работа» / «только Жизнь»: переключателей сферы нет нигде */
        body.realm-single #realmSwitch,
        body.realm-single #realmSwitchSep,
        body.realm-single #captureRealmToggle,
        body.realm-single #aiBotRealmQuickBtn,
        body.realm-single .realm-both-only { display: none !important; }
        body:not(.realm-single) .realm-single-only { display: none !important; }
        .mobile-board-tabs {
            display: none;
            flex-shrink: 0;
            gap: 0;
            padding: 0;
            background: transparent;
            border: none;
            border-bottom: 1px solid var(--border-subtle);
            border-radius: 0;
        }
        .mobile-board-tabs button {
            flex: 1;
            min-height: 40px;
            border: none;
            border-bottom: 2px solid transparent;
            margin-bottom: -1px;
            background: transparent;
            color: var(--text-muted);
            border-radius: 0;
            font-size: var(--fs-sm);
            font-weight: 650;
            flex-direction: row;
            gap: 0;
            padding: 8px 10px 10px;
            box-shadow: none;
            transition: color 0.15s ease, border-color 0.15s ease;
        }
        .mobile-board-tabs button .tab-main {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        .mobile-board-tabs button .tab-count {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 20px;
            height: 20px;
            padding: 0 6px;
            border-radius: 99px;
            background: var(--bg-subtle);
            border: none;
            font-size: var(--fs-xs);
            font-weight: 700;
            font-variant-numeric: tabular-nums;
            color: var(--text-muted);
        }
        .mobile-board-tabs button.active {
            background: transparent;
            color: var(--text-primary);
            box-shadow: none;
            border-color: transparent;
            border-bottom-color: var(--accent);
        }
        .mobile-board-tabs button.active .tab-count {
            background: var(--accent-soft);
            border-color: transparent;
            color: var(--accent);
            font-weight: 800;
        }
        .empty-slot-hint-mob { display: none; }
        .label-desk { display: inline; }
        .label-mob { display: none; }

        .column-panel {
            background: var(--bg-panel);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg);
            display: flex;
            flex-direction: column;
            box-shadow: none;
            overflow: hidden;
            min-height: 0;
            height: 100%;
            max-height: 100%;
        }
        /* Светлая тема: границы колонок из .column-panel; в тёмной — без обводки (theme.css) */
        /* Сегодня — высота по задачам; буфер тянется и скроллится */
        @media (min-width: 1025px) {
            #colToday.column-panel {
                height: auto;
                max-height: 100%;
                align-self: start;
            }
            #colOther.column-panel {
                height: 100%;
                max-height: 100%;
                align-self: stretch;
                min-height: 0;
            }
            #colToday .column-title {
                font-size: var(--fs-xl);
                font-weight: 780;
            }
            #colOther .column-title {
                font-size: var(--fs-base);
                font-weight: 650;
                color: var(--text-secondary);
            }
            #colOther .counter-badge {
                font-weight: 600;
                color: var(--text-muted);
            }
        }

        .column-header {
            padding: 12px 16px 10px;
            border-bottom: 1px solid var(--border-subtle);
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            background: var(--bg-panel);
            flex-shrink: 0;
        }

        .column-title-wrap,
        .list-col-title-group {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
            flex-wrap: wrap;
        }

        .column-icon-box {
            display: none;
        }

        .column-title,
        .list-col-title {
            font-size: var(--fs-ml);
            font-weight: 750;
            letter-spacing: -0.015em;
            color: var(--text-primary);
        }

        .column-subtitle {
            display: none;
        }

        .counter-badge,
        .slot-load-pill {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            font-size: var(--fs-xs);
            font-weight: 650;
            padding: 4px 10px;
            border-radius: 999px;
            background: var(--bg-subtle);
            border: 1px solid var(--border);
            color: var(--text-secondary);
            white-space: nowrap;
        }
        .slot-load-pill .slot-dots {
            gap: 3px;
        }
        .slot-load-pill .slot-dot {
            width: 7px;
            height: 7px;
            border-radius: 2px;
        }

        .column-body {
            padding: 12px 14px 14px;
            display: flex;
            flex-direction: column;
            gap: 14px;
            flex: 1;
            min-height: 0;
            overflow-x: hidden;
            overflow-y: auto;
        }

        .column-body > .backlog-toolbar {
            flex-shrink: 0;
            position: sticky;
            top: 0;
            z-index: 2;
            background: var(--bg-panel);
            padding-bottom: 4px;
        }

        .column-body > #backlogList {
            flex: 1;
            min-height: 0;
        }

        /* Секции внутри колонки */
        .section-block {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .section-label-row,
        .section-caption {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
            padding: 0 4px 4px;
            font-size: var(--fs-xs);
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-muted);
        }
        .section-caption-hint {
            font-weight: 600;
            text-transform: none;
            letter-spacing: 0;
            color: var(--text-muted);
            opacity: 0.9;
        }

        /* Карточка задачи и слота */
        .slot-row {
            display: flex;
            gap: 12px;
            align-items: stretch;
        }

        .slot-index {
            width: 28px;
            border-radius: var(--radius-sm);
            background: var(--bg-subtle);
            border: 1px solid var(--border-subtle);
            color: var(--text-muted);
            font-family: monospace;
            font-size: var(--fs-sm);
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .slot-index.filled {
            background: var(--accent-soft);
            border-color: rgba(59, 130, 246, 0.35);
            color: var(--accent);
        }

        .task-card {
            flex: 1;
            min-width: 0;
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 0;
            display: flex;
            flex-direction: column;
            gap: 0;
            transition: border-color 0.16s ease, box-shadow 0.16s ease;
            position: relative;
            cursor: pointer;
        }

        .task-card:hover {
            border-color: #cbd5e1;
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
        }

        .task-card.stale-card {
            border-left: 3px solid var(--warning);
        }

        .task-card.is-expanded {
            border-color: var(--border);
            background: var(--bg-panel);
            box-shadow: var(--shadow-sm);
        }

        .task-card.is-collapsed .task-details,
        .task-card.is-collapsed .task-drawer {
            display: none;
        }

        .task-card.in-work-card.is-timer-live,
        .task-card.is-active-work {
            border-color: rgba(37, 99, 235, 0.55);
            background: linear-gradient(180deg, rgba(37, 99, 235, 0.03) 0%, #ffffff 100%);
            box-shadow: 0 0 0 3px var(--accent-soft), 0 8px 22px rgba(37, 99, 235, 0.08);
        }
        .task-card.is-done {
            opacity: 0.9;
            background: var(--bg-card);
        }
        .task-card.is-done .task-row-title {
            text-decoration: line-through;
            color: var(--text-secondary);
        }
        .task-card.is-done .task-check-btn {
            background: var(--success);
            border-color: var(--success);
            color: #fff;
        }
        .meta-pill.done-at {
            background: rgba(5, 150, 105, 0.1);
            color: var(--success);
        }

        .task-row-main {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            min-width: 0;
        }

        .task-check-btn {
            width: 20px;
            height: 20px;
            border-radius: 6px;
            border: 1.75px solid var(--border);
            background: var(--bg-panel);
            color: transparent;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            flex-shrink: 0;
            padding: 0;
            transition: all 0.15s ease;
        }
        .task-check-btn .icon { width: 12px; height: 12px; }
        .task-check-btn:hover {
            border-color: var(--success);
            background: rgba(5, 150, 105, 0.08);
            color: var(--success);
        }

        .slot-badge {
            font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
            font-size: var(--fs-xs);
            font-weight: 800;
            padding: 2px 6px;
            border-radius: 6px;
            background: var(--accent-soft);
            color: var(--accent);
            flex-shrink: 0;
        }

        .task-row-body {
            flex: 1;
            min-width: 0;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .task-row-title {
            flex: 1;
            min-width: 0;
            font-size: var(--fs-md);
            font-weight: 600;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.35;
        }
        .task-card.is-expanded .task-row-title {
            white-space: normal;
        }

        .task-row-meta {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            flex-shrink: 0;
        }
        .meta-pills-wrap {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
            min-width: 0;
        }
        .task-row-delete {
            opacity: 0;
            transition: opacity 0.15s ease;
        }
        .task-card:hover .task-row-delete,
        .task-card.is-expanded .task-row-delete,
        .task-row-delete:focus-visible {
            opacity: 1;
        }

        .meta-pill {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: var(--fs-xs);
            font-weight: 600;
            padding: 3px 8px;
            border-radius: 999px;
            background: var(--bg-subtle);
            color: var(--text-secondary);
            white-space: nowrap;
        }
        .meta-pill.time {
            background: var(--accent-soft);
            color: var(--accent);
        }
        .meta-pill.live-timer {
            background: var(--accent);
            color: #fff;
            font-family: ui-monospace, SFMono-Regular, monospace;
            font-weight: 700;
        }
        .meta-pill.live-timer .pulse-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #fff;
            animation: blinkDot 1.1s infinite;
        }
        @keyframes blinkDot {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.35; }
        }
        .meta-pill.stale {
            background: rgba(217, 119, 6, 0.12);
            color: var(--warning);
        }
        .meta-pill.quick {
            background: rgba(217, 119, 6, 0.1);
            color: var(--warning);
        }

        .row-action-btn {
            border: 1px solid var(--border);
            background: #fff;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: var(--fs-xs);
            font-weight: 650;
            padding: 4px 9px;
            border-radius: 8px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            transition: all 0.15s ease;
            white-space: nowrap;
        }
        .row-action-btn:hover {
            border-color: var(--accent);
            color: var(--accent);
            background: var(--accent-soft);
        }
        .row-action-btn .icon { width: 12px; height: 12px; }
        .row-action-btn.is-primary {
            border-color: rgba(37, 99, 235, 0.35);
            background: var(--accent-soft);
            color: var(--accent);
        }
        .row-action-btn.is-live {
            border-color: rgba(37, 99, 235, 0.4);
            background: var(--accent);
            color: #fff;
        }

        .task-drawer,
        .task-card .task-details {
            display: none;
            padding: 6px 14px 12px 42px;
            flex-direction: column;
            gap: 10px;
            border-top: 1px dashed var(--border);
            background: var(--bg-card);
            border-radius: 0 0 12px 12px;
        }
        .task-card.is-expanded .task-drawer,
        .task-card.is-expanded .task-details {
            display: flex;
        }
        .task-card.is-expanded .drawer-steps .drawer-step-row {
            padding: 5px 8px;
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 8px;
        }
        .drawer-desc {
            font-size: var(--fs-base);
            color: var(--text-secondary);
            line-height: 1.45;
            padding-top: 2px;
            white-space: pre-wrap;
        }

        .task-card.is-expanded .drawer-steps {
            gap: 6px;
            background: transparent;
            border: none;
            padding: 0;
        }
        .task-card.is-expanded .subtask-add-inline {
            margin-top: 2px;
        }
        .task-card.is-expanded .subtask-add-inline input {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 9px;
            font-size: var(--fs-sm);
            padding: 8px 40px 8px 12px;
            color: var(--text-primary);
        }

        .drawer-footer {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 8px;
            flex-wrap: wrap;
            padding-top: 2px;
        }

        .drawer-chips {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .mini-chip {
            border: 1px solid var(--border);
            background: var(--bg-panel);
            color: var(--text-secondary);
            font-family: inherit;
            font-size: var(--fs-xs);
            font-weight: 650;
            padding: 6px 11px;
            border-radius: 9px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            box-shadow: none;
        }
        .mini-chip:hover {
            border-color: var(--text-muted);
            color: var(--text-primary);
            background: var(--bg-card-hover);
        }
        .mini-chip .icon { width: 13px; height: 13px; flex-shrink: 0; }

        .task-card.is-expanded .drawer-chips .mini-chip {
            background: var(--bg-panel);
            border-color: var(--border);
            color: var(--text-secondary);
        }
        .task-card.is-expanded .drawer-chips .mini-chip.has-value {
            background: var(--bg-panel);
            border-color: var(--border);
            color: var(--text-primary);
        }
        .task-card.is-expanded .drawer-chips .mini-chip:hover {
            border-color: var(--text-muted);
            color: var(--text-primary);
        }

        .empty-slot-pill {
            border: 1px dashed #cbd5e1;
            border-radius: 12px;
            padding: 9px 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            color: var(--text-muted);
            font-size: var(--fs-sm);
            background: rgba(241, 245, 249, 0.5);
            flex: 1;
            min-width: 0;
        }

        .task-card-summary {
            display: contents;
        }

        .task-expand-btn {
            flex-shrink: 0;
            width: 28px;
            height: 28px;
            min-height: 28px;
            padding: 0;
            border-radius: 8px;
            border: 1px solid var(--border-subtle);
            background: var(--bg-subtle);
            color: var(--text-secondary);
        }

        .task-expand-btn:hover {
            border-color: rgba(37, 99, 235, 0.35);
            color: var(--accent);
            background: var(--accent-soft);
        }

        .task-expand-btn .task-expand-chevron {
            width: 14px;
            height: 14px;
            transition: transform 0.2s ease;
        }

        .task-card.is-expanded .task-expand-chevron {
            transform: rotate(180deg);
        }

        .task-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 8px;
        }

        .task-header-main {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            min-width: 0;
            flex: 1;
        }

        .task-title {
            font-weight: 600;
            font-size: var(--fs-md);
            color: var(--text-primary);
            word-break: break-word;
            cursor: pointer;
            border-bottom: 1px dashed transparent;
            flex: 1;
            min-width: 0;
        }
        .task-card.is-expanded .task-title:hover {
            border-bottom-color: var(--accent);
        }
        .task-card.is-collapsed .task-title {
            cursor: pointer;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .task-summary-meta {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        .task-quick-actions {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            flex-wrap: wrap;
            margin-left: auto;
        }

        .task-quick-actions button {
            flex: 0 0 auto;
            min-height: 0;
            height: auto;
            padding: 2px 8px;
            font-size: var(--fs-xs);
            font-weight: 600;
            border-radius: 4px;
            gap: 4px;
            white-space: nowrap;
        }

        .task-quick-actions button .icon,
        .task-quick-actions button .icon-sm {
            width: 12px;
            height: 12px;
        }

        .task-footer-secondary {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        .task-footer-secondary button {
            min-height: 0;
            height: auto;
            padding: 3px 8px;
            font-size: var(--fs-xs);
            gap: 4px;
        }

        .task-badges {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        .badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: var(--fs-xs);
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 4px;
            background: var(--bg-subtle);
            color: var(--text-secondary);
            border: 1px solid var(--border-subtle);
        }

        .badge.type-main {
            background: var(--accent-soft);
            color: var(--accent);
            border-color: rgba(59, 130, 246, 0.25);
        }

        .badge.type-voice {
            background: var(--success-soft);
            color: var(--success);
            border-color: rgba(16, 185, 129, 0.25);
        }

        .badge.type-stale {
            background: var(--warning-soft);
            color: var(--warning);
            border-color: rgba(245, 158, 11, 0.3);
        }

        .badge.type-work {
            background: #dc2626;
            color: #fff;
            border-color: #b91c1c;
            font-variant-numeric: tabular-nums;
            font-weight: 700;
            box-shadow: 0 1px 4px rgba(220, 38, 38, 0.35);
            cursor: pointer;
            font: inherit;
            font-size: var(--fs-xs);
            font-weight: 700;
            line-height: 1.25;
            max-width: 100%;
            text-align: left;
            gap: 5px;
        }
        .badge.type-work:hover {
            background: #b91c1c;
            border-color: #991b1b;
        }
        .badge.type-work .work-badge-state {
            letter-spacing: 0.02em;
            text-transform: uppercase;
            font-size: var(--fs-xs);
            opacity: 0.95;
        }
        .badge.type-work .work-badge-meta {
            font-weight: 600;
            opacity: 0.92;
        }
        /* Пауза — сразу другой вид: не «живой» красный таймер */
        .badge.type-work.is-paused {
            background: #64748b;
            color: #fff;
            border: 1px dashed #475569;
            box-shadow: none;
            animation: none;
        }
        .badge.type-work.is-paused:hover {
            background: #475569;
            border-color: #334155;
        }
        .badge.type-work.is-paused .work-badge-state {
            color: #fef3c7;
        }
        .badge.type-work.is-long:not(.is-paused) {
            animation: workPulse 1.6s ease-in-out infinite;
        }
        @keyframes workPulse {
            0%, 100% { box-shadow: 0 1px 4px rgba(220, 38, 38, 0.35); }
            50% { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.28), 0 1px 6px rgba(220, 38, 38, 0.45); }
        }
        .task-card.in-work-card {
            border: 2px solid rgba(220, 38, 38, 0.7);
            box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2), 0 4px 14px rgba(220, 38, 38, 0.16);
            background: var(--danger-soft);
            position: relative;
            z-index: 2;
        }
        /* Пауза: сплошная обводка (dashed + radius рвёт углы в браузерах) */
        .task-card.in-work-card.is-timer-paused {
            border-color: rgba(100, 116, 139, 0.55);
            border-style: solid;
            background: var(--bg-card);
            box-shadow: none;
        }
        .task-card.in-work-card.is-timer-live {
            border-style: solid;
            border-color: #dc2626;
            box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25), 0 6px 18px rgba(220, 38, 38, 0.22);
        }

        .empty-slot-box {
            flex: 1;
            border: 1px dashed var(--border);
            border-radius: var(--radius-md);
            padding: 14px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            color: var(--text-muted);
            font-size: var(--fs-sm);
            background: var(--bg-subtle);
            gap: 12px;
        }

        .empty-slot-box.empty-guide {
            flex: 0 0 auto;
            width: 100%;
            box-sizing: border-box;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            gap: 10px;
            padding: 28px 16px;
            min-height: 168px;
        }

        .empty-guide-title {
            color: var(--text-primary);
            font-weight: 700;
            font-size: var(--fs-md);
            line-height: 1.35;
            max-width: 22em;
        }

        .empty-guide-hint {
            width: 100%;
            max-width: 22em;
            margin: 0 auto;
            line-height: 1.4;
            color: var(--text-muted);
            font-size: var(--fs-sm);
            text-wrap: balance;
        }

        .empty-guide-actions {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 8px;
            width: 100%;
            max-width: 260px;
            margin: 4px auto 0;
        }

        .empty-guide-actions button {
            font-size: var(--fs-sm);
            padding: 10px 12px;
            min-height: 42px;
            width: 100%;
            justify-content: center;
            box-sizing: border-box;
        }

        /* Аудиоплеер в карточке */
        .audio-bar {
            display: flex;
            align-items: center;
            gap: 10px;
            background: var(--bg-subtle);
            border: 1px solid var(--border-subtle);
            padding: 6px 10px;
            border-radius: var(--radius-sm);
        }

        .audio-bar audio {
            height: 28px;
            flex: 1;
        }

        /* Чек-лист подзадач */
        .subtasks-box {
            background: var(--bg-subtle);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-sm);
            padding: 8px 10px;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .drawer-steps {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }
        .drawer-step-row,
        .subtask-row {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: var(--fs-sm);
            color: var(--text-primary);
            cursor: pointer;
        }
        .subtask-row-main {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
            min-width: 0;
            cursor: pointer;
        }
        .drawer-step-row {
            padding: 5px 6px 5px 8px;
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text-primary);
        }

        .subtask-row input[type="checkbox"] {
            accent-color: var(--accent);
            width: 14px;
            height: 14px;
            cursor: pointer;
        }

        .subtask-row.done span {
            text-decoration: line-through;
            color: var(--text-muted);
        }

        .subtask-add-inline input {
            padding: 5px 8px;
            font-size: var(--fs-sm);
            background: var(--bg-card);
        }

        .task-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
            padding-top: 6px;
            border-top: 1px solid var(--border-subtle);
            flex-wrap: wrap;
        }

        /* Панель фильтрации буфера */
        .backlog-toolbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--border-subtle);
            flex-wrap: wrap;
        }

        .segmented-tabs {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            background: transparent;
            padding: 0;
            border: none;
            border-radius: 0;
            flex: 1 1 auto;
            min-width: 0;
        }

        .backlog-search {
            position: relative;
            display: flex;
            align-items: center;
            flex: 1 1 180px;
            min-width: 160px;
            max-width: 320px;
        }
        .backlog-search-toggle,
        .backlog-search-back {
            display: none;
            border: none;
            box-shadow: none;
        }
        /* Десктоп: поиск-иконка ↔ полная ширина с плавной анимацией */
        @media (min-width: 1025px) {
            .backlog-toolbar {
                display: grid;
                grid-template-columns: minmax(0, 1fr) 32px;
                gap: 8px;
                align-items: center;
                transition: grid-template-columns 0.32s cubic-bezier(0.22, 1, 0.36, 1);
            }
            .backlog-toolbar:has(.backlog-search:focus-within) {
                grid-template-columns: 0fr 1fr;
                gap: 0;
            }
            .backlog-toolbar .segmented-tabs {
                min-width: 0;
                overflow: hidden;
                flex-wrap: nowrap;
                opacity: 1;
                transform: translateX(0);
                transition: opacity 0.22s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
            }
            .backlog-toolbar:has(.backlog-search:focus-within) .segmented-tabs {
                opacity: 0;
                transform: translateX(-8px);
                pointer-events: none;
            }
            .backlog-toolbar .segmented-tabs .tab-btn {
                flex: 0 0 auto;
                white-space: nowrap;
                height: 32px;
                padding: 0 14px;
            }
            .backlog-toolbar .backlog-search {
                width: auto;
                min-width: 0;
                max-width: none;
                flex: none;
                overflow: hidden;
                height: 32px;
            }
            .backlog-toolbar .backlog-search .backlog-search-icon {
                left: 11px;
                transform: none;
                z-index: 1;
                color: var(--text-secondary);
                transition: left 0.28s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease;
            }
            .backlog-toolbar:not(:has(.backlog-search:focus-within)) .backlog-search .backlog-search-icon {
                left: 50%;
                transform: translateX(-50%);
            }
            .backlog-toolbar .backlog-search input {
                height: 32px;
                padding: 0 10px 0 10px;
                color: transparent;
                caret-color: transparent;
                background: var(--bg-subtle);
                border: none;
                box-shadow: none;
                cursor: pointer;
                text-overflow: clip;
                transition: padding 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                    background 0.22s ease, color 0.18s ease 0.08s,
                    border-color 0.22s ease, box-shadow 0.22s ease;
            }
            .backlog-toolbar .backlog-search:not(:focus-within):hover input {
                background: var(--bg-card-hover);
            }
            .backlog-toolbar .backlog-search:not(:focus-within):hover .backlog-search-icon {
                color: var(--text-primary);
            }
            .backlog-toolbar .backlog-search input::placeholder {
                color: transparent;
                transition: color 0.18s ease;
            }
            .backlog-toolbar .backlog-search .backlog-search-clear {
                opacity: 0;
                pointer-events: none;
                display: inline-flex !important;
                transition: opacity 0.18s ease;
            }
            .backlog-toolbar .backlog-search:focus-within input {
                padding: 0 34px 0 32px;
                color: var(--text-primary);
                caret-color: var(--text-primary);
                background: var(--bg-subtle);
                border: none;
                box-shadow: none;
                cursor: text;
                text-overflow: ellipsis;
            }
            .backlog-toolbar .backlog-search:focus-within input::placeholder {
                color: var(--text-muted);
            }
            .backlog-toolbar .backlog-search:focus-within .backlog-search-clear.is-visible {
                opacity: 1;
                pointer-events: auto;
            }
            /* есть запрос, но поле не в фокусе — иконка-акцент */
            .backlog-toolbar .backlog-search:has(.backlog-search-clear.is-visible):not(:focus-within) input {
                background: var(--accent);
            }
            .backlog-toolbar .backlog-search:has(.backlog-search-clear.is-visible):not(:focus-within) .backlog-search-icon {
                color: #fff;
            }
        }
        .backlog-search-icon {
            position: absolute;
            left: 10px;
            width: 14px;
            height: 14px;
            color: var(--text-muted);
            pointer-events: none;
            stroke: currentColor;
            fill: none;
            stroke-width: 2;
            stroke-linecap: round;
        }
        .backlog-search input {
            width: 100%;
            height: 36px;
            border: 1px solid var(--border);
            border-radius: 999px;
            background: var(--bg-card);
            padding: 0 34px 0 32px;
            font-family: inherit;
            font-size: var(--fs-sm);
            font-weight: 550;
            color: var(--text-primary);
            outline: none;
            box-shadow: none;
        }
        .backlog-search input[type="search"]::-webkit-search-decoration,
        .backlog-search input[type="search"]::-webkit-search-cancel-button,
        .backlog-search input[type="search"]::-webkit-search-results-button,
        .backlog-search input[type="search"]::-webkit-search-results-decoration {
            -webkit-appearance: none;
            appearance: none;
            display: none;
        }
        .backlog-search input::placeholder {
            color: var(--text-muted);
            font-weight: 500;
        }
        .backlog-search input:focus {
            border-color: rgba(37, 99, 235, 0.45);
            background: var(--bg-panel);
            box-shadow: 0 0 0 3px var(--accent-soft);
        }
        .backlog-search-clear {
            position: absolute;
            right: 6px;
            width: 24px;
            height: 24px;
            border: none;
            border-radius: 50%;
            background: transparent;
            color: var(--text-muted);
            font-size: var(--fs-lg);
            line-height: 1;
            padding: 0;
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
        }
        .backlog-search-clear.is-visible {
            display: inline-flex;
        }
        .backlog-search-clear:hover {
            background: var(--bg-subtle);
            color: var(--text-primary);
            border: none;
        }

        .tab-btn {
            border: none;
            background: var(--bg-subtle);
            color: var(--text-secondary);
            padding: 7px 14px;
            font-size: var(--fs-sm);
            font-weight: 700;
            border-radius: 999px;
            box-shadow: none;
            line-height: 1.2;
        }
        .tab-btn:hover {
            background: var(--bg-card-hover);
            color: var(--text-primary);
            border: none;
        }
        .tab-btn.active {
            background: var(--text-primary);
            color: var(--bg-panel);
            box-shadow: none;
        }
        .tab-btn.active:hover {
            background: var(--text-primary);
            color: var(--bg-panel);
            opacity: 0.92;
        }
        .tab-btn .flt-count {
            font-weight: 700;
            opacity: 0.9;
        }

        /* Подвал выполненных — компактная полоса как в макете */
        .completed-bar,
        .done-summary-bar {
            margin-top: 0;
            padding: 12px 16px;
            background: var(--bg-subtle);
            border-top: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            flex-wrap: wrap;
            flex-shrink: 0;
            max-height: 28%;
            overflow-y: auto;
            position: relative;
            z-index: 2;
        }

        .done-pills-wrap {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
            min-width: 0;
            flex: 1;
        }
        .done-summary-label {
            font-size: var(--fs-xs);
            font-weight: 700;
            color: var(--text-secondary);
            margin-right: 2px;
            white-space: nowrap;
        }

        .done-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            align-items: center;
        }

        .done-chip,
        .done-mini-pill {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: var(--fs-xs);
            font-weight: 600;
            padding: 3px 9px;
            border-radius: 999px;
            background: rgba(5, 150, 105, 0.1);
            color: var(--success);
            border: 1px solid transparent;
            cursor: pointer;
            font: inherit;
            text-align: left;
            max-width: 100%;
        }
        .done-chip:hover {
            border-color: rgba(5, 150, 105, 0.55);
            background: rgba(5, 150, 105, 0.16);
        }
        .done-chip .done-chip-title {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            max-width: 220px;
        }
        .done-summary-bar .mini-chip {
            flex-shrink: 0;
        }

