/* ТаскДей — вид задач: «Список» (view-list), «Карточки» (view-cards), «Планер» (view-planner).
   Общая разметка .tcard из createTaskCardHTML; вид задаётся классом на body.
   Префикс #boardGrid нужен, чтобы перебить старые правила .task-card. */

/* ---------- Заголовки разделов и вместимость ---------- */
#boardGrid .tc-sec-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    padding: 0 2px 8px; margin: 0; text-transform: none; letter-spacing: 0;
}
#boardGrid .tc-sec-title {
    margin: 0; font-size: var(--fs-base); font-weight: 700; color: var(--text-primary);
    letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 8px;
}
#boardGrid .tc-sec-hint { font-size: var(--fs-xs); font-weight: 500; color: var(--text-muted); }
#boardGrid .tc-cap {
    display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-xs); font-weight: 600;
    color: var(--text-muted); font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: 0;
}
#boardGrid .tc-cap.is-over { color: var(--warning); }
#boardGrid .tc-meter { display: inline-flex; gap: 3px; }
#boardGrid .tc-meter i { width: 12px; height: 4px; border-radius: 2px; background: var(--border); }
#boardGrid .tc-meter i.on { background: var(--accent); }
#boardGrid .tc-cap.is-over .tc-meter i.on { background: var(--warning); }
body.realm-life #boardGrid .tc-meter i.on { background: var(--life, #0f766e); }
#workTodaySections { gap: 18px; }

/* ---------- Строка задачи (общее: формат с разделителями) ---------- */
#boardGrid .tc-list { display: flex; flex-direction: column; gap: 0; }
#boardGrid .task-card.tcard {
    flex: none; margin: 0; padding: 8px 6px 8px 4px; gap: 0;
    border: 0; border-bottom: 1px solid var(--border-subtle); border-radius: 0;
    background: transparent; box-shadow: none; transform: none; cursor: pointer;
    overflow: visible; position: relative;
    transition: background .14s ease, opacity .2s ease, box-shadow .14s ease, border-color .14s ease;
}
#boardGrid .tc-list > .tcard:last-child,
#boardGrid .tc-list > :last-child { border-bottom: 0; }
#boardGrid .task-card.tcard::before { display: none; content: none; }
#boardGrid .tcard .tc-row { position: relative; display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
#boardGrid .tcard .tc-gut { display: none; }
#boardGrid .tcard .tc-check {
    width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; border-radius: 50%;
    border: 1.6px solid var(--border); background: transparent; color: transparent; padding: 0;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
#boardGrid .tcard .tc-check svg { width: 11px; height: 11px; }
/* превью галочки только при наведении на сам чекбокс, не на всю строку */
#boardGrid .tcard .tc-check:hover { border-color: var(--success); color: var(--success); background: var(--success-soft); }
#boardGrid .tcard.is-done .tc-check { background: var(--success); border-color: var(--success); color: #fff; }
#boardGrid .tcard .tc-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
#boardGrid .tcard .tc-title {
    flex: none; font-size: var(--fs-base); font-weight: 600; line-height: 1.35; color: var(--text-primary);
    white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere;
    display: block; -webkit-line-clamp: unset; line-clamp: none; padding-right: 0; min-height: 0;
}
#boardGrid .tcard.is-done .tc-title { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--border); font-weight: 500; }
#boardGrid .tcard .tc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.4; }
#boardGrid .tcard .tc-sep { font-style: normal; opacity: .6; }
#boardGrid .tcard .tc-m-ic { display: inline-flex; align-items: center; gap: 3px; }
#boardGrid .tcard .tc-m-ic svg { width: 11px; height: 11px; }
#boardGrid .tcard .tc-m-warn { color: var(--warning); }
#boardGrid .tcard .tc-m-quick { color: var(--warning, #d97706); font-weight: 550; }
#boardGrid .tcard .tc-m-main { color: var(--text-muted); }
#boardGrid .tcard .tc-m-done { color: var(--success); }
#boardGrid .tcard .tc-m-focus { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
#boardGrid .tcard .tc-m-focus.is-ended { color: var(--warning, #d97706); }
#boardGrid .tcard .tc-btn.is-done-act {
    background: rgba(5, 150, 105, 0.12); border-color: rgba(5, 150, 105, 0.35); color: var(--success, #059669);
}
#boardGrid .tcard .tc-btn.is-done-act:hover {
    background: rgba(5, 150, 105, 0.2); border-color: rgba(5, 150, 105, 0.5);
}
html[data-theme="dark"] #boardGrid .tcard .tc-btn.is-done-act {
    background: rgba(52, 211, 153, 0.14); border-color: rgba(52, 211, 153, 0.4); color: #34d399;
}
#boardGrid .tcard .tc-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#boardGrid .tcard.is-timer-live .tc-pulse { animation: blinkDot 1.1s infinite; }

/* действия: компактные пилюли (как в планере), не растягивать на 2 строки карточки */
#boardGrid .tcard .tc-row { min-height: 32px; }
#boardGrid .tcard .tc-acts {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0; align-self: center;
    min-height: 28px;
}
#boardGrid .tcard .tc-acts .tc-reveal { display: none; }
#boardGrid .tcard:hover .tc-acts .tc-reveal,
#boardGrid .tcard.is-expanded .tc-acts .tc-reveal,
#boardGrid .tcard.is-selected .tc-acts .tc-reveal,
#boardGrid .tcard .tc-acts .tc-reveal:focus-visible { display: inline-flex; }
#boardGrid .tcard .tc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    height: 28px; min-height: 28px; align-self: center; box-sizing: border-box;
    padding: 0 10px; border-radius: var(--radius-sm);
    border: 1px solid transparent; font: inherit; font-size: var(--fs-xs); font-weight: 650;
    cursor: pointer; white-space: nowrap;
}
#boardGrid .tcard .tc-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
#boardGrid .tcard .tc-btn.is-primary, #boardGrid .tcard .tc-btn.is-live { background: var(--accent); border-color: var(--accent); color: #fff; }
#boardGrid .tcard .tc-btn.is-primary:hover, #boardGrid .tcard .tc-btn.is-live:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
#boardGrid .tcard .tc-btn.is-plan { background: var(--accent-soft); color: var(--accent); }
#boardGrid .tcard .tc-btn.is-plan:hover { border-color: var(--accent); }
body.realm-life #boardGrid .tcard .tc-btn.is-primary, body.realm-life #boardGrid .tcard .tc-btn.is-live { background: var(--life, #0f766e); border-color: var(--life, #0f766e); }
body.realm-life #boardGrid .tcard .tc-btn.is-plan { background: rgba(15, 118, 110, .12); color: var(--life, #0f766e); }
body.realm-life #boardGrid .tcard .tc-pulse { background: var(--life, #0f766e); box-shadow: 0 0 0 3px rgba(15, 118, 110, .16); }
body.realm-life #boardGrid .tcard .tc-m-focus { color: var(--life, #0f766e); }
#boardGrid .tcard .tc-icon {
    width: 28px; height: 28px; min-height: 28px; align-self: center;
    display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm);
    border: 0; background: transparent; color: var(--text-muted); cursor: pointer; padding: 0;
    box-sizing: border-box;
}
#boardGrid .tcard .tc-icon:hover { background: var(--bg-subtle); color: var(--text-primary); }
#boardGrid .tcard .tc-icon.task-row-delete:hover { color: var(--danger); background: var(--danger-soft); }
#boardGrid .tcard .tc-icon .icon, #boardGrid .tcard .tc-icon svg { width: 15px; height: 15px; }

