/* TaskFlow */

.taskflow-hidden {
  display: none;
}

/* ribbon badge */
.taskflow-ribbon {
  position: relative;
}
.taskflow-ribbon-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: var(--color-red);
  color: var(--text-on-accent);
  font-size: 9px;
  line-height: 14px;
  text-align: center;
  pointer-events: none;
}
.taskflow-ribbon-badge:empty {
  display: none;
}

/* inbox view */
.taskflow-view {
  padding: var(--size-4-3);
  overflow-y: auto;
}
.taskflow-inbox-header {
  display: flex;
  align-items: baseline;
  gap: var(--size-4-2);
  margin-bottom: var(--size-4-3);
}
.taskflow-inbox-header h4 {
  margin: 0;
}
.taskflow-count {
  color: var(--text-muted);
  font-size: var(--font-ui-small);
}
.taskflow-empty {
  color: var(--text-muted);
  padding: var(--size-4-4) 0;
}

.taskflow-card {
  border: 1px solid var(--background-modifier-border);
  border-radius: var(--radius-m);
  padding: var(--size-4-2) var(--size-4-3);
  margin-bottom: var(--size-4-2);
  background: var(--background-primary);
}
.taskflow-card-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--size-4-2);
}
/* Входящие: «Прояснить» и «⋯» — у правого края строки названия; поля — строкой ниже по раскрытию */
.taskflow-card-main-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--size-4-1);
  margin-left: auto;
}
.taskflow-card-more {
  font-size: var(--font-ui-medium);
  line-height: 1;
}
.taskflow-card-more.is-active {
  color: var(--text-accent);
}
.taskflow-card-top + .taskflow-card-actions {
  margin-top: var(--size-4-2);
}
.taskflow-title {
  font-weight: var(--font-medium);
  cursor: pointer;
}
.taskflow-title:hover {
  color: var(--text-accent);
  text-decoration: underline;
}
.taskflow-error-badge {
  cursor: help;
}
.taskflow-chip {
  font-size: var(--font-ui-smaller);
  padding: 0 var(--size-4-1);
  border-radius: var(--radius-s);
  background: var(--background-secondary);
  color: var(--text-muted);
  white-space: nowrap;
}
.taskflow-context {
  color: var(--text-accent);
}

.taskflow-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-4-1);
  align-items: center;
}
.taskflow-input {
  font-size: var(--font-ui-small);
  width: 130px;
}
/* подсказка «Срок… (например, завтра)» целиком */
.taskflow-input.taskflow-due-input {
  width: 190px;
}
.taskflow-select {
  font-size: var(--font-ui-small);
}
.taskflow-danger {
  color: var(--text-error);
}

/* кликабельный бейдж статуса */
.taskflow-status-chip {
  font-size: var(--font-ui-smaller);
  line-height: 1.5;
  height: auto;
  padding: 0 var(--size-4-1);
  border-radius: var(--radius-s);
  background: var(--background-secondary);
  border: 1px solid var(--background-modifier-border);
  color: var(--text-muted);
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
}
/* статуса нет в настройках: «⚠ значение» предупреждающим цветом (бейдж, селект, колонка доски) */
.taskflow-status-chip.is-unknown,
.taskflow-select.is-unknown,
.taskflow-column.is-unknown > .taskflow-column-header {
  color: var(--text-warning);
}
.taskflow-status-chip.is-unknown,
.taskflow-select.is-unknown {
  border-color: var(--text-warning);
}
.taskflow-status-chip:hover {
  color: var(--text-accent);
  border-color: var(--text-accent);
}

/* board */
.taskflow-board-view {
  display: flex;
  flex-direction: column;
  padding: var(--size-4-2);
}
.taskflow-board {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.taskflow-board-header {
  display: flex;
  gap: var(--size-4-2);
  margin-bottom: var(--size-4-2);
  flex-wrap: wrap;
}
.taskflow-board-columns {
  display: flex;
  gap: var(--size-4-2);
  overflow-x: auto;
  flex: 1;
  min-height: 0;
  align-items: flex-start;
}
.taskflow-column {
  flex: 0 0 260px;
  max-height: 100%;
  overflow-y: auto;
  background: var(--background-secondary);
  border-radius: var(--radius-m);
  padding: var(--size-4-2);
}
.taskflow-column.is-drag-over {
  outline: 2px dashed var(--interactive-accent);
  outline-offset: -2px;
}
.taskflow-column-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: var(--font-semibold);
  font-size: var(--font-ui-small);
  padding: 0 var(--size-4-1) var(--size-4-2);
  position: sticky;
  top: 0;
  background: var(--background-secondary);
  z-index: 1;
}
.taskflow-column-empty {
  font-size: var(--font-ui-smaller);
  padding: var(--size-4-2);
}
.taskflow-group-header {
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
  font-weight: var(--font-semibold);
  margin: var(--size-4-2) var(--size-4-1) var(--size-4-1);
}

.taskflow-bcard {
  background: var(--background-primary);
  border: 1px solid var(--background-modifier-border);
  border-radius: var(--radius-m);
  padding: var(--size-4-2);
  margin-bottom: var(--size-4-2);
  cursor: grab;
  position: relative; /* для всплывающих ▶ и ⋯ */
}
/* ▶ и ⋯ — поверх правого верхнего угла: при наведении и фокусе с клавиатуры, места в карточке не занимают */
.taskflow-bcard-hover {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  gap: 2px;
  padding: 1px;
  border-radius: var(--radius-s);
  background: var(--background-primary);
  box-shadow: var(--shadow-s);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease-in-out;
}
/* длинное название уходит под кнопки плавно, а не обрывается */
.taskflow-bcard-hover::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 100%;
  width: 24px;
  background: linear-gradient(to right, transparent, var(--background-primary));
  pointer-events: none;
}
.taskflow-bcard:hover .taskflow-bcard-hover,
.taskflow-bcard:focus-within .taskflow-bcard-hover {
  opacity: 1;
  pointer-events: auto;
}
/* без наведения (телефон, планшет) — всегда видны; место под них зарезервировано, чтобы не закрывать название */
@media (hover: none) {
  .taskflow-bcard-hover {
    opacity: 1;
    pointer-events: auto;
  }
  .taskflow-bcard-hover::before {
    display: none;
  }
  .taskflow-bcard-title-row {
    padding-right: 56px;
  }
}
.taskflow-bcard.is-overdue {
  border-left: 3px solid var(--color-red);
}
.taskflow-bcard-crumb {
  font-size: var(--font-ui-smaller);
  color: var(--text-faint);
  margin-bottom: 2px;
}
.taskflow-bcard-title-row {
  display: flex;
  align-items: center;
  gap: var(--size-4-1);
}
.taskflow-bcard-title-row .taskflow-title {
  min-width: 0;
  overflow-wrap: anywhere;
}
.taskflow-bcard-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--size-4-1);
  margin-top: var(--size-4-1);
}
.taskflow-bcard-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--size-4-1);
  flex: none;
  margin-left: auto;
  white-space: nowrap;
}
.taskflow-due.is-overdue,
.taskflow-bell.is-overdue {
  background: rgba(var(--color-red-rgb), 0.15);
  color: var(--color-red);
}
.taskflow-bell {
  cursor: pointer;
}
/* теги — «пилюлей» в цветах тегов Obsidian: не спутать с чипами @контекстов */
.taskflow-tag {
  background: var(--tag-background, var(--background-modifier-hover));
  color: var(--tag-color, var(--text-accent));
  border-radius: var(--tag-radius, 2em);
  padding: 0 var(--size-4-2);
}
.taskflow-tag-more {
  color: var(--text-muted);
  background: var(--background-secondary);
}
.taskflow-icon-btn {
  padding: 0 var(--size-4-1);
  background: transparent;
  box-shadow: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--font-ui-small);
}
.taskflow-icon-btn:hover {
  color: var(--text-normal);
}
.taskflow-progress {
  display: inline-flex;
  align-items: center;
  gap: var(--size-4-1);
}
/* на карточке доски прогресс — кнопка раскрытия подзадач, без рамки кнопки */
button.taskflow-progress-toggle {
  height: auto;
  padding: 0 2px;
  background: none;
  border: none;
  box-shadow: none;
  cursor: default;
}
button.taskflow-progress-toggle.is-expandable {
  cursor: pointer;
}
button.taskflow-progress-toggle.is-expandable:hover {
  background: var(--background-modifier-hover);
}
.taskflow-progress-caret {
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
}
.taskflow-progress-text {
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
}
.taskflow-progress-bar {
  display: inline-block;
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: var(--background-modifier-border);
  overflow: hidden;
}
.taskflow-progress-fill {
  display: block;
  height: 100%;
  background: var(--interactive-accent);
}

