/* Задачи и автозадачи — Figma «LidFly — Бренд и UI Kit 2026», стр. 16 (360:2328): #workspace/tasks,
   вкладка проекта «Задачи» и метки задач в «Календарях». Общие компоненты кита:
   «Задача / Знак вида» → .lf-task-kind, «Задача / Строка» → .lf-task-row,
   «Задача / Метка в календаре» → .lf-task-chip, «Автозадача / Шаг» → .lf-plan-step.
   Задача (делает человек) — нейтральный тон и контур; автозадача (делает ИИ) — голубой тон ИИ.
   Тона берутся из рубрик календаря (calendar.css, светлая и тёмная тема), карточка — .lf-cal-panel. */

/* ── Знак вида ── */
.lf-task-kind { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-element); background: var(--color-category-neutral-bg); color: var(--color-category-neutral-text); }
.lf-task-kind .lf-icon { width: 18px; height: 18px; }
.lf-task-kind--auto, .lf-task-kind--repeat { background: var(--color-category-sky-bg); color: var(--color-category-sky-text); }
.lf-task-kind--s { width: 20px; height: 20px; border-radius: 6px; }
.lf-task-kind--s .lf-icon { width: 12px; height: 12px; }

/* ── Строка задачи: время · знак · текст · статус и действие ── */
.lf-task-rows { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.lf-task-row { display: grid; grid-template-columns: 56px 32px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--color-border); }
.lf-task-row:last-child { border-bottom: 0; }
.lf-task-row__time { color: var(--color-text); font: 500 14px/1.3 var(--font-sans); font-variant-numeric: tabular-nums; }
.lf-task-row__time--day { color: var(--color-text-muted); font-size: 13px; font-weight: 400; }
.lf-task-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lf-task-row__title { margin: 0; padding: 0; border: 0; background: none; color: var(--color-text); font: 500 16px/1.35 var(--font-sans); text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.lf-task-row__title:hover { text-decoration: underline; text-underline-offset: 3px; }
.lf-task-row__title:focus-visible { border-radius: 4px; outline: none; box-shadow: var(--btn-focus-ring); }
.lf-task-row__meta { color: var(--color-text-muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.lf-task-row__side { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.lf-task-row.is-done .lf-task-row__title { color: var(--color-text-muted); }

/* ── Метка в неделе, месяце и календаре ── */
.lf-task-chip { display: flex; gap: 4px; align-items: center; width: 100%; min-width: 0; min-height: 24px; padding: 3px 6px; border: 1px solid var(--color-border); border-radius: var(--radius-xs, 6px); background: transparent; color: var(--color-text); font: 500 13px/16px var(--font-sans); text-align: left; cursor: pointer; }
.lf-task-chip .lf-icon { flex: 0 0 auto; width: 12px; height: 12px; color: var(--color-category-neutral-text); }
.lf-task-chip__time { flex: 0 0 auto; color: var(--color-category-sky-text); font-variant-numeric: tabular-nums; }
.lf-task-chip__title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-task-chip--auto, .lf-task-chip--repeat { border-color: transparent; background: var(--color-category-sky-bg); }
.lf-task-chip--auto .lf-icon, .lf-task-chip--repeat .lf-icon { color: var(--color-category-sky-text); }
.lf-task-chip--attention { border-color: var(--color-error); }
.lf-task-chip--attention .lf-icon { color: var(--color-error); }
.lf-task-chip--done { opacity: .72; }
.lf-task-chip--done .lf-task-chip__title, .lf-task-chip--done .lf-task-chip__time { color: var(--color-text-muted); }
.lf-task-chip--wrap .lf-task-chip__title { display: -webkit-box; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.lf-task-chip:focus-visible { outline: none; box-shadow: var(--btn-focus-ring); }

/* ── Шаг плана автозадачи ── */
.lf-plan-steps { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lf-plan-step { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-medium); background: var(--color-bg-card); }
.lf-plan-step__num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: var(--radius-pill); background: var(--color-category-neutral-bg); color: var(--color-category-neutral-text); font: 500 13px/1 var(--font-sans); }
.lf-plan-step--write .lf-plan-step__num { background: var(--color-category-green-bg); color: var(--color-category-green-text); }
.lf-plan-step--unsupported { border-color: var(--color-error); }
.lf-plan-step__title { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.35; }
.lf-plan-step__meta { margin: 2px 0 0; color: var(--color-text-muted); font-size: 13px; }

/* ── Экран ── */
.wt-screen { display: grid; gap: 20px; min-width: 0; }
.wt-head { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; }
.wt-head h1 { margin: 0 0 8px; }
.wt-head p { max-width: 700px; margin: 0; color: var(--color-text-secondary); font-size: 16px; line-height: 1.5; }
/* The menu hint under the heading, as on every section page (app-sidebar.css), then the description. */
.wt-head .section-title + .section-hint { margin: 0 0 8px; font-size: 15px; line-height: 22px; }
.wt-head .btn { flex: 0 0 auto; }
.wt-legend { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; padding: 16px 16px 16px 20px; border-radius: var(--radius-card); background: var(--color-bg-subtle); }
.wt-legend__item { display: flex; gap: 12px; align-items: center; }
.wt-legend__item strong { display: block; font-size: 14px; font-weight: 500; }
.wt-legend__item small { display: block; max-width: 240px; color: var(--color-text-muted); font-size: 13px; line-height: 1.4; }
.wt-legend__close { margin-left: auto; }
.wt-toolbar { min-width: 0; }
.wt-group { gap: 4px; padding: 8px; }
.wt-group__head { display: flex; gap: 8px; align-items: center; padding: 8px 16px; }
.wt-group__head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.wt-group__head .lf-cal-toolbar__spacer + small { color: var(--color-text-muted); font-size: 13px; }
.wt-attention-strip { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-bg-card); }
.wt-attention-strip > .lf-icon { flex: 0 0 auto; width: 20px; height: 20px; color: var(--color-error); }
.wt-attention-strip div { flex: 1 1 auto; min-width: 0; }
.wt-attention-strip strong { display: block; font-size: 14px; font-weight: 500; }
.wt-attention-strip small { color: var(--color-text-muted); font-size: 13px; }
.wt-period { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.wt-period__legend { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.wt-period__legend .lf-task-chip { width: auto; cursor: default; }
.wt-switch { display: inline-flex; gap: 8px; align-items: center; color: var(--color-text-secondary); font-size: 14px; }

/* ── Неделя: полоса «Срок» для задач, сетка по часам для автозадач ── */
.wt-week { display: grid; grid-template-columns: 64px repeat(7, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-bg-card); }
.wt-week > * { min-width: 0; border-bottom: 1px solid var(--color-border); }
.wt-week__day, .wt-week__cell { border-left: 1px solid var(--color-border); }
.wt-week__day { display: flex; gap: 6px; align-items: center; padding: 8px; color: var(--color-text-muted); font-size: 13px; }
.wt-week__day strong { color: var(--color-text); font-size: 14px; font-weight: 500; }
.wt-week__label { padding: 8px 8px 8px 12px; color: var(--color-text-muted); font-size: 12px; }
.wt-week__cell { display: flex; flex-direction: column; gap: 4px; min-height: 40px; padding: 4px; }
.wt-week__band { border-bottom-color: var(--color-text-muted); }
.wt-week .is-today { background: var(--color-bg-subtle); }
.wt-week > .wt-week--last { border-bottom: 0; }

.wt-grid .lf-cal-day { cursor: pointer; }
.wt-day__list { display: grid; gap: 0; }
.wt-note { margin: 0; color: var(--color-text-muted); font-size: 13px; }

/* ── Карточка задачи в боковой панели (.lf-cal-panel) ── */
.lf-cal-panel__top > span.lf-task-kind { flex: 0 0 auto; }
.wt-card .lf-cal-panel__footer { flex-wrap: wrap; }
.wt-card .lf-cal-panel__footer .btn { white-space: nowrap; }
.wt-card__kv { display: grid; gap: 10px; margin: 0; padding: 16px; border-radius: var(--radius-medium); background: var(--color-bg-subtle); }
.wt-card__kv div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; }
.wt-card__kv dt { color: var(--color-text-muted); font-size: 13px; }
.wt-card__kv dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.wt-card__section { display: grid; gap: 8px; }
.wt-card__section h3 { margin: 0; font-size: 16px; font-weight: 600; }
.wt-card__section p, .wt-card__section li { margin: 0; color: var(--color-text-secondary); font-size: 14px; line-height: 1.45; }
.wt-card__section ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.wt-card__allowed li { display: flex; gap: 8px; align-items: center; color: var(--color-text); }
.wt-card__allowed .lf-icon { flex: 0 0 auto; width: 16px; height: 16px; color: var(--color-brand-text); }
.wt-card__pre { max-height: 220px; margin: 0; padding: 12px; overflow: auto; border-radius: var(--radius-medium); background: var(--color-bg-subtle); font: 400 13px/1.5 var(--font-sans); white-space: pre-wrap; }
.wt-card__alert { display: grid; gap: 8px; padding: 12px 16px; border: 1px solid var(--color-error); border-radius: var(--radius-medium); }
.wt-card__alert p { margin: 0; font-size: 14px; }
.wt-card__ai { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--radius-medium); background: var(--color-category-sky-bg); }
.wt-card__ai > .lf-icon { flex: 0 0 auto; width: 20px; height: 20px; color: var(--color-category-sky-text); }
.wt-card__ai div { flex: 1 1 auto; min-width: 0; }
.wt-card__ai strong { display: block; font-size: 14px; font-weight: 500; }
.wt-card__ai small { color: var(--color-text-muted); font-size: 13px; }

@media (max-width: 1100px) {
  .wt-period__legend { width: 100%; margin-left: 0; }
}

/* Телефон: строка без колонки времени и кнопки действия (они в подробностях и карточке),
   в ячейке месяца — точки: задача — кольцо, автозадача — голубая точка; выбранный день — списком ниже. */
@media (max-width: 768px) {
  .wt-head { flex-direction: column; }
  .wt-legend { display: none; }
  .lf-task-row { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; padding: 12px; }
  .lf-task-row__time, .lf-task-row__side .btn { display: none; }
  .wt-week { grid-template-columns: 48px repeat(7, minmax(0, 1fr)); }
  .wt-week__label { padding-left: 6px; }
  .wt-week .lf-task-chip__title { display: none; }
  .lf-cal-month.wt-grid .lf-cal-weekday { padding: 6px 2px; text-align: center; font-size: 11px; }
  .lf-cal-month.wt-grid .lf-cal-day { flex-flow: row wrap; align-content: flex-start; justify-content: center; gap: 3px; min-height: 46px; padding: 4px 2px; }
  .lf-cal-month.wt-grid .lf-cal-day__date { flex: 1 0 100%; justify-content: center; min-height: 22px; padding: 0; }
  .lf-cal-month.wt-grid .lf-cal-day__today-label { display: none; }
  .lf-cal-month.wt-grid .lf-task-chip { flex: none; width: 7px; height: 7px; min-height: 0; padding: 0; border: 1.5px solid var(--color-category-neutral-text); border-radius: 50%; pointer-events: none; }
  .lf-cal-month.wt-grid .lf-task-chip--auto, .lf-cal-month.wt-grid .lf-task-chip--repeat { border: 0; background: var(--color-category-sky-text); }
  .lf-cal-month.wt-grid .lf-task-chip--attention { border-color: var(--color-error); background: var(--color-error); }
  .lf-cal-month.wt-grid .lf-task-chip > *, .lf-cal-month.wt-grid .lf-cal-day__more { display: none; }
}

/* Строка «Задачи и автозадачи» в индексе «Календарей». */
.lf-cal-index__next--alert { color: var(--color-error); }
@media (max-width: 768px) {
  .wt-day-month { display: none; }
}