/* раскрытая задача (компьютер): панель деталей под строкой */
#boardGrid .tcard .task-drawer { margin-top: 8px; border-radius: var(--radius-md); padding: 8px 12px 12px 30px; }

/* свободные слоты */
#boardGrid .tc-empty {
    display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--text-muted);
    border: 0; border-bottom: 1px dashed var(--border-subtle); border-radius: 0;
    padding: 8px 6px 8px 30px; background: transparent;
}
#boardGrid .tc-empty .tc-gut { display: none; }
#boardGrid .tc-empty-hint { margin-left: auto; opacity: .8; }

/* «Готово · N» */
#boardGrid .tc-done { margin-top: 6px; }
#boardGrid .tc-done-head {
    display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; padding: 4px 2px;
    font: inherit; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); cursor: pointer; border-radius: 6px;
}
#boardGrid .tc-done-head:hover { color: var(--text-primary); }
#boardGrid .tc-done-head svg { width: 12px; height: 12px; transition: transform .15s; }
#boardGrid .tc-done.is-open .tc-done-head svg { transform: rotate(90deg); }
#boardGrid .tc-done-list .tcard { opacity: .85; }

/* группы буфера */
#boardGrid .backlog-group { gap: 0; margin-bottom: 16px; }
#boardGrid .backlog-group-head {
    justify-content: flex-start; gap: 7px; padding: 0 2px 6px; font-size: var(--fs-xs); font-weight: 700;
    color: var(--text-secondary); text-transform: none; letter-spacing: 0;
}
#boardGrid .backlog-group-head .grp-count { margin-left: auto; font-family: inherit; color: var(--text-muted); font-variant-numeric: tabular-nums; }
#boardGrid .tc-grp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
#boardGrid .backlog-group.is-today .backlog-group-head,
#boardGrid .backlog-group.is-nodate .backlog-group-head,
#boardGrid .backlog-group.is-overdue .backlog-group-head { color: var(--text-secondary); }
#boardGrid .backlog-group.is-today .tc-grp-dot { background: var(--accent); }
#boardGrid .backlog-group.is-nodate .tc-grp-dot { background: var(--warning); }
#boardGrid .backlog-group.is-overdue .tc-grp-dot { background: var(--danger); }
#boardGrid .backlog-group.is-overdue .tc-grp-t { color: var(--danger); }

/* итог дня внизу колонки — одна строка без пилюль */
.done-summary-bar .done-summary-label { font-weight: 600; color: var(--text-muted); }

/* Общий hover / в работе для всех видов */
#boardGrid .tcard:hover,
#boardGrid .tcard.is-selected,
#boardGrid .tcard.is-expanded { background: var(--bg-subtle); }
#boardGrid .tcard.is-selected,
#boardGrid .tcard.is-expanded { box-shadow: inset 2px 0 0 var(--accent); }
#boardGrid .tcard.in-work-card {
    background: var(--accent-soft);
    box-shadow: inset 3px 0 0 var(--accent);
}
body.realm-life #boardGrid .tcard.in-work-card {
    background: rgba(15, 118, 110, .1);
    box-shadow: inset 3px 0 0 var(--life, #0f766e);
}
#boardGrid .tcard .task-drawer {
    margin: 4px 0 0; border-radius: var(--radius-md);
    background: var(--bg-subtle); padding: 8px 10px 10px 28px;
}
#boardGrid .backlog-group:not(.is-day-focus) { background: transparent; border-radius: 0; padding: 0; }
#boardGrid .backlog-group { margin-bottom: 10px; }

/* ================= Список / Карточки / Планер: 2 строки =================
   1) заголовок  2) метки/meta; кнопки справа при hover; meta не прячем (высота стабильна) */
body.view-list #boardGrid .tc-list,
body.view-cards #boardGrid .tc-list,
body.view-planner #boardGrid .tc-list { border-top: 1px solid var(--border-subtle); }

body.view-list #boardGrid .tcard { padding: 8px 6px 8px 4px; }
body.view-list #boardGrid .tcard .tc-row,
body.view-cards #boardGrid .tcard .tc-row,
body.view-planner #boardGrid .tcard .tc-row {
    align-items: flex-start; gap: 8px;
}
body.view-list #boardGrid .tcard .tc-check,
body.view-cards #boardGrid .tcard .tc-check,
body.view-planner #boardGrid .tcard .tc-check {
    align-self: start; margin-top: 2px;
}
body.view-list #boardGrid .tcard .tc-body,
body.view-cards #boardGrid .tcard .tc-body,
body.view-planner #boardGrid .tcard .tc-body {
    flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; flex: 1;
}
body.view-list #boardGrid .tcard .tc-title,
body.view-cards #boardGrid .tcard .tc-title,
body.view-planner #boardGrid .tcard .tc-title {
    flex: none; width: 100%; max-width: 100%; min-width: 0;
    font-size: var(--fs-base); font-weight: 650; line-height: 1.35;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    overflow-wrap: normal; word-break: normal;
}
body.view-cards #boardGrid .tcard .tc-title { font-weight: 700; }
body.view-planner #boardGrid .tcard .tc-title { font-size: var(--fs-sm); }
body.view-list #boardGrid .tcard .tc-meta,
body.view-cards #boardGrid .tcard .tc-meta,
body.view-planner #boardGrid .tcard .tc-meta {
    flex: none; width: 100%; min-width: 0;
    display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px;
    white-space: normal; overflow: visible; line-height: 1.35;
}
body.view-list #boardGrid .tcard .tc-acts,
body.view-cards #boardGrid .tcard .tc-acts,
body.view-planner #boardGrid .tcard .tc-acts {
    flex-shrink: 0; align-self: center;
}
body.view-list #boardGrid .tc-empty { padding: 9px 6px 9px 32px; }