.taskflow-bcard-details {
  margin-top: var(--size-4-2);
  border-top: 1px solid var(--background-modifier-border);
  padding-top: var(--size-4-2);
}
.taskflow-subtask {
  display: flex;
  align-items: center;
  gap: var(--size-4-1);
  padding: 2px 0;
  font-size: var(--font-ui-small);
  cursor: pointer;
}
.taskflow-subtask-heading {
  font-weight: var(--font-medium);
}
.taskflow-subtask-nested {
  padding-left: var(--size-4-4);
}
.taskflow-subtask-text.is-done {
  text-decoration: line-through;
  color: var(--text-muted);
}
.taskflow-children-heading {
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
  font-weight: var(--font-semibold);
  margin-top: var(--size-4-2);
}
.taskflow-child {
  display: flex;
  align-items: center;
  gap: var(--size-4-1);
  padding: 2px 0;
  font-size: var(--font-ui-small);
  cursor: pointer;
}
.taskflow-child:hover .taskflow-subtask-text {
  color: var(--text-accent);
}

/* today sidebar */
.taskflow-today-section {
  margin-bottom: var(--size-4-4);
}
.taskflow-today-section h5 {
  margin: 0 0 var(--size-4-2);
}
.taskflow-overdue-heading {
  color: var(--color-red);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--size-4-2);
}
/* «Все на сегодня» — скромная кнопка в заголовке «Просроченные» */
.taskflow-overdue-all {
  font-size: var(--font-ui-smaller);
  font-weight: normal;
  padding: 0 var(--size-4-2);
  height: auto;
  color: var(--text-muted);
}
/* просроченная — одной строкой: срок по-человечески и быстрые переносы справа, группа не разрывается */
.taskflow-overdue-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex: none;
}
/* название сжимается и переносится внутри, кнопки остаются на строке названия */
.taskflow-today-item.taskflow-overdue-item .taskflow-title {
  flex: 1 1 0;
}
.taskflow-overdue-item .taskflow-status-chip.is-unknown {
  margin-left: 22px;
}
.taskflow-move-btn {
  padding: 2px;
  font-size: var(--font-ui-smaller);
  font-weight: var(--font-semibold);
  min-width: 20px;
}
.taskflow-move-btn svg {
  width: 15px;
  height: 15px;
}
.taskflow-move-btn.is-active {
  color: var(--text-accent);
}
.taskflow-date-pick {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: var(--size-4-2);
  padding-left: 22px; /* под название, мимо чекбокса */
}
.taskflow-date-pick .taskflow-input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
.taskflow-when-preview.is-bad {
  color: var(--text-warning);
}
.taskflow-notice-undo {
  margin-left: var(--size-4-1);
}
.taskflow-today-item {
  display: flex;
  align-items: center;
  gap: var(--size-4-1);
  padding: var(--size-4-1) 0;
  flex-wrap: wrap;
}
/* длинное название остаётся рядом с чекбоксом и переносится внутри; не хватает места — на новую строку уходят чипы */
.taskflow-today-item .taskflow-title {
  flex: 1 1 8em;
  min-width: 0;
  overflow-wrap: anywhere;
}
.taskflow-today-item > .taskflow-timer-btn,
.taskflow-today-item > .taskflow-timer-live {
  margin-left: auto;
}

/* calendar */
.taskflow-calendar-view {
  display: flex;
  flex-direction: column;
}
.taskflow-calendar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.taskflow-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--size-4-2);
  margin-bottom: var(--size-4-2);
  flex-wrap: wrap;
}
.taskflow-calendar-nav {
  display: flex;
  align-items: center;
  gap: var(--size-4-1);
}
/* ‹ › — обычные кнопки высотой с «Сегодня», а не узкие иконки */
.taskflow-calendar-step {
  min-width: var(--input-height, 30px);
  padding: 0 var(--size-4-2);
  font-size: var(--font-ui-medium);
  line-height: 1;
}
.taskflow-calendar-label {
  font-weight: var(--font-semibold);
  margin-left: var(--size-4-2);
}
.taskflow-calendar-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--size-4-1);
  min-width: 0;
}
.taskflow-calendar-tools .taskflow-view-search {
  flex: 1 1 120px;
  min-width: 0;
}

/* Панель «Без даты» (SPEC §4): справа от сетки; в узкой основной области — под сеткой */
.taskflow-calendar {
  container-type: inline-size;
}
.taskflow-calendar-body {
  display: flex;
  gap: var(--size-4-3);
  flex: 1;
  min-height: 0;
}
.taskflow-calendar-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.taskflow-nodate-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--size-4-1);
}
.taskflow-nodate-toggle.is-active {
  color: var(--text-accent);
  border-color: var(--interactive-accent);
}
.taskflow-nodate {
  flex: 0 0 230px;
  display: flex;
  flex-direction: column;
  gap: var(--size-4-1);
  min-height: 0;
  padding: var(--size-4-2);
  border: 1px solid var(--background-modifier-border);
  border-radius: var(--radius-m);
  background: var(--background-secondary);
}
.taskflow-nodate.is-drag-over {
  border-color: var(--interactive-accent);
  background: rgba(var(--color-accent-rgb), 0.08);
}
.taskflow-nodate-head {
  display: flex;
  align-items: center;
  gap: var(--size-4-1);
}
.taskflow-nodate-title {
  font-weight: var(--font-semibold);
}
.taskflow-nodate-group {
  margin-left: auto;
  font-size: var(--font-ui-smaller);
}
.taskflow-nodate-filter {
  width: 100%;
  font-size: var(--font-ui-small);
}
.taskflow-nodate-inbox {
  display: flex;
  align-items: center;
  gap: var(--size-4-1);
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
}
.taskflow-nodate-hint,
.taskflow-nodate-drop {
  font-size: var(--font-ui-smaller);
  color: var(--text-faint);
}
.taskflow-nodate-drop {
  color: var(--text-accent);
  padding: var(--size-4-2) 0;
  text-align: center;
}
.taskflow-nodate-list {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}
.taskflow-nodate-grouphead {
  margin-top: var(--size-4-2);
  font-size: var(--font-ui-smaller);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
}
.taskflow-nodate-item {
  display: flex;
  align-items: center;
  gap: var(--size-4-1);
  padding: 2px var(--size-4-1);
  border-radius: var(--radius-s);
  cursor: grab;
}
.taskflow-nodate-item:hover {
  background: var(--background-modifier-hover);
}
.taskflow-nodate-item .taskflow-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-ui-small);
}
.taskflow-nodate-more {
  padding: 0 2px;
  opacity: 0.5;
}
.taskflow-nodate-item:hover .taskflow-nodate-more,
.taskflow-nodate-more:focus-visible {
  opacity: 1;
}
@media (hover: none) {
  .taskflow-nodate-more {
    opacity: 1;
  }
}
/* узкая основная область (телефон): сначала сетка, панель «Без даты» — под ней, список невысокий */
@container (max-width: 640px) {
  .taskflow-calendar-body {
    flex-direction: column;
    justify-content: flex-start;
  }
  .taskflow-nodate {
    flex: none;
  }
  .taskflow-nodate-list {
    max-height: 160px;
  }
}
.taskflow-calendar-overdue {
  margin-bottom: var(--size-4-2);
}
.taskflow-overdue-toggle {
  background: transparent;
  border: none;
  box-shadow: none;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--size-4-1);
}
.taskflow-overdue-items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-4-1);
  margin-top: var(--size-4-1);
}
.taskflow-calendar-weekdays,
.taskflow-calendar-row {
  display: grid;
  /* 7 дней, без выходных — 5 (SPEC §4, Календарь) */
  grid-template-columns: repeat(var(--taskflow-cal-cols, 7), minmax(0, 1fr));
  gap: 2px;
}
.taskflow-calendar-weekday {
  text-align: center;
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
  padding: var(--size-4-1) 0;
}
.taskflow-calendar-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative; /* для невидимого образца записи */
}
.taskflow-calendar-row {
  min-height: 90px;
}
/* месяц: строки одной высоты на всю область — ячейка не растёт от записей, лишнее уходит в «+N ещё»;
   90px вмещают шапку и три строки записей */