/* Карточки — цветной акцент слева */
body.view-cards #boardGrid .tcard {
    padding: 8px 8px 8px 10px;
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 75%, transparent);
}
body.view-cards #boardGrid .tcard.is-quick {
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--warning) 80%, transparent);
}
body.view-cards #boardGrid .tcard.is-life {
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--life, #0f766e) 80%, transparent);
}
body.view-cards #boardGrid .tcard.is-done { box-shadow: inset 3px 0 0 var(--border); }
body.view-cards #boardGrid .tcard.in-work-card {
    background: var(--accent-soft);
    box-shadow: inset 3px 0 0 var(--accent);
}
body.realm-life.view-cards #boardGrid .tcard.in-work-card {
    background: rgba(15, 118, 110, .1);
    box-shadow: inset 3px 0 0 var(--life, #0f766e);
}
body.view-cards #boardGrid .tcard.is-selected,
body.view-cards #boardGrid .tcard.is-expanded {
    box-shadow: inset 3px 0 0 var(--accent);
}
body.view-cards #boardGrid .backlog-group-head { padding: 2px 2px 6px; }

/* Планер — компактный номер слота слева; время задачи в meta */
body.view-planner #boardGrid .tc-list { background: transparent; }
body.view-planner #boardGrid .tcard { padding: 0; background: transparent; }
/* hover/expand должны перебивать transparent выше (выше specificity) */
body.view-planner #boardGrid .tcard:hover,
body.view-planner #boardGrid .tcard.is-selected,
body.view-planner #boardGrid .tcard.is-expanded {
    background: var(--bg-subtle);
}
body.view-planner #boardGrid .tcard.is-selected,
body.view-planner #boardGrid .tcard.is-expanded {
    box-shadow: inset 2px 0 0 var(--accent);
}
body.view-planner #boardGrid .tcard.in-work-card {
    background: var(--accent-soft);
    box-shadow: inset 3px 0 0 var(--accent);
}
body.realm-life.view-planner #boardGrid .tcard.in-work-card {
    background: rgba(15, 118, 110, .1);
    box-shadow: inset 3px 0 0 var(--life, #0f766e);
}
body.view-planner #boardGrid .tc-list > :last-child { border-bottom: 0; }
body.view-planner #boardGrid .tcard .tc-row { padding: 8px 6px; }
body.view-planner #boardGrid .tc-gut {
    width: 22px; flex-shrink: 0; align-self: start; display: flex; align-items: center; justify-content: center;
    margin-top: 3px; margin-right: 2px;
    font-size: 11px; font-weight: 650; color: var(--text-muted); font-variant-numeric: tabular-nums;
    border: 0; background: transparent;
}
body.view-planner #boardGrid .tc-gut:empty { display: none; }
body.view-planner #boardGrid .tcard.in-work-card .tc-gut { color: var(--accent); border: 0; }
body.realm-life.view-planner #boardGrid .tcard.in-work-card .tc-gut { color: var(--life, #0f766e); border: 0; }
body.view-planner #boardGrid .tcard .tc-m-time {
    color: var(--text-secondary); font-variant-numeric: tabular-nums; font-weight: 650;
}
body.view-planner #boardGrid .tcard .tc-m-time svg { width: 11px; height: 11px; color: var(--text-muted); }
body.view-planner #boardGrid .tc-empty {
    border-bottom: 1px dashed var(--border-subtle); padding: 8px 6px; min-height: 0;
    background: transparent; opacity: 0.75; gap: 8px;
}
body.view-planner #boardGrid .tc-empty .tc-gut {
    display: flex; align-self: center; margin: 0; width: 22px;
}
body.view-planner #boardGrid .tcard .task-drawer { margin: 0; border-radius: 0; padding-left: 40px; background: var(--bg-subtle); }
body.view-planner #boardGrid .tc-done-list .tcard:last-child { border-bottom: 0; }

/* ================= Фокус-hero + плотная доска (гибрид B+A) ================= */
/* Hero убран: фокус живёт в раскрытой карточке на доске */
#focusHero { display: none !important; }
#focusHero[hidden] { display: none !important; }
#focusHero .fh-label {
    font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--accent); margin: 0 0 6px;
}
body.realm-life #focusHero .fh-label { color: var(--life, #0f766e); }
#focusHero .fh-title {
    margin: 0 0 8px; font-size: 17px; font-weight: 750; letter-spacing: -0.025em;
    line-height: 1.3; color: var(--text-primary); overflow-wrap: anywhere;
}
#focusHero .fh-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: 12px;
}
#focusHero .fh-meta .badge {
    display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px;
    border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left;
    font: inherit; color: inherit;
}
#focusHero .fh-meta .work-badge-state { font-weight: 700; color: var(--accent); }
body.realm-life #focusHero .fh-meta .work-badge-state { color: var(--life, #0f766e); }
#focusHero .fh-meta .work-badge-meta { font-size: var(--fs-xs); color: var(--text-muted); }
#focusHero .fh-meta .fh-steps { font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
#focusHero .fh-acts { display: flex; flex-wrap: wrap; gap: 8px; }
#focusHero .fh-primary {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px;
    border-radius: var(--radius-sm); border: 0; background: var(--accent); color: #fff;
    font: inherit; font-size: var(--fs-xs); font-weight: 700; cursor: pointer;
}
#focusHero .fh-primary:hover { background: var(--accent-hover); }
body.realm-life #focusHero .fh-primary { background: var(--life, #0f766e); }
#focusHero .fh-secondary {
    display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
    border-radius: var(--radius-sm); border: 1px solid var(--border-subtle);
    background: var(--bg-panel); color: var(--text-secondary);
    font: inherit; font-size: var(--fs-xs); font-weight: 650; cursor: pointer;
}
#focusHero .fh-secondary:hover { border-color: var(--border); color: var(--text-primary); }
#focusHero .fh-done {
    display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
    border-radius: var(--radius-sm); border: 1px solid rgba(52, 211, 153, 0.45);
    background: rgba(52, 211, 153, 0.12); color: var(--success, #059669);
    font: inherit; font-size: var(--fs-xs); font-weight: 700; cursor: pointer;
}
#focusHero .fh-done:hover { background: rgba(52, 211, 153, 0.2); }