.taskflow-calendar-grid:not(.is-week) .taskflow-calendar-row {
  flex: 1 1 0;
}
/* режим «День»: список дня — сам вид, крупнее и с местом для перетаскивания */
.taskflow-calendar-daypanel.is-dayview {
  flex: 1;
  min-height: 160px;
  max-height: none;
  border-top: none;
  margin-top: 0;
  overflow-y: auto;
  padding: var(--size-4-2) var(--size-4-3);
  border-radius: var(--radius-m);
  background: var(--background-secondary);
}
.taskflow-calendar-daypanel.is-dayview .taskflow-daypanel-item {
  padding: var(--size-4-2) var(--size-4-1);
  border-bottom: 1px solid var(--background-modifier-border);
}
.taskflow-calendar-daypanel.is-dayview.is-drag-over {
  outline: 2px dashed var(--interactive-accent);
}
.taskflow-calendar-grid.is-week .taskflow-calendar-row {
  min-height: 220px;
}
.taskflow-calendar-day {
  background: var(--background-secondary);
  border-radius: var(--radius-s);
  padding: var(--size-4-1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}
.taskflow-calendar-day.is-out {
  opacity: 0.45;
}
.taskflow-calendar-day.is-today .taskflow-calendar-daynum {
  background: var(--interactive-accent);
  color: var(--text-on-accent);
}
.taskflow-calendar-day.is-selected {
  outline: 2px solid var(--interactive-accent);
  outline-offset: -2px;
}
.taskflow-calendar-day.is-drag-over {
  outline: 2px dashed var(--interactive-accent);
  outline-offset: -2px;
}
.taskflow-calendar-daynum {
  align-self: flex-start;
  min-width: 18px;
  text-align: center;
  border-radius: 9px;
  font-size: var(--font-ui-smaller);
  padding: 0 3px;
}
.taskflow-cal-entry {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  flex: none;
  font-size: var(--font-ui-smaller);
  background: var(--background-primary);
  border-left: 2px solid var(--interactive-accent);
  border-radius: var(--radius-s);
  padding: 0 var(--size-4-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: grab;
}
.taskflow-cal-entry-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* input[type=checkbox] у Obsidian задаёт свой размер — уточняем селектор, чтобы чекбокс был по строке */
input[type="checkbox"].taskflow-cal-check {
  --checkbox-size: 12px;
  flex: none;
  margin: 0;
  width: 12px;
  height: 12px;
  cursor: pointer;
}
/* узкая ячейка месяца: чекбоксы прячутся, чтобы названию осталось место */
.taskflow-calendar-grid.is-tight .taskflow-cal-entry .taskflow-cal-check {
  display: none;
}
.taskflow-cal-entry.is-done {
  color: var(--text-muted);
  opacity: 0.75;
  border-left-color: var(--background-modifier-border);
}
.taskflow-cal-entry.is-done .taskflow-cal-entry-title {
  text-decoration: line-through;
}
/* невидимый образец записи: по нему меряется высота строки и ширина ~10 символов названия */
.taskflow-cal-entry.taskflow-cal-probe {
  position: absolute;
  top: 0;
  left: 0;
  width: max-content;
  visibility: hidden;
  pointer-events: none;
}
/* «+N ещё» и счётчик узкой ячейки — открывают список дня (селектор с .taskflow-calendar — сильнее стиля кнопок Obsidian) */
.taskflow-calendar .taskflow-cal-more,
.taskflow-calendar .taskflow-cal-count {
  flex: none;
  height: auto;
  background: none;
  border: none;
  box-shadow: none;
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
  cursor: pointer;
}
.taskflow-calendar .taskflow-cal-more {
  align-self: stretch;
  padding: 0 var(--size-4-1);
  text-align: left;
  justify-content: flex-start;
}
.taskflow-calendar .taskflow-cal-more:hover,
.taskflow-calendar .taskflow-cal-count:hover {
  color: var(--text-accent);
}
.taskflow-calendar .taskflow-cal-count {
  align-self: flex-start;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--background-modifier-hover);
}
.taskflow-daypanel-item.is-done .taskflow-title {
  text-decoration: line-through;
  color: var(--text-muted);
}
/* компактная плотность: меньше отступы, шрифт и высота строк */
.taskflow-calendar.is-compact .taskflow-calendar-day {
  padding: 2px;
  gap: 1px;
}
.taskflow-calendar.is-compact .taskflow-cal-entry {
  font-size: var(--font-ui-smallest, 11px);
  line-height: 1.2;
  padding: 0 2px;
}
.taskflow-calendar.is-compact input[type="checkbox"].taskflow-cal-check {
  --checkbox-size: 10px;
  width: 10px;
  height: 10px;
}
.taskflow-calendar.is-compact .taskflow-calendar-daynum {
  font-size: var(--font-ui-smallest, 11px);
}
.taskflow-calendar.is-compact .taskflow-calendar-row {
  min-height: 66px;
}
.taskflow-calendar.is-compact .taskflow-calendar-grid.is-week .taskflow-calendar-row {
  min-height: 160px;
}
.taskflow-cal-entry.is-scheduled {
  border-left-style: dashed;
}
.taskflow-cal-entry.is-overdue {
  border-left-color: var(--color-red);
  display: inline-block;
}
.taskflow-calendar-daypanel {
  border-top: 1px solid var(--background-modifier-border);
  padding-top: var(--size-4-2);
  margin-top: var(--size-4-2);
  max-height: 30%;
  overflow-y: auto;
}
.taskflow-calendar-daypanel-title {
  font-weight: var(--font-semibold);
  margin-bottom: var(--size-4-1);
}
.taskflow-quick-create {
  width: 100%;
  margin-top: var(--size-4-2);
}

/* inline field chips (reading view + live preview) */
.taskflow-inline-chip {
  display: inline-block;
  font-size: 0.85em;
  line-height: 1.4;
  padding: 0 var(--size-4-1);
  border-radius: var(--radius-s);
  background: var(--background-secondary);
  border: 1px solid var(--background-modifier-border);
  color: var(--text-muted);
  vertical-align: baseline;
  white-space: nowrap;
}
.taskflow-inline-chip.is-clickable {
  cursor: pointer;
}
.taskflow-inline-chip.is-clickable:hover {
  color: var(--text-accent);
  border-color: var(--text-accent);
}
.taskflow-inline-due {
  color: var(--text-normal);
}
.taskflow-inline-status {
  color: var(--text-accent);
}

/* reschedule modal */
.taskflow-reschedule-list {
  max-height: 40vh;
  overflow-y: auto;
  margin: var(--size-4-2) 0;
}
.taskflow-reschedule-item {
  display: flex;
  align-items: center;
  gap: var(--size-4-2);
  padding: var(--size-4-1) 0;
  flex-wrap: wrap;
}
.taskflow-reschedule-path {
  color: var(--text-faint);
  font-size: var(--font-ui-smaller);
}

.taskflow-cycle-badge {
  cursor: help;
}

/* weekly review */
.taskflow-review-modal {
  width: min(680px, 90vw);
}
.taskflow-review-header {
  display: flex;
  align-items: baseline;
  gap: var(--size-4-2);
}
.taskflow-review-header h4 {
  margin: 0;
}
.taskflow-review-step {
  color: var(--text-muted);
  font-size: var(--font-ui-smaller);
}
.taskflow-review-hint {
  color: var(--text-muted);
  margin: var(--size-4-1) 0 var(--size-4-2);
}
.taskflow-review-list {
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: var(--size-4-3);
}
.taskflow-review-item {
  display: flex;
  align-items: center;
  gap: var(--size-4-2);
  padding: var(--size-4-1) 0;
  border-bottom: 1px solid var(--background-modifier-border);
  flex-wrap: wrap;
}
.taskflow-review-spacer {
  flex: 1;
}
.taskflow-review-nav {
  display: flex;
  justify-content: flex-end;
  gap: var(--size-4-2);
}

/* reminders */
.taskflow-reminder-task {
  font-weight: var(--font-semibold);
}
.taskflow-reminder-row + .taskflow-reminder-row {
  border-top: 1px solid var(--background-modifier-border);
}
.taskflow-reminder-row .taskflow-reminder-task {
  margin-bottom: 0;
}
.taskflow-digest-item {
  display: flex;
  align-items: center;
  gap: var(--size-4-2);
  padding: var(--size-4-1) 0;
}

/* settings */
.taskflow-settings-board {
  margin-left: var(--size-4-4);
  border-left: 2px solid var(--background-modifier-border);
  padding-left: var(--size-4-3);
  margin-bottom: var(--size-4-3);
}

/* capture modal: одна строка, под ней — чипы распознанного */
.taskflow-capture .taskflow-capture-line {
  width: 100%;
  font-size: var(--font-ui-medium);
  padding: var(--size-4-2) var(--size-4-3);
  height: auto;
}
.taskflow-capture-hint {
  margin: var(--size-4-1) var(--size-2-1) 0;
  color: var(--text-faint);
  font-size: var(--font-ui-smaller);
}
.taskflow-capture-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-4-1);
  min-height: 28px;
  margin: var(--size-4-2) 0;
}
.taskflow-capture-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 2px 1px var(--size-4-2);
  border-radius: var(--radius-s);
  background: var(--background-modifier-hover);
  color: var(--text-normal);
  font-size: var(--font-ui-small);
}
.taskflow-capture-chip.is-date {
  color: var(--text-accent);
}
.taskflow-capture-chip-x {
  padding: 2px;
}
.taskflow-capture-chip-x svg {
  width: 12px;
  height: 12px;
}
.taskflow-capture-details {
  border-top: 1px solid var(--background-modifier-border);
}
.taskflow-capture-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--size-4-3);
}
/* ссылка, а не кнопка: стили кнопок Obsidian перебиваются специфичностью */
.taskflow-capture button.taskflow-capture-more {
  background: none;
  border: none;
  box-shadow: none;
  color: var(--text-muted);
  font-size: var(--font-ui-small);
  padding: 0;
  height: auto;
  cursor: pointer;
}
.taskflow-capture button.taskflow-capture-more:hover {
  color: var(--text-accent);
  text-decoration: underline;
}
/* поле в «Подробнее» исправлено руками — распознанное в строке не применится */
.taskflow-capture-chip.is-overridden {
  color: var(--text-faint);
  text-decoration: line-through;
}
.taskflow-when-preview {
  color: var(--text-accent);
  font-size: var(--font-ui-smaller);
}