/* активная задача в списке слотов — без большой кнопки, когда есть hero */
/* Закреплённая в фокусе задача — раскрыта, акцент слева, Пауза всегда видна */
#boardGrid .tcard.is-focus-pinned {
    box-shadow: inset 3px 0 0 var(--accent);
    background: var(--bg-subtle);
}
body.realm-life #boardGrid .tcard.is-focus-pinned {
    box-shadow: inset 3px 0 0 var(--life, #0f766e);
}
#boardGrid .tcard.is-focus-pinned .tc-btn.is-live {
    opacity: 1; visibility: visible;
}

@media (min-width: 1025px) {
    #boardGrid .section-block { gap: 4px; }
    #workTodaySections { gap: 12px; }
    #colToday .tcard .tc-title { font-size: var(--fs-md); }
    /* буфер чуть тише — акцент на Сегодня */
    #colOther .tcard .tc-title { font-weight: 600; color: var(--text-secondary); }
    #colOther .tcard:hover .tc-title,
    #colOther .tcard.is-selected .tc-title,
    #colOther .tcard.is-expanded .tc-title { color: var(--text-primary); }
}

/* ================= Телефон/планшет ≤1024: плотные строки (demo A) ================= */
@media (max-width: 1024px) {
    #boardGrid .tcard:hover:not(.is-selected) .tc-acts .tc-reveal { display: none; }
    #boardGrid .tcard .tc-acts .task-row-delete,
    #boardGrid .tcard .tc-acts .tc-rename { display: none !important; }
    #boardGrid .tcard .tc-acts .tc-icon.tc-reveal { display: none !important; }
    /* Пауза/таймер — только в шторке; в строке не дублируем */
    #boardGrid .tcard .tc-btn.is-live,
    #boardGrid .tcard #focusCardTimerBtn {
        display: none !important;
    }
    #boardGrid .tcard.is-focus-pinned .tc-acts .tc-expand,
    #boardGrid .tcard.is-selected .tc-acts .tc-expand {
        display: inline-flex !important;
    }
    #boardGrid .tc-empty-hint { display: none; }
    #boardGrid .task-card.tcard {
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        box-sizing: border-box;
        padding: 8px 6px;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        border: none;
        border-bottom: 1px solid var(--border-subtle);
    }
    #boardGrid .tcard:not(.td-task-row) .tc-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "check title title"
            "check meta  acts";
        column-gap: 6px;
        row-gap: 4px;
        align-items: center;
        width: 100%;
        min-width: 0;
        min-height: 0;
    }
    /* без колонки времени планера — время в meta */
    #boardGrid .tcard:not(.td-task-row) .tc-gut,
    body.view-planner #boardGrid .tcard:not(.td-task-row) .tc-gut,
    body.view-planner #boardGrid .tc-empty .tc-gut {
        display: none !important;
    }
    #boardGrid .tcard:not(.td-task-row) .tc-check {
        grid-area: check;
        align-self: start;
        position: relative;
        width: 20px;
        height: 20px;
        min-width: 20px;
        margin-top: 2px;
        padding: 0;
        box-sizing: border-box;
        flex-shrink: 0;
    }
    /* тач-зона ≥44px без раздувания самого круга */
    #boardGrid .tcard:not(.td-task-row) .tc-check::after {
        content: '';
        position: absolute;
        inset: -12px;
    }
    #boardGrid .tcard:not(.td-task-row) .tc-m-time {
        color: var(--text-secondary);
        font-variant-numeric: tabular-nums;
    }
    #boardGrid .tcard:not(.td-task-row) .tc-m-time svg {
        width: 11px;
        height: 11px;
        color: var(--text-muted);
    }
    /* дети body участвуют в сетке строки */
    #boardGrid .tcard:not(.td-task-row) .tc-body {
        display: contents;
    }
    #boardGrid .tcard:not(.td-task-row) .tc-title {
        grid-area: title;
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
        text-overflow: ellipsis;
        overflow-wrap: anywhere;
        word-break: break-word;
        max-width: 100%;
        min-width: 0;
        font-size: var(--fs-base);
        font-weight: 650;
        line-height: 1.3;
        padding-right: 0;
        min-height: 0;
    }
    #boardGrid .tcard:not(.td-task-row) .tc-meta {
        grid-area: meta;
        display: flex !important;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0 6px;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-size: 12px;
        line-height: 1.3;
    }
    #boardGrid .tcard:not(.td-task-row) .tc-meta > * {
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    #boardGrid .tcard:not(.td-task-row) .tc-meta:empty { display: none !important; }
    /* нижняя строка: статус слева, CTA справа */
    #boardGrid .tcard:not(.td-task-row) .tc-acts {
        grid-area: acts;
        display: flex;
        flex: 0 0 auto;
        flex-shrink: 0;
        gap: 2px;
        align-self: center;
        align-items: center;
        justify-content: flex-end;
        min-height: 0;
        height: auto;
        max-width: none;
    }
    /* Текстовые ссылки вместо pill (demo A) */
    #boardGrid .tcard .tc-btn,
    #boardGrid .tcard .row-action-btn.tc-btn {
        display: inline-flex;
        flex: 0 0 auto;
        height: 36px;
        min-height: 36px;
        max-height: 36px;
        min-width: 0;
        width: auto;
        padding: 0 8px;
        font-size: var(--fs-sm);
        font-weight: 650;
        line-height: 1;
        gap: 0;
        align-self: center;
        white-space: nowrap;
        border-radius: 8px;
        box-sizing: border-box;
        background: transparent;
        border: none;
        box-shadow: none;
        color: var(--accent);
    }
    #boardGrid .tcard .tc-btn.is-primary,
    #boardGrid .tcard .tc-btn.is-plan,
    #boardGrid .tcard .tc-btn.is-live {
        background: transparent;
        border: none;
        color: var(--accent);
    }
    #boardGrid .tcard .tc-btn:hover,
    #boardGrid .tcard .tc-btn:active,
    #boardGrid .tcard .tc-btn.is-primary:hover,
    #boardGrid .tcard .tc-btn.is-primary:active,
    #boardGrid .tcard .tc-btn.is-plan:hover,
    #boardGrid .tcard .tc-btn.is-plan:active {
        background: var(--accent-soft);
        border: none;
        color: var(--accent);
    }
    body.realm-life #boardGrid .tcard .tc-btn,
    body.realm-life #boardGrid .tcard .tc-btn.is-primary,
    body.realm-life #boardGrid .tcard .tc-btn.is-plan,
    body.realm-life #boardGrid .tcard .tc-btn.is-live {
        background: transparent;
        border: none;
        color: var(--life, #0f766e);
    }
    body.realm-life #boardGrid .tcard .tc-btn:hover,
    body.realm-life #boardGrid .tcard .tc-btn:active,
    body.realm-life #boardGrid .tcard .tc-btn.is-primary:hover,
    body.realm-life #boardGrid .tcard .tc-btn.is-primary:active {
        background: rgba(15, 118, 110, 0.1);
        color: var(--life, #0f766e);
    }
    #boardGrid .tcard .tc-btn .tc-btn-full { display: none !important; }
    #boardGrid .tcard .tc-btn .tc-btn-short { display: inline !important; }
    #boardGrid .tcard .tc-btn > svg,
    #boardGrid .tcard .tc-btn > .icon { display: none; }
    #boardGrid .tcard .tc-icon {
        width: 36px;
        height: 36px;
        min-height: 36px;
        max-height: 36px;
        flex-shrink: 0;
        align-self: center;
    }
    /* list / cards / planner — одна схема без gutter */
    body.view-list #boardGrid .tcard { padding: 8px 4px; }
    body.view-cards #boardGrid .tcard { padding: 8px 6px; }
    body.view-planner #boardGrid .tcard { padding: 7px 4px; }
    body.view-planner #boardGrid .tcard .tc-row {
        padding: 0;
        min-height: 0;
        row-gap: 4px;
    }
    body.view-planner #boardGrid .tcard.in-work-card .tc-gut { border: 0; }
    /* на телефоне статус фокуса в нижней строке — не прятать */
    body.view-planner #boardGrid .tcard .tc-meta,
    body.view-planner #boardGrid .tcard.in-work-card .tc-meta,
    body.view-planner #boardGrid .tcard:hover:not(.in-work-card) .tc-meta,
    body.view-planner #boardGrid .tcard.is-selected:not(.in-work-card) .tc-meta {
        display: flex !important;
    }
    body.view-planner #boardGrid .tcard .tc-body {
        flex-direction: unset;
        align-items: unset;
        gap: unset;
    }
    /* свободные слоты — тише */
    #boardGrid .tc-empty {
        background: transparent;
        border-bottom-color: var(--border-subtle);
        opacity: 0.72;
        padding: 8px 6px 8px 28px;
    }
    body.view-planner #boardGrid .tc-empty {
        background: transparent;
        border-bottom: 1px dashed var(--border-subtle);
        opacity: 0.7;
        min-height: 28px;
    }
    body.view-list #boardGrid .tc-empty { padding-left: 28px; }
    #boardGrid,
    #boardGrid .column-body,
    #boardGrid .tasks-list {
        overflow-x: hidden;
        max-width: 100%;
    }
    #boardGrid .task-card.tcard:active { transform: none; background: var(--bg-subtle); }
    #boardGrid .tc-sec-head {
        padding: 0 2px 4px;
        margin: 0;
    }
    #boardGrid .tc-sec-title {
        font-size: var(--fs-sm);
    }
    #boardGrid .backlog-group-head,
    #colOther .backlog-group-head {
        font-size: 11px;
        padding: 6px 4px 2px;
    }
}
@media (min-width: 1025px) {
    #boardGrid .tcard .tc-btn .tc-btn-short { display: none; }
}