/* settings */
/* редактор статусов и колонок досок: строки с ⋮⋮, галочками и ✕ вместо ручного синтаксиса */
.taskflow-status-list,
.taskflow-column-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--size-4-2);
}
.taskflow-status-row,
.taskflow-column-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--size-4-2);
  padding: 2px var(--size-4-1);
  border-radius: var(--radius-s);
  border: 1px solid transparent;
}
.taskflow-status-row:hover,
.taskflow-column-row:hover {
  background: var(--background-modifier-hover);
}
.taskflow-status-row.is-drag-over,
.taskflow-column-row.is-drag-over {
  border-color: var(--interactive-accent);
}
.taskflow-status-row.is-dragging,
.taskflow-column-row.is-dragging {
  opacity: 0.5;
}
.taskflow-drag {
  cursor: grab;
  color: var(--text-faint);
}
.taskflow-status-label {
  flex: 1 1 10em;
  min-width: 0;
}
.taskflow-status-id {
  width: 9em;
  font-family: var(--font-monospace);
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
}
.taskflow-status-id.is-locked {
  cursor: help;
}
.taskflow-status-done,
.taskflow-column-row label {
  display: inline-flex;
  align-items: center;
  gap: var(--size-4-1);
  font-size: var(--font-ui-small);
  white-space: nowrap;
}
.taskflow-status-row.is-confirm {
  background: rgba(var(--color-red-rgb), 0.08);
}
.taskflow-status-warning {
  flex-basis: 100%;
  font-size: var(--font-ui-smaller);
}
.taskflow-status-problem,
.taskflow-column-warning {
  font-size: var(--font-ui-small);
  margin-bottom: var(--size-4-2);
}
/* редкие настройки — свёрнутый блок внизу вкладки; заголовок — как у разделов Obsidian */
.taskflow-advanced {
  margin-top: var(--size-4-6);
  border-top: 1px solid var(--background-modifier-border);
}
.taskflow-advanced > summary {
  padding: var(--size-4-3) 0;
  font-size: var(--font-ui-medium);
  font-weight: var(--font-semibold);
  color: var(--text-normal);
  cursor: pointer;
  user-select: none;
}
.taskflow-advanced > summary:hover {
  color: var(--text-accent);
}
.taskflow-advanced[open] > summary {
  margin-bottom: var(--size-4-2);
}

/* тайм-трекинг */
.taskflow-time {
  cursor: pointer;
}
.taskflow-time.is-over {
  background: rgba(var(--color-orange-rgb), 0.15);
  color: var(--color-orange);
}
.taskflow-timer-live {
  font-size: var(--font-ui-smaller);
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-medium);
  color: var(--text-accent);
  white-space: nowrap;
}
.taskflow-timer-live.is-paused {
  color: var(--text-muted);
}
.taskflow-bcard.is-tracking {
  border-color: var(--text-accent);
  box-shadow: inset 0 0 0 1px var(--text-accent);
}
.taskflow-today-item.is-tracking {
  background: rgba(var(--color-accent-rgb), 0.08);
  border-radius: var(--radius-s);
}
.taskflow-timer-btn {
  opacity: 0.55;
}
.taskflow-bcard:hover .taskflow-timer-btn,
.taskflow-today-item:hover .taskflow-timer-btn {
  opacity: 1;
}
.taskflow-statusbar {
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.taskflow-statusbar.is-paused {
  color: var(--text-muted);
}
.taskflow-statusbar:hover {
  color: var(--text-accent);
}

/* плавающее окно таймера */
.taskflow-float {
  position: fixed;
  z-index: var(--layer-popover, 30);
  min-width: 200px;
  max-width: 320px;
  padding: 6px 10px 8px;
  background: var(--background-primary);
  border: 1px solid var(--background-modifier-border);
  border-radius: var(--radius-m, 8px);
  box-shadow: var(--shadow-s);
  user-select: none;
  -webkit-user-select: none;
}
.taskflow-float.is-dragging {
  opacity: 0.85;
  box-shadow: var(--shadow-l);
}
.taskflow-float-head {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: grab;
  color: var(--text-muted);
  font-size: var(--font-ui-smaller);
  touch-action: none;
}
.taskflow-float.is-dragging .taskflow-float-head {
  cursor: grabbing;
}
.taskflow-float-grip svg {
  width: 14px;
  height: 14px;
}
.taskflow-float-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.taskflow-float-title:hover {
  color: var(--text-accent);
}
.taskflow-float-close {
  padding: 2px;
}
.taskflow-float-close svg {
  width: 14px;
  height: 14px;
}
.taskflow-float-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}
.taskflow-float-clock {
  font-size: 1.5em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-normal);
}
.taskflow-float-clock.is-countdown {
  color: var(--text-accent);
}
.taskflow-float.is-paused .taskflow-float-clock,
.taskflow-float.is-idle .taskflow-float-clock {
  color: var(--text-muted);
}
.taskflow-float-controls {
  display: flex;
  gap: 2px;
}
.taskflow-float-btn {
  background: none;
  border: none;
  box-shadow: none;
  padding: 4px;
}

/* иконка таймера в ленте */
.taskflow-ribbon-timer.is-running {
  color: var(--text-accent);
}
.taskflow-ribbon-timer.is-paused {
  color: var(--text-muted);
}

/* модалка «чем занимались» */
.taskflow-note-summary {
  color: var(--text-muted);
  margin: 0 0 8px;
}
.taskflow-note-input {
  width: 100%;
  resize: vertical;
  margin-bottom: 8px;
}

/* настройки MCP: команды подключения агентов */
.taskflow-mcp-snippet { align-items: flex-start; }
.taskflow-mcp-snippet .setting-item-info { min-width: 0; }
.taskflow-mcp-code {
  margin: 4px 0 0;
  padding: 6px 8px;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: var(--font-smaller);
  user-select: text;
  background: var(--background-secondary);
  border-radius: var(--radius-s, 4px);
}
.taskflow-mcp-hint { margin-top: 4px; color: var(--text-muted); font-style: italic; }

.taskflow-invalid {
  border-color: var(--text-error) !important;
}