/* ================= Раскрытая задача: внутренность (строка на компьютере + шторка на телефоне) ================= */
#boardGrid .tcard .task-drawer {
    border-top: 0; background: transparent; gap: 0; cursor: default;
    padding: 6px 12px 12px 30px; margin-top: 2px;
}
html[data-theme="dark"] #boardGrid .tcard .task-drawer { background: transparent; }
:is(#boardGrid, #taskSheetBody) .ti {
    --ti-acc: var(--accent);
    --ti-acc-soft: var(--accent-soft);
    display: flex; flex-direction: column; gap: 10px; min-width: 0; cursor: default;
}
:is(#boardGrid, #taskSheetBody) .ti.is-quick { --ti-acc: var(--warning); --ti-acc-soft: var(--warning-soft); }
:is(#boardGrid, #taskSheetBody) .ti.is-life { --ti-acc: var(--life, #0f766e); --ti-acc-soft: rgba(15, 118, 110, .12); }
html[data-theme="dark"] :is(#boardGrid, #taskSheetBody) .ti.is-life { --ti-acc: #2dd4bf; --ti-acc-soft: rgba(45, 212, 191, .14); }

/* описание */
:is(#boardGrid, #taskSheetBody) .ti-desc { position: relative; max-width: 68ch; }
:is(#boardGrid, #taskSheetBody) .ti-desc-t {
    font-size: var(--fs-sm); line-height: 1.55; color: var(--text-secondary); white-space: pre-wrap; overflow-wrap: anywhere;
    cursor: text; border-radius: 6px; margin: -2px -6px; padding: 2px 6px; transition: background .15s;
}
:is(#boardGrid, #taskSheetBody) .ti-desc-t:hover { background: var(--bg-subtle); }
:is(#boardGrid, #taskSheetBody) .ti-desc-edit {
    width: 100%; max-width: 68ch; resize: vertical; font: inherit; font-size: var(--fs-sm); line-height: 1.55;
    padding: 7px 9px; border-radius: 8px; border: 1px solid var(--ti-acc, var(--accent)); background: var(--bg-panel); color: var(--text-primary);
    outline: none; box-shadow: 0 0 0 3px var(--ti-acc-soft, var(--accent-soft));
}
:is(#boardGrid, #taskSheetBody) .ti-audio { margin: 0; }
:is(#boardGrid, #taskSheetBody) .ti-audio-l { font-size: var(--fs-xs); color: var(--text-secondary); font-weight: 600; }

/* шаги — компактный чек-лист */
:is(#boardGrid, #taskSheetBody) .ti-steps { display: flex; flex-direction: column; gap: 0; background: transparent; border: 0; padding: 0; margin: 0; }
:is(#boardGrid, #taskSheetBody) .ti-steps-head { display: flex; align-items: center; gap: 8px; padding: 0 0 4px; }
:is(#boardGrid, #taskSheetBody) .ti-steps-t { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
:is(#boardGrid, #taskSheetBody) .ti-steps-n { font-size: var(--fs-xs); font-weight: 650; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
:is(#boardGrid, #taskSheetBody) .ti-steps-bar { display: none; flex: 1; max-width: 160px; height: 4px; border-radius: 99px; background: var(--bg-subtle); overflow: hidden; }
:is(#boardGrid, #taskSheetBody) .ti-steps-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ti-acc); }
:is(#boardGrid, #taskSheetBody) .ti-step-list { display: flex; flex-direction: column; }
:is(#boardGrid, #taskSheetBody) .ti .ti-step {
    display: flex; align-items: flex-start; gap: 4px; padding: 0 2px 0 0; margin: 0;
    background: transparent; border: 0; border-radius: 7px; color: var(--text-primary); font-size: var(--fs-sm); cursor: default;
}
:is(#boardGrid, #taskSheetBody) .ti .ti-step:hover, :is(#boardGrid, #taskSheetBody) .ti .ti-step:focus-within { background: var(--bg-subtle); }
:is(#boardGrid, #taskSheetBody) .ti .ti-step-main { display: flex; align-items: flex-start; gap: 9px; flex: 1; min-width: 0; padding: 5px 6px; cursor: pointer; }
:is(#boardGrid, #taskSheetBody) .ti .ti-step-t { line-height: 1.4; color: var(--text-primary); overflow-wrap: anywhere; }
:is(#boardGrid, #taskSheetBody) .ti .ti-step.done .ti-step-t { color: var(--text-muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-muted) 70%, transparent); }
:is(#boardGrid, #taskSheetBody) .ti .ti-cb {
    -webkit-appearance: none; appearance: none; flex-shrink: 0; width: 16px; height: 16px; margin: 2px 0 0; padding: 0;
    border: 1.6px solid color-mix(in srgb, var(--text-muted) 70%, transparent); border-radius: 5px; background: var(--bg-panel);
    display: inline-grid; place-content: center; cursor: pointer; transition: background .12s, border-color .12s;
}
:is(#boardGrid, #taskSheetBody) .ti .ti-cb::after {
    content: ''; width: 8px; height: 4px; border: solid #fff; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .12s;
}
:is(#boardGrid, #taskSheetBody) .ti .ti-cb:hover { border-color: var(--ti-acc); }
:is(#boardGrid, #taskSheetBody) .ti .ti-cb:checked { background: var(--ti-acc); border-color: var(--ti-acc); }
:is(#boardGrid, #taskSheetBody) .ti .ti-cb:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
:is(#boardGrid, #taskSheetBody) .ti .ti-step.done .ti-cb:checked { opacity: .7; }
:is(#boardGrid, #taskSheetBody) .ti .ti-cb:focus-visible { outline: 2px solid var(--ti-acc); outline-offset: 2px; }
:is(#boardGrid, #taskSheetBody) .ti .ti-step-del {
    flex-shrink: 0; width: 26px; height: 26px; margin: 2px 0 0; padding: 0; border: 0; border-radius: 6px; background: transparent;
    color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .12s;
}
:is(#boardGrid, #taskSheetBody) .ti .ti-step-del svg { width: 13px; height: 13px; }
:is(#boardGrid, #taskSheetBody) .ti .ti-step:hover .ti-step-del,
:is(#boardGrid, #taskSheetBody) .ti .ti-step:focus-within .ti-step-del,
:is(#boardGrid, #taskSheetBody) .ti .ti-step-del:focus-visible { opacity: 1; }
:is(#boardGrid, #taskSheetBody) .ti .ti-step-del:hover { color: var(--danger); background: var(--danger-soft); }

/* добавить шаг */
:is(#boardGrid, #taskSheetBody) .ti .ti-add { position: relative; display: flex; align-items: center; margin: 2px 0 0; }
:is(#boardGrid, #taskSheetBody) .ti .ti-add-plus {
    position: absolute; left: 6px; width: 16px; text-align: center; font-size: 16px; line-height: 1; color: var(--text-muted); pointer-events: none;
}
:is(#boardGrid, #taskSheetBody) .ti .ti-add input[type="text"] {
    width: 100%; height: 32px; padding: 4px 40px 4px 31px; font: inherit; font-size: var(--fs-sm); color: var(--text-primary);
    background: transparent; border: 1px solid transparent; border-radius: 7px; box-shadow: none; outline: none;
}
:is(#boardGrid, #taskSheetBody) .ti .ti-add input[type="text"]::placeholder { color: var(--text-muted); }
:is(#boardGrid, #taskSheetBody) .ti .ti-add input[type="text"]:hover { background: var(--bg-subtle); }
:is(#boardGrid, #taskSheetBody) .ti .ti-add input[type="text"]:focus { background: var(--bg-panel); border-color: var(--ti-acc); box-shadow: 0 0 0 3px var(--ti-acc-soft); }
:is(#boardGrid, #taskSheetBody) .ti .ti-add .input-mic-btn { right: 3px; width: 28px; height: 28px; border-radius: 6px; color: var(--text-muted); }
:is(#boardGrid, #taskSheetBody) .ti .ti-add .input-mic-btn:hover { color: var(--ti-acc); background: var(--ti-acc-soft); }
:is(#boardGrid, #taskSheetBody) .ti .ti-add .input-mic-btn svg, :is(#boardGrid, #taskSheetBody) .ti .ti-add .input-mic-btn .icon { width: 15px; height: 15px; }

/* панель действий */
:is(#boardGrid, #taskSheetBody) .ti .ti-bar { padding: 0; margin: 0; border: 0; background: none; display: block; }
:is(#boardGrid, #taskSheetBody) .ti .ti-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
:is(#boardGrid, #taskSheetBody) .ti .ti-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; margin: 0;
    font: inherit; font-size: var(--fs-xs); font-weight: 600; line-height: 1; white-space: nowrap;
    color: var(--text-secondary); background: transparent; border: 1px solid transparent; border-radius: 7px; box-shadow: none; cursor: pointer;
}
:is(#boardGrid, #taskSheetBody) .ti .ti-chip svg, :is(#boardGrid, #taskSheetBody) .ti .ti-chip .icon { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted); }
:is(#boardGrid, #taskSheetBody) .ti button.ti-chip:hover { background: var(--bg-subtle); color: var(--text-primary); border-color: transparent; }
:is(#boardGrid, #taskSheetBody) .ti button.ti-chip:hover svg { color: var(--text-primary); }
:is(#boardGrid, #taskSheetBody) .ti .ti-chip.has-value { color: var(--ti-acc); }
:is(#boardGrid, #taskSheetBody) .ti .ti-chip.has-value svg { color: var(--ti-acc); }
:is(#boardGrid, #taskSheetBody) .ti .ti-chip:focus-visible { outline: 2px solid var(--ti-acc); outline-offset: 1px; }
:is(#boardGrid, #taskSheetBody) .ti .ti-est { cursor: default; color: var(--text-muted); }
:is(#boardGrid, #taskSheetBody) .ti .ti-move { margin-left: auto; }
:is(#boardGrid, #taskSheetBody) .ti .ti-del { width: 28px; padding: 0; justify-content: center; color: var(--danger); background: transparent; border: 0; }
:is(#boardGrid, #taskSheetBody) .ti .ti-del svg { color: var(--danger); }
:is(#boardGrid, #taskSheetBody) .ti button.ti-del:hover { background: var(--danger-soft); }

/* --- Список: минимально, тонкие разделители --- */
body.view-list :is(#boardGrid, #taskSheetBody) .ti .ti-step-list { border-top: 1px solid var(--border-subtle); }
body.view-list :is(#boardGrid, #taskSheetBody) .ti .ti-step { border-bottom: 1px solid var(--border-subtle); border-radius: 0; }
body.view-list :is(#boardGrid, #taskSheetBody) .ti .ti-bar { border-top: 1px solid var(--border-subtle); padding-top: 6px; }
body.view-list :is(#boardGrid, #taskSheetBody) .ti .ti-chips { margin-left: -9px; }

/* --- Карточки: мягкая внутренняя поверхность, полоса прогресса, акцент полосы карточки --- */
body.view-cards #boardGrid .tcard .task-drawer { margin: 4px -10px -10px -14px; padding: 0 10px 10px 14px; }
body.view-cards :is(#boardGrid, #taskSheetBody) .ti {
    background: var(--bg-subtle); border-radius: 12px; padding: 12px 12px 8px; gap: 10px;
}
html[data-theme="dark"] body.view-cards :is(#boardGrid, #taskSheetBody) .ti { background: #111111; border-color: #2a2a2a; }
body.view-cards #boardGrid .ti { margin-left: 28px; }
body.view-cards :is(#boardGrid, #taskSheetBody) .ti .ti-steps-bar { display: block; }
body.view-cards :is(#boardGrid, #taskSheetBody) .ti .ti-steps-n { order: 3; margin-left: auto; color: var(--ti-acc); }
body.view-cards :is(#boardGrid, #taskSheetBody) .ti .ti-steps-bar { max-width: none; order: 2; }
body.view-cards :is(#boardGrid, #taskSheetBody) .ti .ti-step:hover, body.view-cards :is(#boardGrid, #taskSheetBody) .ti .ti-step:focus-within { background: var(--bg-panel); }
body.view-cards :is(#boardGrid, #taskSheetBody) .ti .ti-add input[type="text"] { background: var(--bg-panel); border-color: var(--border-subtle); }
body.view-cards :is(#boardGrid, #taskSheetBody) .ti .ti-chip:not(.ti-est):not(.ti-del) { background: var(--bg-panel); border-color: var(--border-subtle); border-radius: 99px; }
body.view-cards :is(#boardGrid, #taskSheetBody) .ti .ti-chip.has-value { background: var(--ti-acc-soft); border-color: transparent; }
body.view-cards :is(#boardGrid, #taskSheetBody) .ti .ti-bar { border-top: 1px solid var(--border-subtle); padding-top: 8px; }

/* --- Планер: плотно, слева мета, справа шаги (компьютер) --- */
body.view-planner #boardGrid .tcard .task-drawer { padding: 4px 10px 10px 0; margin: 0; }
body.view-planner #boardGrid .ti {
    display: grid; grid-template-columns: 172px minmax(0, 1fr); grid-template-areas: "side desc" "side audio" "side steps";
    align-items: start; column-gap: 0; row-gap: 8px;
}
body.view-planner #boardGrid .ti.no-desc { grid-template-areas: "side audio" "side steps"; }
body.view-planner #boardGrid .ti > .ti-desc { grid-area: desc; padding-left: 14px; }
body.view-planner #boardGrid .ti > .ti-audio { grid-area: audio; margin-left: 14px; }
body.view-planner #boardGrid .ti > .ti-steps { grid-area: steps; padding-left: 14px; }
body.view-planner #boardGrid .ti > .ti-bar { grid-area: side; align-self: stretch; border-right: 1px solid var(--border-subtle); padding: 0 8px 0 10px; }
body.view-planner #boardGrid .ti .ti-chips { flex-direction: column; align-items: stretch; gap: 1px; }
body.view-planner #boardGrid .ti .ti-chip { height: 26px; padding: 0 6px; border-radius: 5px; width: 100%; justify-content: flex-start; overflow: hidden; text-overflow: ellipsis; }
body.view-planner #boardGrid .ti .ti-chip > span { overflow: hidden; text-overflow: ellipsis; }
body.view-planner #boardGrid .ti .ti-move { margin-left: 0; margin-top: 4px; border-top: 1px dashed var(--border-subtle); border-radius: 0 0 5px 5px; }
body.view-planner :is(#boardGrid, #taskSheetBody) .ti .ti-step { border-radius: 0; border-bottom: 1px dashed var(--border-subtle); }
body.view-planner :is(#boardGrid, #taskSheetBody) .ti .ti-step-main { padding: 3px 4px; gap: 8px; }
body.view-planner :is(#boardGrid, #taskSheetBody) .ti .ti-step-t { font-size: var(--fs-xs); line-height: 1.45; }
body.view-planner :is(#boardGrid, #taskSheetBody) .ti .ti-step-del { width: 22px; height: 22px; margin-top: 1px; }
body.view-planner :is(#boardGrid, #taskSheetBody) .ti .ti-cb { width: 14px; height: 14px; border-radius: 4px; margin-top: 1px; }
body.view-planner :is(#boardGrid, #taskSheetBody) .ti .ti-cb::after { width: 7px; height: 3.5px; }
body.view-planner :is(#boardGrid, #taskSheetBody) .ti .ti-add input[type="text"] { height: 28px; font-size: var(--fs-xs); }
body.view-planner :is(#boardGrid, #taskSheetBody) .ti .ti-steps-n { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
body.view-planner :is(#boardGrid, #taskSheetBody) .ti .ti-desc-t { font-size: var(--fs-xs); line-height: 1.5; }
/* шторка (телефон) в планере — стопкой: мета-сетка 2 колонки */
body.view-planner #taskSheetBody .ti .ti-bar { border: 1px solid var(--border-subtle); border-radius: 8px; padding: 2px; }
body.view-planner #taskSheetBody .ti .ti-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
body.view-planner #taskSheetBody .ti .ti-chip { border-radius: 6px; justify-content: flex-start; height: 34px; }
body.view-planner #taskSheetBody .ti .ti-move { margin-left: 0; }
body.view-planner #taskSheetBody .ti .ti-del { width: auto; justify-content: flex-start; padding: 0 9px; }

/* шторка: отступы и крупнее цели касания */
#taskSheetBody .ti { margin-top: 4px; }
@media (max-width: 1024px) {
    #taskSheetBody .ti {
        min-width: 0;
        max-width: 100%;
    }
    body.view-list #taskSheetBody .ti .ti-chips {
        margin-left: 0;
        gap: 6px;
    }
    body.view-cards #taskSheetBody .ti {
        padding: 14px 12px 10px;
        gap: 12px;
    }
    body.view-planner #taskSheetBody .ti .ti-bar {
        border-radius: 10px;
        padding: 6px;
        margin-top: 4px;
    }
    body.view-planner #taskSheetBody .ti .ti-chips {
        gap: 6px;
    }
    body.view-planner #taskSheetBody .ti .ti-chip {
        height: 38px;
        padding: 0 10px;
        border-radius: 8px;
    }
    body.view-planner #taskSheetBody .ti .ti-del {
        padding: 0 12px;
        min-height: 38px;
    }
    body.view-planner #taskSheetBody .ti .ti-step-del,
    body.view-planner :is(#boardGrid, #taskSheetBody) .ti .ti-step-del {
        width: 36px;
        height: 36px;
        min-width: 36px;
        margin-top: 0;
    }
    body.view-planner #taskSheetBody .ti .ti-cb,
    body.view-planner :is(#boardGrid, #taskSheetBody) .ti .ti-cb {
        width: 18px;
        height: 18px;
    }
    #taskSheetBody .ti .ti-step-list { padding: 0 2px; }
    #taskSheetBody .ti .ti-step { padding-right: 2px; }
    #taskSheetBody .ti .ti-step-main {
        padding: 10px 4px 10px 6px;
        min-width: 0;
        gap: 10px;
    }
    #taskSheetBody .ti .ti-step-t {
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
        line-height: 1.4;
    }
    #taskSheetBody .ti .ti-step-del {
        width: 36px;
        height: 36px;
        min-width: 36px;
        margin-right: 0;
        opacity: 0.65;
        flex-shrink: 0;
    }
    #taskSheetBody .ti .ti-cb {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    #taskSheetBody .ti .ti-chip {
        height: 36px;
        font-size: var(--fs-sm);
        padding: 0 10px;
    }
    #taskSheetBody .ti .ti-add input[type="text"] {
        height: 42px;
        font-size: 16px;
    }
}
@media (hover: none) and (pointer: coarse) {
    :is(#boardGrid, #taskSheetBody) .ti .ti-step-del { opacity: .55; }
}
:is(#boardGrid, #taskSheetBody) .ti .ti-del-t { display: none; }
body.view-planner #taskSheetBody .ti .ti-del-t { display: inline; color: var(--danger); }

/* ===== Переименование: только по карандашу; клик по названию раскрывает задачу ===== */
#boardGrid .tcard .tc-title, #boardGrid .tcard.is-expanded .task-title, #boardGrid .tcard.is-expanded .task-title:hover { cursor: pointer; border-bottom: 0; }
#boardGrid .tcard .tc-rename svg { width: 15px; height: 15px; }
#boardGrid .tcard .tc-rename:hover { color: var(--accent); background: var(--accent-soft); }
#boardGrid .tcard.is-renaming .tc-acts .tc-reveal { display: none; }
:is(#boardGrid, #taskSheetBody) .task-title-edit {
    display: block; width: 100%; min-width: 0; margin: -3px 0 -3px -7px; padding: 3px 7px; font: inherit; font-weight: 650;
    font-size: var(--fs-base); line-height: 1.35; color: var(--text-primary); background: var(--bg-panel);
    border: 1px solid var(--accent); border-radius: 7px; outline: none; box-shadow: 0 0 0 3px var(--accent-soft);
}
body.view-planner #boardGrid .task-title-edit { font-size: var(--fs-sm); flex: 1; }
body.realm-life :is(#boardGrid, #taskSheetBody) .task-title-edit { border-color: var(--life, #0f766e); box-shadow: 0 0 0 3px rgba(15, 118, 110, .14); }
#taskSheetBody .task-sheet-title-row { display: flex; align-items: flex-start; gap: 6px; }
#taskSheetBody .task-sheet-title-row .task-sheet-title { flex: 1; min-width: 0; }
#taskSheetBody .task-title-edit.is-sheet { font-size: var(--fs-lg); font-weight: 750; margin: -4px 0 -4px -8px; padding: 4px 8px; }
#taskSheetBody .task-sheet-rename {
    flex-shrink: 0; width: 34px; height: 34px; margin: -4px -6px 0 0; padding: 0; border: 0; border-radius: 9px; background: transparent;
    color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
#taskSheetBody .task-sheet-rename svg { width: 17px; height: 17px; }
#taskSheetBody .task-sheet-rename:hover, #taskSheetBody .task-sheet-rename:active { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 1024px) {
    #boardGrid .tcard .tc-acts .tc-rename { display: none !important; }
}