/* панель «Напоминания» */
.taskflow-reminders { display: flex; flex-direction: column; gap: 10px; }
.taskflow-reminders-group h5 { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.taskflow-reminders-group.is-overdue h5 { color: var(--text-error); }
.taskflow-reminder-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 3px 4px;
  border-radius: var(--radius-s, 4px);
}
.taskflow-reminder-item:hover { background: var(--background-modifier-hover); }
.taskflow-reminder-at {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: var(--font-ui-smaller);
  padding-top: 2px;
}
.taskflow-reminders-group.is-overdue .taskflow-reminder-at { color: var(--text-error); }
.taskflow-reminder-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.taskflow-reminder-parent { font-size: var(--font-ui-smaller); color: var(--text-muted); }
.taskflow-reminder-btn {
  flex: none;
  padding: 2px 6px;
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
  cursor: pointer;
}
.taskflow-reminder-btn:hover { color: var(--text-normal); background: var(--background-modifier-hover); }
/* ⏰ ✎ ✕ места в строке не занимают (иначе название сжималось до слова в строке) — всплывают справа при наведении/фокусе */
.taskflow-reminder-item { position: relative; }
.taskflow-reminder-actions {
  position: absolute;
  top: 1px;
  right: 2px;
  display: inline-flex;
  border-radius: var(--radius-s, 4px);
  background: var(--background-secondary);
  box-shadow: var(--shadow-s);
  opacity: 0;
  pointer-events: none;
}
.taskflow-reminder-item:hover .taskflow-reminder-actions,
.taskflow-reminder-item:focus-within .taskflow-reminder-actions {
  opacity: 1;
  pointer-events: auto;
}
/* без наведения — в строке, всегда видны */
@media (hover: none) {
  .taskflow-reminder-actions {
    position: static;
    opacity: 1;
    pointer-events: auto;
    background: none;
    box-shadow: none;
  }
}
.taskflow-bcard-hover .taskflow-timer-btn {
  opacity: 1;
}

/* «+ задача» в колонке доски и в дне календаря (SPEC §4, §6) */
.taskflow-column .taskflow-column-add {
  display: block;
  width: 100%;
  margin-top: var(--size-4-1);
  padding: var(--size-4-1) var(--size-4-2);
  text-align: left;
  font-size: var(--font-ui-small);
  color: var(--text-faint);
  background: transparent;
  box-shadow: none;
  border: 1px dashed transparent;
  cursor: pointer;
}
.taskflow-column:hover .taskflow-column-add,
.taskflow-column .taskflow-column-add:focus-visible {
  color: var(--text-muted);
  border-color: var(--background-modifier-border);
}
.taskflow-column .taskflow-column-add:hover {
  color: var(--text-normal);
  background: var(--background-modifier-hover);
}
.taskflow-quickadd {
  margin-top: var(--size-4-1);
}
.taskflow-quickadd-input {
  width: 100%;
  font-size: var(--font-ui-small);
}
.taskflow-quickadd .taskflow-capture-chips {
  margin-top: var(--size-4-1);
}
.taskflow-calendar-dayhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.taskflow-cal-add {
  padding: 0 4px;
  line-height: 1.2;
  font-size: var(--font-ui-small);
  opacity: 0;
}
.taskflow-calendar-day:hover .taskflow-cal-add,
.taskflow-cal-add:focus-visible {
  opacity: 1;
}
@media (hover: none) {
  .taskflow-cal-add {
    opacity: 1;
  }
}
/* пустые Входящие / «Сегодня»: действие ссылкой */
.taskflow-empty .taskflow-empty-action {
  padding: 0;
  margin-left: 4px;
  height: auto;
  background: none;
  box-shadow: none;
  color: var(--text-accent);
  font-size: inherit;
  cursor: pointer;
}
.taskflow-empty .taskflow-empty-action:hover {
  text-decoration: underline;
}

/* быстрая карточка задачи (SPEC §4.10): окошко у задачи; на мобильном — нижний лист */
.taskflow-qc {
  position: fixed;
  z-index: var(--layer-popover, 30);
  width: 320px;
  max-width: calc(100vw - 16px);
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: var(--size-4-3);
  background: var(--background-primary);
  border: 1px solid var(--background-modifier-border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-l);
  font-size: var(--font-ui-small);
}
.taskflow-qc.is-sheet {
  left: 0 !important;
  right: 0;
  bottom: 0;
  top: auto !important;
  width: auto;
  max-width: none;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
}
.taskflow-qc-head {
  display: flex;
  align-items: flex-start;
  gap: var(--size-4-2);
  margin-bottom: var(--size-4-2);
}
.taskflow-qc-title {
  flex: 1;
  min-width: 0;
  display: block;
  border: none;
  text-align: left;
  justify-content: flex-start;
  height: auto;
  padding: 0;
  background: none;
  box-shadow: none;
  font-size: var(--font-ui-medium);
  font-weight: var(--font-semibold);
  color: var(--text-normal);
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.taskflow-qc-title:hover {
  color: var(--text-accent);
  background: none;
}
.taskflow-qc-close {
  flex: none;
}
.taskflow-qc-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--size-4-2);
  padding: 3px 0;
}
.taskflow-qc-label {
  flex: none;
  width: 92px;
  color: var(--text-muted);
}
.taskflow-qc-muted {
  color: var(--text-muted);
}
.taskflow-qc-status.is-unknown {
  color: var(--text-warning);
  border-color: var(--text-warning);
}
.taskflow-qc-move {
  display: inline-flex;
  gap: 2px;
}
.taskflow-qc-indent {
  padding: 0 0 3px 100px;
}
.taskflow-qc-btn {
  height: auto;
  padding: 2px 8px;
  font-size: var(--font-ui-smaller);
}
.taskflow-qc-btn.is-active {
  background: var(--interactive-accent);
  color: var(--text-on-accent);
}
.taskflow-qc-pick {
  display: flex;
  align-items: center;
  gap: var(--size-4-2);
  padding: 2px 0 4px 100px;
}
.taskflow-qc-pick input {
  flex: 1;
  min-width: 0;
}
.taskflow-qc-pick-preview.is-bad {
  color: var(--text-error);
}
.taskflow-qc-chips {
  padding-left: 100px;
}
.taskflow-qc-link {
  height: auto;
  padding: 0;
  background: none;
  box-shadow: none;
  color: var(--text-accent);
  cursor: pointer;
}
.taskflow-qc-subs ul {
  list-style: none;
  margin: 4px 0 0;
  padding-left: var(--size-4-3);
}
.taskflow-qc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-4-2);
  margin-top: var(--size-4-3);
  padding-top: var(--size-4-2);
  border-top: 1px solid var(--background-modifier-border);
}
.taskflow-qc-delete {
  margin-left: auto;
}
.taskflow-qc-hint {
  margin-top: var(--size-4-2);
  font-size: var(--font-ui-smaller);
  color: var(--text-faint);
}
.taskflow-bcard:focus-visible {
  outline: 2px solid var(--interactive-accent);
  outline-offset: 1px;
}
/* кнопки-тексты в карточке: стиль кнопок Obsidian (button:not(.clickable-icon)) сильнее — перебиваем */
.taskflow-qc button.taskflow-qc-title,
.taskflow-qc button.taskflow-qc-link {
  border: none;
  background: none;
  box-shadow: none;
}

/* перенос повторяющейся задачи: «Только эту / Эту и следующие / Отмена» */
.taskflow-recur-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-4-2);
  margin: var(--size-4-3) 0;
}
.taskflow-recur-hint {
  font-size: var(--font-ui-small);
  color: var(--text-muted);
}
.taskflow-recur-hint.is-warning {
  color: var(--text-warning);
}
.taskflow-recur-remember {
  display: flex;
  align-items: center;
  gap: var(--size-4-1);
  margin-top: var(--size-4-3);
  font-size: var(--font-ui-small);
  color: var(--text-muted);
}
/* Клавиатура и поиск в видах (SPEC §4.11) */
.taskflow-calendar-day:focus-visible,
.taskflow-cal-entry[data-task-id]:focus-visible,
[data-nav-item]:focus-visible {
  outline: 2px solid var(--interactive-accent);
  outline-offset: 1px;
  border-radius: var(--radius-s);
}
.taskflow-view-search {
  width: 14em;
  max-width: 100%;
  min-width: 8em;
  flex: 0 1 auto;
}
.taskflow-inbox-header .taskflow-view-search {
  margin-left: auto;
}
mark.taskflow-hl {
  background-color: var(--text-highlight-bg, rgba(255, 208, 0, 0.4));
  color: inherit;
  border-radius: 2px;
  padding: 0;
}
.taskflow-keys {
  width: 100%;
  border-collapse: collapse;
}
.taskflow-keys td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--background-modifier-border);
  vertical-align: top;
}
.taskflow-keys td:first-child {
  white-space: nowrap;
  width: 1%;
}
.taskflow-keys-note {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: var(--font-ui-small);
}
/* ── Цвета задач и легенда (SPEC §4, «Цвета») ──
   --tf-color — переменная палитры темы (--color-red … --color-pink), поэтому цвета свои в светлой и тёмной теме. */
.taskflow-cal-entry.has-color {
  border-left: 3px solid var(--tf-color);
  background: rgba(var(--tf-color-rgb), 0.16);
}
/* просрочка остаётся видна: красная обводка справа поверх цветной полосы слева */
.taskflow-cal-entry.has-color.is-overdue {
  box-shadow: inset -2px 0 0 var(--color-red);
}
.taskflow-cal-entry.has-color.is-scheduled {
  border-left-style: dashed;
}
/* карточка доски: цветная полоса — отдельный слой у левого края, не спорит с красной рамкой просрочки */
.taskflow-bcard.has-color {
  padding-left: calc(var(--size-4-2) + 4px);
}
.taskflow-bcard.has-color::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--tf-color);
  border-radius: var(--radius-m) 0 0 var(--radius-m);
  pointer-events: none;
}
.taskflow-bcard.has-color.is-overdue::before {
  left: 1px; /* полоса правее красной рамки — видны обе */
  border-radius: 0;
}
.taskflow-color-dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tf-color);
  margin-right: var(--size-4-1);
  vertical-align: middle;
}
.taskflow-legend-toggle {
  font-size: var(--font-ui-smaller);
}
.taskflow-legend-toggle.is-active {
  color: var(--text-accent);
  border-color: var(--interactive-accent);
}
.taskflow-calendar-legend {
  border: 1px solid var(--background-modifier-border);
  border-radius: var(--radius-m);
  padding: var(--size-4-1) var(--size-4-2);
  margin-bottom: var(--size-4-2);
}
.taskflow-calendar-legend .taskflow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 2px var(--size-4-3);
}
.taskflow-legend-item {
  display: flex;
  align-items: center;
  gap: var(--size-4-1);
  min-width: 0;
  font-size: var(--font-ui-smaller);
}
.taskflow-legend-item.is-hidden .taskflow-legend-label {
  color: var(--text-faint);
  text-decoration: line-through;
}
.taskflow-legend-check {
  margin: 0;
}
.taskflow-legend-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
button.taskflow-legend-swatch,
.taskflow-legend-swatch {
  flex: none;
  width: 14px;
  height: 14px;
  min-width: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--background-modifier-border);
  background: var(--tf-color, transparent);
  box-shadow: none;
  cursor: pointer;
}
.taskflow-legend-swatch.is-none {
  border-style: dashed;
  cursor: default;
}
.taskflow-legend-swatch.is-current {
  outline: 2px solid var(--text-normal);
  outline-offset: 1px;
}
.taskflow-legend-palette {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--size-4-1);
  padding: var(--size-4-1) 0 var(--size-4-1) 20px;
  flex-basis: 100%;
}
.taskflow-legend-auto {
  font-size: var(--font-ui-smaller);
  padding: 0 var(--size-4-2);
  height: auto;
}
/* доска: компактное меню «Цвета» в шапке */
.taskflow-board-colors {
  position: relative;
}
.taskflow-board-legend {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 220px;
  max-width: 320px;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--size-4-2);
  padding: var(--size-4-2);
  background: var(--background-primary);
  border: 1px solid var(--background-modifier-border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
}
.taskflow-board-legend .taskflow-legend {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Проекты (SPEC §4, «Проекты»): плашка календаря проекта, иконка в настройках, выбор иконки */
.taskflow-project-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 10px;
  border-radius: var(--radius-l);
  background: var(--background-modifier-hover);
  color: var(--text-normal);
  font-size: var(--font-ui-small);
  white-space: nowrap;
}
.taskflow-project-chip-clear {
  padding: 0 6px;
  height: auto;
  background: none;
  box-shadow: none;
  color: var(--text-muted);
}
.taskflow-project-chip-clear:hover {
  color: var(--text-normal);
}
.taskflow-project-row .setting-item-name {
  display: flex;
  align-items: center;
  gap: 8px;
}
.taskflow-project-icon {
  display: inline-flex;
  color: var(--text-muted);
}
.taskflow-icon-suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
}
.taskflow-icon-suggestion-icon {
  display: inline-flex;
}
.taskflow-qc-project {
  flex: 1;
  min-width: 0;
}

/* одна иконка TaskFlow на ленте (SPEC §4, «Лента»): точка — просроченные напоминания, цвет — идущий таймер */
.taskflow-ribbon-dot {
  display: none;
  position: absolute;
  bottom: 1px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-orange);
  pointer-events: none;
}
.taskflow-ribbon-single.has-alert .taskflow-ribbon-dot {
  display: block;
}
.taskflow-ribbon-single.is-running {
  color: var(--text-accent);
}

/* ---------- Входящие: лёгкий список (SPEC §4, Inbox) ---------- */
.taskflow-inbox {
  max-width: 960px;
  margin: 0 auto;
  container-type: inline-size;
}
.taskflow-inbox .taskflow-inbox-header {
  align-items: center;
  margin-bottom: var(--size-4-2);
}
.taskflow-inbox .taskflow-inbox-header h4 {
  font-size: var(--h3-size, 1.25em);
}
.taskflow-inbox-capture {
  margin-bottom: var(--size-4-3);
}
.taskflow-inbox-capture .taskflow-quickadd {
  margin-top: 0;
}
.taskflow-inbox-capture .taskflow-quickadd-input {
  height: auto;
  padding: var(--size-4-2) var(--size-4-3);
  border-radius: var(--radius-m);
  font-size: var(--font-ui-medium);
  background: var(--background-primary-alt);
}
/* список: строки с тонкими разделителями в одной рамке, а не коробка на каждый пункт */
.taskflow-inbox-list {
  border: 1px solid var(--background-modifier-border);
  border-radius: var(--radius-m);
  overflow: hidden;
}
.taskflow-inbox-list:empty {
  display: none;
}
.taskflow-inbox .taskflow-card {
  margin: 0;
  padding: var(--size-4-2) var(--size-4-3);
  border: none;
  border-bottom: 1px solid var(--background-modifier-border);
  border-radius: 0;
  background: transparent;
  transition: background-color 0.1s ease-in-out;
}
.taskflow-inbox .taskflow-card:last-child {
  border-bottom: none;
}
.taskflow-inbox .taskflow-card:hover {
  background: var(--background-modifier-hover);
}
/* выбранный пункт (клавиатура, клик) — полоса акцента слева, без толстой рамки */
.taskflow-inbox .taskflow-card:focus-within,
.taskflow-inbox .taskflow-card.is-expanded {
  background: rgba(var(--color-accent-rgb), 0.06);
}
.taskflow-inbox .taskflow-card:focus-visible,
.taskflow-inbox .taskflow-card:focus {
  outline: none;
  box-shadow: inset 3px 0 0 var(--interactive-accent);
  background: rgba(var(--color-accent-rgb), 0.08);
}
.taskflow-inbox .taskflow-card-top {
  min-height: 30px;
}
.taskflow-inbox .taskflow-card-top .taskflow-title {
  flex: 0 1 auto;
  min-width: 0;
  font-weight: var(--font-medium, 500);
  overflow-wrap: anywhere;
}
/* быстрые решения — у пункта под мышью или в фокусе; на устройствах без наведения видны всегда */
.taskflow-inbox-decisions {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.1s ease-in-out;
}
.taskflow-inbox .taskflow-card:hover .taskflow-inbox-decisions,
.taskflow-inbox .taskflow-card:focus-within .taskflow-inbox-decisions,
.taskflow-inbox .taskflow-card:focus .taskflow-inbox-decisions {
  opacity: 1;
}
@media (hover: none) {
  .taskflow-inbox-decisions {
    opacity: 1;
  }
}
.taskflow-inbox-decision {
  padding: var(--size-2-2);
  color: var(--text-muted);
}
.taskflow-inbox-decision[data-decision="done"]:hover {
  color: var(--color-green);
}
.taskflow-inbox-decision[data-decision="trash"]:hover {
  color: var(--text-error);
}
/* «Прояснить» — спокойная кнопка; акцентной становится только у выбранного пункта */
.taskflow-clarify {
  height: auto;
  padding: 3px var(--size-4-3);
  font-size: var(--font-ui-small);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--background-modifier-border);
  box-shadow: none;
  border-radius: var(--radius-s);
  cursor: pointer;
}
.taskflow-inbox .taskflow-card:hover .taskflow-clarify,
.taskflow-inbox .taskflow-card:focus-within .taskflow-clarify,
.taskflow-inbox .taskflow-card:focus .taskflow-clarify {
  color: var(--text-on-accent);
  background: var(--interactive-accent);
  border-color: var(--interactive-accent);
}
.taskflow-inbox .taskflow-card-more {
  color: var(--text-faint);
}
/* раскрытые поля — мягкая подложка под строкой */
.taskflow-inbox .taskflow-card.is-expanded .taskflow-card-actions {
  margin-top: var(--size-4-2);
  padding: var(--size-4-2);
  border-radius: var(--radius-s);
  background: var(--background-secondary);
}
/* узкая вкладка: подпись «Прояснить» короче не делаем — убираем лишние решения, остаются ✓ и 📅 */
@container (max-width: 480px) {
  .taskflow-inbox-decision[data-decision="waiting"],
  .taskflow-inbox-decision[data-decision="someday"] {
    display: none;
  }
}
/* узкая вкладка (телефон, боковая панель): у невыбранных пунктов — только название и ⋯, без строки под кнопку;
   возраст записи — тоже только у выбранного */
@container (max-width: 480px) {
  .taskflow-inbox .taskflow-card:not(:focus):not(:focus-within):not(.is-expanded) .taskflow-clarify,
  .taskflow-inbox .taskflow-card:not(:focus):not(:focus-within):not(.is-expanded) .taskflow-inbox-decisions,
  .taskflow-inbox .taskflow-card:not(:focus):not(:focus-within):not(.is-expanded) .taskflow-inbox-age:not(.is-stale) {
    display: none;
  }
}
/* Входящие: значок клавиш, возраст записи, вторая строка (что внутри), поля «⋯», пустые состояния */
.taskflow-inbox-keys {
  color: var(--text-faint);
}
.taskflow-inbox-age {
  color: var(--text-faint);
  font-size: var(--font-ui-smaller);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* залежалая запись (неделя и больше) — заметнее, но без тревоги */
.taskflow-inbox-age.is-stale {
  color: var(--color-orange);
}
.taskflow-inbox-meta {
  display: flex;
  align-items: baseline;
  gap: var(--size-4-2);
  margin-top: 2px;
  min-width: 0;
  color: var(--text-muted);
  font-size: var(--font-ui-smaller);
}
.taskflow-inbox-meta-item {
  flex: none;
  white-space: nowrap;
}
.taskflow-inbox-snippet {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-faint);
}
.taskflow-inbox-rename {
  flex: 1 1 240px;
  min-width: 0;
  font-weight: var(--font-medium, 500);
}
.taskflow-inbox .taskflow-card-actions .taskflow-input {
  width: auto;
  flex: 1 1 140px;
  min-width: 110px;
  max-width: 220px;
}
.taskflow-inbox-rename-btn {
  font-size: var(--font-ui-small);
}
.taskflow-inbox-zero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--size-4-2);
  padding: var(--size-4-12, 48px) var(--size-4-4);
  color: var(--text-muted);
  text-align: center;
}
.taskflow-inbox-zero-icon {
  color: var(--color-green);
  opacity: 0.8;
}
.taskflow-inbox-zero-icon svg {
  width: 40px;
  height: 40px;
}
.taskflow-inbox-zero-title {
  font-size: var(--font-ui-large);
  font-weight: var(--font-semibold);
  color: var(--text-normal);
}
.taskflow-inbox-nothing {
  display: flex;
  align-items: center;
  gap: var(--size-4-2);
  padding: var(--size-4-4) var(--size-4-1);
  color: var(--text-muted);
}
